Get metadata definition object schema

Overview

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

Classification

  • Show

API Operation Object

  • schemas

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/schemas/metadefs/object

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
                }
            ]
        },
        "property": {
            "additionalProperties": {
                "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": "<type>"
                    },
                    "uniqueItems": {
                        "default": false,
                        "type": "<type>"
                    }
                },
                "required": [
                    "title",
                    "type"
                ],
                "type": "<type>"
            },
            "type": "<type>"
        },
        "stringArray": {
            "items": {
                "type": "<type>"
            },
            "type": "<type>",
            "uniqueItems": true
        }
    },
    "name": "object",
    "properties": {
        "created_at": {
            "description": "<description>",
            "format": "<format>",
            "type": "<type>"
        },
        "description": {
            "type": "<type>"
        },
        "name": {
            "type": "<type>"
        },
        "properties": {
            "$ref": "<#/definitions/property>"
        },
        "required": {
            "$ref": "<#/definitions/stringArray>"
        },
        "schema": {
            "type": "<type>"
        },
        "self": {
            "type": "<type>"
        },
        "updated_at": {
            "description": "<description>",
            "format": "<format>",
            "type": "<type>"
        }
    },
    "required": [
        "name"
    ]
}

Response Parameter

Response Parameters

item

format

description

created_at

time/date

Date and time of object creation

description

String

Detailed description for the object.

name

String

The name of the object.

properties

String

Property definition(s)of the object.

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.

schema

String

The URL for schema of the object.

self

String

URL for the object.

updated_at

time/date

Date and time of the last object modification

Sample API Request and Response

Sample API Request

Request URI

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

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
                }
            ]
        },
        "property": {
            "additionalProperties": {
                "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": [
                    "title",
                    "type"
                ],
                "type": "object"
            },
            "type": "object"
        },
        "stringArray": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "uniqueItems": true
        }
    },
    "name": "object",
    "properties": {
        "created_at": {
            "description": "Date and time of object creation (READ-ONLY)",
            "format": "date-time",
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "name": {
            "type": "string"
        },
        "properties": {
            "$ref": "#/definitions/property"
        },
        "required": {
            "$ref": "#/definitions/stringArray"
        },
        "schema": {
            "type": "string"
        },
        "self": {
            "type": "string"
        },
        "updated_at": {
            "description": "Date and time of the last object modification (READ-ONLY)",
            "format": "date-time",
            "type": "string"
        }
    },
    "required": [
        "name"
    ]
}

Execution Example

HTTP Request

GET /v2/schemas/metadefs/object 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: 1883
X-Openstack-Request-Id: req-6da70bea-5565-488a-80ec-54e3c9ffb46e
Date: Thu, 15 Oct 2015 14:39:48 GMT

{"additionalProperties": false, "definitions": {"property": {"additionalProperties": {"required": ["title", "type"], "type": "object", "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"}}}, "type": "object"}, "positiveIntegerDefault0": {"allOf": [{"$ref": "#/definitions/positiveInteger"}, {"default": 0}]}, "stringArray": {"uniqueItems": true, "items": {"type": "string"}, "type": "array"}, "positiveInteger": {"minimum": 0, "type": "integer"}}, "required": ["name"], "name": "object", "properties": {"created_at": {"type": "string", "description": "Date and time of object creation (READ-ONLY)", "format": "date-time"}, "schema": {"type": "string"}, "name": {"type": "string"}, "updated_at": {"type": "string", "description": "Date and time of the last object modification (READ-ONLY)", "format": "date-time"}, "self": {"type": "string"}, "required": {"$ref": "#/definitions/stringArray"}, "properties": {"$ref": "#/definitions/property"}, "description": {"type": "string"}}}

Error Execution Example

HTTP Request

GET /v2/schema/metadefs/object 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-d294ec61-f75f-4d1b-a39c-3dec0c8ca9e1
Date: Thu, 15 Oct 2015 17:54:32 GMT

404 Not Found

The resource could not be found.