How to upload image from url using Image service REST API
Hello,
I'm looking for a way to upload images from external URL using Image service API , but I can't find in API docs how to pass URL argument to create image method or to any other method.
Is API v2 support uploading images from URL and how?
And the same questions about API v1.
Thanks
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Glance Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Ksenia
- Solved:
- 2015-10-13
- Last query:
- 2015-10-13
- Last reply:
- 2015-10-12
For v1 you can do:
glance --os-image-
for v2 there is currently no universally recognised way to do this.
There is some design work going on around importing images using v2 at the moment, stay tuned.
Ksenia (ks-malysheva) said : | #2 |
Thanks for the answer,
but I need a way to do this via REST Api from my frontend.
I make a POST request to glance endpoint:
POST /v1/images
with request payload:
{
"name":"webV1",
"copy_from":"http://
"disk_
"container_
}
Response received:
400 Bad Request
Invalid disk format 'None' for image.
But image is created, with id instead of name, in state queued (and it never changes to Active) and 0 bytes size.
What is correct way to upload image from url via Rest api?
wangxiyuan (wangxiyuan) said : | #3 |
In v1, You should pass parameter in header, like : x-image-
Ksenia (ks-malysheva) said : | #4 |
Hi all,
thanks for answers!
Looks like in REST Api v1 we can do following request:
POST v1/images
headers: {
'x-glance-
'x-image-
}
Request shouldn't contain body.
Gary Marchiny (gary-marchiny) said : | #5 |
I've recently reported a 'bug' that is related to this topic: https:/