Correct bulk subnet-create JSON example

Add examples of bulk create responses
Move the examples of bulk create requests to separate files

Change-Id: Ia546b797b640b5827f75bf80237e1e62cac8b303
Closes-Bug: #1191694
This commit is contained in:
Akihiro Motoki 2013-10-26 18:44:07 +09:00
parent e34325c574
commit 65841d4514
7 changed files with 188 additions and 42 deletions

View File

@ -1579,20 +1579,16 @@ Accept: application/json</literallayout>
<example>
<title>Bulk Create Networks: JSON Request </title>
<literallayout class="monospaced">POST v2.0/networks.json
Content-Type: application/json
Accept: application/json</literallayout>
<programlisting language="json">{
"networks": [
{
"name": "sample_network_1",
"admin_state_up": false
},
{
"name": "sample_network_2",
"admin_state_up": false
}]
}</programlisting>
<programlisting language="json"><xi:include href="samples/network-post-req-bulk.json" parse="text"/></programlisting>
</example>
<example>
<title>Bulk Create Networks: JSON Response </title>
<literallayout class="monospaced">HTTP/1.1 201 OK
Content-Type: application/json; charset=UTF-8
</literallayout>
<programlisting language="json"><xi:include href="samples/network-post-res-bulk.json" parse="text"/></programlisting>
</example>
<para>The bulk create operation is always atomic.
Either all or no networks in the request body
@ -1707,7 +1703,6 @@ content-type: application/json
} </programlisting>
</example>
</section>
<?hard-pagebreak?>
<section xml:id="Delete_Network">
<title>Delete Network</title>
<informaltable rules="all" width="100%">
@ -1853,12 +1848,11 @@ Accept: application/json</literallayout>
<example>
<title>List Subnets: JSON Request </title>
<literallayout class="monospaced">GET v2.0/subnets.json
Accept: application/json</literallayout>
</example>
<example>
<title>List Subnets: JSON Response</title>
<programlisting language="json"><xi:include href="samples/subnets_get_resp.json" parse="text"/> </programlisting>
<programlisting language="json"><xi:include href="samples/subnets-get-res.json" parse="text"/></programlisting>
</example>
</section>
<?hard-pagebreak?>
@ -2018,29 +2012,14 @@ Accept: application/json</literallayout>
<literallayout class="monospaced">POST /v2.0/subnets
Content-Type: application/json
Accept: application/json</literallayout>
<programlisting language="json">{
"subnet":{
"allocation_pools":[
{
"end":"10.0.3.254",
"start":"10.0.3.2"
}
],
"cidr":"10.0.3.0/24",
"dns_nameservers":[
],
"enable_dhcp":true,
"gateway_ip":"10.0.3.1",
"host_routes":[
],
"ip_version":4,
"name":"",
"network_id":"1a6f6006-9e0b-4f99-984c-96787ae66363",
"tenant_id":"f667b69e4d6749749ef3bcba7251d9ce"
}
}</programlisting>
<programlisting language="json"><xi:include href="samples/subnet-post-req-bulk.json" parse="text"/></programlisting>
</example>
<example>
<title>Bulk Create Subnets: JSON Response </title>
<literallayout class="monospaced">HTTP/1.1 201 OK
Content-Type: application/json; charset=UTF-8
</literallayout>
<programlisting language="json"><xi:include href="samples/subnet-post-res-bulk.json" parse="text"/></programlisting>
</example>
<para>The bulk create operation is always atomic.
Either all subnets or no subnets in the
@ -2494,10 +2473,20 @@ accept: application/json</literallayout>
<para>This operation enables you to create several
ports in a single request. Specify a list of
ports in the request body.</para>
<!-- <example>
<title>Bulk Create Port: JSON Request</title>
<programlisting>xx</programlisting>
</example> -->
<example>
<title>Bulk Create Ports: JSON Request </title>
<literallayout class="monospaced">POST /v2.0/ports
Content-Type: application/json
Accept: application/json</literallayout>
<programlisting language="json"><xi:include href="samples/port-post-req-bulk.json" parse="text"/></programlisting>
</example>
<example>
<title>Bulk Create Ports: JSON Response </title>
<literallayout class="monospaced">HTTP/1.1 201 OK
Content-Type: application/json; charset=UTF-8
</literallayout>
<programlisting language="json"><xi:include href="samples/port-post-res-bulk.json" parse="text"/></programlisting>
</example>
<para>The &APIv2; always guarantees the atomic
completion of the bulk operation.</para>
</section>

View File

@ -0,0 +1,12 @@
{
"networks": [
{
"admin_state_up": true,
"name": "sample_network_1"
},
{
"admin_state_up": false,
"name": "sample_network_2"
}
]
}

View File

@ -0,0 +1,22 @@
{
"networks": [
{
"admin_state_up": true,
"id": "e6031bc2-901a-4c66-82da-f4c32ed89406",
"name": "sample_network_1",
"shared": false,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
},
{
"admin_state_up": false,
"id": "64239a54-dcc4-4b39-920b-b37c2144effa",
"name": "sample_network_2",
"shared": false,
"status": "ACTIVE",
"subnets": [],
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
}
]
}

View File

@ -0,0 +1,22 @@
{
"ports": [
{
"admin_state_up": true,
"device_id": "24df1d04-d5cb-41e1-8de5-61ed77c558df",
"name": "port1",
"network_id": "64239a54-dcc4-4b39-920b-b37c2144effa",
"security_groups": [
"dbc107f4-afcd-4d5a-9352-f68f82241d5b"
]
},
{
"admin_state_up": false,
"name": "port2",
"network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406",
"security_groups": [
"8bf3f7cc-8471-40b1-815f-9da47e79775b",
"dbc107f4-afcd-4d5a-9352-f68f82241d5b"
]
}
]
}

View File

@ -0,0 +1,47 @@
{
"ports": [
{
"admin_state_up": true,
"allowed_address_pairs": [],
"device_id": "24df1d04-d5cb-41e1-8de5-61ed77c558df",
"device_owner": "",
"fixed_ips": [
{
"ip_address": "10.56.4.2",
"subnet_id": "b0e7435c-1512-45fb-aa9e-9a7c5932fb30"
}
],
"id": "4fa2a5b2-d758-449d-80d6-dff31df9e91e",
"mac_address": "fa:16:3e:63:b0:82",
"name": "port1",
"network_id": "64239a54-dcc4-4b39-920b-b37c2144effa",
"security_groups": [
"dbc107f4-afcd-4d5a-9352-f68f82241d5b"
],
"status": "DOWN",
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
},
{
"admin_state_up": false,
"allowed_address_pairs": [],
"device_id": "",
"device_owner": "",
"fixed_ips": [
{
"ip_address": "192.168.199.2",
"subnet_id": "0468a7a7-290d-4127-aedd-6c9449775a24"
}
],
"id": "d3c059b8-40fd-489a-8d17-97bde9370987",
"mac_address": "fa:16:3e:86:09:06",
"name": "port2",
"network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406",
"security_groups": [
"8bf3f7cc-8471-40b1-815f-9da47e79775b",
"dbc107f4-afcd-4d5a-9352-f68f82241d5b"
],
"status": "DOWN",
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
}
]
}

View File

@ -0,0 +1,14 @@
{
"subnets": [
{
"cidr": "192.168.199.0/24",
"ip_version": 4,
"network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406"
},
{
"cidr": "10.56.4.0/22",
"ip_version": 4,
"network_id": "64239a54-dcc4-4b39-920b-b37c2144effa"
}
]
}

View File

@ -0,0 +1,40 @@
{
"subnets": [
{
"allocation_pools": [
{
"end": "192.168.199.254",
"start": "192.168.199.2"
}
],
"cidr": "192.168.199.0/24",
"dns_nameservers": [],
"enable_dhcp": true,
"gateway_ip": "192.168.199.1",
"host_routes": [],
"id": "0468a7a7-290d-4127-aedd-6c9449775a24",
"ip_version": 4,
"name": "",
"network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406",
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
},
{
"allocation_pools": [
{
"end": "10.56.7.254",
"start": "10.56.4.2"
}
],
"cidr": "10.56.4.0/22",
"dns_nameservers": [],
"enable_dhcp": true,
"gateway_ip": "10.56.4.1",
"host_routes": [],
"id": "b0e7435c-1512-45fb-aa9e-9a7c5932fb30",
"ip_version": 4,
"name": "",
"network_id": "64239a54-dcc4-4b39-920b-b37c2144effa",
"tenant_id": "d19231fc08ec4bc4829b668040d34512"
}
]
}