{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Blackbeard API", "description": "A REST API served from Blackbeard. See https://github.com/Meetic/blackbeard", "contact": { "name": "Sébastien Le gall", "url": "http://le-gall.bzh", "email": "seb@le-gall.net" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, "basePath": "/", "schemes": [ "http" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ { "name": "Namespaces" }, { "name": "Monitoring" } ], "paths": { "/inventories/{namespace}": { "get": { "tags": [ "Namespaces" ], "description": "Read inventory file for a given namespace and return it as a json object.", "summary": "Return inventory for the given namespace", "operationId": "get-inventory", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "namespace", "in": "path", "description": "Namespace name", "required": true, "type": "string" } ], "responses": { "200": { "description": "The inventory", "schema": { "$ref": "#/definitions/blackbeard.Inventory" } }, "404": { "description": "Can not find the namespace/inventory", "schema": { "type": "string" } }, "500": { "description": "Something went wrong when reading the inventory", "schema": { "type": "string" } } } }, "put": { "tags": [ "Namespaces" ], "description": "Update the inventory for the given namespace. If the namespace field is different from the namespace passed as query param, it will also rename the namespace.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Update the inventory", "operationId": "update-inventory", "parameters": [ { "name": "namespace", "in": "path", "description": "Namespace name", "required": true, "type": "string" }, { "description": "Inventory", "name": "Inventory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/blackbeard.Inventory" } } ], "responses": { "204": { "description": "Sucess" }, "400": { "description": "The inventory is malformed", "schema": { "type": "string" } }, "422": { "description": "The inventory could not be created.", "schema": { "type": "string" } } } }, "delete": { "tags": [ "Namespaces" ], "description": "Delete inventory file, configs and namespace for the given namespace", "summary": "Delete inventory file and associated namespace", "operationId": "delete-inventory", "produces": [ "application/json" ], "parameters": [ { "name": "namespace", "in": "path", "description": "Namespace name", "required": true, "type": "string" } ], "responses": { "204": { "description": "Deletion successfully executed" }, "500": { "description": "Something went wrong when deleting the inventory, the config files or the namespace", "schema": { "type": "string" } } } } }, "/inventories/{namespace}/status": { "get": { "tags": [ "Namespaces" ], "description": "Read the namespace status : either ready or not ready", "summary": "Return the namespace status", "operationId": "get-inventory-status", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "namespace", "in": "path", "description": "Namespace name", "required": true, "type": "string" } ], "responses": { "200": { "description": "The status", "schema": { "$ref": "#/definitions/blackbeard.Inventory.Status" } }, "404": { "description": "Can not find the namespace/inventory", "schema": { "type": "string" } }, "500": { "description": "Something went wrong when reading the inventory", "schema": { "type": "string" } } } } }, "/inventories/{namespace}/reset": { "post": { "tags": [ "Namespaces" ], "description": "Reset a namespace to defaults. This will reset the inventory and apply the changes to kubernetes.", "summary": "Reset a namespace to defaults", "consumes": [ "application/json" ], "produces": [ "application/json" ], "operationId": "reset-inventory", "parameters": [ { "name": "namespace", "in": "path", "description": "Namespace name", "required": true, "type": "string" } ], "responses": { "200": { "description": "Success" }, "400": { "description": "The given inventory has no associated namespace", "schema": { "type": "string" } }, "422": { "description": "The inventory could not be created due to communication with kubernetes", "schema": { "type": "string" } } } } }, "/inventories": { "post": { "tags": [ "Namespaces" ], "description": "Create an inventory for the given namespace. This will also create the inventory file and the associated namespace.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Create an inventory", "operationId": "create-inventory", "parameters": [ { "description": "Namespace", "name": "namespace", "in": "body", "required": true, "schema": { "$ref": "#/definitions/http.createQuery" } } ], "responses": { "200": { "description": "The inventory", "schema": { "$ref": "#/definitions/blackbeard.Inventory" } }, "400": { "description": "The inventory already exists", "schema": { "type": "string" } }, "422": { "description": "The inventory could not be created due to communication with kubernetes", "schema": { "type": "string" } }, "500": { "description": "Something went wrong checking for existing inventories", "schema": { "type": "string" } } } }, "get": { "tags": [ "Namespaces" ], "description": "Read all inventory files and return them as an array", "produces": [ "application/json" ], "summary": "Return the list of existing inventories", "operationId": "list-inventories", "responses": { "200": { "description": "List of inventories", "schema": { "type": "array", "items": { "$ref": "#/definitions/blackbeard.Inventory" } } }, "500": { "description": "Impossible to read the inventory list", "schema": { "type": "string" } } } } }, "/defaults": { "get": { "tags": [ "Namespaces" ], "description": "Return the content of the defaults.json file in the used playbook.", "produces": [ "application/json" ], "summary": "Get default value for an inventory", "operationId": "get-defaults", "responses": { "200": { "description": "The default inventory", "schema": { "$ref": "#/definitions/blackbeard.Inventory" } }, "404": { "description": "Defaults file not found", "schema": { "type": "string" } } } } }, "/inventories/{namespace}/services": { "get": { "tags": [ "Namespaces" ], "description": "Returns the list of exposed services (NodePort and ingress configuration) of a given inventory", "summary": "Returns the list of exposed services", "operationId": "get-services", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "namespace", "in": "path", "description": "Namespace name", "required": true, "type": "string" } ], "responses": { "200": { "description": "The inventory", "schema": { "type": "array", "items": { "$ref": "#/definitions/blackbeard.Service" } } }, "404": { "description": "Can not find the namespace/inventory", "schema": { "type": "string" } }, "500": { "description": "Something went wrong when reading the namespace services", "schema": { "type": "string" } } } } }, "/resource/{namespace}/job/{resource}": { "delete": { "tags": [ "Namespaces" ], "description": "Delete a namespace job", "summary": "Delete a job in a namespace, this will", "operationId": "delete-namespace-job", "parameters": [ { "name": "namespace", "in": "path", "description": "Namespace name", "required": true, "type": "string" }, { "name": "resource", "in": "path", "description": "Resource name", "required": true, "type": "string" } ], "produces": [ "application/json" ], "responses": { "204": { "description": "Deletion successfully executed" }, "500": { "description": "Something went wrong when deleting the resource", "schema": { "type": "string" } } } } }, "/version": { "get": { "tags": [ "Monitoring" ], "description": "Return blackbeard, kubernetes and kubectl version", "summary": "Return blackbeard, kubernetes and kubectl version", "operationId": "get-version", "consumes": [ "application/json" ], "produces": [ "application/json" ], "responses": { "200": { "description": "Version", "schema": { "$ref": "#/definitions/blackbeard.Version" } } } } }, "/ready": { "get": { "tags": [ "Monitoring" ], "description": "Check if http server is ready to handle traffic", "summary": "Check if http server is ready", "operationId": "get-ready", "consumes": [ "application/json" ], "produces": [ "application/json" ], "responses": { "200": { "description": "Ready" } } } }, "/alive": { "get": { "tags": [ "Monitoring" ], "description": "Check if http server is alive and can handle traffic", "summary": "Check if http server is alive", "operationId": "get-alive", "consumes": [ "application/json" ], "produces": [ "application/json" ], "responses": { "200": { "description": "Alive" } } } } }, "definitions": { "blackbeard.Inventory": { "type": "object", "properties": { "Namespace": { "type": "string" }, "Values": { "type": "object" } } }, "blackbeard.Inventory.Status": { "type": "object", "properties": { "status": { "type": "string" } } }, "blackbeard.Service": { "type": "object", "properties": { "name": { "type": "string" }, "port": { "type": "array", "items": { "$ref": "#/definitions/service.Port" } }, "addr": { "type": "string" } } }, "blackbeard.Version": { "type": "object", "properties": { "blackbeard": { "type": "string" }, "kubernetes": { "type": "string" }, "kubectl": { "type": "string" } } }, "service.Port": { "type": "object", "properties": { "port": { "type": "integer" }, "exposedPort": { "type": "integer" } } }, "http.createQuery": { "type": "object", "properties": { "Namespace": { "type": "string" } } } } }