#!/usr/bin/python
# Copyright 2017 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
Management of Contrail resources
================================

:depends:   - vnc_api Python module


Enforce the virtual router existence
------------------------------------

.. code-block:: yaml

    virtual_router:
      contrail.virtual_router_present:
        name: tor01
        ip_address: 10.0.0.23
        dpdk_enabled: False
        router_type: tor-agent


Enforce the virtual router absence
----------------------------------

.. code-block:: yaml

    virtual_router_tor01:
      contrail.virtual_router_absent:
        name: tor01


Enforce the physical router existence
------------------------------------

.. code-block:: yaml

    physical_router_phr01:
      contrail.physical_router_present:
      name: phr01
        parent_type: global-system-config
        management_ip: 10.167.4.206
        dataplane_ip: 172.17.56.9
        vendor_name: MyVendor
        product_name: MyProduct
        agents:
          - tor01
          - tns01


Enforce the physical router absence
----------------------------------

.. code-block:: yaml

    physical_router_delete_phr01:
      contrail.physical_router_absent:
        name: phr01


Enforce the physical interface present
----------------------------------

.. code-block:: yaml

    create physical interface ge-0/1/10 for phr01:
      contrail.physical_interface_present:
        - name: ge-0/1/10
        - physical_router: prh01


Enforce the physical interface absence
----------------------------------

.. code-block:: yaml

    physical_interface_delete ge-0/1/10:
      contrail.physical_interface_absent:
        name: ge-0/1/10
        physical_router: phr01

Enforce the logical interface present
----------------------------------

.. code-block:: yaml

    create logical interface 11/15:
      contrail.logical_interface_present:
        - name: ge-0/1/11.15
        - parent_names:
          - ge-0/1/11
          - phr01
        - parent_type: physical-interface
        - vlan_tag: 15
        - interface_type: L3


Enforce the logical interface absence
----------------------------------

.. code-block:: yaml

    logical interface delete ge-0/1/10.0 phr02:
      contrail.logical_interface_absent:
        - name: ge-0/1/10.0
        - parent_names:
          - ge-0/1/10
          - phr02
        - parent_type: physical-interface


Enforce the global vrouter config existence
-------------------------------------------

.. code-block:: yaml

    #Example
    opencontrail_client_virtual_router_global_conf_create:
      contrail.global_vrouter_config_present:
      - name: "global-vrouter-config"
      - parent_type: "global-system-config"
      - encap_priority : "MPLSoUDP,MPLSoGRE"
      - vxlan_vn_id_mode : "automatic"
      - flow_export_rate: 100
      - fq_names:
        - default-global-system-config
        - default-global-vrouter-config


Enforce the global vrouter config absence
-----------------------------------------

.. code-block:: yaml

    #Example
    opencontrail_client_virtual_router_global_conf_delete:
      contrail.global_vrouter_config_absent:
      - name: "global-vrouter-config"


Enforce the link local service entry existence
----------------------------------------------

.. code-block:: yaml

    # Example with dns name, only one is permited
    lls_meta1:
      contrail.linklocal_service_present:
        - name: meta1
        - lls_ip: 10.0.0.23
        - lls_port: 80
        - ipf_addresses: "meta.example.com"
        - ipf_port: 80

    # Example with multiple ip addresses
    lls_meta2:
      contrail.linklocal_service_present:
        - name: meta2
        - lls_ip: 10.0.0.23
        - lls_port: 80
        - ipf_addresses:
          - 10.10.10.10
          - 10.20.20.20
          - 10.30.30.30
        - ipf_port: 80

    # Example with one ip addresses
    lls_meta3:
      contrail.linklocal_service_present:
        - name: meta3
        - lls_ip: 10.0.0.23
        - lls_port: 80
        - ipf_addresses:
          - 10.10.10.10
        - ipf_port: 80


Enforce the link local service entry absence
--------------------------------------------

.. code-block:: yaml

    lls_meta1_delete:
      contrail.linklocal_service_absent:
        - name: cmp01


Enforce the analytics node existence
------------------------------------

.. code-block:: yaml

    analytics_node01:
      contrail.analytics_node_present:
        - name: nal01
        - ip_address: 10.0.0.13


Enforce the analytics node absence
------------------------------------

.. code-block:: yaml

    analytics_node01_delete:
      contrail.analytics_node_absent:
        - name: nal01



Enforce the config node existence
---------------------------------

.. code-block:: yaml

    config_node01:
      contrail.config_node_present:
        - name: ntw01
        - ip_address: 10.0.0.23


Enforce the config node absence
-------------------------------

.. code-block:: yaml

    config_node01_delete:
      contrail.config_node_absent:
        - name: ntw01


Enforce the BGP router existence
--------------------------------

.. code-block:: yaml

    BGP router mx01:
      contrail.bgp_router_present:
        - name: mx01
        - ip_address: 10.0.0.133
        - type: mx
        - asn: 64512
        - key_type: md5
        - key: password


Enforce the BGP router absence
------------------------------

.. code-block:: yaml

    BGP router mx01:
      contrail.bgp_router_absence:
        - name: mx01


Enforce the service appliance set existence
-------------------------------------------

.. code-block:: yaml

   create service appliance:
     contrail.service_appliance_set_present:
       - name: testappliance
       - driver: 'neutron_lbaas.drivers.avi.avi_ocdriver.OpencontrailAviLoadbalancerDriver'
       - ha_mode: active-backup
       - properties:
           address: 10.1.11.3
           user: admin
           password: avi123
           cloud: Default-Cloud


Enforce the service appliance set entry absence
-----------------------------------------------

 .. code-block:: yaml

    delete service appliance:
     contrail.service_appliance_set_absent:
       - name: testappliance


Enforce the database node existence
-----------------------------------

.. code-block:: yaml

    database_node01:
      contrail.database_node_present:
        - name: dbs01
        - ip_address: 10.0.0.33


Enforce the database node absence
-----------------------------------

.. code-block:: yaml

    database_node01:
      contrail.database_node_absent:
        - name: dbs01


Enforce the global system config existence
------------------------------------------

.. code-block:: yaml
    global_system_config_update:
      contrail.global_system_config_present:
        - name: default-global-system_config
        - ans: 64512
        - grp:
            enable: true
            restart_time: 400
            bgp_helper_enable: true
            xmpp_helper_enable: true
            long_lived_restart_time: 400
            end_of_rib_timeout: 40


Enforce the global system config absence
----------------------------------------

.. code-block:: yaml

    global_system_config_delete:
      contrail.global_system_config_absent:
        - name: global-system_config


Enforce the virtual network existence
----------------------------------------

.. code-block: yaml

    virtual_network_create:
      contrail.virtual_network_present:
        - name: virtual_network_name


Enforce Floating Ip Pool configuration
----------------------------------------

.. code-block: yaml

    floating_ip_pool_present
       - vn_name: virtual_network_name
       - vn_project:
       - vn_domain
       - owner_access: owner_access_permission
       - global_access: global_access_permission
       - projects: list of project-permission pairs
'''


def __virtual__():
    '''
    Load Contrail module
    '''
    return 'contrail'


def virtual_router_present(name, ip_address, router_type=None, dpdk_enabled=False, **kwargs):
    '''
    Ensures that the Contrail virtual router exists.

    :param name:        Virtual router name
    :param ip_address:  Virtual router IP address
    :param router_type: Any of ['tor-agent', 'tor-service-node', 'embedded']
    '''
    ret = __salt__['contrail.virtual_router_create'](name, ip_address, router_type, dpdk_enabled, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def virtual_router_absent(name, **kwargs):
    '''
    Ensure that the Contrail virtual router doesn't exist

    :param name: The name of the virtual router that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Virtual router "{0}" is already absent'.format(name)}
    virtual_router = __salt__['contrail.virtual_router_get'](name, **kwargs)
    if 'Error' not in virtual_router:
        ret = __salt__['contrail.virtual_router_delete'](name, **kwargs)
    return ret


def physical_router_present(name, parent_type=None,
                            management_ip=None,
                            dataplane_ip=None,  # VTEP address in web GUI
                            vendor_name=None,
                            product_name=None,
                            vnc_managed=None,
                            junos_service_ports=None,
                            agents=None, **kwargs):
    '''
    Ensures that the Contrail virtual router exists.

    :param name:        	Physical router name
    :param parent_type:		Parent resource type: Any of ['global-system-config']
    :param management_ip:	Management ip for this physical router. It is used by the device manager to perform netconf and by SNMP collector if enabled.
    :param dataplane_ip: 	VTEP address in web GUI. This is ip address in the ip-fabric(underlay) network that can be used in data plane by physical router. Usually it is the VTEP address in VxLAN for the TOR switch.
    :param vendor_name:		Vendor name of the physical router (e.g juniper). Used by the device manager to select driver.
    :param product_name:	Model name of the physical router (e.g juniper). Used by the device manager to select driver.
    :param vnc_managed:		This physical router is enabled to be configured by device manager.
    :param user_credentials:	Username and password for netconf to the physical router by device manager.
    :param junos_service_ports:	Juniper JUNOS specific service interfaces name to perform services like NAT.
    :param agents: 		List of virtual-router references
    '''

    ret = __salt__['contrail.physical_router_create'](name, parent_type, management_ip, dataplane_ip, vendor_name,
                                                      product_name, vnc_managed, junos_service_ports, agents,
                                                      **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def physical_router_absent(name, **kwargs):
    '''
    Ensure that the Contrail physical router doesn't exist

    :param name: The name of the physical router that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Physical router "{0}" is already absent'.format(name)}
    physical_router = __salt__['contrail.physical_router_get'](name, **kwargs)
    if 'Error' not in physical_router:
        ret = __salt__['contrail.physical_router_delete'](name, **kwargs)
    return ret


def physical_interface_present(name, physical_router, **kwargs):
    '''
    Ensures that the Contrail physical interface exists.

    :param name:                Physical interface name
    :param physical_router:     Name of existing physical router
    '''
    ret = __salt__['contrail.physical_interface_create'](name, physical_router, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def physical_interface_absent(name, physical_router, **kwargs):
    '''
    Ensure that the Contrail physical interface doesn't exist

    :param name: 		The name of the physical interface that should not exist
    :param physical_router:     Physical router name
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Physical interface "{0}" is already absent'.format(name)}
    physical_interface = __salt__['contrail.physical_interface_get'](name, physical_router, **kwargs)
    if 'Error' not in physical_interface:
        ret = __salt__['contrail.physical_interface_delete'](name, physical_router, **kwargs)
    return ret


def logical_interface_present(name, parent_names, parent_type, vlan_tag=None, interface_type="L2",
                              vmis=None, **kwargs):
    '''
    Ensures that the Contrail logical interface exists.

    :param name:                Logical interface name
    :param parent_names:  	List of parents
    :param parent_type		Parent resource type. Any of ['physical-router', 'physical-interface']
    :param vlan_tag:		VLAN tag (.1Q) classifier for this logical interface.
    :param interface_type:	Logical interface type can be L2 or L3.
    :param vmis:                Virtual machine interface name associate with
    '''
    ret = __salt__['contrail.logical_interface_create'](name, parent_names, parent_type, vlan_tag,
                                                        interface_type, vmis=vmis, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def logical_interface_absent(name, parent_names, parent_type=None, **kwargs):
    '''
    Ensure that the Contrail logical interface doesn't exist

    :param name: 		The name of the logical interface that should not exist
    :param parent_names: 	List of parent names. Example ['phr01','ge-0/1/0']
    :param parent_type: 	Parent resource type. Any of ['physical-router', 'physical-interface']
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'logical interface "{0}" is already absent'.format(name)}
    logical_interface = __salt__['contrail.logical_interface_get'](name, parent_names, parent_type, **kwargs)
    if 'Error' not in logical_interface:
        ret = __salt__['contrail.logical_interface_delete'](name, parent_names, parent_type, **kwargs)
    return ret


def global_vrouter_config_present(name, parent_type, encap_priority="MPLSoUDP,MPLSoGRE", vxlan_vn_id_mode="automatic",
                                  flow_export_rate=None, *fq_names, **kwargs):
    '''
    Ensures that the Contrail global vrouter config exists.

    :param name:         	Global vrouter config name
    :param parent_type:  	Parent resource type
    :param encap_priority: 	Ordered list of encapsulations that vrouter will use in priority order
    :param vxlan_vn_id_mode:	Method of allocation of VxLAN VNI(s).
    :param fq_names:		Fully Qualified Name of resource devided <string>array
    :param flow_export_rate:	Flow export rate is global config, rate at which each vrouter will sample and export flow records to analytics
    '''
    ret = __salt__['contrail.global_vrouter_config_create'](name, parent_type, encap_priority, vxlan_vn_id_mode,
                                                            flow_export_rate, *fq_names, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def global_vrouter_config_absent(name, **kwargs):
    '''
    Ensure that the Contrail global vrouter config doesn't exist

    :param name: The name of the global vrouter config that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Global vrouter config "{0}" is already absent'.format(name)}
    vrouter_conf = __salt__['contrail.global_vrouter_config_get'](name, **kwargs)
    if 'Error' not in vrouter_conf:
        ret = __salt__['contrail.global_vrouter_config_delete'](name, **kwargs)
    return ret


def linklocal_service_present(name, lls_ip, lls_port, ipf_addresses, ipf_port, **kwargs):
    '''
    Ensures that the Contrail link local service entry exists.

    :param name:           Link local service name
    :param lls_ip:         Link local ip address
    :param lls_port:       Link local service port
    :param ipf_addresses:  IP fabric dns name or list of IP fabric ip addresses
    :param ipf_port:       IP fabric port
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Link local service "{0}" already exists'.format(name)}

    ret = __salt__['contrail.linklocal_service_create'](name, lls_ip, lls_port, ipf_addresses, ipf_port, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def linklocal_service_absent(name, **kwargs):
    '''
    Ensure that the Contrail link local service entry doesn't exist

    :param name: The name of the link local service entry
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Linklocal service "{0}" is already absent'.format(name)}
    lls = __salt__['contrail.linklocal_service_get'](name, **kwargs)
    if 'Error' not in lls:
        ret = __salt__['contrail.linklocal_service_delete'](name, **kwargs)
    return ret


def analytics_node_present(name, ip_address, **kwargs):
    '''
    Ensures that the Contrail analytics node exists.

    :param name:        Analytics node name
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Analytics node {0} already exists'.format(name)}

    ret = __salt__['contrail.analytics_node_create'](name, ip_address, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def analytics_node_absent(name, **kwargs):
    '''
    Ensure that the Contrail analytics node doesn't exist

    :param name: The name of the analytics node that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Analytics node "{0}" is already absent'.format(name)}
    node = __salt__['contrail.analytics_node_get'](name, **kwargs)
    if 'Error' not in node:
        ret = __salt__['contrail.analytics_node_delete'](name, **kwargs)
    return ret


def config_node_present(name, ip_address, **kwargs):
    '''
    Ensures that the Contrail config node exists.

    :param name:        Config node name
    '''
    ret = __salt__['contrail.config_node_create'](name, ip_address, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def config_node_absent(name, **kwargs):
    '''
    Ensure that the Contrail config node doesn't exist

    :param name: The name of the config node that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Config node "{0}" is already absent'.format(name)}
    node = __salt__['contrail.config_node_get'](name, **kwargs)
    if 'Error' not in node:
        ret = __salt__['contrail.config_node_delete'](name, **kwargs)
    return ret


def bgp_router_present(name, type, ip_address, asn=64512, key_type=None, key=None, **kwargs):
    '''
    Ensures that the Contrail BGP router exists.

    :param name:        BGP router name
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'BGP router {0} already exists'.format(name)}

    ret = __salt__['contrail.bgp_router_create'](name, type, ip_address, asn, key_type, key, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def bgp_router_absent(name, **kwargs):
    '''
    Ensure that the Contrail BGP router doesn't exist

    :param name: The name of the BGP router that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'BGP router "{0}" is already absent'.format(name)}
    node = __salt__['contrail.bgp_router_get'](name, **kwargs)
    if 'Error' not in node:
        ret = __salt__['contrail.bgp_router_delete'](name, **kwargs)
    return ret


def database_node_present(name, ip_address, **kwargs):
    '''
    Ensures that the Contrail database node exists.

    :param name:        Database node name
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Database node {0} already exists'.format(name)}
    ret = __salt__['contrail.database_node_create'](name, ip_address, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def database_node_absent(name, **kwargs):
    '''
    Ensure that the Contrail database node doesn't exist

    :param name: The name of the database node that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Database node "{0}" is already absent'.format(name)}
    node = __salt__['contrail.database_node_get'](name, **kwargs)
    if 'Error' not in node:
        ret = __salt__['contrail.database_node_delete'](name, **kwargs)
    return ret


def virtual_machine_interface_present(name,
                                      virtual_network,
                                      mac_address=None,
                                      ip_address=None,
                                      security_group=None,
                                      **kwargs):
    '''
    Ensures that the Contrail virtual machine interface exists.

    :param name:             Virtual machine interface name
    :param virtual_network:  Network name
    :param mac_address:      Mac address of vmi interface
    :param ip_address:       Virtual machine interface ip address
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Virtual machine interface "{0}" already exists'.format(name)}

    vmis = __salt__['contrail.virtual_machine_interface_list'](**kwargs)

    for vmi in vmis:
      if vmi['name'] == name:
        return ret

    vmi = __salt__['contrail.virtual_machine_interface_create'](name, virtual_network,
                                                                mac_address=mac_address,
                                                                ip_address=ip_address,
                                                                security_group=security_group,
                                                                **kwargs)
    if vmi['name'] == name:
        ret['comment'] = 'Virtual machine interface {0} has been created'.format(name)
        ret['result'] = True
    else:
        ret['comment'] = 'Virtual machine interface {0} creation failed'.format(name)
        ret['result'] = False
    return ret


def service_appliance_set_present(name,
                                  properties=None,
                                  driver=None,
                                  ha_mode=None,
                                  **kwargs):
    '''
    Ensures that the Contrail service appliance set exists.

    :param name:             Service appliance set name
    :param properties:       Key:Value pairs that are used by the provider driver and opaque to sytem.
    :param driver:           Name of the provider driver for this service appliance set.
    :param ha_mode:          High availability mode for the service appliance set, active-active or active-backup.
    '''
    ret = __salt__['contrail.service_appliance_set_create'](name, properties, driver, ha_mode, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def service_appliance_set_absent(name, **kwargs):
    '''
    Ensure that the Contrail service appliance set doesn't exist

    :param name: The name of the service appliance set that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Service appliance set "{0}" is already absent'.format(name)}
    physical_router = __salt__['contrail.service_appliance_set_get'](name, **kwargs)
    if 'Error' not in physical_router:
        ret = __salt__['contrail.service_appliance_set_delete'](name, **kwargs)
    return ret


def global_system_config_present(name, ans=64512, grp=None, **kwargs):
    '''
    Ensures that the Contrail global system config exists or is updated

    :param name:        Virtual router name
    :param ans:         Autonomous system number
    :param grp:         Graceful-Restart-Parameters - dict of parameters
    '''
    ret = __salt__['contrail.global_system_config_create'](name=name, ans=ans, grp=grp, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def global_system_config_absent(name, **kwargs):
    '''
    Ensure that the Contrail global system config doesn't exist

    :param name: The name of the global system config that should not exist
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Global system config "{0}" is already absent'.format(name)}
    gsc = __salt__['contrail.global_system_config_get'](name, **kwargs)
    if 'Error' not in gsc:
        ret = __salt__['contrail.global_system_config_delete'](name, **kwargs)
    return ret


def virtual_network_present(name, domain='default-domain', project='admin',
                            ipam_domain='default-domain',
                            ipam_project='default-project',
                            ipam_name='default-network-ipam',
                            router_external=None, route_target_list=None,
                            subnet_conf=None, vntype_conf=None, **kwargs):
    '''
    Ensure that the virtual network exists.

    :param name (str): name of the network (required)
    :param domain (str): name of domain (optional)
    :param project (str): name of project (optional)
    :param ipam_domain (str): domain for ipam (optional)
    :param ipam_project (str): project for ipam (optional)
    :param ipam_name (str): name of IP Address Management (optional)
    :param router_external (bool): When true, this virtual network is openstack
        router external network. (optional)
    :param route_target_list (list): route target list - format is
        ['target:<asn>:<target>']
    :param subnet_conf (dict):
        ip_prefix (string) optional - format is xxx.xxx.xxx.xxx
        ip_prefix_len (int) optional - format is xx
    :param vntype_conf (dict):
        allow_transit (boolean) optional - enable allow transit
        vxlan_network_identifier (int) - VxLAN VNI value for network
        forwarding_mode (any of ['l2_l3','l2','l3']) optional
            - packet forwarding mode for this virtual network
        rpf (any of ['enabled','disabled']) optional
            - Enable or disable Reverse Path Forwarding check
        for this network
        mirror_destination (boolean) optional
            - Mark the vn as mirror destination network
    '''

    ret = __salt__['contrail.virtual_network_create'](
        name, domain='default-domain', project='admin',
        ipam_domain='default-domain',
        ipam_project='default-project',
        ipam_name='default-network-ipam',
        router_external=None, route_target_list=None,
        subnet_conf=None, vntype_conf=None, **kwargs)
    if len(ret['changes']) == 0:
        pass
    return ret


def floating_ip_pool_present(vn_name,
                             vn_project,
                             vn_domain=None,
                             owner_access=None,
                             global_access=None,
                             projects=None,
                             **kwargs):
    '''
    Ensure that floating ip pool existst
    Virtual network with flag external need to be created before this
    function is called

    :param vn_name: Name of the virtual network with external flag,
                    tell us which floating ip pool we want to manage
    :param vn_project: Name of the project in which floating pool exists
    :param vn_domain: Name of the domain in which floating pool exists
    :param owner_access: permissions rights for owner of the pool
    :param global_access: permissions rights for other users than owner
    :param projects: list of pairs (project, permission for given project)
    '''

    ret = __salt__['contrail.update_floating_ip_pool'](vn_name,
                                                       vn_project,
                                                       vn_domain,
                                                       owner_access,
                                                       global_access,
                                                       projects,
                                                       **kwargs)
    return ret
