Ask Your Question
2

Rest API v2 create image with URL to copy from

asked 2015-10-08 05:51:33 -0500

Andrey gravatar image

updated 2015-10-08 08:54:18 -0500

In the horizon there is an option to upload image file from disk or from external URL. But is API support copying from external URL? There is no such methods/parameters I found in docs.

Is there any way to create image with external source using v2 api? Maybe with several requests, or with v1 API?

Any help is apreciated.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-10-09 00:38:29 -0500

soumitrakarmakar gravatar image

Why would you like to reinvent the wheel? I mean you can scp a image to your backend and then run a script to run glance create image.

edit flag offensive delete link more

Comments

1

Thanks for response, but I think waiting the REST API functionality to be the same as CLI functionality is not reinventing the wheel.

Andrey gravatar imageAndrey ( 2015-10-09 02:57:39 -0500 )edit
0

answered 2015-10-13 02:01:44 -0500

Ksenia gravatar image

Hello, Looks like in REST Api v1 we can do following request:

POST v1/images

headers: {
  'x-glance-api-copy-from': '<image_url>',
  'x-image-meta-name': '<image_name>'
}

Request shouldn't contain body.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2015-10-08 05:51:33 -0500

Seen: 946 times

Last updated: Oct 09 '15