{ "swagger": 2, "info": { "title": "Panamax Agent/Adapter API", "description": "API Specifications to access Panamax Agent/Adapter features.", "version": "1.0.0", "license": { "name": "Apache License", "url": "https://github.com/CenturyLinkLabs/panamax-api/blob/master/LICENSE" } }, "host": "api.panamax.io", "schemes": [ "http" ], "basePath": "/", "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/metadata": { "get": { "summary": "Get Metadata for Agent", "description": "Get Metadata for Agent", "tags": [ "Metadata" ], "responses": { "200": { "description": "Metadata about Agent.", "schema": { "$ref": "Metadata" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "Error" } } } } }, "/deployments": { "get": { "summary": "List of all Deployments.", "description": "List of all Deployments.", "tags": [ "Deployments" ], "responses": { "200": { "description": "An array of Deployments.", "schema": { "type": "array", "items": { "$ref": "Deployment" } } }, "default": { "description": "Unexpected error", "schema": { "$ref": "Error" } } } }, "post": { "summary": "Creates a new Deployment", "description": "Creates a new Deployment", "tags": [ "Deployments" ], "parameters": [ { "name": "deployment_descriptor", "in": "body", "description": "Specifics of Deployment", "required": true, "schema": { "$ref": "DeploymentDescriptor" } } ], "responses": { "200": { "description": "Returns a Deployment", "schema": { "$ref": "Deployment" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "Error" } } } } }, "/deployments/{id}": { "get": { "summary": "Gets a Deployment", "description": "Returns a Deployment", "tags": [ "Deployments" ], "parameters": [ { "name": "id", "in": "path", "description": "ID of Deployment", "required": true, "type": "integer" } ], "responses": { "200": { "description": "Deployment data", "schema": { "$ref": "Deployments" } }, "default": { "description": "unexpected error", "schema": { "$ref": "Error" } } } }, "delete": { "summary": "Deletes a Deployment", "description": "Deletes a Deployment", "tags": [ "Deployments" ], "parameters": [ { "name": "id", "in": "path", "description": "ID of Deployment", "required": true, "type": "integer" } ], "responses": { "204": { "description": "No Content" }, "default": { "description": "unexpected error", "schema": { "$ref": "Error" } } } } }, "/deployments/{id}/redeploy": { "post": { "summary": "Redeploys a Deployment", "description": "Returns a Deployment", "tags": [ "Deployments" ], "parameters": [ { "name": "id", "in": "path", "description": "ID of Deployment", "required": true, "type": "integer" } ], "responses": { "200": { "description": "Returns a Deployment", "schema": { "$ref": "Deployment" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "Error" } } } } } }, "definitions": { "Deployments": { "properties": { "id": { "type": "integer", "description": "Unique identifier representing a Deployment." }, "name": { "type": "string", "description": "Name of the Deployment." }, "status": { "description": "Status of services in the Deployment.", "properties": { "services": { "type": "array", "description": "List of services in the deployment.", "items": { "properties": { "id": { "type": "string", "description": "Name of service" }, "actualState": { "type": "string", "description": "Actual status of service" } } } } } } } }, "Deployment": { "properties": { "id": { "type": "integer", "description": "Unique identifier representing a Deployment." }, "name": { "type": "string", "description": "Name of the Deployment." }, "template": { "type": "integer", "description": "Unique identifier representing the template used to create the deployment." }, "service_ids": { "type": "array", "description": "List of services in the deployment.", "items": { "type": "string" } } } }, "Metadata": { "description": "Metadata about Agent.", "properties": { "agent": { "properties": { "version": { "type": "string" } } }, "adapter": { "properties": { "version": { "type": "string" }, "type": { "type": "string" } } } } }, "DeploymentDescriptor": { "properties": { "override": { "properties": { "images": { "type": "array", "items": { "$ref": "OverrideImage" } }, "template": { "$ref": "DeployDescriptorTemplate" } } } } }, "OverrideImage": { "properties": { "name": { "type": "string", "description": "Name of the image." }, "description": { "type": "string", "description": "Brief description about the image." }, "expose": { "type": "array", "description": "An array of ports exposed by the image.", "items": { "type": "string" } }, "ports": { "description": "An array of port bindings exposed by the image.", "type": "array", "items": { "$ref": "Port" } }, "links": { "description": "An array of service links exposed by the image.", "type": "array", "items": { "$ref": "ServiceLink" } }, "volumes": { "description": "An array of volumes exposed by the image.", "type": "array", "items": { "$ref": "Volume" } }, "volumes_from": { "type": "array", "description": "An array of volumes mounted from other images.", "items": { "$ref": "Volume_From" } }, "command": { "type": "string", "description": "The command that will override the CMD value exposed by the image." }, "deployment": { "description": "Deployment specific data", "$ref": "OverrideDeployment" } }, "required": [ "name" ] }, "OverrideDeployment": { "description": "Deployment specific data.", "properties": { "count": { "type": "integer" } } }, "DeployDescriptorTemplate": { "properties": { "name": { "type": "string", "description": "Name of the template." }, "description": { "type": "string", "description": "Brief description about the template." }, "keywords": { "type": "string", "description": "A comma-delimted list of keywords that describe the template." }, "source": { "type": "string", "description": "The source repository where the template is stored." }, "type": { "type": "string", "description": "A type that describes the template." }, "image_count": { "type": "integer", "description": "The number of images referenced by the template." }, "documentation": { "type": "string", "description": "The documentation for the template. This supports the Markdown format." }, "images": { "type": "array", "description": "An array of images that make up the template.", "$ref": "DeployDescriptorImage" } } }, "DeployDescriptorImage": { "properties": { "category": { "type": "string", "description": "Category of the image." }, "name": { "type": "string", "description": "Name of the image." }, "source": { "type": "string", "description": "Source of the image from a Docker registry." }, "description": { "type": "string", "description": "Brief description about the image." }, "type": { "type": "string", "description": "A type that describes the image." }, "expose": { "type": "array", "description": "An array of ports exposed by the image.", "items": { "type": "string" } }, "ports": { "description": "An array of port bindings exposed by the image.", "type": "array", "items": { "$ref": "Port" } }, "links": { "description": "An array of service links exposed by the image.", "type": "array", "items": { "$ref": "ServiceLink" } }, "volumes": { "description": "An array of volumes exposed by the image.", "type": "array", "items": { "$ref": "Volume" } }, "volumes_from": { "type": "array", "description": "An array of volumes mounted from other images.", "items": { "$ref": "Volume_From" } }, "command": { "type": "string", "description": "The command that will override the CMD value exposed by the image." } }, "required": [ "name" ] }, "ServiceLink": { "description": "A hash of service links.", "properties": { "id": { "type": "string", "description": "The ID of the linked service." }, "service": { "type": "string", "description": "The name of the linked service." }, "alias": { "type": "string", "description": "The alias of the linked service." }, "errors": { "$ref": "Error" } }, "required": [ "service", "alias" ] }, "Port": { "description": "Port bindings", "properties": { "host_interface": { "type": "string", "format": "ipv4" }, "host_port": { "type": [ "integer", "string" ], "description": "The host port part of the port binding." }, "container_port": { "type": [ "integer", "string" ], "description": "The container port part of the port binding." }, "proto": { "type": "string", "enum": [ "UDP", "TCP" ] } }, "required": [ "container_port" ] }, "Volume": { "description": "Volume information.", "properties": { "host_path": { "type": "string", "description": "The host path of the volume." }, "container_path": { "type": "string", "description": "The container path volume." } }, "required": [ "container_path" ] }, "Volume_From": { "description": "Volume mounted from elsewhere.", "properties": { "service": { "type": "string" } }, "required": [ "service" ] }, "Environment": { "description": "Environment variables data.", "properties": { "variable": { "type": "string", "description": "The name of the environment variable." }, "value": { "type": "string", "description": "The value of the environment variable." } }, "required": [ "variable", "value" ] }, "Error": { "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "fields": { "type": "string" } } } } }