api-ref: Parameter verification for servers.inc (1/3)

This patch verifies query parameters.
Subsequent patches will verify other parameters.

Change-Id: I6078c0c8ebc888dc120f446f228a3b0433b89a76
Partial-Bug: #1738930
This commit is contained in:
Takashi NATSUME 2018-03-08 09:05:16 +09:00
parent 88f6c3b7b8
commit 56283f167d
2 changed files with 144 additions and 37 deletions

View File

@ -385,9 +385,12 @@ all_tenants:
all_tenants_query: all_tenants_query:
description: | description: |
Specify the ``all_tenants`` query parameter to list all instances Specify the ``all_tenants`` query parameter to list all instances
for all projects. A value of `all_tenants`` need not be specified. for all projects. By default this is only allowed by administrators.
If it is specified, it must be 'boolean'. If the value of this parameter is not specified, it is treated as
By default this is only allowed by admin users. ``True``. If the value is specified, ``1``, ``t``, ``true``,
``on``, ``y`` and ``yes`` are treated as ``True``. ``0``, ``f``,
``false``, ``off``, ``n`` and ``no`` are treated as ``False``.
(They are case-insensitive.)
in: query in: query
required: false required: false
type: boolean type: boolean
@ -403,6 +406,9 @@ all_tenants_sec_grp_query:
availability_zone_query_server: availability_zone_query_server:
description: | description: |
Filter the server list result by server availability zone. Filter the server list result by server availability zone.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -489,9 +495,12 @@ changes_since_server:
config_drive_query_server: config_drive_query_server:
description: | description: |
Filter the server list result by the config drive setting of the server. Filter the server list result by the config drive setting of the server.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: boolean type: string
created_at_query_server: created_at_query_server:
description: | description: |
Filter the server list result by a date and time stamp when server was created. Filter the server list result by a date and time stamp when server was created.
@ -504,6 +513,9 @@ created_at_query_server:
The ``±hh:mm`` value, if included, returns the time zone as an offset from UTC. The ``±hh:mm`` value, if included, returns the time zone as an offset from UTC.
For example, ``2015-08-27T09:49:58-05:00``. For example, ``2015-08-27T09:49:58-05:00``.
If you omit the time zone, the UTC time zone is assumed. If you omit the time zone, the UTC time zone is assumed.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -523,14 +535,21 @@ deleted_query:
required: false required: false
type: boolean type: boolean
description: | description: |
Show deleted items. In some circumstances deleted items will still Show deleted items only. In some circumstances deleted items will still
be accessible via the backend database, however there is no be accessible via the backend database, however there is no
contract on how long, so this parameter should be used with contract on how long, so this parameter should be used with
caution. It is typically only available to administrators. caution. ``1``, ``t``, ``true``, ``on``, ``y`` and ``yes`` are treated as
``True`` (case-insensitive). Other than them are treated as ``False``.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
description_query_server: description_query_server:
description: | description: |
Filter the server list result by description. Filter the server list result by description.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
.. note:: .. note::
``display_description`` can also be requested which is alias of ``display_description`` can also be requested which is alias of
@ -553,6 +572,9 @@ disk_config_query_server:
- ``AUTO`` - ``AUTO``
- ``MANUAL`` - ``MANUAL``
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -606,7 +628,10 @@ flavor_query:
type: string type: string
host_query_server: host_query_server:
description: | description: |
Filter the server list result by the host name of compute node. Only allowed for Admin. Filter the server list result by the host name of compute node.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -619,6 +644,9 @@ host_query_service:
hostname_query_server: hostname_query_server:
description: | description: |
Filter the server list result by the host name of server. Filter the server list result by the host name of server.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -742,10 +770,15 @@ instance_action_marker:
ip6_query: ip6_query:
description: | description: |
An IPv6 address to filter results by. An IPv6 address to filter results by.
Up to microversion 2.4, this parameter is only valid when specified
by administrators. If non-admin users specify this parameter,
it is ignored.
Starting from microversion 2.5, this parameter is valid for no-admin users
as well as administrators.
in: query in: query
required: false required: false
type: string type: string
min_version: 2.5
ip_query: ip_query:
description: | description: |
An IPv4 address to filter results by. An IPv4 address to filter results by.
@ -759,9 +792,15 @@ kernel_id_query_server:
description: | description: |
Filter the server list result by the UUID of the kernel image Filter the server list result by the UUID of the kernel image
when using an AMI. when using an AMI.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
key_name_query_server: key_name_query_server:
description: | description: |
Filter the server list result by keypair name. Filter the server list result by keypair name.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -796,9 +835,12 @@ launch_index_query_server:
description: | description: |
Filter the server list result by the sequence in which the Filter the server list result by the sequence in which the
servers were launched. servers were launched.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: integer
launched_at_query_server: launched_at_query_server:
description: | description: |
Filter the server list result by a date and time stamp when the instance was launched. Filter the server list result by a date and time stamp when the instance was launched.
@ -810,6 +852,9 @@ launched_at_query_server:
The ``±hh:mm`` value, if included, returns the time zone as an offset from UTC. The ``±hh:mm`` value, if included, returns the time zone as an offset from UTC.
For example, ``2015-08-27T09:49:58-05:00``. For example, ``2015-08-27T09:49:58-05:00``.
If you omit the time zone, the UTC time zone is assumed. If you omit the time zone, the UTC time zone is assumed.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -834,7 +879,10 @@ limit_simple:
locked_by_query_server: locked_by_query_server:
description: | description: |
Filter the server list result by who locked the server, possible value Filter the server list result by who locked the server, possible value
could be ``admin``, ``owner`` or ``none``. could be ``admin`` or ``owner``.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -919,7 +967,10 @@ minRam:
type: integer type: integer
node_query_server: node_query_server:
description: | description: |
Filter the server list result by the node. Only allowed for Admin. Filter the server list result by the node.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -951,12 +1002,41 @@ offset_simple:
power_state_query_server: power_state_query_server:
in: query in: query
required: false required: false
type: string type: integer
description: | description: |
Filter the server list result by server power state. Filter the server list result by server power state.
Possible values are integer values that is mapped as::
0: NOSTATE
1: RUNNING
3: PAUSED
4: SHUTDOWN
6: CRASHED
7: SUSPENDED
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
progress_query_server: progress_query_server:
description: | description: |
Filter the server list result by the progress of the server. Filter the server list result by the progress of the server.
The value could be from 0 to 100 as integer.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query
required: false
type: integer
project_id_query_server:
description: |
Filter the list of servers by the given project ID.
This filter only works when the ``all_tenants`` filter is also specified.
.. note::
'tenant_id' can also be requested which is alias of 'project_id'
but that is not recommended to use as that will be removed in future.
in: query in: query
required: false required: false
type: string type: string
@ -967,6 +1047,9 @@ ramdisk_id_query_server:
description: | description: |
Filter the server list result by the UUID of the ramdisk image when Filter the server list result by the UUID of the ramdisk image when
using an AMI. using an AMI.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
reservation_id_query: reservation_id_query:
in: query in: query
required: false required: false
@ -1003,19 +1086,29 @@ server_name_query:
type: string type: string
server_root_device_name_query: server_root_device_name_query:
in: query in: query
required: true required: false
type: string type: string
description: | description: |
Filter the server list result by the root device name of the server Filter the server list result by the root device name of the server.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
server_status_query: server_status_query:
description: | description: |
Filters the response by a server status, as a string. For example, ``ACTIVE``. Filters the response by a server status, as a string. For example, ``ACTIVE``.
Up to microversion 2.37, an empty list is returnd if an invalid status is
specified. Starting from microversion 2.38, a 400 error is returned
in that case.
in: query in: query
required: false required: false
type: string type: string
server_uuid_query: server_uuid_query:
description: | description: |
Filter the server list result by the UUID of the server. Filter the server list result by the UUID of the server.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -1137,6 +1230,9 @@ task_state_query_server:
type: string type: string
description: | description: |
Filter the server list result by task state. Filter the server list result by task state.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
tenant_id_query: tenant_id_query:
description: | description: |
Specify the project ID (tenant ID) to show the rate and absolute limits. Specify the project ID (tenant ID) to show the rate and absolute limits.
@ -1155,6 +1251,9 @@ terminated_at_query_server:
The ``±hh:mm`` value, if included, returns the time zone as an offset from UTC. The ``±hh:mm`` value, if included, returns the time zone as an offset from UTC.
For example, ``2015-08-27T09:49:58-05:00``. For example, ``2015-08-27T09:49:58-05:00``.
If you omit the time zone, the UTC time zone is assumed. If you omit the time zone, the UTC time zone is assumed.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -1192,6 +1291,9 @@ user_id_query_quota_delete:
user_id_query_server: user_id_query_server:
description: | description: |
Filter the list of servers by the given user ID. Filter the list of servers by the given user ID.
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -1204,6 +1306,24 @@ user_id_query_set_quota:
vm_state_query_server: vm_state_query_server:
description: | description: |
Filter the server list result by vm state. Filter the server list result by vm state.
The value could be:
- ``ACTIVE``
- ``BUILDING``
- ``DELETED``
- ``ERROR``
- ``PAUSED``
- ``RESCUED``
- ``RESIZED``
- ``SHELVED``
- ``SHELVED_OFFLOADED``
- ``SOFT_DELETED``
- ``STOPPED``
- ``SUSPENDED``
This parameter is only valid when specified by administrators.
If non-admin users specify this parameter, it is ignored.
in: query in: query
required: false required: false
type: string type: string
@ -4834,19 +4954,6 @@ project_id_instance_action:
in: body in: body
required: true required: true
type: string type: string
project_id_query_server:
description: |
Filter the list of servers by the given project ID.
This filter only works when the ``all_tenants=1`` filter is also specified.
.. note::
'tenant_id' can also be requested which is alias of 'project_id'
but that is not recommended to use as that will be removed in future.
in: body
required: false
type: string
project_id_server_group: project_id_server_group:
description: | description: |
The project ID who owns the server group. The project ID who owns the server group.

View File

@ -194,8 +194,8 @@ Request
- all_tenants: all_tenants_query - all_tenants: all_tenants_query
- auto_disk_config: disk_config_query_server - auto_disk_config: disk_config_query_server
- availability_zone: availability_zone_query_server - availability_zone: availability_zone_query_server
- config_drive: config_drive_query_server
- changes-since: changes_since_server - changes-since: changes_since_server
- config_drive: config_drive_query_server
- created_at: created_at_query_server - created_at: created_at_query_server
- deleted: deleted_query - deleted: deleted_query
- description: description_query_server - description: description_query_server
@ -214,8 +214,6 @@ Request
- marker: marker - marker: marker
- name: server_name_query - name: server_name_query
- node: node_query_server - node: node_query_server
- not-tags: not_tags_query
- not-tags-any: not_tags_any_query
- power_state: power_state_query_server - power_state: power_state_query_server
- progress: progress_query_server - progress: progress_query_server
- project_id: project_id_query_server - project_id: project_id_query_server
@ -225,13 +223,15 @@ Request
- sort_dir: sort_dir_server - sort_dir: sort_dir_server
- sort_key: sort_key_server - sort_key: sort_key_server
- status: server_status_query - status: server_status_query
- tags: tags_query
- tags-any: tags_any_query
- task_state: task_state_query_server - task_state: task_state_query_server
- terminated_at: terminated_at_query_server - terminated_at: terminated_at_query_server
- user_id: user_id_query_server - user_id: user_id_query_server
- uuid: server_uuid_query - uuid: server_uuid_query
- vm_state: vm_state_query_server - vm_state: vm_state_query_server
- not-tags: not_tags_query
- not-tags-any: not_tags_any_query
- tags: tags_query
- tags-any: tags_any_query
Response Response
-------- --------
@ -491,8 +491,8 @@ Request
- all_tenants: all_tenants_query - all_tenants: all_tenants_query
- auto_disk_config: disk_config_query_server - auto_disk_config: disk_config_query_server
- availability_zone: availability_zone_query_server - availability_zone: availability_zone_query_server
- config_drive: config_drive_query_server
- changes-since: changes_since_server - changes-since: changes_since_server
- config_drive: config_drive_query_server
- created_at: created_at_query_server - created_at: created_at_query_server
- deleted: deleted_query - deleted: deleted_query
- description: description_query_server - description: description_query_server
@ -511,8 +511,6 @@ Request
- marker: marker - marker: marker
- name: server_name_query - name: server_name_query
- node: node_query_server - node: node_query_server
- not-tags: not_tags_query
- not-tags-any: not_tags_any_query
- power_state: power_state_query_server - power_state: power_state_query_server
- progress: progress_query_server - progress: progress_query_server
- project_id: project_id_query_server - project_id: project_id_query_server
@ -522,13 +520,15 @@ Request
- sort_dir: sort_dir_server - sort_dir: sort_dir_server
- sort_key: sort_key_server - sort_key: sort_key_server
- status: server_status_query - status: server_status_query
- tags: tags_query
- tags-any: tags_any_query
- task_state: task_state_query_server - task_state: task_state_query_server
- terminated_at: terminated_at_query_server - terminated_at: terminated_at_query_server
- user_id: user_id_query_server - user_id: user_id_query_server
- uuid: server_uuid_query - uuid: server_uuid_query
- vm_state: vm_state_query_server - vm_state: vm_state_query_server
- not-tags: not_tags_query
- not-tags-any: not_tags_any_query
- tags: tags_query
- tags-any: tags_any_query
Response Response
-------- --------