{ "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" } } } } }, "/applications/{id}/pipeline-bindings": { "get": { "produces": [ "application/json" ], "tags": [ "pipeline-bindings" ], "summary": "List pipeline bindings for application", "parameters": [ { "type": "string", "description": "Application ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Binding type: ci/cd", "name": "binding_type", "in": "query" }, { "type": "string", "description": "Provider: jenkins/argocd", "name": "provider", "in": "query" }, { "type": "string", "description": "Binding status", "name": "status", "in": "query" }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.PipelineBindingListResponse" } }, "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" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "pipeline-bindings" ], "summary": "Create pipeline binding for application", "parameters": [ { "type": "string", "description": "Application ID", "name": "id", "in": "path", "required": true }, { "description": "Create binding request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/httpapi.CreateBindingRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/httpapi.PipelineBindingDataResponse" } }, "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" } } } } }, "/jenkins/pipelines/sync": { "post": { "produces": [ "application/json" ], "tags": [ "pipelines" ], "summary": "Sync pipelines from Jenkins", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.SyncPipelinesResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } } } } }, "/pipeline-bindings/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "pipeline-bindings" ], "summary": "Get pipeline binding by ID", "parameters": [ { "type": "string", "description": "Binding ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.PipelineBindingDataResponse" } }, "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": [ "pipeline-bindings" ], "summary": "Update pipeline binding", "parameters": [ { "type": "string", "description": "Binding ID", "name": "id", "in": "path", "required": true }, { "description": "Update binding request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/httpapi.UpdateBindingRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.PipelineBindingDataResponse" } }, "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" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "pipeline-bindings" ], "summary": "Delete pipeline binding", "parameters": [ { "type": "string", "description": "Binding 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" } } } } }, "/pipelines": { "get": { "produces": [ "application/json" ], "tags": [ "pipelines" ], "summary": "List pipelines", "parameters": [ { "type": "string", "description": "Pipeline name", "name": "name", "in": "query" }, { "type": "string", "description": "Provider, default jenkins", "name": "provider", "in": "query" }, { "type": "string", "description": "Pipeline status", "name": "status", "in": "query" }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.PipelineListResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/httpapi.ErrorResponse" } } } } }, "/pipelines/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "pipelines" ], "summary": "Get pipeline by ID", "parameters": [ { "type": "string", "description": "Pipeline ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.PipelineDataResponse" } }, "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" } } } } }, "/pipelines/{id}/verify": { "post": { "produces": [ "application/json" ], "tags": [ "pipelines" ], "summary": "Verify Jenkins pipeline availability", "parameters": [ { "type": "string", "description": "Pipeline ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/httpapi.VerifyPipelineResponse" } }, "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.CreateBindingRequest": { "type": "object", "properties": { "binding_type": { "type": "string" }, "external_ref": { "type": "string" }, "name": { "type": "string" }, "pipeline_id": { "type": "string" }, "provider": { "type": "string" }, "status": { "type": "string" }, "trigger_mode": { "type": "string" } } }, "httpapi.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } } }, "httpapi.PipelineBindingDataResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpapi.PipelineBindingResponse" } } }, "httpapi.PipelineBindingListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpapi.PipelineBindingResponse" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" } } }, "httpapi.PipelineBindingResponse": { "type": "object", "properties": { "application_id": { "type": "string" }, "application_name": { "type": "string" }, "binding_type": { "type": "string" }, "created_at": { "type": "string" }, "external_ref": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "pipeline_id": { "type": "string" }, "provider": { "type": "string" }, "status": { "type": "string" }, "trigger_mode": { "type": "string" }, "updated_at": { "type": "string" } } }, "httpapi.PipelineDataResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/httpapi.PipelineResponse" } } }, "httpapi.PipelineListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/httpapi.PipelineResponse" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" } } }, "httpapi.PipelineResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "credential_ref": { "type": "string" }, "default_branch": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "job_full_name": { "type": "string" }, "job_name": { "type": "string" }, "job_url": { "type": "string" }, "last_synced_at": { "type": "string" }, "last_verified_at": { "type": "string" }, "provider": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "httpapi.SyncPipelinesResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/usecase.SyncPipelinesOutput" } } }, "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" } } }, "httpapi.UpdateBindingRequest": { "type": "object", "properties": { "external_ref": { "type": "string" }, "name": { "type": "string" }, "pipeline_id": { "type": "string" }, "provider": { "type": "string" }, "status": { "type": "string" }, "trigger_mode": { "type": "string" } } }, "httpapi.VerifyPipelineResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "job_name": { "type": "string" }, "job_url": { "type": "string" }, "pipeline": { "$ref": "#/definitions/httpapi.PipelineResponse" }, "verified": { "type": "boolean" } } } } }, "usecase.SyncPipelinesOutput": { "type": "object", "properties": { "created": { "type": "integer" }, "skipped": { "type": "integer" }, "total": { "type": "integer" }, "updated": { "type": "integer" } } } } }