Skip to content

Instantly share code, notes, and snippets.

@clemensv
Last active June 25, 2019 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clemensv/505944ce9c56a593af6882d65accd4c5 to your computer and use it in GitHub Desktop.
Save clemensv/505944ce9c56a593af6882d65accd4c5 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.2",
"info": {
"title": "AMQP Management",
"version": "1.0"
},
"components": {
"schemas": {
"discovery-document": {
"type": "object",
"required": [
"collections"
],
"properties": {
"collections": {
"$ref": "#/components/schemas/collections"
},
"types": {
"$ref": "#/components/schemas/entity-type-collection-ref"
},
"configuration": {
"$ref": "#/components/schemas/configuration-ref"
},
"operations": {
"$ref": "#/components/schemas/operations"
}
}
},
"collections": {
"type": "object",
"required": [
"entities"
],
"properties": {
"entities": {
"$ref": "#/components/schemas/entity-collection-ref"
}
},
"additionalProperties": {
"$ref": "#/components/schemas/entity-collection-ref"
}
},
"operations": {
"type": "array",
"items": {
"$ref": "#/components/schemas/operation"
}
},
"configuration-ref": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"address": {
"type": "string",
"format": "uri-reference"
}
}
},
"entity-collection-ref": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"address": {
"type": "string",
"format": "uri-reference"
}
}
},
"entity-type-collection-ref": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"address": {
"type": "string",
"format": "uri-reference"
}
}
},
"operation": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"address": {
"type": "string",
"format": "uri-reference"
},
"description": {
"$ref": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v3.0/schema.json#/definitions/Operation"
}
}
},
"entity-collection": {
"type": "array",
"items": {
"$ref": "#/components/schemas/entity"
}
},
"entity": {
"type": "object",
"required" : ["id", "type", "typeversion", "tag", "self"],
"properties": {
"id": {
"type": "string",
"description": "Identifier. Must be set to null during creation, required otherwise."
},
"type": {
"type": "string",
"description": "Entity type. May be an archetype reference during creation."
},
"typeversion": {
"type": "string",
"description": "Referenced entity type version."
},
"label": {
"type": "string",
"description": "Descriptive label"
},
"tag": {
"type": "string",
"description": "Version tag for concurrency control. Must be set to null during creation, required otherwise."
},
"self": {
"type": "string",
"format": "uri-reference",
"description": "Self management address."
},
"managementnode": {
"type": "string",
"format": "uri-reference",
"description": "Management node for internal structure of this entity"
}
}
},
"entity-type-collection": {
"type": "array",
"items": {
"$ref": "#/components/schemas/entity-type"
}
},
"entity-type": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Type name"
},
"version": {
"type": "string",
"description": "Version of this type"
},
"properties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/entity-property"
}
}
}
},
"entity-property": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Property name"
},
"amqptype": {
"type": "string",
"description": "AMQP data type"
},
"label": {
"type": "string",
"description": "Descriptive label"
}
}
}
}
},
"paths": {
"/$management": {
"description": "Management discovery endpoint. Might redirect to managemt node endpoint or return the discovery document.",
"get": {
"responses": {
"302": {
"description" : "Redirect to management node",
"headers": {
"Location": {
"description": "Management node address",
"schema": {
"type": "string"
}
}
}
},
"200": {
"description": "",
"content": {
"application/amqp-management+json;type=discovery-document": {
"schema": {
"$ref": "#/components/schemas/discovery-document"
}
},
"application/amqp-management+amqp;type=discovery-document": {
"schema": {
"$ref": "#/components/schemas/discovery-document"
}
}
}
}
}
}
},
"/{management-node}": {
"description": "Management node.",
"get": {
"responses": {
"200": {
"description": "",
"content": {
"application/amqp-management+json;type=discovery-document": {
"schema": {
"$ref": "#/components/schemas/discovery-document"
}
},
"application/amqp-management+amqp;type=discovery-document": {
"schema": {
"$ref": "#/components/schemas/discovery-document"
}
}
}
}
}
}
},
"/{entity-collection}": {
"description": "Entity collection. Referred to by the discovery document.",
"get": {
"description": "Returns a list of entities",
"parameters": [
{
"name": "$top",
"in": "query",
"required": false,
"description": "limits the enumeration to the given number of entities",
"allowEmptyValue": false,
"schema": {
"type": "integer"
}
},
{
"name": "$skip",
"in": "query",
"required": false,
"description": "skips the given numnber of entities",
"allowEmptyValue": false,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/amqp-management+json;type=entity-collection": {
"schema": {
"$ref": "#/components/schemas/entity-collection"
}
},
"application/amqp-management+amqp;type=entity-collection": {
"schema": {
"$ref": "#/components/schemas/entity-collection"
}
}
}
}
}
},
"post": {
"description": "Entity factory. Creates new entities given an entity description.",
"requestBody": {
"content": {
"application/amqp-management+json;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
},
"application/amqp-management+amqp;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
}
}
},
"responses": {
"201": {
"description": "Successful creation of a new entity",
"headers": {
"Location": {
"description": "Self management address of the created entity",
"schema": {
"type": "string"
}
}
},
"content": {
"application/amqp-management+json;type=entity-collection": {
"schema": {
"$ref": "#/components/schemas/entity-collection"
}
},
"application/amqp-management+amqp;type=entity-collection": {
"schema": {
"$ref": "#/components/schemas/entity-collection"
}
}
}
},
"400": {
"description": "Error creating entity"
},
"406": {
"description": "Content not acceptable"
},
"419": {
"description": "Conflict with existing entity"
}
}
}
},
"/{entity}": {
"get": {
"responses": {
"200": {
"description": "",
"content": {
"application/amqp-management+json;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
},
"application/amqp-management+amqp;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
}
}
}
}
},
"put": {
"requestBody": {
"content": {
"application/amqp-management+json;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
},
"application/amqp-management+amqp;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
}
}
},
"responses": {
"200": {
"description": "Successful update of entity",
"content": {
"application/amqp-management+json;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
},
"application/amqp-management+amqp;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
}
}
},
"400": {
"description": "Error creating entity"
},
"406": {
"description": "Content not acceptable"
},
"419": {
"description": "Conflict with existing entity"
}
}
},
"delete" : {
"parameters": [
{
"name": "tag",
"required": false,
"in" : "query",
"description": "Concurrency tag",
"allowEmptyValue": false,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/amqp-management+json;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
},
"application/amqp-management+amqp;type=entity": {
"schema": {
"$ref": "#/components/schemas/entity"
}
}
}
},
"responses": {
"204": {
"description": "Successful delete of entity"
},
"400": {
"description": "Error creating entity"
},
"406": {
"description": "Content not acceptable"
},
"419": {
"description": "Conflict with existing entity"
}
}
}
},
"/{type-collection}": {
"get": {
"responses": {
"default": {
"description": "",
"content": {
"application/amqp-management+json;type=entity-type-collection": {
"schema": {
"$ref": "#/components/schemas/entity-type-collection"
}
},
"application/amqp-management+amqp;type=entity-type-collection": {
"schema": {
"$ref": "#/components/schemas/entity-type-collection"
}
}
}
}
}
}
}
}
}
@clemensv
Copy link
Author

AMQP Management WD15 OpenAPI definition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment