Copy image¶
Overview¶
Copy image to a specified region.
Classification¶
Copy
API Operation Object¶
jobs
Synchronous / Asynchronous¶
asynchronous
Request¶
HTTP Request Method¶
POST
HTTP Request Path¶
{api_endpoint}/v2/extension/image_replicator/jobs
HTTP Request Body¶
Format¶
{
"image_id": "<image_id>",
"tenant_id_dst": "<tenant_id_dst>"
}
Request Parameter¶
name |
style |
format |
description |
required/optional |
default value |
action for invalid parameter |
response code for invalid parameter |
---|---|---|---|---|---|---|---|
token_id |
Header |
authentication token string |
keystone authentication token |
required |
- |
Terminate |
401 |
tenant_id_dst |
Body |
UUID |
An identifier for the image tenant for destination region. |
required |
- |
Terminate |
401, 409 |
image_id |
Body |
UUID |
An identifier for the image |
required |
- |
Terminate |
400, 404, 409 |
Response¶
HTTP Response Header¶
Format¶
HTTP/1.1 <response_code> <message> (ex. 202 Accepted)
<response_code>: see "HTTP Responses" section
<message>: message based on the response code
skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"
Response Code¶
response code |
condition |
---|---|
202 |
normal end |
400 |
validation error of the request parameter |
401 |
unauthorized |
404 |
specify non-existent image_id |
- |
specify the image_id of deleted image |
- |
specify the destination tenant_id |
- |
the license switch type of the specified image is not supported at the destination region |
- |
the official template type of the specified image is not supported at the destination region |
409 |
Glance of the specified region is down |
- |
no active source of image status |
- |
destination_region does not support the image |
500 |
system error |
Sample API Request and Response¶
Sample API Request¶
Request URI¶
https://example.com/v2/extension/image_replicator/jobs
Request Header¶
X-Auth-Token: ajk3adjiown02
Content-Type: application/json
Request Body¶
{
"image_id": "<image_id>",
"tenant_id_dst": "<tenant_id_dst>"
}
Sample API Response¶
Response Header¶
HTTP/1.1 202 Accepted
<response_code>: see "HTTP Responses" section
<message>: message based on the response code
skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"
Response Body¶
{
"job_id" : "<job_id>"
}
Execution Example¶
HTTP Request¶
POST /v2/extension/image_replicator/jobs HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
Content-Type: application/json
X-Auth-Token: f4328bab05ff4502b397b88657baaefd
{"image_id":"335eef3f-551d-46e1-8781-173f43209d48","tenant_id_dst":"91b5c7c09cbd45caa3c146fd67ae471e"}
HTTP Response¶
HTTP/1.1 202 Accepted
Date: Fri, 10 Jun 2016 04:30:21 GMT
Content-Length: 51
Connection: close
Content-Type: application/json; charset=UTF-8
{"job_id": "33911588-c299-4369-a240-7e5b741cdb6a"}
Error Execution Example¶
HTTP Request¶
POST /v2/extension/image_replicator/jobs HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
X-Auth-Token: 1e020f07e531408c9095ea64c4db230d
{"image_id":"335eef3f-551d-46e1-8781-173f43209d48","tenant_id_dst":"91b5c7c09cbd45caa3c146fd67ae471e"}
HTTP Response¶
HTTP/1.1 400 Bad Request
Date: Fri, 10 Jun 2016 04:53:16 GMT
Content-Length: 66
Vary: X-Auth-Token
Connection: close
Content-Type: text/plain; charset=UTF-8
400 Bad Request
There is no such action: Content-Type in header