Ask Your Question
0

how can i update the image via CURL command.

asked 2015-04-29 03:39:25 -0500

Nicholas I gravatar image

updated 2015-04-29 04:15:12 -0500

Hi,

how can i update the image via CURL command.

edit retag flag offensive close merge delete

Comments

can you please edit your question, that will help others to understand & respond better.

SGPJ gravatar imageSGPJ ( 2015-04-29 03:55:35 -0500 )edit

yeah i have edited. thanks

Nicholas I gravatar imageNicholas I ( 2015-04-29 04:17:56 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-05-06 12:27:09 -0500

cduch gravatar image

If the glance api documentation is correct, it's currently not possible to directly update an image if it's not in "queued" state.

http://docs.openstack.org/developer/glance/glanceapi.html#update-an-image (glance api documentation > update an image):

If an image was previously reserved, and thus is in the queued state, then image data can be added by including it as the request body. If the image already has data associated with it (e.g. not in the queued state), then including a request body will result in a 409 Conflict exception.

But as mention in https://ask.openstack.org/en/question/65969/need-rest-api-to-attach-volume-to-a-instance/?answer=66002#post-id-66002 (this answer), you can use the glance CLI with the --debug option to check which API calls are made.

edit flag offensive delete link more
-1

answered 2015-04-29 10:33:10 -0500

Why not just use Glance CLI this guide may assist http://docs.openstack.org/image-guide...

# glance help image-update
usage: glance image-update [--name <NAME>] [--disk-format <DISK_FORMAT>]
                           [--container-format <CONTAINER_FORMAT>]
                           [--owner <TENANT_ID>] [--size <SIZE>]
                           [--min-disk <DISK_GB>] [--min-ram <DISK_RAM>]
                           [--location <IMAGE_URL>] [--file <FILE>]
                           [--checksum <CHECKSUM>] [--copy-from <IMAGE_URL>]
                           [--is-public {True,False}]
                           [--is-protected {True,False}]
                           [--property <key=value>] [--purge-props]
                           [--human-readable] [--progress]
                           <IMAGE>

Update a specific image.

Positional arguments:
  <IMAGE>               Name or ID of image to modify.

Optional arguments:
  --name <NAME>         Name of image.
  --disk-format <DISK_FORMAT>
                        Disk format of image. Acceptable formats: ami, ari,
                        aki, vhd, vmdk, raw, qcow2, vdi, and iso.
  --container-format <CONTAINER_FORMAT>
                        Container format of image. Acceptable formats: ami,
                        ari, aki, bare, and ovf.
  --owner <TENANT_ID>   Tenant who should own image.
  --size <SIZE>         Size of image data (in bytes).
  --min-disk <DISK_GB>  Minimum size of disk needed to boot image (in
                        gigabytes).
  --min-ram <DISK_RAM>  Minimum amount of ram needed to boot image (in
                        megabytes).
  --location <IMAGE_URL>
                        URL where the data for this image already resides. For
                        example, if the image data is stored in swift, you
                        could specify 'swift+http://tenant%3Aaccount:key@auth_
                        url/v2.0/container/obj'. (Note: '%3A' is ':' URL
                        encoded.)
  --file <FILE>         Local file that contains disk image to be uploaded
                        during update. Alternatively, images can be passed to
                        the client via stdin.
  --checksum <CHECKSUM>
                        Hash of image data used Glance can use for
                        verification.
  --copy-from <IMAGE_URL>
                        Similar to '--location' in usage, but this indicates
                        that the Glance server should immediately copy the
                        data and store it in its configured image store.
  --is-public {True,False}
                        Make image accessible to the public.
  --is-protected {True,False}
                        Prevent image from being deleted.
  --property <key=value>
                        Arbitrary property to associate with image. May be
                        used multiple times.
  --purge-props         If this flag is present, delete all image properties
                        not explicitly set in the update request. Otherwise,
                        those properties not referenced are preserved.
  --human-readable      Print image size in a human-friendly format.
  --progress            Show upload progress bar.
edit flag offensive delete link more

Comments

No. there are some functions needs to be tested right now they are not available in CLI nor in horizon.

Nicholas I gravatar imageNicholas I ( 2015-04-30 01:53:09 -0500 )edit

which functions are you talking about?

omar-munoz gravatar imageomar-munoz ( 2015-04-30 09:55:43 -0500 )edit
Nicholas I gravatar imageNicholas I ( 2015-05-02 12:14:38 -0500 )edit

You understand that's a blueprint right?

omar-munoz gravatar imageomar-munoz ( 2015-05-06 14:49:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-04-29 03:39:25 -0500

Seen: 429 times

Last updated: May 06 '15