Update test API Ref
- Added more content to test the display of method labels, url strings, http status code and parameter tables. - Added 'OpenStack API Documentation' title in titlerow. This removes the duplicate title for the API references. Change-Id: Ifdbac89efc91ab023510c466cf0cf97b21a69fbe
This commit is contained in:
parent
fe3bc79f2e
commit
90fd29b079
160
api-ref/source/image.inc
Normal file
160
api-ref/source/image.inc
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
.. -*- rst -*-
|
||||||
|
|
||||||
|
=======
|
||||||
|
Image
|
||||||
|
=======
|
||||||
|
|
||||||
|
**Introductory Concepts**
|
||||||
|
|
||||||
|
When you create a server, you can specify a password through the
|
||||||
|
optional adminPass attribute. The password must meet the complexity
|
||||||
|
requirements set by your OpenStack Compute provider. The server might
|
||||||
|
enter an ``ERROR`` state if the complexity requirements are not met. In
|
||||||
|
this case, a client might issue a change password action to reset the
|
||||||
|
server password.
|
||||||
|
|
||||||
|
List the Images
|
||||||
|
===============
|
||||||
|
|
||||||
|
.. rest_method:: GET /v3/images/{role_id}/role/{another_id}/role/{some_id}<br>/b/a/x/{image_id.x}
|
||||||
|
|
||||||
|
Short explanation about this GET method.
|
||||||
|
|
||||||
|
HTTP Status codes
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
.. rest_status_code:: success status.yaml
|
||||||
|
|
||||||
|
- 200
|
||||||
|
- 201
|
||||||
|
|
||||||
|
.. rest_status_code:: error status.yaml
|
||||||
|
|
||||||
|
- 400
|
||||||
|
- 500
|
||||||
|
|
||||||
|
Response
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- host: host
|
||||||
|
- name: name
|
||||||
|
|
||||||
|
Create an Image
|
||||||
|
===============
|
||||||
|
|
||||||
|
.. rest_method:: POST /images
|
||||||
|
|
||||||
|
Explantory text about this POST method.
|
||||||
|
|
||||||
|
List of information:
|
||||||
|
|
||||||
|
- Item 1
|
||||||
|
- Item 2
|
||||||
|
- Item 3
|
||||||
|
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
|
||||||
|
Response
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- server: server.obj
|
||||||
|
- name: name
|
||||||
|
|
||||||
|
**Example List Servers:**
|
||||||
|
|
||||||
|
.. literalinclude:: update-server-resp.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
|
||||||
|
Change or Update the Images
|
||||||
|
===========================
|
||||||
|
|
||||||
|
.. rest_method:: PATCH /servers
|
||||||
|
|
||||||
|
Explantory text about this PATCH method.
|
||||||
|
|
||||||
|
List of information:
|
||||||
|
|
||||||
|
- Item 1
|
||||||
|
- Item 2
|
||||||
|
- Item 3
|
||||||
|
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
|
||||||
|
Response
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- server: server.obj
|
||||||
|
- name: name
|
||||||
|
|
||||||
|
**Example List Servers:**
|
||||||
|
|
||||||
|
.. literalinclude:: update-server-resp.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
|
||||||
|
Change or Update the Images
|
||||||
|
===========================
|
||||||
|
|
||||||
|
.. rest_method:: PUT /images
|
||||||
|
|
||||||
|
Explantory text about this PUT method.
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- name: name
|
||||||
|
|
||||||
|
Response
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- server: server.obj
|
||||||
|
- name: name
|
||||||
|
|
||||||
|
**Example List Servers:**
|
||||||
|
|
||||||
|
.. literalinclude:: update-server-resp.json
|
||||||
|
:language: javascript
|
||||||
|
|
||||||
|
|
||||||
|
Delete an Image
|
||||||
|
===============
|
||||||
|
|
||||||
|
.. rest_method:: DELETE /image/{id}
|
||||||
|
|
||||||
|
Explain what the DELETE method does here.
|
||||||
|
|
||||||
|
|
||||||
|
Request
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. rest_parameters:: parameters.yaml
|
||||||
|
|
||||||
|
- id: id
|
||||||
|
|
||||||
|
Response
|
||||||
|
--------
|
||||||
|
|
||||||
|
No content in body of response.
|
@ -1,9 +1,6 @@
|
|||||||
:tocdepth: 2
|
:tocdepth: 2
|
||||||
|
|
||||||
==================
|
|
||||||
Test Service API
|
|
||||||
==================
|
|
||||||
|
|
||||||
.. rest_expand_all::
|
.. rest_expand_all::
|
||||||
|
|
||||||
.. include:: service.inc
|
.. include:: service.inc
|
||||||
|
.. include:: image.inc
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
.. -*- rst -*-
|
.. -*- rst -*-
|
||||||
|
|
||||||
This is a Test Service API Reference.
|
=========
|
||||||
|
Service
|
||||||
|
=========
|
||||||
|
|
||||||
List the Servers
|
**Introductory Concepts**
|
||||||
================
|
|
||||||
|
|
||||||
Testing API for Service 1.
|
|
||||||
|
|
||||||
**Passwords**
|
|
||||||
|
|
||||||
When you create a server, you can specify a password through the
|
When you create a server, you can specify a password through the
|
||||||
optional adminPass attribute. The password must meet the complexity
|
optional adminPass attribute. The password must meet the complexity
|
||||||
@ -21,35 +18,6 @@ password that it returns in the response object. This password meets the
|
|||||||
security requirements set by the compute provider. For security reasons,
|
security requirements set by the compute provider. For security reasons,
|
||||||
subsequent GET calls do not require this password.
|
subsequent GET calls do not require this password.
|
||||||
|
|
||||||
**Server metadata**
|
|
||||||
|
|
||||||
You can specify custom server metadata at server launch time. The
|
|
||||||
maximum size for each metadata key-value pair is 255 bytes. The compute
|
|
||||||
provider determines the maximum number of key-value pairs for each
|
|
||||||
server. You can query this value through the ``maxServerMeta`` absolute
|
|
||||||
limit.
|
|
||||||
|
|
||||||
**Server networks**
|
|
||||||
|
|
||||||
You can specify one or more networks to which the server connects at
|
|
||||||
launch time. Users can also specify a specific port on the network or
|
|
||||||
the fixed IP address to assign to the server interface.
|
|
||||||
|
|
||||||
**Note**
|
|
||||||
|
|
||||||
You can use both IPv4 and IPv6 addresses as access addresses and you
|
|
||||||
can assign both addresses simultaneously. You can update access
|
|
||||||
addresses after you create a server.
|
|
||||||
|
|
||||||
**Server personality**
|
|
||||||
|
|
||||||
To customize the personality of a server instance, you can inject data
|
|
||||||
into its file system. For example, you might insert ssh keys, set
|
|
||||||
configuration files, or store data that you want to retrieve from inside
|
|
||||||
the instance. This customization method provides minimal launch-time
|
|
||||||
personalization. If you require significant customization, create a
|
|
||||||
custom image.
|
|
||||||
|
|
||||||
Follow these guidelines when you inject files:
|
Follow these guidelines when you inject files:
|
||||||
|
|
||||||
- The maximum size of the file path data is 255 bytes.
|
- The maximum size of the file path data is 255 bytes.
|
||||||
@ -79,21 +47,27 @@ files. For example, on Linux, all files have root as the owner and the
|
|||||||
root group as the group owner, and allow only user and group read access
|
root group as the group owner, and allow only user and group read access
|
||||||
(``chmod 440``).
|
(``chmod 440``).
|
||||||
|
|
||||||
**Server access addresses**
|
|
||||||
|
|
||||||
In a hybrid environment, the underlying implementation might not control
|
List the Servers
|
||||||
the IP address of a server. Instead, the access IP address might be part
|
================
|
||||||
of the dedicated hardware; for example, a router/NAT device. In this
|
|
||||||
case, you cannot use the addresses that the implementation provides to
|
|
||||||
access the server from outside the local LAN. Instead, the API might
|
|
||||||
assign a separate access address at creation time to provide access to
|
|
||||||
the server. This address might not be directly bound to a network
|
|
||||||
interface on the server and might not necessarily appear when you query
|
|
||||||
the server addresses. However, clients should use an access address to
|
|
||||||
access the server directly.
|
|
||||||
|
|
||||||
.. rest_method:: GET /v3/servers/{role_id}/role/{another_id}/role/{some_id}
|
.. rest_method:: GET /v3/servers/{role_id}/role/{another_id}/role/{some_id}
|
||||||
|
|
||||||
|
Short explanation about this GET method.
|
||||||
|
|
||||||
|
HTTP Status codes
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
.. rest_status_code:: success status.yaml
|
||||||
|
|
||||||
|
- 200
|
||||||
|
- 201
|
||||||
|
|
||||||
|
.. rest_status_code:: error status.yaml
|
||||||
|
|
||||||
|
- 400
|
||||||
|
- 500
|
||||||
|
|
||||||
Response
|
Response
|
||||||
--------
|
--------
|
||||||
|
|
||||||
@ -106,10 +80,11 @@ Response
|
|||||||
Copy the Server
|
Copy the Server
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Testing display of copy API.
|
|
||||||
|
|
||||||
.. rest_method:: COPY /v3/servers/{role_id}
|
.. rest_method:: COPY /v3/servers/{role_id}
|
||||||
|
|
||||||
|
Short explanation about this COPY method.
|
||||||
|
|
||||||
|
|
||||||
Response
|
Response
|
||||||
--------
|
--------
|
||||||
|
|
||||||
@ -124,6 +99,15 @@ Change or Update the Servers
|
|||||||
|
|
||||||
.. rest_method:: PUT /servers
|
.. rest_method:: PUT /servers
|
||||||
|
|
||||||
|
Explantory text about this PUT method.
|
||||||
|
|
||||||
|
List of information:
|
||||||
|
|
||||||
|
- Item 1
|
||||||
|
- Item 2
|
||||||
|
- Item 3
|
||||||
|
|
||||||
|
|
||||||
Request
|
Request
|
||||||
-------
|
-------
|
||||||
|
|
||||||
@ -148,10 +132,11 @@ Response
|
|||||||
Delete a Server
|
Delete a Server
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Delete some server content.
|
|
||||||
|
|
||||||
.. rest_method:: DELETE /servers/{id}
|
.. rest_method:: DELETE /servers/{id}
|
||||||
|
|
||||||
|
Explain what the DELETE method does here.
|
||||||
|
|
||||||
|
|
||||||
Request
|
Request
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
17
api-ref/source/status.yaml
Normal file
17
api-ref/source/status.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
200:
|
||||||
|
default: |
|
||||||
|
Request was successful.
|
||||||
|
201:
|
||||||
|
default: |
|
||||||
|
Resource was created and is ready to use.
|
||||||
|
400:
|
||||||
|
default: |
|
||||||
|
Some content in the request was invalid
|
||||||
|
another_400_error: |
|
||||||
|
Sample message for 400 error response.
|
||||||
|
401:
|
||||||
|
default: |
|
||||||
|
User must authenticate before making a request
|
||||||
|
500:
|
||||||
|
default: |
|
||||||
|
Something went wrong inside the service.
|
@ -5,7 +5,7 @@
|
|||||||
<div class="btn-group docs-sidebar-releases">
|
<div class="btn-group docs-sidebar-releases">
|
||||||
<button onclick="location.href='/'" class="btn docs-sidebar-home" data-toggle="tooltip" data-placement="top" title="Docs Home"><i class="fa fa-arrow-circle-o-left"></i></button>
|
<button onclick="location.href='/'" class="btn docs-sidebar-home" data-toggle="tooltip" data-placement="top" title="Docs Home"><i class="fa fa-arrow-circle-o-left"></i></button>
|
||||||
|
|
||||||
{%- if theme_sidebar_dropdown == 'api_ref'%}
|
{%- if theme_sidebar_dropdown == 'api_ref' %}
|
||||||
{% include 'sidebartoc_menu_apiref.html' %}
|
{% include 'sidebartoc_menu_apiref.html' %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{% include 'sidebartoc_menu.html' %}
|
{% include 'sidebartoc_menu.html' %}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<h2>{{ title }}</h2>
|
{%- if theme_sidebar_dropdown == 'os_docs' %}
|
||||||
|
<h2>{{ title }}</h2>
|
||||||
|
{% else %}
|
||||||
|
<h2>OpenStack API Documentation</h2>
|
||||||
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="docs-actions">
|
<div class="docs-actions">
|
||||||
{% if prev %}
|
{% if prev %}
|
||||||
|
Loading…
Reference in New Issue
Block a user