diff --git a/specs/app-labels.yaml b/specs/app-labels.yaml index df657b401c..6ed965f725 100644 --- a/specs/app-labels.yaml +++ b/specs/app-labels.yaml @@ -2,12 +2,32 @@ openapi: "3.0.0" info: version: 1.0.0 title: Devtron Labs + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: http://localhost/orchestrator + description: Local development server +security: + - ApiKeyAuth: [] paths: /orchestrator/app/labels/list: get: - description: this api will return all the labels available in database. + summary: List all app labels + description: This API will return all the labels available in the database. + operationId: listAppLabels + security: + - ApiKeyAuth: [] parameters: [ ] responses: + '400': + description: Bad request + '401': + description: Unauthorized + '404': + description: Not found + '500': + description: Internal server error '200': description: list response content: @@ -39,7 +59,11 @@ paths: /orchestrator/app/meta/info/{appId}: get: - description: application basic info, projects and labels + summary: Get application meta info + description: Application basic info, projects and labels + operationId: getAppMetaInfo + security: + - ApiKeyAuth: [] parameters: - name: appId in: path @@ -65,6 +89,14 @@ paths: type: object description: meta info project name and labels $ref: '#/components/schemas/AppMetaInfo' + '400': + description: Bad request + '401': + description: Unauthorized + '404': + description: Not found + '500': + description: Internal server error default: description: unexpected error content: @@ -73,7 +105,11 @@ paths: $ref: '#/components/schemas/ErrorResponse' /orchestrator/helm/meta/info/{appId}: get: - description: application info for all types of helm apps + summary: Get Helm application meta info + description: Application info for all types of Helm apps + operationId: getHelmAppMetaInfo + security: + - ApiKeyAuth: [] parameters: - name: appId in: path @@ -98,9 +134,28 @@ paths: type: object description: meta info project name and labels $ref: '#/components/schemas/AppMetaInfo' + '400': + description: Bad request + '401': + description: Unauthorized + '404': + description: Not found + '500': + description: Internal server error + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' # components mentioned below components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization schemas: AppLabel: type: object @@ -167,35 +222,36 @@ components: description: app created by ErrorResponse: - required: - - code - - status + type: object properties: code: type: integer format: int32 - description: Error code status: type: string - description: Error message + result: + type: object + nullable: true errors: type: array - description: errors items: - $ref: '#/components/schemas/Error' + type: object + properties: + userMessage: + type: string + nullable: true + internalMessage: + type: string + nullable: true Error: required: - code - - status + - message properties: code: type: integer - format: int32 - description: Error internal code - internalMessage: - type: string - description: Error internal message - userMessage: + description: Error code + message: type: string - description: Error user message \ No newline at end of file + description: Error message diff --git a/specs/application.yaml b/specs/application.yaml index 5fc4434f7f..6cab55e0ac 100644 --- a/specs/application.yaml +++ b/specs/application.yaml @@ -2,10 +2,22 @@ openapi: "3.0.0" info: version: 1.0.0 title: Devtron Labs + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: https://api.yourdomain.com + description: Production server +security: + - ApiKeyAuth: [] paths: /orchestrator/app: post: + summary: Create a new application + operationId: createApplication description: create new application + security: + - ApiKeyAuth: [] requestBody: description: json as request body required: true @@ -38,6 +50,12 @@ paths: required: - id - $ref: '#/components/schemas/App' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' default: description: unexpected error content: @@ -46,7 +64,11 @@ paths: $ref: '#/components/schemas/ErrorResponse' /orchestrator/app/edit: post: + summary: Update application projects and labels + operationId: updateApplicationProjectsAndLabels description: update application projects and labels + security: + - ApiKeyAuth: [] requestBody: description: json as request body required: true @@ -79,6 +101,12 @@ paths: required: - id - $ref: '#/components/schemas/App' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' default: description: unexpected error content: @@ -88,7 +116,11 @@ paths: /orchestrator/app/list: post: + summary: List applications + operationId: listApplications description: app listing, collection of deployed applications or undeployed or incomplete configured apps. + security: + - ApiKeyAuth: [] requestBody: description: json as request body required: true @@ -129,6 +161,12 @@ paths: type: object description: deployment group $ref: '#/components/schemas/DeploymentGroup' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' default: description: unexpected error content: @@ -138,7 +176,11 @@ paths: /orchestrator/app/edit/projects: post: + summary: Update project for app + operationId: updateProjectForApp description: update project for app + security: + - ApiKeyAuth: [] requestBody: description: json as request body required: true @@ -163,7 +205,12 @@ paths: type: object description: string $ref: '#/components/schemas/AppProjectUpdateRequest' - + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' default: description: unexpected error content: @@ -172,6 +219,11 @@ paths: $ref: '#/components/schemas/ErrorResponse' # components mentioned below components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization schemas: AppLabel: type: object @@ -363,35 +415,36 @@ components: ErrorResponse: - required: - - code - - status + type: object properties: code: type: integer format: int32 - description: Error code status: type: string - description: Error message + result: + type: object + nullable: true errors: type: array - description: errors items: - $ref: '#/components/schemas/Error' + type: object + properties: + userMessage: + type: string + nullable: true + internalMessage: + type: string + nullable: true Error: required: - code - - status + - message properties: code: type: integer - format: int32 - description: Error internal code - internalMessage: - type: string - description: Error internal message - userMessage: + description: Error code + message: type: string - description: Error user message \ No newline at end of file + description: Error message diff --git a/specs/applisting.yaml b/specs/applisting.yaml index c888185926..3cf221f4f4 100644 --- a/specs/applisting.yaml +++ b/specs/applisting.yaml @@ -2,9 +2,19 @@ openapi: "3.0.0" info: version: 1.0.0 title: Devtron Labs + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: https://api.yourdomain.com + description: Production server +security: + - ApiKeyAuth: [] paths: /orchestrator/app/autocomplete: get: + summary: List application autocomplete + operationId: listAppAutocomplete description: list of namespaces group by clusters parameters: - in: query @@ -39,8 +49,12 @@ paths: result: type: array description: app list - items: - $ref: '#/components/schemas/App' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' default: description: unexpected error content: @@ -50,46 +64,43 @@ paths: # components mentioned below components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization schemas: - App: - type: object - properties: - id: - type: integer - description: app id - name: - type: string - description: app name ErrorResponse: - required: - - code - - status + type: object properties: code: type: integer format: int32 - description: Error code status: type: string - description: Error message + result: + type: object + nullable: true errors: type: array - description: errors items: - $ref: '#/components/schemas/Error' + type: object + properties: + userMessage: + type: string + nullable: true + internalMessage: + type: string + nullable: true Error: required: - code - - status + - message properties: code: type: integer - format: int32 - description: Error internal code - internalMessage: - type: string - description: Error internal message - userMessage: + description: Error code + message: type: string - description: Error user message \ No newline at end of file + description: Error message diff --git a/specs/charts.yaml b/specs/charts.yaml index ac17859e7e..64ca3dfe8a 100644 --- a/specs/charts.yaml +++ b/specs/charts.yaml @@ -2,10 +2,22 @@ openapi: "3.0.0" info: version: 1.0.0 title: Devtron Labs + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: https://api.yourdomain.com + description: Production server +security: + - ApiKeyAuth: [] paths: /orchestrator/app-store/installed-app: get: + summary: List deployed charts + operationId: listDeployedCharts description: deployed chart listing, with search filters + security: + - ApiKeyAuth: [] parameters: - name: envs in: query @@ -71,6 +83,12 @@ paths: description: deployed chart listing, with search filters items: $ref: '#/components/schemas/ChartInfo' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' default: description: unexpected error content: @@ -79,18 +97,24 @@ paths: $ref: '#/components/schemas/ErrorResponse' /orchestrator/app-store/installed-app/notes: get: + summary: Fetch notes.txt for deployed helm charts + operationId: fetchNotesTxt description: Used to fetch notes.txt for helm charts deployed via gitOps + security: + - ApiKeyAuth: [] parameters: - name: env-id in: query description: it is an environment id of app required: true - type: integer + schema: + type: integer - name: installed-app-id in: query description: it is a installed application id required: true - type: integer + schema: + type: integer responses: '200': description: if it is able to fetch the notes.txt then status will be ok @@ -101,6 +125,12 @@ paths: notes: type: string description: it will provide notes + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' '500': description: error while fetching notes.txt @@ -108,6 +138,11 @@ paths: # components mentioned below components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization schemas: ChartInfo: type: object @@ -169,35 +204,36 @@ components: description: is deprecated or not ErrorResponse: - required: - - code - - status + type: object properties: code: type: integer format: int32 - description: Error code status: type: string - description: Error message + result: + type: object + nullable: true errors: type: array - description: errors items: - $ref: '#/components/schemas/Error' + type: object + properties: + userMessage: + type: string + nullable: true + internalMessage: + type: string + nullable: true Error: required: - code - - status + - message properties: code: type: integer - format: int32 - description: Error internal code - internalMessage: - type: string - description: Error internal message - userMessage: + description: Error code + message: type: string - description: Error user message \ No newline at end of file + description: Error message diff --git a/specs/jobs.yaml b/specs/jobs.yaml index 635136ad5a..4d374cf6ac 100644 --- a/specs/jobs.yaml +++ b/specs/jobs.yaml @@ -1,95 +1,141 @@ openapi: "3.0.0" info: - title: Jobs - version: "1.0" + version: 1.0.0 + title: Devtron Labs + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: https://api.yourdomain.com + description: Production server + - url: http://localhost/orchestrator + description: Local development server + paths: /orchestrator/job: post: - description: Create and clones a job + summary: Create or clone a job + description: Create and clone a job + operationId: createOrCloneJob + security: + - ApiKeyAuth: [] requestBody: required: true content: - application/json: - schema: - items: - $ref: "#/components/schemas/CreateJob" + application/json: + schema: + $ref: "#/components/schemas/CreateJob" responses: - "200 OK": + "200": description: Used to give response once a job is created content: application/json: schema: $ref: "#/components/schemas/ActionResponse" + "400": + description: Bad request + "401": + description: Unauthorized + "500": + description: Internal server error /orchestrator/job/list: post: + summary: List jobs description: Get the list of all the jobs by applying filter + operationId: listJobs + security: + - ApiKeyAuth: [] requestBody: required: true content: application/json: schema: - items: - $ref: "#/components/schemas/JobList" - response: - description: Used to give response of list of jobs - content: - application/json: - schema: - items: + $ref: "#/components/schemas/JobList" + responses: + "200": + description: Used to give response of list of jobs + content: + application/json: + schema: $ref: "#/components/schemas/JobListResponse" + "400": + description: Bad request + "401": + description: Unauthorized + "500": + description: Internal server error /orchestrator/job/ci-pipeline/list/{jobId}: get: + summary: Get job CI pipeline list description: fetch details of job ci-pipelines for the overview page + operationId: getJobCiPipelineList + security: + - ApiKeyAuth: [] parameters: - name: jobId in: path required: true schema: type: integer -#components + responses: + "200": + description: Job CI pipeline list + "400": + description: Bad request + "401": + description: Unauthorized + "500": + description: Internal server error + components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization schemas: CreateJob: type: object properties: - appName: - type: string - description: Used to give the name of the job - example: "my-job-1" - isJob: - type: boolean - description: States whether its a job or an app - example: true - teamId: - type: integer - description: Used to give team id - example: 1 - templateId: - type: integer - description: Used to give the id of the job it wants to clone - example: 18 - labels: - type: []label - label: - key: - type: string - example: "hello" - value: - type: string - example: "world" - propogate: - type: bool - example: false - description: - type: string - description: Used to give the description of the job once it is made. - example: "This is my first Job" + appName: + type: string + description: Used to give the name of the job + example: "my-job-1" + isJob: + type: boolean + description: States whether its a job or an app + example: true + teamId: + type: integer + description: Used to give team id + example: 1 + templateId: + type: integer + description: Used to give the id of the job it wants to clone + example: 18 + labels: + type: array + items: + type: object + properties: + key: + type: string + example: "hello" + value: + type: string + example: "world" + propogate: + type: boolean + example: false + description: + type: string + description: Used to give the description of the job once it is made. + example: "This is my first Job" ActionResponse: - name: result type: object properties: id: - type: integer + type: integer description: Used to give the id of job once its created example: 25 appName: @@ -97,47 +143,38 @@ components: description: Used to give the name of job once its created example: "my-job-1" material: - type: []gitMaterial - gitMaterial: - name: - type: string - url: - type: string - id: - type: integer - gitProviderId: - type: integer - checkoutPath: - type: string - fetchSubmodules: - type: bool - isUsedInCiConfig: - type: bool - teamId: - type: integer - description: Used to give the team id - example: 1 - templateId: - type: integer - description: Used to give the templateId - example: 0 - description: - type: string - description: Used to give the description of the job once it is made. - example: "This is my first Job" - isJob: - type: boolean - description: used to tell whether it is a job or an app - example: true + type: array + items: + $ref: '#/components/schemas/gitMaterial' + teamId: + type: integer + description: Used to give the team id + example: 1 + templateId: + type: integer + description: Used to give the templateId + example: 0 + description: + type: string + description: Used to give the description of the job once it is made. + example: "This is my first Job" + isJob: + type: boolean + description: used to tell whether it is a job or an app + example: true JobList: type: object properties: teams: - type: [] integer + type: array + items: + type: integer description: used to give the project id example: [1,2] appStatuses: - type: [] string + type: array + items: + type: string description: used to give the filter of app ci-build status example: ["Succeeded", "Starting"] sortBy: @@ -161,29 +198,55 @@ components: type: object properties: jobContainers: - type: [] jobContainer - jobContainer: - properties: - jobId: - type: integer - jobName: - type: string - description: - type: string - ciPipelines: - type: []jobCiPipeline - jobCiPipeline: - properties: - ciPipelineId: - type: integer - status: - type: string - lastRunAt: - type: time.Time - lastSuccessAt: - type: time.Time + type: array + items: + $ref: '#/components/schemas/jobContainer' jobCount: type: integer +# Add missing schemas for gitMaterial, jobContainer, and jobCiPipeline + gitMaterial: + type: object + properties: + name: + type: string + url: + type: string + id: + type: integer + gitProviderId: + type: integer + checkoutPath: + type: string + fetchSubmodules: + type: boolean + isUsedInCiConfig: + type: boolean + jobContainer: + type: object + properties: + jobId: + type: integer + jobName: + type: string + description: + type: string + ciPipelines: + type: array + items: + $ref: '#/components/schemas/jobCiPipeline' + jobCiPipeline: + type: object + properties: + ciPipelineId: + type: integer + status: + type: string + lastRunAt: + type: string + format: date-time + lastSuccessAt: + type: string + format: date-time diff --git a/specs/swagger/openapi.yaml b/specs/swagger/openapi.yaml index daf9095a33..e95b7e567e 100644 --- a/specs/swagger/openapi.yaml +++ b/specs/swagger/openapi.yaml @@ -2,10 +2,28 @@ openapi: 3.0.0 info: version: 1.0.0 title: Common Devtron automation APIs + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html servers: - url: http://localhost/orchestrator description: Local development server tags: + - name: Metadata + description: Application metadata and information retrieval + x-displayName: Application Metadata + - name: Jobs + description: Job management operations for creating, cloning, and retrieving jobs + x-displayName: Job Management + - name: Helm Charts + description: Helm chart deployment management and operations + x-displayName: Helm Chart Management + - name: List Applications + x-displayName: List Applications + description: Application listing + - name: Applications + description: Application management operations including creation, listing, and updates + x-displayName: Application Management - name: Labels x-displayName: Labels - name: bulk_other @@ -50,6 +68,9 @@ tags: x-displayName: ChangeChartType - name: Clone Workflow x-displayName: CloneWorkflow (ENT) + - name: Deployment History + x-displayName: Get Deployment History (ENT) + description: Retrieves the deployment history for a specific CD pipeline based on various filter criteria. - name: K8s Resource description: >- APIs for managing Kubernetes resources (get, create, update, delete, @@ -60,6 +81,969 @@ tags: - name: Devtron Server version x-displayName: Devtron Server version paths: + /resource/history/deployment/cd-pipeline/v1: + get: + summary: Get Deployment History + description: >- + Retrieves the deployment history for a specific CD pipeline based on + various filter criteria. + operationId: getDeploymentHistory + security: + - bearerAuth: [] + - apiKeyAuth: [] + parameters: + - name: filterCriteria + in: query + required: true + schema: + type: array + items: + type: string + description: | + Filter criteria for deployment history. Example: + - application/devtron-application|id|1064 + - environment|id|146 + - release|id|203 + - name: offset + in: query + required: false + schema: + type: integer + description: The starting point for fetching records (pagination). + - name: limit + in: query + required: false + schema: + type: integer + description: The number of records to return (pagination). + responses: + '200': + description: Successful retrieval of deployment history. + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 200 + status: + type: string + example: OK + result: + type: object + properties: + cdWorkflows: + type: array + items: + type: object + properties: + id: + type: integer + example: 19767 + cd_workflow_id: + type: integer + example: 19576 + name: + type: string + example: cd-1064-nu4s + status: + type: string + example: Succeeded + pod_status: + type: string + example: '' + message: + type: string + example: '' + started_on: + type: string + format: date-time + example: '2024-07-25T08:36:42.414376Z' + finished_on: + type: string + format: date-time + example: '2024-07-25T08:40:03.455303Z' + pipeline_id: + type: integer + example: 2082 + namespace: + type: string + example: devtron-cd + log_file_path: + type: string + example: '' + triggered_by: + type: integer + example: 23 + email_id: + type: string + example: deepak@devtron.ai + image: + type: string + example: >- + devtroninc.azurecr.io/test:8a0c2298-fc94fa4b-956-18655 + ci_artifact_id: + type: integer + example: 14593 + workflow_type: + type: string + example: DEPLOY + blobStorageEnabled: + type: boolean + example: true + userApprovalMetadata: + type: object + nullable: true + gitTriggers: + type: object + additionalProperties: + type: object + properties: + Commit: + type: string + example: 8a0c22983ae7acae10abe7569026ae25d889e159 + Author: + type: string + example: >- + jatin-jangir-0220 + <122791251+jatin-jangir-0220@users.noreply.github.com> + Date: + type: string + format: date-time + example: '2024-04-29T18:49:39Z' + Message: + type: string + example: |+ + Update Dockerfile (#19) + + Changes: + type: string + nullable: true + WebhookData: + type: object + properties: + id: + type: integer + example: 0 + eventActionType: + type: string + example: '' + data: + type: string + nullable: true + CiConfigureSourceValue: + type: string + example: main + GitRepoUrl: + type: string + example: >- + https://github.com/devtron-labs/casbin-enterprise + GitRepoName: + type: string + example: casbin-enterprise + CiConfigureSourceType: + type: string + example: SOURCE_TYPE_BRANCH_FIXED + ciMaterials: + type: array + items: + type: object + properties: + id: + type: integer + example: 1013 + gitMaterialId: + type: integer + example: 411 + gitMaterialUrl: + type: string + example: '' + gitMaterialName: + type: string + example: casbin-enterprise + type: + type: string + example: SOURCE_TYPE_BRANCH_FIXED + value: + type: string + example: main + active: + type: boolean + example: true + lastFetchTime: + type: string + format: date-time + example: '0001-01-01T00:00:00Z' + isRepoError: + type: boolean + example: false + repoErrorMsg: + type: string + example: '' + isBranchError: + type: boolean + example: false + branchErrorMsg: + type: string + example: '' + url: + type: string + example: >- + https://github.com/devtron-labs/casbin-enterprise + regex: + type: string + example: '' + tagsEditable: + type: boolean + example: false + appReleaseTagNames: + type: array + items: + type: string + example: [] + hideImageTaggingHardDelete: + type: boolean + example: false + examples: + example-1: + value: + code: 200 + status: OK + result: + cdWorkflows: + - id: 19752 + cd_workflow_id: 19561 + name: cd-1064-nu4s + status: Failed + pod_status: '' + message: >- + Unable to continue with install: could not get + information about the resource Job "" in namespace + "devtroncd": resource name may not be empty + started_on: '2024-07-25T08:26:21.792068Z' + finished_on: '2024-07-25T08:26:23.855384Z' + pipeline_id: 2082 + namespace: devtron-cd + log_file_path: '' + triggered_by: 23 + email_id: deepak@devtron.ai + image: >- + devtroninc.azurecr.io/test:8a0c2298-fc94fa4b-956-18655 + ci_artifact_id: 14593 + workflow_type: DEPLOY + blobStorageEnabled: true + userApprovalMetadata: null + gitTriggers: + '1013': + Commit: 8a0c22983ae7acae10abe7569026ae25d889e159 + Author: >- + jatin-jangir-0220 + <122791251+jatin-jangir-0220@users.noreply.github.com> + Date: '2024-04-29T18:49:39Z' + Message: |+ + Update Dockerfile (#19) + + Changes: null + WebhookData: + id: 0 + eventActionType: '' + data: null + CiConfigureSourceValue: main + GitRepoUrl: >- + https://github.com/devtron-labs/casbin-enterprise + GitRepoName: casbin-enterprise + CiConfigureSourceType: SOURCE_TYPE_BRANCH_FIXED + '2072': + Commit: fc94fa4bad21460e822ce896b5166273aa3df1a8 + Author: >- + Gireesh Naidu + <111440205+gireesh-naidu@users.noreply.github.com> + Date: '2024-07-23T18:13:18+05:30' + Message: "fix: getting 500 while updating the branch of linked CI (#1424)\n\n* fix: sync ci pipeline materials for linked pipelines\r\n\r\n* fix: sync ci pipeline materials for linked pipelines\r\n\r\n* fix: null column fix\r\n\r\n* fix: null column fix\r\n\r\n* fix: able to delete ci pipeline though it has linked ci's using API" + Changes: null + WebhookData: + id: 0 + eventActionType: '' + data: null + CiConfigureSourceValue: main + GitRepoUrl: >- + https://github.com/devtron-labs/devtron-enterprise + GitRepoName: devtron-enterprise + CiConfigureSourceType: SOURCE_TYPE_BRANCH_FIXED + ciMaterials: + - id: 1013 + gitMaterialId: 411 + gitMaterialUrl: '' + gitMaterialName: casbin-enterprise + type: SOURCE_TYPE_BRANCH_FIXED + value: main + active: true + lastFetchTime: '0001-01-01T00:00:00Z' + isRepoError: false + repoErrorMsg: '' + isBranchError: false + branchErrorMsg: '' + url: >- + https://github.com/devtron-labs/casbin-enterprise + regex: '' + - id: 2072 + gitMaterialId: 1286 + gitMaterialUrl: '' + gitMaterialName: devtron-enterprise + type: SOURCE_TYPE_BRANCH_FIXED + value: main + active: true + lastFetchTime: '0001-01-01T00:00:00Z' + isRepoError: false + repoErrorMsg: '' + isBranchError: false + branchErrorMsg: '' + url: >- + https://github.com/devtron-labs/devtron-enterprise + regex: '' + imageReleaseTags: null + imageComment: null + referenceCdWorkflowRunnerId: 0 + appliedFilters: null + appliedFiltersState: 0 + appliedFiltersTimestamp: '0001-01-01T00:00:00Z' + promotionApprovalMetadata: null + runSource: + kind: release + version: alpha1 + id: 203 + identifier: qa-releases-track-0.0.2 + releaseVersion: 0.0.2 + name: deepak-qa-release + releaseTrackName: qa-releases-track + targetConfig: + tenantId: qa-devtroncd-x + tenantName: QA Devtron Env + installationId: qa-devtroncd-2 + installationName: qa-devtroncd-2 + releaseChannelId: beta + releaseChannelName: beta-channel + tags: + - Deployment History + /orchestrator/app/labels/list: + get: + summary: List all app labels + description: This API will return all the labels available in the database. + operationId: listAppLabels + security: + - ApiKeyAuth: [] + parameters: [] + responses: + '200': + description: list response + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + allOf: + - type: object + properties: + appId: + type: integer + description: unique application id + required: + - appId + - $ref: '#/components/schemas/AppLabel' + '400': + description: Bad request + '401': + description: Unauthorized + '404': + description: Not found + '500': + description: Internal server error + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Metadata + /orchestrator/app/meta/info/{appId}: + get: + summary: Get application meta info + description: Application basic info, projects and labels + operationId: getAppMetaInfo + security: + - ApiKeyAuth: [] + parameters: + - name: appId + in: path + description: application id + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: application basic info, projects and labels + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: object + description: meta info project name and labels + $ref: '#/components/schemas/AppMetaInfo' + '400': + description: Bad request + '401': + description: Unauthorized + '404': + description: Not found + '500': + description: Internal server error + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Metadata + /orchestrator/helm/meta/info/{appId}: + get: + summary: Get Helm application meta info + description: Application info for all types of Helm apps + operationId: getHelmAppMetaInfo + security: + - ApiKeyAuth: [] + parameters: + - name: appId + in: path + description: application id + required: true + schema: + type: string + responses: + '200': + description: Helm application basic info + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: object + description: meta info project name and labels + $ref: '#/components/schemas/AppMetaInfo' + '400': + description: Bad request + '401': + description: Unauthorized + '404': + description: Not found + '500': + description: Internal server error + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Metadata + /orchestrator/job: + post: + summary: Create or clone a job + description: Create and clone a job + operationId: createOrCloneJob + security: + - ApiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateJob' + responses: + '200': + description: Used to give response once a job is created + content: + application/json: + schema: + $ref: '#/components/schemas/ActionResponse' + '400': + description: Bad request + '401': + description: Unauthorized + '500': + description: Internal server error + tags: + - Jobs + /orchestrator/job/list: + post: + summary: List jobs + description: Get the list of all the jobs by applying filter + operationId: listJobs + security: + - ApiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/JobList' + responses: + '200': + description: Used to give response of list of jobs + content: + application/json: + schema: + $ref: '#/components/schemas/JobListResponse' + '400': + description: Bad request + '401': + description: Unauthorized + '500': + description: Internal server error + tags: + - Jobs + /orchestrator/job/ci-pipeline/list/{jobId}: + get: + summary: Get job CI pipeline list + description: fetch details of job ci-pipelines for the overview page + operationId: getJobCiPipelineList + security: + - ApiKeyAuth: [] + parameters: + - name: jobId + in: path + required: true + schema: + type: integer + responses: + '200': + description: Job CI pipeline list + '400': + description: Bad request + '401': + description: Unauthorized + '500': + description: Internal server error + tags: + - Jobs + /orchestrator/app-store/installed-app: + get: + summary: List deployed charts + operationId: listDeployedCharts + description: deployed chart listing, with search filters + security: + - ApiKeyAuth: [] + parameters: + - name: envs + in: query + description: environment ids + required: false + schema: + type: array + items: + type: string + - name: chartRepoId + in: query + description: chart repo ids + required: false + schema: + type: array + items: + type: string + - name: appStoreName + in: query + description: chart name + required: false + schema: + type: string + - name: appName + in: query + description: chart name as app name for devtron + required: false + schema: + type: string + - name: onlyDeprecated + in: query + description: show only deprecated or all + required: false + schema: + type: boolean + - name: offset + in: query + description: offset for result set + required: false + schema: + type: integer + - name: size + in: query + description: total request size. + required: false + schema: + type: integer + responses: + '200': + description: deployed chart listing, with search filters + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: array + description: deployed chart listing, with search filters + items: + $ref: '#/components/schemas/ChartInfo' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Helm Charts + /orchestrator/app-store/installed-app/notes: + get: + summary: Fetch notes.txt for deployed helm charts + operationId: fetchNotesTxt + description: Used to fetch notes.txt for helm charts deployed via gitOps + security: + - ApiKeyAuth: [] + parameters: + - name: env-id + in: query + description: it is an environment id of app + required: true + schema: + type: integer + - name: installed-app-id + in: query + description: it is a installed application id + required: true + schema: + type: integer + responses: + '200': + description: if it is able to fetch the notes.txt then status will be ok + content: + application/json: + schema: + properties: + notes: + type: string + description: it will provide notes + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: error while fetching notes.txt + tags: + - Helm Charts + /orchestrator/app/autocomplete: + get: + summary: List application autocomplete + operationId: listAppAutocomplete + description: list of namespaces group by clusters + parameters: + - in: query + name: appName + example: abc + description: app name, wildcard query + required: false + allowEmptyValue: true + schema: + type: string + - in: query + name: teamId + example: '1' + description: project id + required: false + allowEmptyValue: false + schema: + type: integer + responses: + '200': + description: list response + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: array + description: app list + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - List Applications + security: + - ApiKeyAuth: [] + /orchestrator/app: + post: + summary: Create a new application + operationId: createApplication + description: create new application + security: + - ApiKeyAuth: [] + requestBody: + description: json as request body + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/App' + responses: + '200': + description: App create response + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: object + description: string + allOf: + - type: object + properties: + id: + type: integer + description: unique application id + required: + - id + - $ref: '#/components/schemas/App' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Applications + /orchestrator/app/edit: + post: + summary: Update application projects and labels + operationId: updateApplicationProjectsAndLabels + description: update application projects and labels + security: + - ApiKeyAuth: [] + requestBody: + description: json as request body + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/App' + responses: + '200': + description: App update response + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: object + description: string + allOf: + - type: object + properties: + id: + type: integer + description: unique application id + required: + - id + - $ref: '#/components/schemas/App' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Applications + /orchestrator/app/list: + post: + summary: List applications + operationId: listApplications + description: >- + app listing, collection of deployed applications or undeployed or + incomplete configured apps. + security: + - ApiKeyAuth: [] + requestBody: + description: json as request body + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppListingRequest' + responses: + '200': + description: App create response + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: object + description: string + required: + - appCount + - appContainers + - deploymentGroup + properties: + appCount: + type: integer + description: >- + app count, total number of apps available based on + filter provided in request. + appContainers: + type: array + description: app containers + items: + $ref: '#/components/schemas/AppContainer' + deploymentGroup: + type: object + description: deployment group + $ref: '#/components/schemas/DeploymentGroup' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Applications + /orchestrator/app/edit/projects: + post: + summary: Update project for app + operationId: updateProjectForApp + description: update project for app + security: + - ApiKeyAuth: [] + requestBody: + description: json as request body + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppProjectUpdateRequest' + responses: + '200': + description: App update response + content: + application/json: + schema: + properties: + code: + type: integer + description: status code + status: + type: string + description: status + result: + type: object + description: string + $ref: '#/components/schemas/AppProjectUpdateRequest' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + default: + description: unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - Applications /app/labels/list: get: summary: List Application Labels @@ -2512,79 +3496,570 @@ paths: description: ID of the application workflow to delete. schema: type: integer - - name: app-id - in: path - required: true - description: ID of the application. - schema: + - name: app-id + in: path + required: true + description: ID of the application. + schema: + type: integer + responses: + '200': + description: Successfully deleted workflow. + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: OK + '400': + description: Bad Request. Invalid path parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized User. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden. User does not have permission. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal Server Error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /version: + get: + summary: Get Devtron server version information + security: [] + responses: + '200': + description: meta info about devtron server + content: + application/json: + schema: + type: object + properties: + gitCommit: + type: string + example: d252aa3e + description: git hash from which code was compiled + buildTime: + type: string + format: date-time + example: '2021-12-15T05:44:05Z' + description: time when code was complied + serverMode: + type: string + example: FULL + description: server mode FULL/EA_ONLY + enum: + - FULL + - EA_ONLY + tags: + - Devtron Server version +components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + description: JWT token authentication + apiKeyAuth: + type: apiKey + in: header + name: X-API-Key + description: API key authentication + schemas: + AppLabel: + type: object + required: + - key + - value + properties: + key: + type: string + description: label key + value: + type: string + description: label value + propagate: + type: boolean + description: Whether to propagate to kubernetes resources + AppLabels: + type: object + required: + - appId + - labels + properties: + appId: + type: integer + description: application id + labels: + type: array + items: + $ref: '#/components/schemas/AppLabel' + AppMetaInfo: + type: object + required: + - appId + - projectId + - appName + - projectName + - createdOn + - createdBy + - labels + properties: + appId: + type: integer + description: app id + projectId: + type: integer + description: team/project id + appName: + type: string + description: app name + projectName: + type: string + description: team/project name + labels: + type: array + items: + $ref: '#/components/schemas/AppLabel' + createdOn: + type: string + description: app creation date + createdBy: + type: string + description: app created by + ErrorResponse: + type: object + properties: + code: + type: integer + format: int32 + status: + type: string + result: + type: object + nullable: true + errors: + type: array + items: + type: object + properties: + userMessage: + type: string + nullable: true + internalMessage: + type: string + nullable: true + Error: + required: + - code + - message + properties: + code: + type: integer + description: Error code + message: + type: string + description: Error message + CreateJob: + type: object + properties: + appName: + type: string + description: Used to give the name of the job + example: my-job-1 + isJob: + type: boolean + description: States whether its a job or an app + example: true + teamId: + type: integer + description: Used to give team id + example: 1 + templateId: + type: integer + description: Used to give the id of the job it wants to clone + example: 18 + labels: + type: array + items: + type: object + properties: + key: + type: string + example: hello + value: + type: string + example: world + propogate: + type: boolean + example: false + description: + type: string + description: Used to give the description of the job once it is made. + example: This is my first Job + ActionResponse: + type: object + properties: + id: + type: integer + description: Used to give the id of job once its created + example: 25 + appName: + type: string + description: Used to give the name of job once its created + example: my-job-1 + material: + type: array + items: + $ref: '#/components/schemas/gitMaterial' + teamId: + type: integer + description: Used to give the team id + example: 1 + templateId: + type: integer + description: Used to give the templateId + example: 0 + description: + type: string + description: Used to give the description of the job once it is made. + example: This is my first Job + isJob: + type: boolean + description: used to tell whether it is a job or an app + example: true + JobList: + type: object + properties: + teams: + type: array + items: + type: integer + description: used to give the project id + example: + - 1 + - 2 + appStatuses: + type: array + items: + type: string + description: used to give the filter of app ci-build status + example: + - Succeeded + - Starting + sortBy: + type: string + description: used to give the sort by constraint + example: appNameSort + sortOrder: + type: string + description: used to give the sort order + example: ASC + offset: + type: integer + description: >- + used to give the number from which we want our job (if the offset is + 20 means we want list of jobs from 20) + example: 0 + size: + type: integer + description: used to give the number of jobs we want + example: 20 + JobListResponse: + type: object + properties: + jobContainers: + type: array + items: + $ref: '#/components/schemas/jobContainer' + jobCount: + type: integer + gitMaterial: + type: object + properties: + name: + type: string + url: + type: string + id: + type: integer + gitProviderId: + type: integer + checkoutPath: + type: string + fetchSubmodules: + type: boolean + isUsedInCiConfig: + type: boolean + jobContainer: + type: object + properties: + jobId: + type: integer + jobName: + type: string + description: + type: string + ciPipelines: + type: array + items: + $ref: '#/components/schemas/jobCiPipeline' + jobCiPipeline: + type: object + properties: + ciPipelineId: + type: integer + status: + type: string + lastRunAt: + type: string + format: date-time + lastSuccessAt: + type: string + format: date-time + ChartInfo: + type: object + required: + - installedAppId + - environmentId + - installedAppVersionId + - appStoreApplicationVersionId + - appStoreApplicationName + - status + - appName + - environmentName + - deployedAt + - deployedBy + - readme + - deprecated + properties: + installedAppId: + type: integer + description: installed chart id + environmentId: + type: integer + description: environment id + installedAppVersionId: + type: integer + description: installed chart version id + appStoreApplicationVersionId: + type: integer + description: team/project id + appStoreApplicationName: + type: string + description: chart name externally + chartName: + type: string + description: chart repo name + icon: + type: string + description: image + status: + type: string + description: status of deployed chart + appName: + type: string + description: chart name is app name for devtron + environmentName: + type: string + description: env name + deployedAt: + type: string + description: deployement time + deployedBy: + type: string + description: user + readme: + type: string + description: readme + deprecated: + type: boolean + description: is deprecated or not + App: + type: object + required: + - appName + - teamId + - templateId + properties: + appName: + type: string + description: app name + teamId: + type: integer + description: project id + templateId: + type: integer + description: reference app id, used for clone, set default value 0 for blank app. + labels: + type: array + description: each apps may have multiple labels. these are optional. + items: + $ref: '#/components/schemas/AppLabel' + AppProjectUpdateRequest: + type: object + required: + - teamId + - appId + properties: + teamId: + type: integer + description: project id + appId: + type: array + description: team id, teams ids are projects ids + items: + type: integer + AppListingRequest: + type: object + required: + - offset + - size + properties: + appNameSearch: + type: string + description: app name search, wildcard match + offset: + type: integer + description: offset + size: + type: integer + description: result size + sortBy: + type: string + description: sort by + sortOrder: + type: string + description: sort order + environments: + type: array + description: environment id + items: type: integer - responses: - '200': - description: Successfully deleted workflow. - content: - application/json: - schema: - type: object - properties: - status: - type: string - example: OK - '400': - description: Bad Request. Invalid path parameters. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized User. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: Forbidden. User does not have permission. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal Server Error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /version: - get: - summary: Get Devtron server version information - security: [] - responses: - '200': - description: meta info about devtron server - content: - application/json: - schema: - type: object - properties: - gitCommit: - type: string - example: d252aa3e - description: git hash from which code was compiled - buildTime: - type: string - format: date-time - example: '2021-12-15T05:44:05Z' - description: time when code was complied - serverMode: - type: string - example: FULL - description: server mode FULL/EA_ONLY - enum: - - FULL - - EA_ONLY - tags: - - Devtron Server version -components: - schemas: + teams: + type: array + description: team id, teams ids are projects ids + items: + type: integer + labels: + type: array + description: app labels + items: + type: string + statuses: + type: array + description: status + items: + type: string + AppContainer: + type: object + required: + - appId + - appName + - environments + properties: + appId: + type: integer + description: app id + appName: + type: string + description: app name + environments: + type: array + items: + $ref: '#/components/schemas/EnvContainer' + EnvContainer: + type: object + required: + - appId + - appName + - environmentId + - environmentName + properties: + appId: + type: integer + description: app id + appName: + type: string + description: app name + cdStageStatus: + type: string + description: app name + dataSource: + type: string + description: app name + ciArtifactId: + type: integer + description: app name + deleted: + type: boolean + description: app name + environmentId: + type: integer + description: app name + environmentName: + type: string + description: app name + status: + type: string + description: app name + appStatus: + type: string + description: app status for this environment + postStageStatus: + type: string + description: app name + preStageStatus: + type: string + description: app name + lastDeployedTime: + type: string + description: deployed time + materialInfo: + type: array + items: + type: object + DeploymentGroup: + type: object + required: + - id + properties: + id: + type: integer + description: id + ciPipelineId: + type: integer + description: ciPipelineId + environmentId: + type: integer + description: environmentId + appCount: + type: integer + description: appCount + name: + type: string + description: name + noOfApps: + type: string + description: noOfApps BulkUpdateSeeExampleResponse: type: object required: @@ -2923,17 +4398,6 @@ components: ciPipelineId: type: integer description: ID of the CI pipeline to trigger builds for - Error: - required: - - code - - message - properties: - code: - type: integer - description: Error code - message: - type: string - description: Error message SSOLoginDto: type: object properties: @@ -3183,28 +4647,6 @@ components: type: boolean nullable: true readOnly: true - ErrorResponse: - type: object - properties: - code: - type: integer - format: int32 - status: - type: string - result: - type: object - nullable: true - errors: - type: array - items: - type: object - properties: - userMessage: - type: string - nullable: true - internalMessage: - type: string - nullable: true EnvironmentCreateRequest: type: object required: @@ -4231,20 +5673,14 @@ components: format: int32 minimum: 1 default: 20 - securitySchemes: - bearerAuth: - type: http - scheme: bearer - bearerFormat: JWT - description: JWT token authentication - apiKeyAuth: - type: apiKey - in: header - name: X-API-Key - description: API key authentication x-tagGroups: - name: Common Devtron automation APIs tags: + - Metadata + - Jobs + - Helm Charts + - List Applications + - Applications - Labels - bulk_other - BulkUpdate @@ -4263,3 +5699,4 @@ x-tagGroups: - K8s Resource - Workflow Management - Devtron Server version + - Deployment History \ No newline at end of file