From d8aa90e482ef13af4cc10b7ccd4d0d664bf2818b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 23 Oct 2023 11:42:32 +0200 Subject: [PATCH] Add first Helm API --- src/openapi.yaml | 50 ++++++++ src/parameters/_index.yaml | 2 + src/parameters/path/helmId.yaml | 7 ++ .../DefaultHelmAdvancedSettings.yaml | 16 +++ src/resources/helm/EnvironmentHelm.yaml | 50 ++++++++ src/resources/helm/EnvironmentHelmStatus.yaml | 21 ++++ src/resources/helm/Helm.yaml | 68 ++++++++++ src/resources/helm/HelmAdvancedSettings.yaml | 50 ++++++++ src/resources/helm/HelmDeploy.yaml | 38 ++++++ src/resources/helm/HelmDeploymentHistory.yaml | 21 ++++ .../helm/HelmDeploymentRestriction.yaml | 50 ++++++++ .../helm/HelmDeploymentRestrictionRef.yaml | 49 ++++++++ src/resources/helm/HelmRedeploy.yaml | 30 +++++ src/resources/helm/HelmRestart.yaml | 31 +++++ src/resources/helm/HelmStatus.yaml | 20 +++ src/resources/helm/HelmStop.yaml | 22 ++++ src/resources/helm/HelmVariableImport.yaml | 28 +++++ src/schemas/_index.yaml | 24 +++- src/schemas/enums/HelmForceEvent.yaml | 3 + ...ymentHistoryHelmPaginatedResponseList.yaml | 8 ++ .../helm/DeploymentHistoryHelmResponse.yaml | 9 ++ src/schemas/helm/HelmAdvancedSettings.yaml | 1 + src/schemas/helm/HelmDeployRequest.yaml | 12 ++ .../HelmDeploymentRestrictionRequest.yaml | 14 +++ .../HelmDeploymentRestrictionResponse.yaml | 3 + ...HelmDeploymentRestrictionResponseList.yaml | 6 + src/schemas/helm/HelmRequest.yaml | 116 ++++++++++++++++++ src/schemas/helm/HelmResponse.yaml | 116 ++++++++++++++++++ src/schemas/helm/HelmResponseList.yaml | 6 + 29 files changed, 869 insertions(+), 2 deletions(-) create mode 100644 src/parameters/path/helmId.yaml create mode 100644 src/resources/DefaultHelmAdvancedSettings.yaml create mode 100644 src/resources/helm/EnvironmentHelm.yaml create mode 100644 src/resources/helm/EnvironmentHelmStatus.yaml create mode 100644 src/resources/helm/Helm.yaml create mode 100644 src/resources/helm/HelmAdvancedSettings.yaml create mode 100644 src/resources/helm/HelmDeploy.yaml create mode 100644 src/resources/helm/HelmDeploymentHistory.yaml create mode 100644 src/resources/helm/HelmDeploymentRestriction.yaml create mode 100644 src/resources/helm/HelmDeploymentRestrictionRef.yaml create mode 100644 src/resources/helm/HelmRedeploy.yaml create mode 100644 src/resources/helm/HelmRestart.yaml create mode 100644 src/resources/helm/HelmStatus.yaml create mode 100644 src/resources/helm/HelmStop.yaml create mode 100644 src/resources/helm/HelmVariableImport.yaml create mode 100644 src/schemas/enums/HelmForceEvent.yaml create mode 100644 src/schemas/helm/DeploymentHistoryHelmPaginatedResponseList.yaml create mode 100644 src/schemas/helm/DeploymentHistoryHelmResponse.yaml create mode 100644 src/schemas/helm/HelmAdvancedSettings.yaml create mode 100644 src/schemas/helm/HelmDeployRequest.yaml create mode 100644 src/schemas/helm/HelmDeploymentRestrictionRequest.yaml create mode 100644 src/schemas/helm/HelmDeploymentRestrictionResponse.yaml create mode 100644 src/schemas/helm/HelmDeploymentRestrictionResponseList.yaml create mode 100644 src/schemas/helm/HelmRequest.yaml create mode 100644 src/schemas/helm/HelmResponse.yaml create mode 100644 src/schemas/helm/HelmResponseList.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index ae3b5f7d..0f27d48a 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -55,6 +55,19 @@ tags: - name: Job Registry - name: Job Secret - name: Jobs + - name: Helm + - name: Helm Actions + - name: Helm Configuration + - name: Helm Database + - name: Helm Deployment Restriction + - name: Helm Deployment History + - name: Helm Environment Variable + - name: Helm Logs + - name: Helm Main Calls + - name: Helm Metrics + - name: Helm Registry + - name: Helm Secret + - name: Helms - name: Backups - name: Billing - name: Cloud Provider @@ -191,6 +204,17 @@ x-tagGroups: - Job Deployment History - Job Environment Variable - Job Secret + - name: Helm + tags: + - Helm Main Calls + - Helm Actions + - Helm Configuration + - Helm Custom Domain + - Helm Deployment Restriction + - Helm Metrics + - Helm Deployment History + - Helm Environment Variable + - Helm Secret - name: Account tags: - Account Info @@ -498,6 +522,8 @@ paths: $ref: './resources/DefaultContainerAdvancedSettings.yaml' /defaultJobAdvancedSettings: $ref: './resources/DefaultJobAdvancedSettings.yaml' + /defaultHelmAdvancedSettings: + $ref: './resources/DefaultHelmAdvancedSettings.yaml' /application/{applicationId}: $ref: './resources/Application.yaml' /application/{applicationId}/status: @@ -694,6 +720,30 @@ paths: $ref: './resources/AccountRewardClaim.yaml' /admin/userSignUp: $ref: './resources/UserSignUp.yaml' + /environment/{environmentId}/helm: + $ref: './resources/helm/EnvironmentHelm.yaml' + /environment/{environmentId}/helm/status: + $ref: './resources/helm/EnvironmentHelmStatus.yaml' + /helm/{helmId}: + $ref: './resources/helm/Helm.yaml' + /helm/{helmId}/advancedSettings: + $ref: './resources/helm/HelmAdvancedSettings.yaml' + /helm/{helmId}/deploy: + $ref: './resources/helm/HelmDeploy.yaml' + /helm/{helmId}/restart: + $ref: './resources/helm/HelmRestart.yaml' + /helm/{helmId}/redeploy: + $ref: './resources/helm/HelmRedeploy.yaml' + /helm/{helmId}/stop: + $ref: './resources/helm/HelmStop.yaml' + /helm/{helmId}/status: + $ref: './resources/helm/HelmStatus.yaml' + /helm/{helmId}/deploymentHistory: + $ref: './resources/helm/HelmDeploymentHistory.yaml' + /helm/{helmId}/deploymentRestriction: + $ref: './resources/helm/HelmDeploymentRestriction.yaml' + /helm/{helmId}/deploymentRestriction/{deploymentRestrictionId}: + $ref: './resources/helm/HelmDeploymentRestrictionRef.yaml' /environment/{environmentId}/job: $ref: './resources/job/EnvironmentJob.yaml' /environment/{environmentId}/job/status: diff --git a/src/parameters/_index.yaml b/src/parameters/_index.yaml index aef28783..328adc5e 100644 --- a/src/parameters/_index.yaml +++ b/src/parameters/_index.yaml @@ -78,3 +78,5 @@ webhookId: $ref: ./path/webhookId.yaml variableId: $ref: ./path/variableId.yaml +helmId: + $ref: ./path/helmId.yaml diff --git a/src/parameters/path/helmId.yaml b/src/parameters/path/helmId.yaml new file mode 100644 index 00000000..cccdf8e8 --- /dev/null +++ b/src/parameters/path/helmId.yaml @@ -0,0 +1,7 @@ +name: helmId +in: path +description: Helm ID +required: true +schema: + type: string + format: uuid diff --git a/src/resources/DefaultHelmAdvancedSettings.yaml b/src/resources/DefaultHelmAdvancedSettings.yaml new file mode 100644 index 00000000..e26d1ff2 --- /dev/null +++ b/src/resources/DefaultHelmAdvancedSettings.yaml @@ -0,0 +1,16 @@ +get: + summary: 'List default helm advanced settings' + operationId: getDefaultHelmAdvancedSettings + tags: + - Helm + responses: + '200': + description: 'Default helm advanced settings' + content: + application/json: + schema: + $ref: '../schemas/helm/HelmAdvancedSettings.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' diff --git a/src/resources/helm/EnvironmentHelm.yaml b/src/resources/helm/EnvironmentHelm.yaml new file mode 100644 index 00000000..aa4a2e5d --- /dev/null +++ b/src/resources/helm/EnvironmentHelm.yaml @@ -0,0 +1,50 @@ +get: + summary: 'List helms' + operationId: listHelms + parameters: + - $ref: '../../parameters/path/environmentId.yaml' + - $ref: '../../parameters/query/toUpdate.yaml' + tags: + - Helms + responses: + '200': + description: 'List helms' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmResponseList.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' +post: + summary: 'Create a helm' + operationId: createHelm + parameters: + - $ref: '../../parameters/path/environmentId.yaml' + tags: + - Helms + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmRequest.yaml' + responses: + '201': + description: 'Create helm' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmResponse.yaml' + '400': + $ref: '../../responses/BadRequest.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + '409': + description: Helm name within the environment is already taken diff --git a/src/resources/helm/EnvironmentHelmStatus.yaml b/src/resources/helm/EnvironmentHelmStatus.yaml new file mode 100644 index 00000000..8489ac61 --- /dev/null +++ b/src/resources/helm/EnvironmentHelmStatus.yaml @@ -0,0 +1,21 @@ +get: + summary: 'List all environment helm statuses' + description: Returns a list of helms with only their id and status. + operationId: getEnvironmentHelmStatus + parameters: + - $ref: '../../parameters/path/environmentId.yaml' + tags: + - Helms + responses: + '200': + description: 'Get status' + content: + application/json: + schema: + $ref: '../../schemas/ReferenceObjectStatusResponseList.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/resources/helm/Helm.yaml b/src/resources/helm/Helm.yaml new file mode 100644 index 00000000..c3a4cdac --- /dev/null +++ b/src/resources/helm/Helm.yaml @@ -0,0 +1,68 @@ +get: + summary: 'Get helm by ID' + operationId: getHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Main Calls + responses: + '200': + description: 'Get helm by ID' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmResponse.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' +put: + summary: 'Edit helm' + description: | + - To edit the helm you must have the admin permission. + operationId: editHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Main Calls + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmRequest.yaml' + responses: + '200': + description: 'Edit helm' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmResponse.yaml' + '400': + $ref: '../../responses/BadRequest.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + '409': + description: Helm name within the environment is already taken +delete: + summary: 'Delete helm' + description: 'To delete the helm you must have the admin permission' + operationId: deleteHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Main Calls + responses: + '204': + $ref: '../../responses/Deleted.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/resources/helm/HelmAdvancedSettings.yaml b/src/resources/helm/HelmAdvancedSettings.yaml new file mode 100644 index 00000000..1162bc2e --- /dev/null +++ b/src/resources/helm/HelmAdvancedSettings.yaml @@ -0,0 +1,50 @@ +get: + summary: 'Get advanced settings' + description: Get list and values of the advanced settings of the helm. + operationId: getHelmAdvancedSettings + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Configuration + responses: + '200': + description: 'Advanced settings list' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmAdvancedSettings.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + +put: + summary: 'Edit advanced settings' + description: Edit advanced settings by returning table of advanced settings. + operationId: editHelmAdvancedSettings + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Configuration + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmAdvancedSettings.yaml' + responses: + '201': + description: 'Updated advanced settings' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmAdvancedSettings.yaml' + '400': + $ref: '../../responses/BadRequest.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/resources/helm/HelmDeploy.yaml b/src/resources/helm/HelmDeploy.yaml new file mode 100644 index 00000000..3a686d51 --- /dev/null +++ b/src/resources/helm/HelmDeploy.yaml @@ -0,0 +1,38 @@ +post: + summary: 'Deploy helm' + description: You must provide a git commit id or an image tag depending on the source location of your code (git vs image repository). + operationId: deployHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + - name: forceEvent + in: query + required: false + description: | + When filled, it indicates the target event to be deployed. + If the concerned helm hasn't the target event provided, the helm won't be deployed. + schema: + $ref: ../../schemas/enums/HelmForceEvent.yaml + tags: + - Helm Actions + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmDeployRequest.yaml' + responses: + '202': + description: 'Deploy helm' + content: + application/json: + schema: + $ref: '../../schemas/Status.yaml' + '400': + $ref: '../../responses/BadRequest.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + '409': + description: 'Operation is in progress' diff --git a/src/resources/helm/HelmDeploymentHistory.yaml b/src/resources/helm/HelmDeploymentHistory.yaml new file mode 100644 index 00000000..8e9c291a --- /dev/null +++ b/src/resources/helm/HelmDeploymentHistory.yaml @@ -0,0 +1,21 @@ +get: + summary: 'List helm deployments' + description: Returns the 20 last helm deployments + operationId: listHelmDeploymentHistory + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Deployment History + responses: + '200': + description: 'List deployment history' + content: + application/json: + schema: + $ref: '../../schemas/helm/DeploymentHistoryHelmPaginatedResponseList.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/resources/helm/HelmDeploymentRestriction.yaml b/src/resources/helm/HelmDeploymentRestriction.yaml new file mode 100644 index 00000000..61f9471a --- /dev/null +++ b/src/resources/helm/HelmDeploymentRestriction.yaml @@ -0,0 +1,50 @@ +get: + summary: 'Get helm deployment restrictions' + description: 'Get helm deployment restrictions' + operationId: getHelmDeploymentRestrictions + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Deployment Restriction + responses: + '200': + description: 'Get helm deployment restrictions' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmDeploymentRestrictionResponseList.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + +post: + summary: 'Create a helm deployment restriction' + description: 'Create a helm deployment restriction' + operationId: createHelmDeploymentRestriction + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Deployment Restriction + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmDeploymentRestrictionRequest.yaml' + responses: + '201': + description: 'Added an helm deployment restriction' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmDeploymentRestrictionResponse.yaml' + '400': + $ref: '../../responses/BadRequest.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '409': + description: A Helm deployment restriction with same properties already exists for this helm diff --git a/src/resources/helm/HelmDeploymentRestrictionRef.yaml b/src/resources/helm/HelmDeploymentRestrictionRef.yaml new file mode 100644 index 00000000..cf52bd0b --- /dev/null +++ b/src/resources/helm/HelmDeploymentRestrictionRef.yaml @@ -0,0 +1,49 @@ +put: + summary: 'Edit a helm deployment restriction' + description: 'Edit a helm deployment restriction' + operationId: editHelmDeploymentRestriction + parameters: + - $ref: '../../parameters/path/helmId.yaml' + - $ref: '../../parameters/path/deploymentRestrictionId.yaml' + + tags: + - Helm Deployment Restriction + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmDeploymentRestrictionRequest.yaml' + responses: + '200': + description: 'Edit a helm deployment restriction' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmDeploymentRestrictionResponse.yaml' + '400': + $ref: '../../responses/BadRequest.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + +delete: + summary: 'Delete a helm deployment restriction' + description: 'Delete a helm deployment restriction' + operationId: deleteHelmDeploymentRestriction + parameters: + - $ref: '../../parameters/path/helmId.yaml' + - $ref: '../../parameters/path/deploymentRestrictionId.yaml' + tags: + - Helm Deployment Restriction + responses: + '204': + $ref: '../../responses/Deleted.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/resources/helm/HelmRedeploy.yaml b/src/resources/helm/HelmRedeploy.yaml new file mode 100644 index 00000000..6ce0885b --- /dev/null +++ b/src/resources/helm/HelmRedeploy.yaml @@ -0,0 +1,30 @@ +post: + summary: 'Redeploy helm' + operationId: redeployHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + - name: forceEvent + in: query + required: false + description: | + When filled, it indicates the target event to be deployed. + If the concerned helm hasn't the target event provided, the helm won't be deployed. + schema: + $ref: ../../schemas/enums/HelmForceEvent.yaml + tags: + - Helm Actions + responses: + '202': + description: 'Helm redeploy has been requested' + content: + application/json: + schema: + $ref: '../../schemas/Status.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + '409': + description: 'Operation is in progress' diff --git a/src/resources/helm/HelmRestart.yaml b/src/resources/helm/HelmRestart.yaml new file mode 100644 index 00000000..46854dd9 --- /dev/null +++ b/src/resources/helm/HelmRestart.yaml @@ -0,0 +1,31 @@ +post: + summary: 'Deprecated - Restart helm' + description: '**Deprecated** - Please use the "Redeploy helm" endpoint now' + operationId: restartHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + - name: forceEvent + in: query + required: false + description: | + When filled, it indicates the target event to be deployed. + If the concerned helm hasn't the target event provided, the helm won't be deployed. + schema: + $ref: ../../schemas/enums/HelmForceEvent.yaml + tags: + - Helm Actions + responses: + '202': + description: 'Helm restart has been requested' + content: + application/json: + schema: + $ref: '../../schemas/Status.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + '409': + description: 'Operation is in progress' diff --git a/src/resources/helm/HelmStatus.yaml b/src/resources/helm/HelmStatus.yaml new file mode 100644 index 00000000..fbda8d93 --- /dev/null +++ b/src/resources/helm/HelmStatus.yaml @@ -0,0 +1,20 @@ +get: + summary: 'Get helm status' + operationId: getHelmStatus + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Main Calls + responses: + '200': + description: 'Get status' + content: + application/json: + schema: + $ref: '../../schemas/Status.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/resources/helm/HelmStop.yaml b/src/resources/helm/HelmStop.yaml new file mode 100644 index 00000000..3d5a6f42 --- /dev/null +++ b/src/resources/helm/HelmStop.yaml @@ -0,0 +1,22 @@ +post: + summary: 'Stop helm' + operationId: stopHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Actions + responses: + '202': + description: 'Helm stop has been requested' + content: + application/json: + schema: + $ref: '../../schemas/Status.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + '409': + description: 'Helm is already stopped or an operation is in progress' diff --git a/src/resources/helm/HelmVariableImport.yaml b/src/resources/helm/HelmVariableImport.yaml new file mode 100644 index 00000000..9bd2c0eb --- /dev/null +++ b/src/resources/helm/HelmVariableImport.yaml @@ -0,0 +1,28 @@ +post: + summary: 'Import variables' + description: Import environment variables in a defined scope, with a defined visibility. + operationId: importHelmEnvironmentVariable + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Environment Variable + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/VariableImportRequest.yaml' + responses: + '201': + description: 'Import environment variables' + content: + application/json: + schema: + $ref: '../../schemas/VariableImportResponse.yaml' + '400': + $ref: '../../responses/BadRequest.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 45b84d47..8203f8dc 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -418,6 +418,28 @@ JobForceEvent: $ref: ./enums/JobForceEvent.yaml DeploymentHistoryJobResponse: $ref: ./job/DeploymentHistoryJobResponse.yaml +HelmRequest: + $ref: ./helm/HelmRequest.yaml +HelmResponse: + $ref: ./helm/HelmResponse.yaml +HelmResponseList: + $ref: ./helm/HelmResponseList.yaml +HelmAdvancedSettings: + $ref: ./helm/HelmAdvancedSettings.yaml +#HelmDeployRequest: +# $ref: ./helm/HelmDeployRequest.yaml +#HelmDeploymentRestrictionRequest: +# $ref: ./helm/HelmDeploymentRestrictionRequest.yaml +#HelmDeploymentRestrictionResponse: +# $ref: ./helm/HelmDeploymentRestrictionResponse.yaml +#HelmDeploymentRestrictionResponseList: +# $ref: ./helm/HelmDeploymentRestrictionResponseList.yaml +#HelmScheduleEvent: +# $ref: ./enums/HelmScheduleEvent.yaml +HelmForceEvent: + $ref: ./enums/HelmForceEvent.yaml +#DeploymentHistoryHelmResponse: +# $ref: ./helm/DeploymentHistoryHelmResponse.yaml Key: $ref: ./Key.yaml KubernetesEnum: @@ -700,5 +722,3 @@ OrganizationJobAutoDeployRequest: $ref: ./OrganizationJobAutoDeployRequest.yaml RegistryMirroringModeEnum: $ref: ./enums/RegistryMirroringMode.yaml - - diff --git a/src/schemas/enums/HelmForceEvent.yaml b/src/schemas/enums/HelmForceEvent.yaml new file mode 100644 index 00000000..c38008a2 --- /dev/null +++ b/src/schemas/enums/HelmForceEvent.yaml @@ -0,0 +1,3 @@ +type: string +enum: + - DIFF diff --git a/src/schemas/helm/DeploymentHistoryHelmPaginatedResponseList.yaml b/src/schemas/helm/DeploymentHistoryHelmPaginatedResponseList.yaml new file mode 100644 index 00000000..f95707e2 --- /dev/null +++ b/src/schemas/helm/DeploymentHistoryHelmPaginatedResponseList.yaml @@ -0,0 +1,8 @@ +allOf: + - $ref: '../PaginationDataResponse.yaml' + - type: object + properties: + results: + type: array + items: + $ref: 'DeploymentHistoryHelmResponse.yaml' diff --git a/src/schemas/helm/DeploymentHistoryHelmResponse.yaml b/src/schemas/helm/DeploymentHistoryHelmResponse.yaml new file mode 100644 index 00000000..6753fe2d --- /dev/null +++ b/src/schemas/helm/DeploymentHistoryHelmResponse.yaml @@ -0,0 +1,9 @@ +allOf: + - $ref: '../BaseResponse.yaml' + - type: object + properties: + name: + type: string + description: name of the helm + status: + $ref: '../enums/State.yaml' diff --git a/src/schemas/helm/HelmAdvancedSettings.yaml b/src/schemas/helm/HelmAdvancedSettings.yaml new file mode 100644 index 00000000..91bf3091 --- /dev/null +++ b/src/schemas/helm/HelmAdvancedSettings.yaml @@ -0,0 +1 @@ +type: object diff --git a/src/schemas/helm/HelmDeployRequest.yaml b/src/schemas/helm/HelmDeployRequest.yaml new file mode 100644 index 00000000..12aaa01a --- /dev/null +++ b/src/schemas/helm/HelmDeployRequest.yaml @@ -0,0 +1,12 @@ +type: object +properties: + version: + type: string + description: | + version of the chart to deploy. + Cannot be set if `git_commit_id` is defined + git_commit_id: + type: string + description: | + Commit to deploy + Cannot be set if `version` is defined diff --git a/src/schemas/helm/HelmDeploymentRestrictionRequest.yaml b/src/schemas/helm/HelmDeploymentRestrictionRequest.yaml new file mode 100644 index 00000000..05df5ab8 --- /dev/null +++ b/src/schemas/helm/HelmDeploymentRestrictionRequest.yaml @@ -0,0 +1,14 @@ +type: object +required: + - mode + - type + - value +properties: + mode: + $ref: '../enums/DeploymentRestrictionMode.yaml' + type: + $ref: '../enums/DeploymentRestrictionType.yaml' + value: + type: string + description: 'For `PATH` restrictions, the value must not start with `/`' + example: "helm1/src/" diff --git a/src/schemas/helm/HelmDeploymentRestrictionResponse.yaml b/src/schemas/helm/HelmDeploymentRestrictionResponse.yaml new file mode 100644 index 00000000..5c61d860 --- /dev/null +++ b/src/schemas/helm/HelmDeploymentRestrictionResponse.yaml @@ -0,0 +1,3 @@ +allOf: + - $ref: '../BaseResponse.yaml' + - $ref: '../helm/HelmDeploymentRestrictionRequest.yaml' diff --git a/src/schemas/helm/HelmDeploymentRestrictionResponseList.yaml b/src/schemas/helm/HelmDeploymentRestrictionResponseList.yaml new file mode 100644 index 00000000..e44abe8e --- /dev/null +++ b/src/schemas/helm/HelmDeploymentRestrictionResponseList.yaml @@ -0,0 +1,6 @@ +type: object +properties: + results: + type: array + items: + $ref: './HelmDeploymentRestrictionResponse.yaml' diff --git a/src/schemas/helm/HelmRequest.yaml b/src/schemas/helm/HelmRequest.yaml new file mode 100644 index 00000000..50bdbc27 --- /dev/null +++ b/src/schemas/helm/HelmRequest.yaml @@ -0,0 +1,116 @@ +allOf: + - type: object + required: + - name + - healthchecks + properties: + name: + type: string + description: name is case insensitive + description: + type: string + timeout_sec: + type: integer + minimum: 0 + default: 600 + description: | + Maximum number of seconds allowed for helm to run before killing it and mark it as failed + auto_preview: + type: boolean + nullable: true + description: | + Indicates if the 'environment preview option' is enabled. + If enabled, a preview environment will be automatically cloned when `/preview` endpoint is called or when a new commit is updated. + If not specified, it takes the value of the `auto_preview` property from the associated environment. + auto_deploy: + type: boolean + description: | + Specify if the helm will be automatically updated after receiving a new image tag or a new commit according to the source type. + source: + type: object + properties: + git: + type: object + nullable: true + properties: + git_repository: + $ref: '../ApplicationGitRepositoryRequest.yaml' + repository: + type: object + nullable: true + properties: + repository: + type: string + format: UUID + description: The id of the helm repository + nullable: true + chart_name: + type: string + description: The name of the chart in the repository + chart_version: + type: string + description: The version of the chart to use + arguments: + type: array + description: The extra arguments to pass to helm + items: + type: string + allow_cluster_wide_resources: + type: boolean + default: false + description: | + If we should allow the chart to deploy object outside his specified namespace. + Setting this flag to true, requires special rights + values_override: + type: object + description: | + Specify helm values you want to set or override + properties: + set: + type: array + items: + type: array + items: + type: string + set_string: + type: array + items: + type: array + items: + type: string + set_json: + type: array + items: + type: array + items: + type: string + file: + type: object + nullable: true + properties: + raw: + type: object + nullable: true + properties: + values: + type: array + items: + type: object + properties: + name: + type: string + description: The name of the value file + content: + type: string + description: The content of the value file + git: + type: object + nullable: true + properties: + git_repository: + $ref: '../ApplicationGitRepositoryRequest.yaml' + paths: + type: array + description: List of path inside your git repository to locate values file. Must start by a / + items: + type: string diff --git a/src/schemas/helm/HelmResponse.yaml b/src/schemas/helm/HelmResponse.yaml new file mode 100644 index 00000000..89efb85f --- /dev/null +++ b/src/schemas/helm/HelmResponse.yaml @@ -0,0 +1,116 @@ +allOf: + - $ref: '../BaseResponse.yaml' + - type: object + required: + - environment + - name + - tag + - auto_preview + - auto_deploy + - source + properties: + environment: + $ref: '../ReferenceObject.yaml' + name: + type: string + description: name is case insensitive + description: + type: string + auto_preview: + type: boolean + description: | + Indicates if the 'environment preview option' is enabled. + If enabled, a preview environment will be automatically cloned when `/preview` endpoint is called. + If not specified, it takes the value of the `auto_preview` property from the associated environment. + auto_deploy: + type: boolean + description: | + Specify if the service will be automatically updated after receiving a new image tag or a new commit according to the source type. + source: + type: object + properties: + git: + type: object + nullable: true + properties: + git_repository: + $ref: '../ApplicationGitRepositoryRequest.yaml' + repository: + type: object + nullable: true + properties: + repository: + type: string + format: UUID + description: The id of the helm repository + nullable: true + chart_name: + type: string + description: The name of the chart in the repository + chart_version: + type: string + description: The version of the chart to use + arguments: + type: array + description: The extra arguments to pass to helm + items: + type: string + allow_cluster_wide_resources: + type: boolean + default: false + description: | + If we should allow the chart to deploy object outside his specified namespace. + Setting this flag to true, requires special rights + values_override: + type: object + description: | + Specify helm values you want to set or override + properties: + set: + type: array + items: + type: array + items: + type: string + set_string: + type: array + items: + type: array + items: + type: string + set_json: + type: array + items: + type: array + items: + type: string + file: + type: object + nullable: true + properties: + raw: + type: object + nullable: true + properties: + values: + type: array + items: + type: object + properties: + name: + type: string + description: The name of the value file + content: + type: string + description: The content of the value file + git: + type: object + nullable: true + properties: + git_repository: + $ref: '../ApplicationGitRepositoryRequest.yaml' + paths: + type: array + description: List of path inside your git repository to locate values file. Must start by a / + items: + type: string diff --git a/src/schemas/helm/HelmResponseList.yaml b/src/schemas/helm/HelmResponseList.yaml new file mode 100644 index 00000000..e08f16ad --- /dev/null +++ b/src/schemas/helm/HelmResponseList.yaml @@ -0,0 +1,6 @@ +type: object +properties: + results: + type: array + items: + $ref: './HelmResponse.yaml'