Exemple #1
0
 def attachment_vif(self, vif_uuid, hypervisor=None):
     logger.info("Attaching VIF %s" % vif_uuid)
     self["vif_uuid"] = vif_uuid
     self["type"] = "VifAttachment"
     uri = common.genuri("lswitch", self.lswitch_uuid, "lport", self.uuid,
                         "attachment")
     return super(LSwitchPort, self)._action('PUT', uri)
Exemple #2
0
 def attachment_vif(self, vif_uuid, hypervisor=None):
     logger.info("Attaching VIF %s" % vif_uuid)
     self["vif_uuid"] = vif_uuid
     self["type"] = "VifAttachment"
     uri = common.genuri("lswitch", self.lswitch_uuid, "lport", self.uuid,
                         "attachment")
     return super(LSwitchPort, self)._action('PUT', uri)
Exemple #3
0
 def _login(self, username, password):
     fields = {'username': username, 'password': password}
     r = self._conn.request_encode_body('POST', common.genuri('login'),
                                        fields=fields, timeout=self.timeout,
                                        encode_multipart=False)
     if self._iserror(r):
         logger.error("Need to handle error")
         return False
     else:
         self.authkey = r.headers['set-cookie']
         logger.info("Authorized (%s)" % (self.authkey))
     self.authenticated = True
     return True
Exemple #4
0
 def _login(self, username, password, uri=None):
     fields = {'username': username, 'password': password}
     if not uri:
         uri = common.genuri('login')
     r = self._conn.request_encode_body('POST', uri,
                                        fields=fields, timeout=self.timeout,
                                        encode_multipart=False,
                                        headers=None, retries=0)
     if self._iserror(r):
         return False
     else:
         self.authkey = r.headers['set-cookie']
     self.authenticated = True
     return True
Exemple #5
0
 def _login(self, username, password):
     fields = {'username': username, 'password': password}
     r = self._conn.request_encode_body('POST',
                                        common.genuri('login'),
                                        fields=fields,
                                        encode_multipart=False)
     if self._iserror(r):
         logger.error("Need to handle error")
         return False
     else:
         self.authkey = r.headers['set-cookie']
         logger.info("Authorized (%s)" % (self.authkey))
     self.authenticated = True
     return True
Exemple #6
0
 def get_method_uris(self):
     uri = common.genuri("doc", "method")
     return super(NVPFunction, self)._action('GET', uri)
Exemple #7
0
 def status(self):
     """Status (verb) will return the logical port's status"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid,
                         'status')
     return super(LSwitchPort, self)._action("GET", uri)
Exemple #8
0
 def query(self):
     """Returns the query object for logical switch ports
     """
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport')
     queryobject = nvpquery.LSwitchPortQuery(self.connection, uri)
     return queryobject
Exemple #9
0
 def delete(self):
     """Delete (verb) will delete the logical switch
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.uuid)
     return super(LSwitch, self)._action('DELETE', uri)
Exemple #10
0
 def read(self):
     """Read (verb) will read the transport zone config"""
     uri = common.genuri('transport-zone', self.uuid)
     return super(TransportZone, self)._action('GET', uri)
Exemple #11
0
 def delete(self):
     """Delete (verb) will delete the Gateway Service"""
     uri = common.genuri('gateway-service', self.uuid)
     return super(GatewayService, self)._action('DELETE', uri)
Exemple #12
0
 def delete(self):
     """Delete (verb) will delete the security profile"""
     uri = common.genuri('security-profile', self.uuid)
     return super(SecurityProfile, self)._action('DELETE', uri)
Exemple #13
0
 def read(self):
     """Read (verb) will read the security profile config"""
     uri = common.genuri('security-profile', self.uuid)
     return super(SecurityProfile, self)._action('GET', uri)
Exemple #14
0
 def update(self):
     """Update (verb) will update the security profile"""
     uri = common.genuri('security-profile', self.uuid)
     return super(SecurityProfile, self)._action('PUT', uri)
Exemple #15
0
 def query(self):
     """Returns the query object for the security profile"""
     uri = common.genuri('security-profile')
     queryobject = nvpquery.SecurityProfileQuery(self.connection, uri)
     return queryobject
Exemple #16
0
 def update(self):
     """Update (verb) will update the logical switch port
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid)
     return super(LSwitchPort, self)._action('PUT', uri)
Exemple #17
0
 def update(self):
     """Update (verb) will update the Gateway Service"""
     uri = common.genuri('gateway-service', self.uuid)
     return super(GatewayService, self)._action('PUT', uri)
Exemple #18
0
 def status(self):
     """Will get the status of the transport node"""
     uri = common.genuri('transport-node', self.uuid, 'status')
     return super(TransportNode, self)._action('GET', uri)
Exemple #19
0
 def query(self):
     """Returns the query object for the transport zone"""
     uri = common.genuri('transport-zone')
     queryobject = nvpquery.TransportZoneQuery(self.connection, uri)
     return queryobject
Exemple #20
0
 def create(self):
     """Create (verb) will create the Gateway Service"""
     uri = common.genuri('gateway-service')
     return super(GatewayService, self)._action('POST', uri)
Exemple #21
0
 def query(self):
     """Returns the query object for logical switches
     """
     queryobject = nvpquery.LSwitchQuery(self.connection,
                                         common.genuri('lswitch'))
     return queryobject
Exemple #22
0
 def query(self):
     """Returns the query object for the Gateway Service"""
     uri = common.genuri('gateway-service')
     queryobject = nvpquery.GatewayServiceQuery(self.connection, uri)
     return queryobject
Exemple #23
0
 def read(self):
     """Read (verb) will return the configuration of the logical switch
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.uuid)
     return super(LSwitch, self)._action('GET', uri)
Exemple #24
0
 def update(self):
     """Update (verb) will update the Gateway Service"""
     uri = common.genuri('gateway-service', self.uuid)
     return super(GatewayService, self)._action('PUT', uri)
Exemple #25
0
 def statistics(self):
     """statistics (verb) will return the port's stats"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid,
                         'statistic')
     return super(LSwitchPort, self)._action("GET", uri)
Exemple #26
0
 def read(self):
     """Read (verb) will read the Gateway Service config"""
     uri = common.genuri('gateway-service', self.uuid)
     return super(GatewayService, self)._action('GET', uri)
Exemple #27
0
 def update(self):
     """Update (verb) will update the logical switch port
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid)
     return super(LSwitchPort, self)._action('PUT', uri)
Exemple #28
0
 def delete(self):
     """Delete (verb) will delete the Gateway Service"""
     uri = common.genuri('gateway-service', self.uuid)
     return super(GatewayService, self)._action('DELETE', uri)
Exemple #29
0
 def get_schemas(self):
     uri = common.genuri("schema")
     return super(NVPFunction, self)._action('GET', uri)
Exemple #30
0
 def create(self):
     """Create (verb) will create the transport zone"""
     uri = common.genuri('transport-zone')
     return super(TransportZone, self)._action('POST', uri)
Exemple #31
0
 def delete(self):
     """Delete (verb) will delete the logical port.
     Requires a UUID set at the object"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid)
     return super(LSwitchPort, self)._action("DELETE", uri)
Exemple #32
0
 def query(self):
     """Returns the query object for the transport zone"""
     uri = common.genuri('transport-zone')
     queryobject = nvpquery.TransportZoneQuery(self.connection, uri)
     return queryobject
Exemple #33
0
 def query(self):
     """Returns the query object for the Gateway Service"""
     uri = common.genuri('gateway-service')
     queryobject = nvpquery.GatewayServiceQuery(self.connection, uri)
     return queryobject
Exemple #34
0
 def update(self):
     """Update (verb) will update the transport zone"""
     uri = common.genuri('transport-zone', self.uuid)
     return super(TransportZone, self)._action('PUT', uri)
Exemple #35
0
 def read(self):
     """Read (verb) will read the Gateway Service config"""
     uri = common.genuri('gateway-service', self.uuid)
     return super(GatewayService, self)._action('GET', uri)
Exemple #36
0
 def read(self):
     """Read (verb) will read the transport zone config"""
     uri = common.genuri('transport-zone', self.uuid)
     return super(TransportZone, self)._action('GET', uri)
Exemple #37
0
 def create(self):
     """Create (verb) will create the transport zone"""
     uri = common.genuri('transport-zone')
     return super(TransportZone, self)._action('POST', uri)
Exemple #38
0
 def delete(self):
     """Delete (verb) will delete the transport zone"""
     uri = common.genuri('transport-zone', self.uuid)
     return super(TransportZone, self)._action('DELETE', uri)
Exemple #39
0
 def update(self):
     """Update (verb) will update the transport zone"""
     uri = common.genuri('transport-zone', self.uuid)
     return super(TransportZone, self)._action('PUT', uri)
Exemple #40
0
 def query(self):
     """Returns the query object for logical switches
     """
     queryobject = nvpquery.LSwitchQuery(self.connection,
                                         common.genuri('lswitch'))
     return queryobject
Exemple #41
0
 def delete(self):
     """Delete (verb) will delete the transport zone"""
     uri = common.genuri('transport-zone', self.uuid)
     return super(TransportZone, self)._action('DELETE', uri)
Exemple #42
0
 def create(self):
     """Create (verb) will create the logical switch
     """
     return super(LSwitch, self)._action('POST', common.genuri('lswitch'))
Exemple #43
0
 def create(self):
     """Create (verb) will create the logical switch
     """
     return super(LSwitch, self)._action('POST', common.genuri('lswitch'))
Exemple #44
0
 def delete(self):
     """Delete (verb) will delete the logical switch
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.uuid)
     return super(LSwitch, self)._action('DELETE', uri)
Exemple #45
0
 def status(self):
     """Status (verb) will return the network status of the logical switch
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.uuid, 'status')
     return super(LSwitch, self)._action('GET', uri)
Exemple #46
0
 def status(self):
     """Status (verb) will return the network status of the logical switch
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.uuid, 'status')
     return super(LSwitch, self)._action('GET', uri)
Exemple #47
0
 def create(self):
     """Create (verb) will create the logical port on the switch"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport')
     return super(LSwitchPort, self)._action("POST", uri)
Exemple #48
0
 def read(self):
     """Read (verb) will return the configuration of the logical switch
     Requires a UUID set at the object.
     """
     uri = common.genuri('lswitch', self.uuid)
     return super(LSwitch, self)._action('GET', uri)
Exemple #49
0
 def read(self):
     """Read (verb) will read the logical port's configuration"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid)
     return super(LSwitchPort, self)._action("GET", uri)
Exemple #50
0
 def create(self):
     """Create (verb) will create the logical port on the switch"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport')
     return super(LSwitchPort, self)._action("POST", uri)
Exemple #51
0
 def clear_statistics(self):
     """clear_statistics (verb) will clear the port's stats"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid,
                         'statistic')
     return super(LSwitchPort, self)._action("DELETE", uri)
Exemple #52
0
 def query(self):
     """Returns the query object for logical switch ports
     """
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport')
     queryobject = nvpquery.LSwitchPortQuery(self.connection, uri)
     return queryobject
Exemple #53
0
 def delete(self):
     """Delete (verb) will delete the logical port.
     Requires a UUID set at the object"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid)
     return super(LSwitchPort, self)._action("DELETE", uri)
Exemple #54
0
 def read(self):
     """Read (verb) will read the logical port's configuration"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid)
     return super(LSwitchPort, self)._action("GET", uri)
Exemple #55
0
 def logout(self):
     uri = common.genuri("logout")
     return super(NVPFunction, self)._action('GET', uri)
Exemple #56
0
 def statistics(self):
     """statistics (verb) will return the port's stats"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid,
                         'statistic')
     return super(LSwitchPort, self)._action("GET", uri)
Exemple #57
0
 def read_method(self, method_name):
     uri = common.genuri("doc", "method", method_name)
     return super(NVPFunction, self)._action('GET', uri)
Exemple #58
0
 def clear_statistics(self):
     """clear_statistics (verb) will clear the port's stats"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid,
                         'statistic')
     return super(LSwitchPort, self)._action("DELETE", uri)
Exemple #59
0
 def read_schema(self, schema_name):
     uri = common.genuri("schema", schema_name)
     return super(NVPFunction, self)._action('GET', uri)
Exemple #60
0
 def status(self):
     """Status (verb) will return the logical port's status"""
     uri = common.genuri('lswitch', self.lswitch_uuid, 'lport', self.uuid,
                         'status')
     return super(LSwitchPort, self)._action("GET", uri)