Get metadata definition namespace schema

Overview

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

Classification

  • Show

API Operation Object

  • schemas

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/schemas/metadefs/namespace

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": "<name>",
    "properties": {
        "created_at": {
            "description": "<description>",
            "format": "<format>",
            "type": "<type>"
        },
        "description": {
            "description": "<description>",
            "maxLength": <maxLength>,
            "type": "<type>"
        },
        "display_name": {
            "description": "<description>",
            "maxLength": <maxLength>,
            "type": "<type>"
        },
        "namespace": {
            "description": "<description>",
            "maxLength": <maxLength>,
            "type": "<type>"
        },
        "objects": {
            "items": {
                "properties": {
                    "description": {
                        "type": "<type>"
                    },
                    "name": {
                        "type": "<type>"
                    },
                    "properties": {
                        "$ref": "<#/definitions/property>"
                    },
                    "required": {
                        "$ref": "<#/definitions/stringArray>"
                    }
                },
                "type": "<type>"
            },
            "type": "<type>"
        },
        "owner": {
            "description": "<description>",
            "maxLength": <maxLength>,
            "type": "<type>"
        },
        "properties": {
            "$ref": "<#/definitions/property>"
        },
        "protected": {
            "description": "<description>",
            "type": "<type>"
        },
        "resource_type_associations": {
            "items": {
                "properties": {
                    "name": {
                        "type": "<type>"
                    },
                    "prefix": {
                        "type": "<type>"
                    },
                    "properties_target": {
                        "type": "<type>"
                    }
                },
                "type": "<type>"
            },
            "type": "<type>"
        },
        "schema": {
            "type": "<type>"
        },
        "self": {
            "type": "<type>"
        },
        "updated_at": {
            "description": "<description>",
            "format": "<format>",
            "type": "<type>"
        },
        "visibility": {
            "description": "<description>",
            "enum": [
                "<enum>",
                <<repeat>>
            ],
            "type": "<type>"
        }
    },
    "required": [
        "namespace"
    ]
}

Response Parameter

Response Parameters
item format description
namespace String The namespace is unique across all users.
display_name String User friendly name which could be used in UI for displaying namespace name.
description String Detailed description for the namespace.
visibility String Namespace visibility. A valid value is public or private. Default is private.
protected String Namespace protection for deletion. A valid value is True or False. Default is False.
properties String Property definition(s) of the namespace.
objects String Object definition(s) of the namespace.
resource_type_associations String Resource type(s) which are associated with this namespace.
created_at time/date Date and time of namespace creation.
owner String Owner of the namespace.
schema String URL for schema of the namespace.
self String URL for the namespace.
visibility String The namespace visibility.
updated_at time/date Date and time of the last namespace modification.

Sample API Request and Response

Sample API Request

Request URI

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

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": "namespace",
    "properties": {
        "created_at": {
            "description": "Date and time of namespace creation (READ-ONLY)",
            "format": "date-time",
            "type": "string"
        },
        "description": {
            "description": "Provides a user friendly description of the namespace.",
            "maxLength": 500,
            "type": "string"
        },
        "display_name": {
            "description": "The user friendly name for the namespace. Used by UI if available.",
            "maxLength": 80,
            "type": "string"
        },
        "namespace": {
            "description": "The unique namespace text.",
            "maxLength": 80,
            "type": "string"
        },
        "objects": {
            "items": {
                "properties": {
                    "description": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "properties": {
                        "$ref": "#/definitions/property"
                    },
                    "required": {
                        "$ref": "#/definitions/stringArray"
                    }
                },
                "type": "object"
            },
            "type": "array"
        },
        "owner": {
            "description": "Owner of the namespace.",
            "maxLength": 255,
            "type": "string"
        },
        "properties": {
            "$ref": "#/definitions/property"
        },
        "protected": {
            "description": "If true, namespace will not be deletable.",
            "type": "boolean"
        },
        "resource_type_associations": {
            "items": {
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "prefix": {
                        "type": "string"
                    },
                    "properties_target": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "type": "array"
        },
        "schema": {
            "type": "string"
        },
        "self": {
            "type": "string"
        },
        "updated_at": {
            "description": "Date and time of the last namespace modification (READ-ONLY)",
            "format": "date-time",
            "type": "string"
        },
        "visibility": {
            "description": "Scope of namespace accessibility.",
            "enum": [
                "public",
                "private"
            ],
            "type": "string"
        }
    },
    "required": [
        "namespace"
    ]
}

Execution Example

HTTP Request

GET /v2/schemas/member 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: 660
X-Openstack-Request-Id: req-33540bc0-add8-4918-b41a-a3f205fb981a
Date: Thu, 15 Oct 2015 14:31:53 GMT

{"name": "member", "properties": {"status": {"enum": ["pending", "accepted", "rejected"], "type": "string", "description": "The status of this image member"}, "created_at": {"type": "string", "description": "Date and time of image member creation"}, "updated_at": {"type": "string", "description": "Date and time of last modification of image member"}, "image_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"}, "member_id": {"type": "string", "description": "An identifier for the image member (tenantId)"}, "schema": {"type": "string"}}}

Error Execution Example

HTTP Request

GET /v2/schema/metadefs/namespace 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-2df4a6c0-040e-4c4e-bdb8-195d38e7b949
Date: Thu, 15 Oct 2015 17:53:41 GMT

404 Not Found

The resource could not be found.