{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "Internal deployment platform API.", "title": "GOS API", "contact": {}, "version": "1.0" }, "basePath": "/", "paths": { "/applications": { "get": { "produces": [ "application/json" ], "tags": [ "applications" ], "summary": "List applications", "parameters": [ { "type": "string", "description": "Application key", "name": "key", "in": "query" }, { "type": "string", "description": "Application name", "name": "name", "in": "query" }, { "type": "string", "description": "Application status", "name": "status", "in": "query" }, { "type": "integer", "description": "Page number, starts from 1", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size, max 100", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.ApplicationListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "applications" ], "summary": "Create application", "parameters": [ { "description": "Create application request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/httpapi.CreateApplicationRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/httpapi.ApplicationDataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } } } } }, "/applications/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "applications" ], "summary": "Get application by ID", "parameters": [ { "type": "string", "description": "Application ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.ApplicationDataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "applications" ], "summary": "Update application", "parameters": [ { "type": "string", "description": "Application ID", "name": "id", "in": "path", "required": true }, { "description": "Update application request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/httpapi.UpdateApplicationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.ApplicationDataResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "applications" ], "summary": "Delete application", "parameters": [ { "type": "string", "description": "Application ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } } } } } }, "definitions": { "httpapi.ApplicationDataResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpapi.ApplicationResponse" } } }, "httpapi.ApplicationListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpapi.ApplicationResponse" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" } } }, "httpapi.ApplicationResponse": { "type": "object", "properties": { "artifact_type": { "type": "string" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "key": { "type": "string" }, "language": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "string" }, "repo_url": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "httpapi.CreateApplicationRequest": { "type": "object", "properties": { "artifact_type": { "type": "string" }, "description": { "type": "string" }, "key": { "type": "string" }, "language": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "string" }, "repo_url": { "type": "string" }, "status": { "type": "string" } } }, "httpapi.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "httpapi.UpdateApplicationRequest": { "type": "object", "properties": { "artifact_type": { "type": "string" }, "description": { "type": "string" }, "key": { "type": "string" }, "language": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "string" }, "repo_url": { "type": "string" }, "status": { "type": "string" } } } } }