Get metadata definition property schema

Overview

Gets a JSON schema document that represents a metadata definition property entity.

Classification

  • Show

API Operation Object

  • schemas

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/schemas/metadefs/property

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": false,
    "definitions": {
        "positiveInteger": {
            "minimum": 0,
            "type": "<type>"
        },
        "positiveIntegerDefault0": {
            "allOf": [
                {
                    "$ref": "<#/definitions/positiveInteger>"
                },
                {
                    "default": 0
                }
            ]
        },
        "stringArray": {
            "items": {
                "type": "<type>"
            },
            "minItems": 1,
            "type": "<type>",
            "uniqueItems": true
        }
    },
    "name": "<name>",
    "properties": {
        "additionalItems": {
            "type": "<type>"
        },
        "default": {},
        "description": {
            "type": "<type>"
        },
        "enum": {
            "type": "<type>"
        },
        "items": {
            "properties": {
                "enum": {
                    "type": "<type>"
                },
                "type": {
                    "enum": [
                        "<enum>",
                        <<repeat>>
                    ],
                    "type": "<type>"
                }
            },
            "type": "<type>"
        },
        "maxItems": {
            "$ref": "</definitions/positiveInteger>"
        },
        "maxLength": {
            "$ref": "<#/definitions/positiveInteger>"
        },
        "maximum": {
            "type": "<type>"
        },
        "minItems": {
            "$ref": "<#/definitions/positiveIntegerDefault0>"
        },
        "minLength": {
            "$ref": "<#/definitions/positiveIntegerDefault0>"
        },
        "minimum": {
            "type": "<type>"
        },
        "name": {
            "type": "<type>"
        },
        "pattern": {
            "format": "<format>",
            "type": "<type>"
        },
        "readonly": {
            "type": "<type>"
        },
        "required": {
            "$ref": "<#/definitions/stringArray>"
        },
        "title": {
            "type": "<type>"
        },
        "type": {
            "enum": [
                "<enum>",
                <<repeat>>
            ],
            "type": "string"
        },
        "uniqueItems": {
            "default": false,
            "type": "<type>"
        }
    },
    "required": [
        "type",
        "title",
        "name"
    ]
}

Response Parameter

Response Parameters

name

format

description

name

String

The name of the property.

title

String

The title of the property.

type

String

The property type.

enum

list

Enumeration of property values.

items

String

Schema for the items in an array.

description

String

The description of the property.

default

base64Binary

Default property description.

readonly

boolean

Indicates whether this is a read-only property.

minimum

String

Minimum allowed numerical value.

maximum

String

Maximum allowed numerical value.

minLength

String

Minimum allowed string length.

maxLength

String

Maximum allowed string length.

pattern

String

A regular expression (ECMA 262) that a string value must match.

minItems

String

Minimum length of an array.

maxItems

String

Maximum length of an array.

uniqueItems

String

Indicates whether all values in the array must be distinct.

additionalItems

String

Describes extra items, if you use tuple typing. If the value of items is an array (tuple typing) and the instance is longer than the list of schemas in items, the additional items are described by the schema in this property.
If this value is false, the instance cannot be longer than the list of schemas in items.

If this value is true, that is equivalent to the empty schema (anything goes).

required

String

The object may optionally define required properties under the semantic understanding that a user who uses the object should provide all required properties.

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/schemas/metadefs/property

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": false,
    "definitions": {
        "positiveInteger": {
            "minimum": 0,
            "type": "integer"
        },
        "positiveIntegerDefault0": {
            "allOf": [
                {
                    "$ref": "#/definitions/positiveInteger"
                },
                {
                    "default": 0
                }
            ]
        },
        "stringArray": {
            "items": {
                "type": "string"
            },
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
        }
    },
    "name": "property",
    "properties": {
        "additionalItems": {
            "type": "boolean"
        },
        "default": {},
        "description": {
            "type": "string"
        },
        "enum": {
            "type": "array"
        },
        "items": {
            "properties": {
                "enum": {
                    "type": "array"
                },
                "type": {
                    "enum": [
                        "array",
                        "boolean",
                        "integer",
                        "number",
                        "object",
                        "string",
                        null
                    ],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "maxItems": {
            "$ref": "#/definitions/positiveInteger"
        },
        "maxLength": {
            "$ref": "#/definitions/positiveInteger"
        },
        "maximum": {
            "type": "number"
        },
        "minItems": {
            "$ref": "#/definitions/positiveIntegerDefault0"
        },
        "minLength": {
            "$ref": "#/definitions/positiveIntegerDefault0"
        },
        "minimum": {
            "type": "number"
        },
        "name": {
            "type": "string"
        },
        "pattern": {
            "format": "regex",
            "type": "string"
        },
        "readonly": {
            "type": "boolean"
        },
        "required": {
            "$ref": "#/definitions/stringArray"
        },
        "title": {
            "type": "string"
        },
        "type": {
            "enum": [
                "array",
                "boolean",
                "integer",
                "number",
                "object",
                "string",
                null
            ],
            "type": "string"
        },
        "uniqueItems": {
            "default": false,
            "type": "boolean"
        }
    },
    "required": [
        "type",
        "title",
        "name"
    ]
}

Execution Example

HTTP Request

GET /v2/schemas/metadefs/property HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
Accept: */*
X-Auth-Token: fcc83cd12e134e76856478a226a8baa2

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 1319
X-Openstack-Request-Id: req-4223619c-0678-48e3-828e-d5e0630dc8c5
Date: Thu, 15 Oct 2015 14:41:13 GMT

{"additionalProperties": false, "definitions": {"positiveIntegerDefault0": {"allOf": [{"$ref": "#/definitions/positiveInteger"}, {"default": 0}]}, "stringArray": {"minItems": 1, "items": {"type": "string"}, "uniqueItems": true, "type": "array"}, "positiveInteger": {"minimum": 0, "type": "integer"}}, "required": ["type", "title", "name"], "name": "property", "properties": {"additionalItems": {"type": "boolean"}, "enum": {"type": "array"}, "name": {"type": "string"}, "title": {"type": "string"}, "default": {}, "minLength": {"$ref": "#/definitions/positiveIntegerDefault0"}, "required": {"$ref": "#/definitions/stringArray"}, "maximum": {"type": "number"}, "minItems": {"$ref": "#/definitions/positiveIntegerDefault0"}, "readonly": {"type": "boolean"}, "minimum": {"type": "number"}, "maxItems": {"$ref": "#/definitions/positiveInteger"}, "maxLength": {"$ref": "#/definitions/positiveInteger"}, "uniqueItems": {"default": false, "type": "boolean"}, "pattern": {"type": "string", "format": "regex"}, "items": {"type": "object", "properties": {"enum": {"type": "array"}, "type": {"enum": ["array", "boolean", "integer", "number", "object", "string", null], "type": "string"}}}, "type": {"enum": ["array", "boolean", "integer", "number", "object", "string", null], "type": "string"}, "description": {"type": "string"}}}

Error Execution Example

HTTP Request

GET /v2/schema/metadefs/property 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-8f4bdf82-1fa4-4e22-8d3f-a487f1a663e3
Date: Thu, 15 Oct 2015 17:55:26 GMT

404 Not Found

The resource could not be found.