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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)