diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index a91befd90aa..e2cc90a9dae 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -506,6 +506,12 @@ container: in: body required: true type: string +container_format: + description: | + Container format for the new image. Defualt is bare. + in: body + required: false + type: string control_location: description: | Notional service where encryption is performed. Valid values are @@ -690,6 +696,12 @@ detached_at: in: body required: false type: string +disk_format: + description: | + Disk format for the new image. Default is raw. + in: body + required: false + type: string display_name: description: | The name of volume backend capabilities. @@ -792,6 +804,13 @@ force_2: in: body required: false type: boolean +force_4: + description: | + Enables or disables upload of a volume that is + attached to an instance. Default=False. + in: body + required: false + type: boolean free_capacity: description: | The amount of free capacity for the back-end @@ -925,6 +944,18 @@ id_8: in: body required: true type: integer +image_id: + description: | + The uuid for the new image. + in: body + required: true + type: string +image_name: + description: | + The name for the new image. + in: body + required: true + type: string imageRef: description: | The UUID of the image from which you want to @@ -1544,6 +1575,13 @@ os-volume-type-access:is_public: in: body required: false type: boolean +os-volume_upload_image: + description: | + The ``os-volume_upload_image`` action. This + action uploads the specified volume to image service. + in: body + required: true + type: object pool_name: description: | The name of the storage pool. @@ -1577,6 +1615,12 @@ properties: in: body required: true type: object +protected: + description: | + Whether the new image is protected. Default=False. + in: body + required: false + type: boolean provider: description: | The class that provides encryption support. @@ -2067,6 +2111,12 @@ visibility: in: body required: true type: string +visibility_1: + description: | + The visibility property of the new image. Default is private. + in: body + required: false + type: string volume: description: | A ``volume`` object. @@ -2190,6 +2240,12 @@ volume_type_5: in: body required: true type: array +volume_type_6: + description: | + The associated volume type for the volume. + in: body + required: true + type: string volume_type_id_body: description: | The UUID of the volume type. diff --git a/api-ref/source/v3/samples/volume-upload-to-image-request.json b/api-ref/source/v3/samples/volume-upload-to-image-request.json new file mode 100644 index 00000000000..4718d4bce5e --- /dev/null +++ b/api-ref/source/v3/samples/volume-upload-to-image-request.json @@ -0,0 +1,10 @@ +{ + "os-volume_upload_image":{ + "image_name": "test", + "force": false, + "disk_format": "raw", + "container_format": "bare", + "visibility": "private", + "protected": false + } +} \ No newline at end of file diff --git a/api-ref/source/v3/samples/volume-upload-to-image-response.json b/api-ref/source/v3/samples/volume-upload-to-image-response.json new file mode 100644 index 00000000000..58ce05f28e5 --- /dev/null +++ b/api-ref/source/v3/samples/volume-upload-to-image-response.json @@ -0,0 +1,16 @@ +{ + "os-volume_upload_image": { + "status": "uploading", + "container_format": "bare", + "image_name": "test", + "visibility": "private", + "updated_at": "2017-06-05T08:44:28.000000", + "image_id": "de75b74e-7f0d-4b59-a263-bd87bfc313bd", + "display_description": null, + "id": "3a81fdac-e8ae-4e61-b6a2-2e14ff316f19", + "size": 1, + "disk_format": "raw", + "volume_type": null, + "protected": false + } +} \ No newline at end of file diff --git a/api-ref/source/v3/volumes-v3-volumes-actions.inc b/api-ref/source/v3/volumes-v3-volumes-actions.inc index 6a5dae7d56b..ca795f7a00f 100644 --- a/api-ref/source/v3/volumes-v3-volumes-actions.inc +++ b/api-ref/source/v3/volumes-v3-volumes-actions.inc @@ -424,3 +424,64 @@ Request Example .. literalinclude:: ./samples/volume-bootable-status-update-request.json :language: javascript + + + + + +Upload volume to image +~~~~~~~~~~~~~~~~~~~~~~~~ + +.. rest_method:: POST /v3/{project_id}/volumes/{volume_id}/action + +Uploads the specified volume to image service. + +Normal response codes: 202 + + +Request +------- + +.. rest_parameters:: parameters.yaml + + - project_id: project_id_path + - volume_id: volume_id_path + - os-volume_upload_image: os-volume_upload_image + - image_name: image_name + - force: force_4 + - disk_format: disk_format + - container_format: container_format + - visibility: visibility_1 + - protected: protected + +Request Example +--------------- + +.. literalinclude:: ./samples/volume-upload-to-image-request.json + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - os-volume_upload_image: os-volume_upload_image + - status: status_3 + - image_name: image_name + - disk_format: disk_format + - container_format: container_format + - visibility: visibility_1 + - protected: protected + - updated_at: updated_at + - image_id: image_id + - display_description: description_9 + - id: id_5 + - size: size + - volume_type: volume_type_6 + + +Response Example +---------------- + +.. literalinclude:: ./samples/volume-upload-to-image-response.json + :language: javascript