Neutron - Create Subnet JSON examples not clear

Bug #1308266 reported by Zack Shoylev
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
High
Dhriti Shikhar

Bug Description

According to
https://wiki.openstack.org/wiki/Neutron/APIv2-specification#Create_Subnet
and
http://api.openstack.org/api-ref-networking.html
there are a bunch of options (tenant_id, gateway_ip, name, etc...) that supposedly could be part of the request, but are not demonstrated in this example.
In addition, options such as dns_nameservers and host_routes do not consistently appear in all different documentation pages.

Also, I am looking at these sources:

[1] http://docs.openstack.org/api/openstack-network/2.0/content/POST_os-subnets-v2_createSubnet_v2.0_subnets_subnets.html

[2] https://wiki.openstack.org/wiki/Neutron/APIv2-specification#Create_Subnet

[3] http://api.openstack.org/api-ref-networking.html

[4] https://wiki.openstack.org/wiki/Neutron/APIv2-specification

As a SDK developer I find that the fact these agree only partially very confusing. Can the manual be updated to contain the full list of request and response parameters?
-----------------------------------
Built: 2014-04-04T15:28:54 00:00
git SHA: 49a00ab38529b20e64414ead52659dc9a68402b0
URL: http://docs.openstack.org/api/openstack-network/2.0/content/POST_os-subnets-v2_createSubnet_v2.0_subnets_subnets.html
source File: file:/home/jenkins/workspace/netconn-api-tox-doc-publishdocs/v2.0/ch_neutron_api_operations.xml
xml:id: POST_os-subnets-v2_createSubnet_v2.0_subnets_subnets

Revision history for this message
Aaron Rosen (arosen) wrote :

Here's the full list if it's helpful. I agree it would be good to include those in the docs:
REQ: curl -i http://10.4.0.7:9696/v2.0/subnets/cd065bcb-33aa-4eb2-a15d-4fc11bb5fb11.json -X GET -H "X-Auth-Token: <snip>" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-neutronclient"

DEBUG: neutronclient.client RESP:{'status': '200', 'content-length': '431', 'content-location': 'http://10.4.0.7:9696/v2.0/subnets/cd065bcb-33aa-4eb2-a15d-4fc11bb5fb11.json', 'date': 'Tue, 15 Apr 2014 22:28:13 GMT', 'content-type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-57e0fbed-b6d3-4d2e-abce-7ff59f7afcb7'} {"subnet": {"name": "private-subnet", "enable_dhcp": true, "network_id": "43ecb539-56c5-46f8-9548-4f3add9f5335", "tenant_id": "bed4c6473430425fa7e794336173bfc2", "dns_nameservers": [], "gateway_ip": "10.0.0.1", "ipv6_ra_mode": null, "allocation_pools": [{"start": "10.0.0.2", "end": "10.0.0.254"}], "host_routes": [], "ip_version": 4, "ipv6_address_mode": null, "cidr": "10.0.0.0/24", "id": "cd065bcb-33aa-4eb2-a15d-4fc11bb5fb11"}}

+-------------------+--------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr | 10.0.0.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.0.0.1 |
| host_routes | |
| id | cd065bcb-33aa-4eb2-a15d-4fc11bb5fb11 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | private-subnet |
| network_id | 43ecb539-56c5-46f8-9548-4f3add9f5335 |
| tenant_id | bed4c6473430425fa7e794336173bfc2 |
+-------------------+--------------------------------------------+

Revision history for this message
Zack Shoylev (zack-shoylev) wrote :

Excellent, I was not even aware of the ipv6 stuff. Just to clarify: it seems you can specify the ID of the subnet being created (to further clarify, the "id", not the "network_id").

Tom Fifield (fifieldt)
affects: openstack-manuals → openstack-api-site
Anne Gentle (annegentle)
Changed in openstack-api-site:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Anne Gentle (annegentle) wrote :

To fix this bug, edit both the netconn subnets entity file and WADL.

The WADL source is here:
https://github.com/openstack/api-site/blob/master/api-ref/src/wadls/netconn-api/src/os-subnets.wadl

The parameters are documented in the entity file, then references like &subnetCreateParameters; are included in the WADL.

https://github.com/openstack/api-site/blob/master/api-ref/src/wadls/netconn-api/src/common.ent#L430 is where the subnetCreateParameters are documented.

The descriptions for the parameters shown below are in the entity file, https://github.com/openstack/api-site/blob/master/api-ref/src/wadls/netconn-api/src/common.ent#L430

These are the parameters that are missing descriptions:

"dns_nameservers": [],
"gateway_ip": "10.0.0.1",
"ipv6_ra_mode": null,
"allocation_pools": [{"start": "10.0.0.2", "end": "10.0.0.254"}],
"host_routes": [],
"ip_version": 4,
"ipv6_address_mode": null,

Some parameters are in the listsubnets reference: https://github.com/openstack/api-site/blob/master/api-ref/src/wadls/netconn-api/src/common.ent#L382

For this one, give a little bit more information than is currently in the entity file. "id": "cd065bcb-33aa-4eb2-a15d-4fc11bb5fb11"

Changed in openstack-api-site:
status: Confirmed → Triaged
Changed in openstack-api-site:
assignee: nobody → chandan kumar (chkumar246)
Changed in openstack-api-site:
assignee: chandan kumar (chkumar246) → Dhriti Shikhar (dhritishikhar)
Changed in openstack-api-site:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/148992

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on api-site (master)

Change abandoned by Dhriti Shikhar (<email address hidden>) on branch: master
Review: https://review.openstack.org/148992

Tom Fifield (fifieldt)
Changed in openstack-api-site:
milestone: none → kilo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/145786
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=c0c10f6d7d7b43be4f14fbab7e5d9a1c88d1e084
Submitter: Jenkins
Branch: master

commit c0c10f6d7d7b43be4f14fbab7e5d9a1c88d1e084
Author: Dhriti Shikhar <email address hidden>
Date: Thu Jan 8 19:36:41 2015 +0530

    updated subnet json example

    Closes-bug: #1308266

    Change-Id: I9795e3f87e523ec6970b96111b57ef8ec9e86a11

Changed in openstack-api-site:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.