neutron-lib/api-ref/source/v2/segments.inc
YAMAMOTO Takashi ab39764fec Add a space after comma
For consistency.

Also,
- Sort codes in "Error responce codes"
- Remove 5xx from "Error response codes"
- Move 2xx to "Normal response codes"

This is mechanically done by applying the following on each *.inc:

    gawk -F": " 'function p(h,a){r=s="";asort(a);
    for(i in a){r=r s a[i];s=", "};print h ": " r}
    /^Error response codes:/{split($2,a,/[, ]*/);
    delete n;ni=1;delete e;ei=1;
    for(i in a){x=a[i];v=x-x%100;if(v==200)n[ni++]=x;
    else if(v!=500)e[ei++]=x};
    if(ni>1){p("Normal response codes",n);
    print ""};p($1,e);next}//{print}'

Change-Id: I5447e660117e56b057d2b2cf509666a1d56e63bf
2017-02-06 09:09:38 +09:00

210 lines
4.2 KiB
ReStructuredText

.. -*- rst -*-
========
Segments
========
Lists, shows details for, creates, updates, and deletes segments. The
segments API is admin-only.
Show segment details
====================
.. rest_method:: GET /v2.0/segments/{segment_id}
Shows details for a segment.
You can control which response parameters are returned by using the
fields query parameter. For information, see `Filtering and column
selection <http://specs.openstack.org/openstack/neutron-
specs/specs/api/networking_general_api_information.html#filtering-
and-column-selection>`__.
Normal response codes: 200
Error response codes: 401, 404
Request
-------
.. rest_parameters:: parameters.yaml
- segment_id: segment_id-path
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: segment_id
- network_id: network_id
- physical_network: provider:physical_network
- network_type: network_type
- segmentation_id: provider:segmentation_id
- name: name
- description: description
Response Example
----------------
.. literalinclude:: samples/segments/segment-show-response.json
:language: javascript
Update segment
==============
.. rest_method:: PUT /v2.0/segments/{segment_id}
Updates a segment.
Normal response codes: 200
Error response codes: 400, 401, 403, 404
Request
-------
.. rest_parameters:: parameters.yaml
- segment_id: segment_id-path
- name: name-segment
- description: description-request
Request Example
---------------
.. literalinclude:: samples/segments/segment-update-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: segment_id
- network_id: network_id
- physical_network: provider:physical_network
- network_type: network_type
- segmentation_id: provider:segmentation_id
- name: name
- description: description
Response Example
----------------
.. literalinclude:: samples/segments/segment-update-response.json
:language: javascript
Delete segment
==============
.. rest_method:: DELETE /v2.0/segments/{segment_id}
Deletes a segment and its associated resources.
Normal response codes: 204
Error response codes: 401, 404, 409
Request
-------
.. rest_parameters:: parameters.yaml
- segment_id: segment_id-path
Response
--------
There is no body content for the response of a successful DELETE request.
List segments
=============
.. rest_method:: GET /v2.0/segments
Lists segments to which the project has access.
Use the ``fields`` query parameter to filter the response. For
information, see `Filtering and Column Selection <https://wiki.open
stack.org/wiki/Neutron/APIv2-specification#Filtering_and_Column_Sel
ection>`__.
Normal response codes: 200
Error response codes: 401
Request
-------
.. rest_parameters:: parameters.yaml
- fields: fields
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: segment_id
- network_id: network_id
- physical_network: provider:physical_network
- network_type: network_type
- segmentation_id: provider:segmentation_id
- name: name
- description: description
Response Example
----------------
.. literalinclude:: samples/segments/segments-list-response.json
:language: javascript
Create segment
==============
.. rest_method:: POST /v2.0/segments
Creates a segment.
Normal response codes: 201
Error response codes: 400, 401
Request
-------
.. rest_parameters:: parameters.yaml
- network_id: network_id
- physical_network: provider:physical_network
- network_type: network_type
- segmentation_id: provider:segmentation_id
- name: name-segment
- description: description-request
Request Example
---------------
.. literalinclude:: samples/segments/segment-create-request.json
:language: javascript
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- id: segment_id
- network_id: network_id
- physical_network: provider:physical_network
- network_type: network_type
- segmentation_id: provider:segmentation_id
- name: name
- description: description
Response Example
----------------
.. literalinclude:: samples/segments/segment-create-response.json
:language: javascript