diff --git a/api-ref/source/index.rst b/api-ref/source/index.rst index 626f5ee9116f..2a80409bcd6f 100644 --- a/api-ref/source/index.rst +++ b/api-ref/source/index.rst @@ -9,7 +9,6 @@ .. include:: versions.inc .. include:: urls.inc .. include:: servers.inc -.. include:: servers-multiple-create.inc .. include:: servers-actions.inc .. include:: servers-action-fixed-ip.inc .. include:: servers-action-evacuate.inc diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index e49113a6c480..f55972a58587 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -3304,9 +3304,11 @@ rescue_image_ref: type: string reservation_id: description: | - The reservation ID of the server. + The reservation id for the server. This is an id that can + be useful in tracking groups of servers created with multiple + create, that will all have the same reservation_id. in: body - required: false + required: true type: string reserved: description: | @@ -3624,6 +3626,26 @@ servers: in: body required: true type: array +servers_max_count: + in: body + required: false + type: string + description: | + The max number of servers to be created. Defaults to the value of ``min_count``. +servers_min_count: + in: body + required: false + type: string + description: | + The min number of servers to be created. Defaults to 1. +servers_multiple_create_name: + in: body + required: true + type: string + description: | + A base name for creating unique names during multiple create. A + unique string will be appended to the end of this base name for + every server created. service: description: | Object representing a compute service. diff --git a/api-ref/source/servers-multiple-create.inc b/api-ref/source/servers-multiple-create.inc deleted file mode 100644 index e5ca393d6735..000000000000 --- a/api-ref/source/servers-multiple-create.inc +++ /dev/null @@ -1,145 +0,0 @@ -.. -*- rst -*- -.. needs:method_verification -.. needs:parameter_verification -.. needs:example_verification -.. needs:body_verification - -=================================== - Servers multiple create (servers) -=================================== - -Creates one or more servers. - -Optionally, you can set ``"return_reservation_id": "True"`` in the -request body to request that a reservation ID be returned instead of the -newly created instance information. With this parameter, the response -shows only the reservation ID. - -Create Multiple Servers -======================= - -.. rest_method:: POST /servers - -Creates one or more servers. - -Normal response codes: 202 - -Error response codes: computeFault(400, 500), serviceUnavailable(503), badRequest(400), -unauthorized(401), forbidden(403), badMethod(405), itemNotFound(404) - -Request -------- - -.. rest_parameters:: parameters.yaml - - - - security_groups: security_groups - - user_data: user_data - - os-availability-zone:availability_zone: os-availability-zone:availability_zone - - server: server - - imageRef: imageRef - - flavorRef: flavorRef - - networks: networks - - uuid: network_uuid - - port: port - - fixed_ip: fixed_ip - - name: name - - metadata: metadata - - personality: personality - - block_device_mapping_v2: block_device_mapping_v2 - - device_name: device_name - - source_type: source_type - - destination_type: destination_type - - delete_on_termination: delete_on_termination - - guest_format: guest_format - - boot_index: boot_index - - config_drive: config_drive - - key_name: key_name - - os:scheduler_hints: os:scheduler_hints - - OS-DCF:diskConfig: OS-DCF:diskConfig - - return_reservation_id: return_reservation_id - -**Example Create multiple servers without reservation ID: JSON request** - -.. literalinclude:: ../../doc/api_samples/os-multiple-create/multiple-create-no-resv-post-req.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - server: server - - adminPass: adminPass - - id: id - - links: links - - OS-DCF:diskConfig: OS-DCF:diskConfig - - security_groups: security_groups - -**Example Create multiple servers without reservation ID: JSON response** - -.. literalinclude:: ../../doc/api_samples/os-multiple-create/multiple-create-no-resv-post-resp.json - :language: javascript - -Create Multiple Servers With Reservation Id -=========================================== - -.. rest_method:: POST /servers - -Creates one or more servers with a reservation ID. - -Set ``"return_reservation_id": "True"`` in the request body to request that a reservation ID be returned instead of the newly created instance information. With this parameter, the response shows only the reservation ID. - -Normal response codes: 202 - -Error response codes: computeFault(400, 500), serviceUnavailable(503), badRequest(400), -unauthorized(401), forbidden(403), badMethod(405), itemNotFound(404) - -Request -------- - -.. rest_parameters:: parameters.yaml - - - - security_groups: security_groups - - user_data: user_data - - os-availability-zone:availability_zone: os-availability-zone:availability_zone - - server: server - - imageRef: imageRef - - flavorRef: flavorRef - - networks: networks - - uuid: network_uuid - - port: port - - fixed_ip: fixed_ip - - name: name - - metadata: metadata - - personality: personality - - block_device_mapping_v2: block_device_mapping_v2 - - device_name: device_name - - source_type: source_type - - destination_type: destination_type - - delete_on_termination: delete_on_termination - - guest_format: guest_format - - boot_index: boot_index - - config_drive: config_drive - - key_name: key_name - - os:scheduler_hints: os:scheduler_hints - - OS-DCF:diskConfig: OS-DCF:diskConfig - - return_reservation_id: return_reservation_id - -**Example Create multiple servers with reservation ID: JSON request** - -.. literalinclude:: ../../doc/api_samples/os-multiple-create/multiple-create-post-req.json - :language: javascript - -Response --------- - -.. rest_parameters:: parameters.yaml - - - reservation_id: reservation_id - -**Example Create multiple servers with reservation ID: JSON response** - -.. literalinclude:: ../../doc/api_samples/os-multiple-create/multiple-create-post-resp.json - :language: javascript diff --git a/api-ref/source/servers.inc b/api-ref/source/servers.inc index 9c634bf97404..1cb47c775924 100644 --- a/api-ref/source/servers.inc +++ b/api-ref/source/servers.inc @@ -370,6 +370,62 @@ Response .. literalinclude:: ../../doc/api_samples/servers/server-create-resp.json :language: javascript +Create Multiple Servers +======================= + +.. rest_method:: POST /servers + +There is a second kind of create call which can build multiple servers +at once. This supports all the same parameters as create with a few +additional attributes specific to multiple create. + +Error handling for multiple create is not as consistent as for single +server create, and there is no guarantee that all the servers will be +built. This call should generally be avoided in favor of clients doing +direct individual server creates. + +Request (Additional Parameters) +------------------------------- + +These are the parameters beyond single create that are supported. + +.. rest_parameters:: parameters.yaml + + - name: servers_multiple_create_name + - min_count: servers_min_count + - max_count: servers_max_count + - return_reservation_id: return_reservation_id + +**Example Multiple Create with reservation ID** + +.. literalinclude:: ../../doc/api_samples/os-multiple-create/multiple-create-post-req.json + :language: javascript + +Response +-------- + +.. rest_parameters:: parameters.yaml + + - reservation_id: reservation_id + +If ``return_reservation_id`` is set to ``true`` only the +``reservation_id`` will be returned. This can be used as a filter with +list servers detailed to see the status of all the servers being +built. + +**Example Create multiple servers with reservation ID** + +.. literalinclude:: ../../doc/api_samples/os-multiple-create/multiple-create-post-resp.json + :language: javascript + +If ``return_reservation_id`` is set to ``false`` a representation of +the ``first`` server will be returned. + +**Example Create multiple servers without reservation ID** + +.. literalinclude:: ../../doc/api_samples/os-multiple-create/multiple-create-no-resv-post-resp.json + :language: javascript + List Servers Detailed =====================