Get image schema

Overview

Gets a JSON schema document that represents an image entity.

Classification

  • Show

API Operation Object

  • schemas

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/schemas/image

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters

name

style

format

description

required/optional

none

-

-

-

-

Response

HTTP Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <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 Codes

response code

condition

200

normal end

*

Follow a Common Error Code

HTTP Response Body

Format

{
    "additionalProperties": {
        "type": "<type>"
    },
    "links": [
        {
            "href": "<volume_url>",
            "rel": "self"
        },
        {
            "href": "<enclosure_url>",
            "rel": "enclosure"
        },
        {
            "href": "<describedby_url>",
            "rel": "describedby"
        }
    ],
    "name": "<name>",
    "properties": {
        "architecture": {
            "description": "<description>",
            "is_base": <is_base>,
            "type": "<type>"
        },
        "checksum": {
            "description": "<description>",
            "maxLength": <maxLength>,
            "type": [
                "null",
                "<type>"
            ]
        },
        "container_format": {
            "description": "<description>",
            "enum": [
                "<enum>",
                <<repeat>>
            ],
            "type": [
                "null",
                "<type>"
            ]
        },
        "created_at": {
            "description": "<description>",
            "type": "<type>"
        },
        "direct_url": {
            "description": "<description>",
            "type": "<type>"
        },
        "disk_format": {
            "description": "<description>",
            "enum": [
                "<enum>"
                <<repeat>>
            ],
            "type": [
                "null",
                "<type>"
            ]
        },
        "file": {
            "description": "<description>",
            "type": "<type>"
        },
        "id": {
            "description": "<description>",
            "pattern": "<pattern>",
            "type": "<type>"
        },
        "instance_uuid": {
            "description": "<description>",
            "is_base": <is_base>,
            "type": "<type>"
        },
        "kernel_id": {
            "description": "<description>",
            "is_base": <is_base>,
            "pattern": "<pattern>",
            "type": "<type>"
        },
        "locations": {
            "description": "<description>",
            "items": {
                "properties": {
                    "metadata": {
                        "type": "<type>"
                    },
                    "url": {
                        "maxLength": <maxLength>,
                        "type": "<type>"
                    }
                },
                "required": [
                    "url",
                    "metadata"
                ],
                "type": "<type>"
            },
            "type": "<type>"
        },
        "min_disk": {
            "description": "<description>",
            "type": "<type>"
        },
        "min_ram": {
            "description": "<description>",
            "type": "<type>"
        },
        "name": {
            "description": "<description>",
            "maxLength": <maxLength>,
            "type": [
                "null",
                "<type>"
            ]
        },
        "os_distro": {
            "description": "<description>",
            "is_base": <is_base>,
            "type": "<type>"
        },
        "os_version": {
            "description": "<description>",
            "is_base": <is_base>,
            "type": "<type>"
        },
        "owner": {
            "description": "<description>",
            "maxLength": <maxLength>,
            "type": [
                "null",
                "<type>"
            ]
        },
        "protected": {
            "description": "<description>",
            "type": "<type>"
        },
        "ramdisk_id": {
            "description": "<description>",
            "is_base": <is_base>,
            "pattern": "<pattern>",
            "type": "<type>"
        },
        "schema": {
            "description": "<description>",
            "type": "<type>"
        },
        "self": {
            "description": "<description>",
            "type": "<type>"
        },
        "size": {
            "description": "<description>",
            "type": [
                "null",
                "<type>"
            ]
        },
        "status": {
            "description": "<description>",
            "enum": [
                "<enum>",
                <<repeat>>
            ],
            "type": "<type>"
        },
        "tags": {
            "description": "<description>",
            "items": {
                "maxLength": <maxLength>,
                "type": "<type>"
            },
            "type": "<type>"
        },
        "updated_at": {
            "description": "<description>",
            "type": "<type>"
        },
        "virtual_size": {
            "description": "<description>",
            "type": [
                "null",
                "<type>"
            ]
        },
        "visibility": {
            "description": "<description>",
            "enum": [
                "<enum>",
                <<repeat>>
            ],
            "type": "<type>"
        }
    }
}

Response Parameter

Response Parameters

item

format

description

architecture

String

Operating system architecture as specified in URL.

status

String

The image status.

container_format

String

The container format of image.

min_ram

UUID

The minimum amount of RAM in MB that is required to boot the image..

updated_at

time/date

The date and time when the resource was updated.The date and time stamp format is ISO 8601:

owner

String

The ID of the owner, or tenant, of the image.

min_disk

int

The minimum disk size in GB that is required to boot the image.

tags

list

A list of Image tag.

visibility

boolean

The image visibility.

id

UUID

The unique ID for the image.

size

int

The size of the image data, in bytes.

virtual_size

int

The virtual size of the image.

name

String

The name of the image.

checksum

String

Hash of the image data used. The Image service uses this value for verification.

created_at

time/date

The date and time when the resource was created.The date and time stamp format is ISO 8601:

disk_format

String

The disk format of the image.

properties

dict

Properties, if any, those are associated with the image.

protected

boolean

Indicates whether the image can be deleted.

location

String

URL to access the image file kept in external store.

self

String

URL for the virtual machine image.

file

String

URL for the virtual machine image file.

schema

String

URL for schema of the virtual machine image.

direct_url

String

URL to access the image file kept in external store.

instance_uuid

String

ID of instance used to create this image.

kernel_id

String

ID of image stored in Glance that should be used as the kernel when booting an AMI-style image.

os_distro

String

Common name of operating system distribution as specified in URL.

os_version

String

Operating system version as specified by the distributor.

ramdisk_id

String

ID of image stored in Glance that should be used as the ramdisk when booting an AMI-style image.

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/schemas/image

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Content-Type: application/json

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <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

{
    "additionalProperties": {
        "type": "string"
    },
    "links": [
        {
            "href": "{self}",
            "rel": "self"
        },
        {
            "href": "{file}",
            "rel": "enclosure"
        },
        {
            "href": "{schema}",
            "rel": "describedby"
        }
    ],
    "name": "image",
    "properties": {
        "architecture": {
            "description": "Operating system architecture as specified in http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-images.html",
            "is_base": false,
            "type": "string"
        },
        "checksum": {
            "description": "md5 hash of image contents. (READ-ONLY)",
            "maxLength": 32,
            "type": [
                "null",
                "string"
            ]
        },
        "container_format": {
            "description": "Format of the container",
            "enum": [
                null,
                "ami",
                "ari",
                "aki",
                "bare",
                "ovf",
                "ova"
            ],
            "type": [
                "null",
                "string"
            ]
        },
        "created_at": {
            "description": "Date and time of image registration (READ-ONLY)",
            "type": "string"
        },
        "direct_url": {
            "description": "URL to access the image file kept in external store (READ-ONLY)",
            "type": "string"
        },
        "disk_format": {
            "description": "Format of the disk",
            "enum": [
                null,
                "ami",
                "ari",
                "aki",
                "vhd",
                "vmdk",
                "raw",
                "qcow2",
                "vdi",
                "iso"
            ],
            "type": [
                "null",
                "string"
            ]
        },
        "file": {
            "description": "(READ-ONLY)",
            "type": "string"
        },
        "id": {
            "description": "An identifier for the image",
            "pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
            "type": "string"
        },
        "instance_uuid": {
            "description": "ID of instance used to create this image.",
            "is_base": false,
            "type": "string"
        },
        "kernel_id": {
            "description": "ID of image stored in Glance that should be used as the kernel when booting an AMI-style image.",
            "is_base": false,
            "pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
            "type": "string"
        },
        "locations": {
            "description": "A set of URLs to access the image file kept in external store",
            "items": {
                "properties": {
                    "metadata": {
                        "type": "object"
                    },
                    "url": {
                        "maxLength": 255,
                        "type": "string"
                    }
                },
                "required": [
                    "url",
                    "metadata"
                ],
                "type": "object"
            },
            "type": "array"
        },
        "min_disk": {
            "description": "Amount of disk space (in GB) required to boot image.",
            "type": "integer"
        },
        "min_ram": {
            "description": "Amount of ram (in MB) required to boot image.",
            "type": "integer"
        },
        "name": {
            "description": "Descriptive name for the image",
            "maxLength": 255,
            "type": [
                "null",
                "string"
            ]
        },
        "os_distro": {
            "description": "Common name of operating system distribution as specified in http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-images.html",
            "is_base": false,
            "type": "string"
        },
        "os_version": {
            "description": "Operating system version as specified by the distributor",
            "is_base": false,
            "type": "string"
        },
        "owner": {
            "description": "Owner of the image",
            "maxLength": 255,
            "type": [
                "null",
                "string"
            ]
        },
        "protected": {
            "description": "If true, image will not be deletable.",
            "type": "boolean"
        },
        "ramdisk_id": {
            "description": "ID of image stored in Glance that should be used as the ramdisk when booting an AMI-style image.",
            "is_base": false,
            "pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$",
            "type": "string"
        },
        "schema": {
            "description": "(READ-ONLY)",
            "type": "string"
        },
        "self": {
            "description": "(READ-ONLY)",
            "type": "string"
        },
        "size": {
            "description": "Size of image file in bytes (READ-ONLY)",
            "type": [
                "null",
                "integer"
            ]
        },
        "status": {
            "description": "Status of the image (READ-ONLY)",
            "enum": [
                "queued",
                "saving",
                "active",
                "killed",
                "deleted",
                "pending_delete"
            ],
            "type": "string"
        },
        "tags": {
            "description": "List of strings related to the image",
            "items": {
                "maxLength": 255,
                "type": "string"
            },
            "type": "array"
        },
        "updated_at": {
            "description": "Date and time of the last image modification (READ-ONLY)",
            "type": "string"
        },
        "virtual_size": {
            "description": "Virtual size of image in bytes (READ-ONLY)",
            "type": [
                "null",
                "integer"
            ]
        },
        "visibility": {
            "description": "Scope of image accessibility",
            "enum": [
                "public",
                "private"
            ],
            "type": "string"
        }
    }
}

Execution Example

HTTP Request

GET /v2/schemas/images HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
Accept: */*
X-Auth-Token: 2529f972b5744519bea7b26327d4925d

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 4073
X-Openstack-Request-Id: req-02e561ea-88dd-4682-a598-e1e755d80ee8
Date: Thu, 15 Oct 2015 14:15:18 GMT

{"additionalProperties": {"type": "string"}, "name": "image", "links": [{"href": "{self}", "rel": "self"}, {"href": "{file}", "rel": "enclosure"}, {"href": "{schema}", "rel": "describedby"}], "properties": {"status": {"enum": ["queued", "saving", "active", "killed", "deleted", "pending_delete"], "type": "string", "description": "Status of the image (READ-ONLY)"}, "tags": {"items": {"type": "string", "maxLength": 255}, "type": "array", "description": "List of strings related to the image"}, "kernel_id": {"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", "type": "string", "description": "ID of image stored in Glance that should be used as the kernel when booting an AMI-style image.", "is_base": false}, "container_format": {"enum": ["ami", "ari", "aki", "bare", "ovf", "ova"], "type": "string", "description": "Format of the container"}, "min_ram": {"type": "integer", "description": "Amount of ram (in MB) required to boot image."}, "ramdisk_id": {"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", "type": "string", "description": "ID of image stored in Glance that should be used as the ramdisk when booting an AMI-style image.", "is_base": false}, "locations": {"items": {"required": ["url", "metadata"], "type": "object", "properties": {"url": {"type": "string", "maxLength": 255}, "metadata": {"type": "object"}}}, "type": "array", "description": "A set of URLs to access the image file kept in external store"}, "visibility": {"enum": ["public", "private"], "type": "string", "description": "Scope of image accessibility"}, "updated_at": {"type": "string", "description": "Date and time of the last image modification (READ-ONLY)"}, "owner": {"type": "string", "description": "Owner of the image", "maxLength": 255}, "file": {"type": "string", "description": "(READ-ONLY)"}, "min_disk": {"type": "integer", "description": "Amount of disk space (in GB) required to boot image."}, "virtual_size": {"type": "integer", "description": "Virtual size of image in bytes (READ-ONLY)"}, "id": {"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", "type": "string", "description": "An identifier for the image"}, "size": {"type": "integer", "description": "Size of image file in bytes (READ-ONLY)"}, "instance_uuid": {"type": "string", "description": "ID of instance used to create this image.", "is_base": false}, "os_distro": {"type": "string", "description": "Common name of operating system distribution as specified in http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-images.html", "is_base": false}, "name": {"type": "string", "description": "Descriptive name for the image", "maxLength": 255}, "checksum": {"type": "string", "description": "md5 hash of image contents. (READ-ONLY)", "maxLength": 32}, "created_at": {"type": "string", "description": "Date and time of image registration (READ-ONLY)"}, "disk_format": {"enum": ["ami", "ari", "aki", "vhd", "vmdk", "raw", "qcow2", "vdi", "iso"], "type": "string", "description": "Format of the disk"}, "os_version": {"type": "string", "description": "Operating system version as specified by the distributor", "is_base": false}, "protected": {"type": "boolean", "description": "If true, image will not be deletable."}, "architecture": {"type": "string", "description": "Operating system architecture as specified in http://docs.openstack.org/trunk/openstack-compute/admin/content/adding-images.html", "is_base": false}, "direct_url": {"type": "string", "description": "URL to access the image file kept in external store (READ-ONLY)"}, "self": {"type": "string", "description": "(READ-ONLY)"}, "schema": {"type": "string", "description": "(READ-ONLY)"}}}

Error Execution Example

HTTP Request

GET /v2/schema/images HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
Accept: */*
X-Auth-Token: 7d14e25e0f1e4eaebbc922c69757e573

HTTP Response

HTTP/1.1 404 Not Found
Content-Length: 154
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-13d02510-2144-4877-91d5-88cc7a47038b
Date: Thu, 15 Oct 2015 17:50:00 GMT

404 Not Found

The resource could not be found.