SHOW:
|
|
- or go back to the newest paste.
1 | When router-port-list using curl request - | |
2 | ||
3 | Request - | |
4 | 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" | |
5 | Response - | |
6 | 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"}]} | |
7 | ||
8 | But when in implemented network client function after making uri as - | |
9 | v2.0/ports.json?device_id=d61674ce-ef3e-4371-a227-1e841944686a | |
10 | ||
11 | - | 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. |
11 | + | 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. |
12 | ||
13 | My client function is as - | |
14 | ||
15 | def list_router_port(self, uuid): | |
16 | print uuid | |
17 | uri = '%s/ports?device_id=%s' % (self.uri_prefix, uuid) | |
18 | print uri | |
19 | resp, body = self.get(uri, self.headers) | |
20 | print resp | |
21 | print body | |
22 | body = json.loads(body) | |
23 | return resp, body |