From 0455e0f2f8db24eb242c3645a1f9f35c57456e3b Mon Sep 17 00:00:00 2001 From: Diane Fleming Date: Thu, 19 Jun 2014 15:38:00 -0500 Subject: [PATCH] Fix error in request/response formats section Change-Id: Ia668640ad59ee0ded4ed7167ed18efe5e1fcf7bc author: diane fleming --- pom.xml | 2 +- v2/bk_compute_api_ref_v2.xml | 202 ++++++++++++++++++++--------------- 2 files changed, 117 insertions(+), 87 deletions(-) diff --git a/pom.xml b/pom.xml index b24309b..2f551aa 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ com.rackspace.cloud.api clouddocs-maven-plugin - 2.0.2 + 2.0.4 diff --git a/v2/bk_compute_api_ref_v2.xml b/v2/bk_compute_api_ref_v2.xml index 80ec550..37947f7 100755 --- a/v2/bk_compute_api_ref_v2.xml +++ b/v2/bk_compute_api_ref_v2.xml @@ -547,96 +547,119 @@
- Request and response types + Request and response formats The OpenStack Compute API supports both JSON and XML data serialization request and response formats. - You specify the request format in the - Content-Type header in the request. - This header is required for operations that have a - request body. The syntax for the - Content-Type header is: - Content-Type: application/format - Where format is either - json or xml, - you specify the response format by using one of the - following methods: - - - Accept header. The syntax for - the Accept header is: - Accept: application/format - Where format is - either json or - xml, the default - format is json. - - - Query extension. Add an - .xml or - .json extension to the - request URI. For example, the - .xml extension in the - following URI request specifies that the - response body is returned in XML format: - &POST; /v2/010101/servers.xml - - - If you do not specify a response format, JSON is the - default. - If you specify conflicting formats in the - Accept header and the query - extension, the format specified in the query extension - takes precedence. For example, if the query extension - is .xml and the Accept - header specifies application/json, - the response is returned in XML format. - You can serialize a response in a different format - from the request format. - and show a - request body in JSON format and a response body in XML - format. - - JSON request with headers - POST /v2/010101/servers HTTP/1.1 +
+ Request format + Use the Content-Type request header + to specify the request format. This header is + required for operations that have a request body. + The syntax for the Content-Type + header is: + Content-Type: application/FORMAT + Where FORMAT is + either json or + xml. +
+
+ Response format + Use one of the following methods to specify the + response format: + + + Accept header + + The syntax for the + Accept header + is: + Accept: application/FORMAT + Where + FORMAT + is either json or + xml. The default + format is + json. + + + + Query extension + + Add an .xml or + .json extension + to the request URI. For example, the + .xml extension + in the following list servers URI + request specifies that the response + body is to be returned in XML + format: + &GET; publicURL/servers.xml + + + + If you do not specify a response format, JSON is + the default. + If the Accept header and the query + extension specify conflicting formats, the format + specified in the query extension takes precedence. + For example, if the query extension is + .xml and the + Accept header specifies + application/json, the + response is returned in XML format. +
+
+ Request and response examples + You can serialize a response in a different + format from the request format. + and show a + request body in JSON format and a response body in + XML format. + + JSON request with headers + POST /v2/010101/servers HTTP/1.1 Host: servers.api.openstack.org Content-Type: application/json Accept: application/xml X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb - - - - shows the - headers and XML response returned by the JSON - request: - - XML response with headers - HTTP/1.1 202 Accepted + + + + shows + the headers and XML response returned by the JSON + request: + + XML response with headers + HTTP/1.1 202 Accepted Date: Mon, 23 Jul 2012 20:24:48 GMT Content-Length: 582 Location: https://servers.api.openstack.org/v2/010101/servers/06dba123-2c7e-4639-bea0-09fbe219b056 Content-Type: application/xml X-Compute-Request-Id: req-ab05045a-452f-4b46-be0d-86494da02a2b Server: Jetty(8.0.y.z-SNAPSHOT) - - - The following example shows an alternative method of - achieving the same result. The following request uses - an URI extension of .xml instead of - an Accept header to request an XML - response. - - The XML response is not shown. - - - JSON request with XML query extension for the - response - POST /v2/010101/servers.xml HTTP/1.1 + + + The following example shows an alternative + method of achieving the same result. The following + request uses an URI extension of + .xml instead of an + Accept header to request an XML + response. + + The XML response is not shown. + + + JSON request with XML query extension for + the response + POST /v2/010101/servers.xml HTTP/1.1 Host: servers.api.openstack.org Content-Type: application/json X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb - - + + +
@@ -962,20 +985,19 @@ X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb maxTotalRAMSize 51200 - Maximum total amount of - RAM (MB) + Maximum total amount of RAM (MB) maxServerMeta 5 - Maximum number of metadata - items associated with a server + Maximum number of metadata items + associated with a server maxImageMeta 5 - Maximum number of metadata - items associated with an Image + Maximum number of metadata items + associated with an Image maxPersonality @@ -987,8 +1009,8 @@ X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb maxPersonalitySize 10240 - The maximum size, in - bytes, for each personality file + The maximum size, in bytes, for each + personality file @@ -1568,6 +1590,13 @@ Host: servers.api.openstack.org/v2/ per account and is not globally unique. +
Networks - Using the network API you can create, update, delete and - show networks, ports and subnets. A few examples are given below. + Using the network API you can create, update, delete + and show networks, ports and subnets. A few examples + are given below. @@ -1949,8 +1979,8 @@ Host: servers.api.openstack.org/v2/ - +
Get all networks
fixed_ip IPv4The IP address to assign to - the interface.The IP address to assign to the + interface.
port