Atom feed of this document
  
 

 Update an Image

PATCH /v2/images/<IMAGE_ID>

Request body must conform to the 'application/openstack-images-v2.1-json-patch' media type, documented in Appendix B. Using PATCH /v2/images/e7db3b45-8db7-47ad-8109-3fb55c2c24fd as an example:

[
    {"op": "replace", "path": "/name", "value": "Fedora 17"},
    {"op": "replace", "path": "/tags", "value": ["fedora", "beefy"]}
]

Response body will represent the updated image entity. For example:

{
    "id": "e7db3b45-8db7-47ad-8109-3fb55c2c24fd",
    "name": "Fedora 17",
    "status": "queued",
    "visibility": "public",
    "tags": ["fedora", "beefy"],
    "created_at": "2012-08-11T17:15:52Z",
    "updated_at": "2012-08-11T17:15:52Z",
    "self": "/v2/images/e7db3b45-8db7-47ad-8109-3fb55c2c24fd",
    "file": "/v2/images/e7db3b45-8db7-47ad-8109-3fb55c2c24fd/file",
    "schema": "/v2/schemas/image"
}

The PATCH method can also be used to add or remove image properties. To add a custom user-defined property such as "login-user" to an image, use the following example request.

[
    {"op": "add", "path": "/login-user", "value": "kvothe"}
]

Similarly, to remove a property such as "login-user" from an image, use the following example request.

[
    {"op": "remove", "path": "/login-user"}
]

See Appendix B for more details about the 'application/openstack-images-v2.1-json-patch' media type.

Property Protections

Version 2.2 of the Images API acknowledges the ability of a cloud provider to employ property protections. Thus, there may be image properties that may not be updated or deleted by non-admin users.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page