Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 6
0
 def get_method_uris(self):
     uri = common.genuri("doc", "method")
     return super(NVPFunction, self)._action('GET', uri)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 20
0
 def create(self):
     """Create (verb) will create the Gateway Service"""
     uri = common.genuri('gateway-service')
     return super(GatewayService, self)._action('POST', uri)
Ejemplo n.º 21
0
 def query(self):
     """Returns the query object for logical switches
     """
     queryobject = nvpquery.LSwitchQuery(self.connection,
                                         common.genuri('lswitch'))
     return queryobject
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 29
0
 def get_schemas(self):
     uri = common.genuri("schema")
     return super(NVPFunction, self)._action('GET', uri)
Ejemplo n.º 30
0
 def create(self):
     """Create (verb) will create the transport zone"""
     uri = common.genuri('transport-zone')
     return super(TransportZone, self)._action('POST', uri)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 37
0
 def create(self):
     """Create (verb) will create the transport zone"""
     uri = common.genuri('transport-zone')
     return super(TransportZone, self)._action('POST', uri)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 40
0
 def query(self):
     """Returns the query object for logical switches
     """
     queryobject = nvpquery.LSwitchQuery(self.connection,
                                         common.genuri('lswitch'))
     return queryobject
Ejemplo n.º 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)
Ejemplo n.º 42
0
 def create(self):
     """Create (verb) will create the logical switch
     """
     return super(LSwitch, self)._action('POST', common.genuri('lswitch'))
Ejemplo n.º 43
0
 def create(self):
     """Create (verb) will create the logical switch
     """
     return super(LSwitch, self)._action('POST', common.genuri('lswitch'))
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 55
0
 def logout(self):
     uri = common.genuri("logout")
     return super(NVPFunction, self)._action('GET', uri)
Ejemplo n.º 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)
Ejemplo n.º 57
0
 def read_method(self, method_name):
     uri = common.genuri("doc", "method", method_name)
     return super(NVPFunction, self)._action('GET', uri)
Ejemplo n.º 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)
Ejemplo n.º 59
0
 def read_schema(self, schema_name):
     uri = common.genuri("schema", schema_name)
     return super(NVPFunction, self)._action('GET', uri)
Ejemplo n.º 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)