Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- When router-port-list using curl request -
- Request -
- curl -i http://10.0.9.46:9696/v2.0/ports.json?device_id=d61674ce-ef3e-4371-a227-1e841944686a -X GET -H "X-Auth-Token: MIIOJgYJKoZIhvcNAQcCoII <token id> -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient"
- Response -
- DEBUG: neutronclient.client RESP:{'date': 'Thu, 26 Sep 2013 05:31:28 GMT', 'status': '200', 'content-length': '591', 'content-type': 'application/ json; charset=UTF-8', 'content-location': 'http://10.0.9.46:9696/v2.0/ports.json?device_id=d61674ce-ef3e-4371-a227-1e841944686a'} {"ports": [{"sta tus": "ACTIVE", "binding:host_id": "os-dev", "name": "", "allowed_address_pairs": [], "admin_state_up": true, "network_id": "118360a5-57d3-4fa6-9a b0-40b9f3e79977", "tenant_id": "", "extra_dhcp_opts": [], "binding:vif_type": "ovs", "device_owner": "network:router_gateway", "binding:capabiliti es": {"port_filter": true}, "mac_address": "fa:16:3e:0c:ca:3f", "fixed_ips": [{"subnet_id": "a3c5cd48-de27-42f2-901a-1b27873323a2", "ip_address": "12.0.0.1"}], "id": "fb9017d3-efcc-4cd0-8d9f-f1cddf0569e3", "security_groups": [], "device_id": "d61674ce-ef3e-4371-a227-1e841944686a"}]}
- But when in implemented network client function after making uri as -
- v2.0/ports.json?device_id=d61674ce-ef3e-4371-a227-1e841944686a
- request is successful but in body I can't see any port. i.e. body is empty while there is one port connected to router as shown above using curl.
- My client function is as -
- def list_router_port(self, uuid):
- print uuid
- uri = '%s/ports?device_id=%s' % (self.uri_prefix, uuid)
- print uri
- resp, body = self.get(uri, self.headers)
- print resp
- print body
- body = json.loads(body)
- return resp, body
Advertisement
Add Comment
Please, Sign In to add comment