Esempio n. 1
0
 def retrieve_inactive_hosts(self, container):
     self.uri = '/' + self.app + '/' + container + '/hosts/inactive'
     self.method = 'GET'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 2
0
 def retrieve_subnet_by_name(self, subnetName, container):
     self.uri = '/' + self.app + '/' + container + '/subnet/' + subnetName
     self.method = 'GET'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 3
0
 def save_nodes_config(self, container):
     self.uri = '/' + self.app + '/' + container + '/save'
     self.method = 'POST'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 4
0
 def del_container(self, container):
     self.uri = '/' + self.app + '/container/' + container
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 5
0
 def retrieve_all_containers(self):
     self.uri = '/' + self.app + '/containers'
     self.method = 'GET'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 6
0
 def del_static_route(self, route, container):
     self.uri = '/' + self.app + '/' + container + '/route/' + route
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 7
0
 def del_userLink(self, container, linkName):
     self.uri = '/' + self.app + '/' + container + '/userLink/' + linkName
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 8
0
 def retrieve_flowspecs_by_container(self, container):
     self.uri = '/' + self.app + '/container/' + container + '/flowspecs'
     self.method = 'GET'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 9
0
 def retrieve_the_topology(self, container):
     self.uri = '/' + self.app + '/' + container
     self.method = 'GET'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 10
0
 def create_bridge(self, nodeType, nodeID, bridgeName):
     self.uri = '/networkconfig/' + self.app + '/bridge/' + \
         nodeType + '/' + nodeID + '/' + bridgeName
     self.method = 'POST'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 11
0
 def del_host(self, networkAddress, container):
     self.uri = '/' + self.app + '/' + \
         container + '/address/' + networkAddress
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 12
0
 def del_user(self, userName):
     self.uri = '/' + self.app + '/users/' + userName
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers,
                        sec=self.sec)
Esempio n. 13
0
 def toggle_flow_by_name(self, nodeId, flowName, nodeType, container):
     self.uri = '/' + self.app + '/' + container + '/node/' + \
         nodeType + '/' + nodeId + '/staticFlow/' + flowName
     self.method = 'POST'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 14
0
 def del_connection(self, connectionNodeId, connectionNodeType):
     self.uri = '/' + self.app + '/node/' + \
         connectionNodeType + '/' + connectionNodeId
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 15
0
 def del_port_from_bridge(self, nodeType, nodeID, bridgeName, portName):
     self.uri = '/netowrkconfig/' + self.app + '/bridge/' + \
         nodeType + '/' + nodeID + '/' + bridgeName + '/' + portName
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 16
0
 def add_flowspec_to_container(self, flowSpecConfig, container):
     self.uri = '/' + self.app + '/container/' + \
         container + '/flowspec/' + flowSpecConfig['name']
     self.method = 'PUT'
     self.data = flowSpecConfig
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 17
0
 def create_container(self, containerConfig):
     self.uri = '/' + self.app + '/container/' + \
         containerConfig['container']
     self.method = 'PUT'
     self.data = containerConfig
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 18
0
 def del_node_connectors_from_container(self, nodeConnectors, container):
     self.uri = '/' + self.app + '/container/' + \
         container + '/nodeconnector'
     self.method = 'DELETE'
     self.data = nodeConnectors
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 19
0
 def del_node_property(self, nodeId, propertyName, nodeType, container):
     self.uri = '/' + self.app + '/' + container + '/node/' + \
         nodeType + '/' + nodeId + '/property/' + propertyName
     self.method = 'DELETE'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 20
0
 def del_flowspec_from_container(self, flowspec, container):
     self.uri = '/' + self.app + '/container/' + \
         container + '/flowspec/' + flowspec
     self.method = 'PUT'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 21
0
 def retrieve_node_connectors_by_node(self, nodeId, nodeType, container):
     self.uri = '/' + self.app + '/' + container + \
         '/node/' + nodeType + '/' + nodeId
     self.method = 'GET'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 22
0
 def retrieve_all_nodes_of_controller(self, controllerIP):
     self.uri = '/' + self.app + '/nodes'
     if controllerIP is not None:
         self.uri = self.uri + '?controller=' + controllerIP
     self.method = 'GET'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 23
0
 def add_port_vlan_to_bridge(self, nodeType, nodeID, bridgeName, portName,
                             vlan):
     self.uri = '/networkconfig/' + self.app + '/port/' + nodeType + \
         '/' + nodeID + '/' + bridgeName + '/' + portName + '/' + vlan
     self.method = 'POST'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 24
0
 def modify_subnet(self, subnetName, subnetConfig, container):
     self.uri = '/' + self.app + '/' + container + '/subnet/' + subnetName
     self.method = 'POST'
     self.data = subnetConfig
     self.headers = {
         'Accept': 'application/' + self.format,
         'Content-type': 'application/' + self.format
     }
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 25
0
 def add_userLink(self, container, topologyUserLinkConfig):
     self.uri = '/' + self.app + '/' + container + \
         '/userLink/' + topologyUserLinkConfig['name']
     self.method = 'PUT'
     self.data = topologyUserLinkConfig
     self.headers = {
         'Accept': 'application/' + self.format,
         'Content-type': 'application/' + self.format
     }
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 26
0
 def add_static_route(self, staticRoute, container):
     self.uri = '/' + self.app + '/' + container + '/route/' + staticRoute[
         'name']
     self.method = 'PUT'
     self.data = staticRoute
     self.headers = {
         'Accept': 'application/' + self.format,
         'Content-type': 'application/' + self.format
     }
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 27
0
 def add_or_modify_flow(self, flowConfig, container):
     self.uri = '/' + self.app + '/' + container + '/node/' + \
         flowConfig['node']['type'] + '/' + flowConfig['node']['id'] + '/staticFlow/' + flowConfig['name']
     self.method = 'PUT'
     self.data = flowConfig
     self.headers = {
         'Accept': 'application/' + self.format,
         'Content-type': 'application/' + self.format
     }
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 28
0
 def add_node_connector_property(self, nodeId, nodeConnectorId, nodeType,
                                 nodeConnectorType, propertyName,
                                 propertyValue, container):
     self.uri = '/' + self.app + '/' + container + '/nodeconnector/' + nodeType + '/' + nodeId + '/' + \
         nodeConnectorType + '/' + nodeConnectorId + \
         '/property/' + propertyName + '/' + propertyValue
     self.method = 'PUT'
     self.data = None
     self.headers = {'Accept': 'application/' + self.format}
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)
Esempio n. 29
0
 def add_user(self, userConfig):
     self.uri = '/' + self.app + '/users'
     self.method = 'POST'
     self.data = userConfig
     self.headers = {
         'Accept': 'application/' + self.format,
         'Content-type': 'application/' + self.format
     }
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers,
                        sec=self.sec)
Esempio n. 30
0
 def add_host(self, hostConfig, container):
     self.uri = '/' + self.app + '/' + \
         container + '/address/' + hostConfig['networkAddress']
     self.method = 'PUT'
     self.data = hostConfig
     self.headers = {
         'Accept': 'application/' + self.format,
         'Content-type': 'application/' + self.format
     }
     return RequestData(uri=self.uri,
                        method=self.method,
                        data=self.data,
                        headers=self.headers)