swagger: '2.0' info: description: | Application deployment and management should be automated, auditable, and easy to understand and that\'s what beetle tries to achieve in a simple manner. Beetle automates the deployment and rollback of your applications in a multi-cluster, multi-namespaces kubernetes environments. Easy to integrate with through API endpoints & webhooks to fit a variety of workflows. version: 1.0.3 title: Beetle contact: email: hello@clivern.com license: name: MIT url: 'https://github.com/Clivern/Beetle/blob/main/LICENSE' host: beetle.yourcompany.com basePath: / schemes: - https - http paths: /_health: get: tags: - Healthcheck summary: Get system health status produces: - application/json parameters: [] responses: '200': description: system healthy schema: $ref: '#/definitions/healthResponse' '500': description: system is down schema: $ref: '#/definitions/healthResponse' /_ready: get: tags: - Readiness summary: Get system readiness produces: - application/json parameters: [] responses: '200': description: system ready to accept traffic schema: $ref: '#/definitions/healthResponse' '500': description: system not ready to accept traffic schema: $ref: '#/definitions/healthResponse' /metrics: get: tags: - Metrics summary: Get metrics for prometheus produces: - text/plain parameters: [] responses: '200': description: system metrics '500': description: Internal server error /api/v1/cluster: get: tags: - Cluster summary: Get clusters list description: '' operationId: getClusters produces: - application/json responses: '200': description: successful operation schema: $ref: '#/definitions/Clusters' '400': description: Invalid request '404': description: Resource not found '500': description: Internal server error security: - api_key: [] '/api/v1/cluster/{cn}': get: tags: - Cluster summary: Get cluster by name description: '' operationId: getClusterByName produces: - application/json parameters: - in: path name: cn description: The name of the cluster required: true type: string responses: '200': description: successful operation schema: $ref: '#/definitions/Cluster' '400': description: Invalid request '404': description: Resource not found '500': description: Internal server error security: - api_key: [] '/api/v1/cluster/{cn}/namespace': get: tags: - Namespace summary: Get namespaces list description: '' operationId: getNamespaces produces: - application/json parameters: - in: path name: cn description: The name of the cluster required: true type: string responses: '200': description: successful operation schema: $ref: '#/definitions/Namespaces' '400': description: Invalid request '404': description: Resource not found '500': description: Internal server error security: - api_key: [] '/api/v1/cluster/{cn}/namespace/{ns}': get: tags: - Namespace summary: Get cluster namespace by name description: '' operationId: getClusterNamespaceByName produces: - application/json parameters: - in: path name: cn description: The name of the cluster required: true type: string - in: path name: ns description: The name of the cluster namespace required: true type: string responses: '200': description: successful operation schema: $ref: '#/definitions/Namespace' '400': description: Invalid request '404': description: Resource not found '500': description: Internal server error security: - api_key: [] '/api/v1/cluster/{cn}/namespace/{ns}/app': get: tags: - Application summary: Get applications list description: '' operationId: getApplications produces: - application/json parameters: - in: path name: cn description: The name of the cluster required: true type: string - in: path name: ns description: The name of the cluster namespace required: true type: string responses: '200': description: successful operation schema: $ref: '#/definitions/Applications' '400': description: Invalid request '404': description: Resource not found '500': description: Internal server error security: - api_key: [] '/api/v1/cluster/{cn}/namespace/{ns}/app/{id}': get: tags: - Application summary: Get application by id description: '' operationId: getApplicationById produces: - application/json parameters: - in: path name: cn description: The name of the cluster required: true type: string - in: path name: ns description: The name of the cluster namespace required: true type: string - in: path name: id description: The application id required: true type: string responses: '200': description: successful operation schema: $ref: '#/definitions/Application' '400': description: Invalid request '404': description: Resource not found '500': description: Internal server error security: - api_key: [] post: tags: - Application summary: Create a deployment request description: '' operationId: createDeploymentRequest produces: - application/json parameters: - in: path name: cn description: The name of the cluster required: true type: string - in: path name: ns description: The name of the cluster namespace required: true type: string - in: path name: id description: The application id required: true type: string - in: body name: body description: The deployment request required: true schema: $ref: '#/definitions/DeploymentRequest' responses: '202': description: successful operation schema: $ref: '#/definitions/Job' '400': description: Invalid request '404': description: Resource not found '500': description: Internal server error security: - api_key: [] /api/v1/job: get: tags: - Job summary: Get jobs list description: '' operationId: getJobs produces: - application/json responses: '200': description: successful operation schema: $ref: '#/definitions/Jobs' '400': description: Invalid request '500': description: Internal server error security: - api_key: [] '/api/v1/job/{uuid}': get: tags: - Job summary: Get a job by UUID description: '' operationId: getJobByUUID produces: - application/json parameters: - in: path name: uuid description: The UUID of the job required: true type: string responses: '200': description: successful operation schema: $ref: '#/definitions/Job' '400': description: Invalid request '404': description: Job not found '500': description: Internal server error security: - api_key: [] delete: tags: - Job summary: Delete a job by UUID description: '' operationId: deleteJobByUUID produces: - application/json parameters: - in: path name: uuid description: The UUID of the job required: true type: string responses: '204': description: successful operation '400': description: Invalid request '404': description: Job not found '500': description: Internal server error security: - api_key: [] securityDefinitions: api_key: type: apiKey name: X-API-KEY in: header definitions: healthResponse: type: object properties: status: type: string Cluster: type: object properties: name: type: string health: type: boolean Clusters: type: object properties: clusters: type: array items: $ref: '#/definitions/Cluster' Namespace: type: object properties: name: type: string uid: type: string status: type: string Namespaces: type: object properties: namespaces: type: array items: $ref: '#/definitions/Namespace' Job: type: object properties: id: type: integer format: int64 uuid: type: string payload: type: string status: type: string type: type: string result: type: string retry: type: integer format: int64 parent: type: integer format: int64 run_at: type: string created_at: type: string updated_at: type: string Jobs: type: object properties: namespaces: type: array items: $ref: '#/definitions/Job' Applications: type: object properties: namespaces: type: array items: $ref: '#/definitions/Application' Application: type: object properties: id: type: string name: type: string format: type: string containers: type: array items: $ref: '#/definitions/Container' Container: type: object properties: name: type: string image: type: string version: type: string deployment: $ref: '#/definitions/Deployment' Deployment: type: object properties: name: type: string uid: type: string DeploymentRequest: type: object properties: version: type: string strategy: type: string externalDocs: description: Find out more about beetle url: 'https://github.com/Clivern/Beetle'