def __init__(self, neutron=None):
        super(VSMRegistration, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'registration_schema.Registration'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/element-managers/vcns')
    def __init__(self, nvp_controller=None):
        super(TransportZone, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'nvp_transport_zone_schema.TransportZone'

        if nvp_controller is not None:
            self.set_connection(nvp_controller.get_connection())

        self.set_create_endpoint('transport-zone')
Beispiel #3
0
    def __init__(self, neutron=None):
        super(NVPRegistration, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'nvp_registration_schema.NVPRegistration'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/element-managers/nvp')
    def __init__(self, nvp_controller=None):

        super(TransportNode, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'nvp_transport_node_schema.TransportNode'
        self.set_create_endpoint('transport-node')

        if nvp_controller != None:
            self.set_connection(nvp_controller.get_connection())
 def __init__(self, vsm=None):
     """ Constructor to create ServiceManager object
     @param vsm object on which ServiceManager has to be configured
     """
     super(ServiceManager, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_manager_schema.ServiceManagerSchema'
     self.set_connection(vsm.get_connection())
     self.set_create_endpoint("/si/servicemanager")
     self.id = None
Beispiel #6
0
    def __init__(self, nvp_controller=None):

        super(LogicalSwitch, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'nvp_logical_switch_schema.LogicalSwitch'

        if nvp_controller != None:
            self.set_connection(nvp_controller.get_connection())

        self.set_create_endpoint('lswitch')
Beispiel #7
0
 def __init__(self, vsm=None):
     super(VsmVersion, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'vsmglobalinfo_schema.VSMGlobalInfoSchema'
     self.set_connection(vsm.get_connection())
     conn = self.get_connection()
     conn.set_api_header("api/1.0/")
     self.set_read_endpoint("appliance-management/global/info")
     self.id = None
     self.update_as_post = False
 def __init__(self, vsm=None):
     """ Constructor to create ServiceManager object
     @param vsm object on which ServiceManager has to be configured
     """
     super(ServiceManager, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_manager_schema.ServiceManagerSchema'
     self.set_connection(vsm.get_connection())
     self.set_create_endpoint("/si/servicemanager")
     self.id = None
 def __init__(self, vsm=None):
     """ Constructor to issue force sync on replicator
     @param vsm object on which IPSet has to be configured
     """
     super(ReplicatorForceSync, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.set_connection(vsm.get_connection())
     self.set_create_endpoint("universalsync/sync?action=invoke")
     self.id = None
     self.update_as_post = False
    def __init__(self, nvp_controller=None):

        super(LogicalSwitch, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'nvp_logical_switch_schema.LogicalSwitch'

        if nvp_controller != None:
            self.set_connection(nvp_controller.get_connection())

        self.set_create_endpoint('lswitch')
Beispiel #11
0
 def __init__(self, vsm=None):
     super(VsmVersion, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'vsmglobalinfo_schema.VSMGlobalInfoSchema'
     self.set_connection(vsm.get_connection())
     conn = self.get_connection()
     conn.set_api_header("api/1.0/")
     self.set_read_endpoint("appliance-management/global/info")
     self.id = None
     self.update_as_post = False
 def __init__(self, service=None):
     """ Constructor to create Service object
     @param vsm object on which Service has to be configured
     """
     super(VendorTemplate, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'vendor_template_schema.VendorTemplateSchema'
     self.set_connection(service.get_connection())
     self.set_create_endpoint("/si/service/" + str(service.id) + "/vendortemplate")
     self.id = None
     self.update_as_post = False
Beispiel #13
0
 def __init__(self, vsm=None):
     """ Constructor to create Service object
     @param vsm object on which Service has to be configured
     """
     super(Service, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_si_schema.ServiceSchema'
     self.set_connection(vsm.get_connection())
     self.set_create_endpoint("/si/service")
     self.id = None
     self.update_as_post = False
Beispiel #14
0
 def __init__(self, vsm=None):
     """ Constructor to create Service object
     @param vsm object on which Service has to be configured
     """
     super(Service, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_si_schema.ServiceSchema'
     self.set_connection(vsm.get_connection())
     self.set_create_endpoint("/si/service")
     self.id = None
     self.update_as_post = False
    def __init__(self, vsm=None):
        """ Constructor to create IPSet object

        @param vsm object on which IPSet has to be configured
        """
        super(ReplicatorRole, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'replicator_role_schema.ReplicatorRoleSchema'
        self.set_connection(vsm.get_connection())
        self.set_create_endpoint("universalsync/configuration/role")
        self.id = None
        self.update_as_post = False
Beispiel #16
0
    def __init__(self, vsm=None):
        """ Constructor to create IPSet object

        @param vsm object on which IPSet has to be configured
        """
        super(ReplicatorRole, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'replicator_role_schema.ReplicatorRoleSchema'
        self.set_connection(vsm.get_connection())
        self.set_create_endpoint("universalsync/configuration/role")
        self.id = None
        self.update_as_post = False
Beispiel #17
0
 def __init__(self, service=None):
     """ Constructor to create VersionedDeploymentSpec object
     @param vsm object on which Service has to be configured
     """
     super(VersionedDeploymentSpec, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'versioned_deployment_spec_schema.VersionedDeploymentSpecSchema'
     self.set_connection(service.get_connection())
     self.set_create_endpoint(
         "/si/service/" + str(service.id) +
         "/servicedeploymentspec/versioneddeploymentspec")
     self.id = None
 def __init__(self, service=None):
     """ Constructor to create ClusterDeploymentConfigs object
     @param vsm object on which ClusterDeploymentConfigs has to be configured
     """
     super(ClusterDeploymentConfigs, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'cluster_deployment_configs_schema.ClusterDeploymentConfigsSchema'
     self.set_connection(service.get_connection())
     self.create_endpoint = 'si/deploy'
     self.delete_endpoint = 'si/deploy/' + 'service/' + str(service.id)
     self.id = None
     self.update_as_post = False
Beispiel #19
0
 def __init__(self, service=None):
     """ Constructor to create Service object
     @param vsm object on which Service has to be configured
     """
     super(VendorTemplate, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'vendor_template_schema.VendorTemplateSchema'
     self.set_connection(service.get_connection())
     self.set_create_endpoint("/si/service/" + str(service.id) +
                              "/vendortemplate")
     self.id = None
     self.update_as_post = False
Beispiel #20
0
 def __init__(self, vsm=None):
     """ Constructor to create ServiceInstance object
     @param vsm object on which ServiceInstance has to be configured
     """
     super(ServiceInstance, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_instance_schema.ServiceInstanceSchema'
     self.set_connection(vsm.get_connection())
     self.set_create_endpoint('/si/serviceinstance')
     self.set_read_endpoint('/si/serviceinstances')
     self.set_delete_endpoint('/si/serviceinstance')
     self.id = None
    def test_attribute_mapping(self):
        self.log = logger.setup_logging(self.__class__.__name__)
        #Attribute map
        attribute_map = {
            'name': 'display_name',
            'summary': 'description',
            'begin': 'start',
            'ipv': 'ip_version',
            'ranges': 'allocation_ranges',
            'dns': 'dns_nameservers',
            'hop': 'next_hop'
        }

        #User dictionary
        py_dict = {'subnets':
                       [{'static_routes': [{'hop': '192.168.10.5', 'destination_cidr': '192.168.10.0/24'}],
                         'ranges': [{'start': '192.168.1.2', 'end': '192.168.1.6'},
                                    {'start': '192.168.1.10', 'end': '192.168.1.100'}],
                         'dns': ['10.10.10.11', '10.10.10.12'],
                         'gateway_ip': '192.168.1.1',
                         'ipv': 4,
                         'cidr': '192.168.1.0/24'},
                         {'cidr': '192.175.1.0/24'}],
                         'name': 'TestIPPool-1-2091',
                         'summary': 'Test IPPool'}

        self.log.debug("User dictionary: %s" % py_dict)

        #Convert user dictionary to product expected form using map_attributes function
        py_dict = utilities.map_attributes(attribute_map, py_dict)

        #Dictionary in product expected form
        self.log.debug("Dictionary in product expected form:: %s" % py_dict)

        self.assertTrue("name" not in py_dict.keys())
        self.assertTrue("display_name" in py_dict.keys())
        self.assertEqual(py_dict["display_name"], "TestIPPool-1-2091")
        self.assertTrue("summary" not in py_dict.keys())
        self.assertTrue("description" in py_dict.keys())
        self.assertEqual(py_dict["description"], "Test IPPool")

        #Convert product expected dictionary in user dictionary form using map_attributes function
        py_dict = utilities.map_attributes(attribute_map, py_dict, reverse_attribute_map=True)

        #Dictionary in user expected form
        self.log.debug("Dictionary in user expected form:: %s" % py_dict)

        self.assertTrue("display_name" not in py_dict.keys())
        self.assertTrue("name" in py_dict.keys())
        self.assertEqual(py_dict["name"], "TestIPPool-1-2091")
        self.assertTrue("description" not in py_dict.keys())
        self.assertTrue("summary" in py_dict.keys())
        self.assertEqual(py_dict["summary"], "Test IPPool")
 def __init__(self, serviceinstance=None):
     """ Constructor to create ServiceInstanceRuntimeInfo object
     @param vsm object on which ServiceInstanceRuntimeInfo has to be configured
     """
     super(ServiceInstanceRuntimeInfo, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_instance_runtime_info_schema.ServiceInstanceRuntimeInfoSchema'
     self.set_connection(serviceinstance.get_connection())
     #create endpoint e.g. si/serviceinstance/serviceinstance-1/runtimeinfo
     self.set_create_endpoint("si/serviceinstance/" + str(serviceinstance.id) + "/runtimeinfo")
     self.id = None
     self.update_as_post = True
 def __init__(self, serviceprofile=None):
     """ Constructor to create ServiceProfileBinding object
     @param vsm object on which ServiceProfileBinding has to be configured
     """
     super(ServiceProfileBinding, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_profile_binding_schema.ServiceProfileBindingSchema'
     self.set_connection(serviceprofile.get_connection())
     #create endpoint e.g. si/serviceprofile/serviceprofile-1/binding
     self.set_create_endpoint("/si/serviceprofile/" + str(serviceprofile.id) + "/binding")
     self.set_read_endpoint('si/serviceprofile/' + str(serviceprofile.id))
     self.id = None
     self.update_as_post = False
    def __init__(self, vsm=None):
        """ Constructor to create VSMUniversalEntityReplicationStatus object

        @param vsm object on which Replication status has to be checked
        """
        super(VSMUniversalEntityReplicationStatus, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'vsm_entity_sync_status_schema.VSMEntitySyncStatusSchema'
        self.set_connection(vsm.get_connection())
        conn = self.get_connection()
        self.set_create_endpoint("universalsync/entitystatus")
        self.id = None
        self.update_as_post = False
 def __init__(self, serviceinstance=None):
     """ Constructor to create ServiceInstanceRuntimeInfo object
     @param vsm object on which ServiceInstanceRuntimeInfo has to be configured
     """
     super(ServiceInstanceRuntimeInfo, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_instance_runtime_info_schema.ServiceInstanceRuntimeInfoSchema'
     self.set_connection(serviceinstance.get_connection())
     #create endpoint e.g. si/serviceinstance/serviceinstance-1/runtimeinfo
     self.set_create_endpoint("si/serviceinstance/" +
                              str(serviceinstance.id) + "/runtimeinfo")
     self.id = None
     self.update_as_post = True
    def __init__(self, logical_switch=None):
        """ Constructor to create LogicalSwitchPort object

        @param LogicalSwitch object on which LogicalSwitchPort object has to be configured
        """
        super(LogicalSwitchPort, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'logical_switch_port_schema.LogicalSwitchPortSchema'

        if logical_switch is not None:
            self.set_connection(logical_switch.get_connection())

        self.set_create_endpoint("/lswitches/" + logical_switch.id +"/ports")
        self.id = None
    def __init__(self, servicegroup=None):
        """ Constructor to create ServiceGroupMember object

        @param servicegroup object in which member has to be added
        """
        super(ServiceGroupMember, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'service_group_member_schema.ServiceGroupMemberSchema'

        if servicegroup is not None:
            self.set_connection(servicegroup.get_connection())

        self.set_create_endpoint("/groupings/service-groups/%s" % servicegroup.id)
        self.set_delete_endpoint("/groupings/service-groups/%s/members" % servicegroup.id)
 def __init__(self, serviceprofile=None):
     """ Constructor to create ServiceProfileBinding object
     @param vsm object on which ServiceProfileBinding has to be configured
     """
     super(ServiceProfileBinding, self).__init__()
     self.log = logger.setup_logging(self.__class__.__name__)
     self.schema_class = 'service_profile_binding_schema.ServiceProfileBindingSchema'
     self.set_connection(serviceprofile.get_connection())
     #create endpoint e.g. si/serviceprofile/serviceprofile-1/binding
     self.set_create_endpoint("/si/serviceprofile/" +
                              str(serviceprofile.id) + "/binding")
     self.set_read_endpoint('si/serviceprofile/' + str(serviceprofile.id))
     self.id = None
     self.update_as_post = False
Beispiel #29
0
    def __init__(self, neutron=None):
        """ Constructor to create IPSet object

        @param neutron object on which IPSet object has to be configured
        """
        super(IPSet, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'ipset_schema.IPSetSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/groupings/ipsets')
        self.id = None
    def __init__(self, applicationgroup=None):
        """ Constructor to create ApplicationGroupMember object

        @param applicationgroup object in which member has to be added
        """
        super(ApplicationGroupMember, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'application_group_member_schema.ApplicationGroupMemberSchema'

        if applicationgroup is not None:
            self.set_connection(applicationgroup.get_connection())

        self.set_create_endpoint("/services/applicationgroup/%s" % applicationgroup.id)
        self.set_delete_endpoint("/services/applicationgroup/%s/members" % applicationgroup.id)
Beispiel #31
0
    def __init__(self, neutron=None):
        """ Constructor to create LogicalSwitch object

        @param neutron object on which LogicalSwitch object has to be configured
        """
        super(MulticastRange, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'multicast_range_schema.MulticastRangeSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/pools/multicast-pools')
        self.id = None
    def __init__(self, security_group=None, ip_address=None):
        """ Constructor to get translated IP addresses from
        security group

        @param security group object on which translation has to be checked
        """
        super(SecurityGroupLookupIPAddress, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'vsm_security_groups_schema.SecurityGroupsSchema'
        self.set_connection(security_group.get_connection())
        if ip_address is None:
            raise ValueError("IP Address to be used for lookup is None")
        self.set_create_endpoint(
            "/services/securitygroup/lookup/ipaddress/%s" % ip_address)
    def __init__(self, neutron=None):
        """ Constructor to create LogicalPipelineStage object

        @param neutron object on which LogicalPipelineStage object has to be configured
        """
        super(LogicalPipelineStage, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'logical_pipeline_stage_schema.LogicalPipelineStageSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/pipeline-stages')
        self.id = None
Beispiel #34
0
    def __init__(self, neutron=None):
        """ Constructor to create TransportNode object

        @param neutron object on which TransportNode object has to be configured
        """
        super(TransportNode, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'transport_node_schema.TransportNodeSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/transport-nodes')
        self.id = None
    def __init__(self, logical_services_node=None):
        """ Constructor to create ServicesNodeBgpConfig object

        @param logical_services_node object on which ServicesNodeBgpConfig object has to be configured
        """
        super(ServicesNodeBgpConfig, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'bgp_config_schema.BgpConfigSchema'

        if logical_services_node is not None:
            self.set_connection(logical_services_node.get_connection())

        self.set_create_endpoint("/lservices-nodes/" + logical_services_node.id + "/service-bindings/routing/bgp")
        self.id = None
    def __init__(self, neutron=None):
        """ Constructor to create LogicalServicesNode object

        @param neutron object on which LogicalServicesNode object has to be configured
        """
        super(LogicalServicesNode, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'logical_services_node_schema.LogicalServicesNodeSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/lservices-routers')
        self.id = None
Beispiel #37
0
    def __init__(self, neutron=None):
        """ Constructor to create TransportNode object

        @param neutron object on which TransportNode object has to be configured
        """
        super(TransportNode, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'transport_node_schema.TransportNodeSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/transport-nodes')
        self.id = None
Beispiel #38
0
    def __init__(self, neutron=None):
        """ Constructor to create ServiceGroup object

        @param neutron object on which ServiceGroup object has to be configured
        """
        super(ServiceGroup, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'service_group_schema.ServiceGroupSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/groupings/service-groups')
        self.id = None
    def __init__(self, security_group=None, ip_address=None):
        """ Constructor to get translated IP addresses from
        security group

        @param security group object on which translation has to be checked
        """
        super(SecurityGroupLookupIPAddress, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'vsm_security_groups_schema.SecurityGroupsSchema'
        self.set_connection(security_group.get_connection())
        if ip_address is None:
            raise ValueError("IP Address to be used for lookup is None")
        self.set_create_endpoint(
            "/services/securitygroup/lookup/ipaddress/%s" % ip_address)
    def __init__(self, neutron=None):
        """ Constructor to create LogicalPipelineStage object

        @param neutron object on which LogicalPipelineStage object has to be configured
        """
        super(LogicalPipelineStage, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'logical_pipeline_stage_schema.LogicalPipelineStageSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/pipeline-stages')
        self.id = None
Beispiel #41
0
    def __init__(self, vsm=None):
        """ Constructor to create IPSet object

        @param vsm object on which IPSet has to be configured
        """
        super(VSMRegister, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'vsm_nsx_manager_info_schema.NSXManagerInfoSchema'
        self.set_connection(vsm.get_connection())
        self.set_create_endpoint(
            "universalsync/configuration/nsxmanagers")
        self.id = None
        self.update_as_post = False
        self.location_header = None
    def __init__(self, logical_services_node=None):
        """ Constructor to create ServicesNodeNatConfig object

        @param logical_services_node object on which ServicesNodeNatConfig object has to be configured
        """
        super(ServicesNodeNatConfig, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'nat_config_schema.NatConfigSchema'

        if logical_services_node is not None:
            self.set_connection(logical_services_node.get_connection())

        self.set_create_endpoint("/lservices-nodes/" + logical_services_node.id + "/service-bindings/nat/config")
        self.id = None
    def __init__(self, vsm=None):
        """ Constructor to create IPSet object

        @param vsm object on which IPSet has to be configured
        """
        super(ReplicatorStatus, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'nsxapi_appliance_management_schema.NSXAPIApplianceManagementSchema'
        self.set_connection(vsm.get_connection())
        conn = self.get_connection()
        conn.set_api_header("api/1.0")
        self.set_create_endpoint("appliance-management/components/component/NSXREPLICATOR/status")
        self.id = None
        self.update_as_post = False
Beispiel #44
0
    def __init__(self, neutron=None):
        """ Constructor to create ServiceGroup object

        @param neutron object on which ServiceGroup object has to be configured
        """
        super(ServiceGroup, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'service_group_schema.ServiceGroupSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/groupings/service-groups')
        self.id = None
    def __init__(self, neutron=None):
        """ Constructor to create LogicalSwitch object

        @param neutron object on which LogicalSwitch object has to be configured
        """
        super(MulticastRange, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'multicast_range_schema.MulticastRangeSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/pools/multicast-pools')
        self.id = None
Beispiel #46
0
    def __init__(self, neutron=None):
        """ Constructor to create OperatingMode object

        @param neutron object on which OperatingMode object has to be configured
        """
        super(OperatingMode, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'neutron_operating_mode_schema.OperatingModeSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint("/cluster/operatingmode")
        self.id = None
Beispiel #47
0
    def __init__(self, logical_switch_port=None):
        """ Constructor to create VifAttachment object

        @param VifAttachment object on which VifAttachment object has to be configured
        """
        super(VifAttachment, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'vif_attachment_schema.VifAttachmentSchema'

        if logical_switch_port is not None:
            self.set_connection(logical_switch_port.get_connection())

        self.set_create_endpoint(logical_switch_port.create_endpoint + "/" + logical_switch_port.id +"/attachment")
        self.id = None
Beispiel #48
0
    def __init__(self, neutron=None):
        """ Constructor to create IPSet object

        @param neutron object on which IPSet object has to be configured
        """
        super(IPSet, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'ipset_schema.IPSetSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint('/groupings/ipsets')
        self.id = None
Beispiel #49
0
    def __init__(self, vsm=None):
        """ Constructor to create IPSet object

        @param vsm object on which IPSet has to be configured
        """
        super(VsmConfig, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'vsmconfig_schema.VSMConfigSchema'
        self.set_connection(vsm.get_connection())
        conn = self.get_connection()
        conn.set_api_header("api/2.0")
        self.set_read_endpoint("services/vsmconfig")
        self.id = None
        self.update_as_post = False
Beispiel #50
0
    def __init__(self, neutron=None):
        """ Constructor to create LogicalSwitch object

        @param neutron object on which LogicalSwitch object has to be configured
        """
        super(LogicalSwitch, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'logical_switch_schema.LogicalSwitchSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_state_endpoint('/lswitches/%s/state')
        self.set_create_endpoint('/lswitches')
        self.id = None
Beispiel #51
0
    def __init__(self, neutron=None):
        """ Constructor to create ConfigSnapshot object

        @param neutron object on which ConfigSnapshot object has to be configured
        """
        super(ConfigSnapshot, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'neutron_backup_schema.ConfigSnapshotSchema'

        if neutron is not None:
            self.set_connection(neutron.get_connection())

        self.set_create_endpoint("/cluster/config-snapshot")
        self.set_content_type("application/octet-stream")
        self.id = None
Beispiel #52
0
    def __init__(self, vsm=None, scope=None):
        """ Constructor to create IPDetection object

        @param vsm object on which IPDetection type has to be configured
        """
        super(IPDetection, self).__init__()
        self.log = logger.setup_logging(self.__class__.__name__)
        self.schema_class = 'ipdetection_schema.IPDetectionSchema'
        self.set_connection(vsm.get_connection())
        if scope is not None:
            self.set_create_endpoint("services/iprepository/config/scope/%s" % scope)
        else:
            self.set_create_endpoint("services/iprepository/config/scope/globalroot-0")
        self.id = None
        self.update_as_post = False