From ecb4ff2253cc13801a21c5106051624f19ca22fb Mon Sep 17 00:00:00 2001 From: pggb25 Date: Wed, 13 Sep 2023 17:58:31 +0200 Subject: [PATCH 01/85] feat: allow to set auto deploy at service level (#442) --- src/openapi.yaml | 2 ++ src/resources/OrganizationJobAutoDeploy.yaml | 33 +++++++++++++++++++ src/schemas/ApplicationEditRequest.yaml | 4 +++ src/schemas/ApplicationRequest.yaml | 4 +++ src/schemas/ApplicationResponse.yaml | 3 ++ src/schemas/ContainerRequest.yaml | 6 ++++ src/schemas/ContainerResponse.yaml | 6 ++++ .../OrganizationJobAutoDeployRequest.yaml | 8 +++++ src/schemas/_index.yaml | 3 ++ src/schemas/job/JobRequest.yaml | 7 ++++ src/schemas/job/JobResponse.yaml | 5 +++ 11 files changed, 81 insertions(+) create mode 100644 src/resources/OrganizationJobAutoDeploy.yaml create mode 100644 src/schemas/OrganizationJobAutoDeployRequest.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 8cf7c363..8a3ddf42 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -460,6 +460,8 @@ paths: $ref: './resources/OrganizationContainerAutoDeploy.yaml' /organization/{organizationId}/container/preview: $ref: './resources/OrganizationContainerPreview.yaml' + /organization/{organizationId}/job/deploy: + $ref: './resources/OrganizationJobAutoDeploy.yaml' /environment/{environmentId}/log: $ref: './resources/EnvironmentLog.yaml' /environment/{environmentId}/logs: diff --git a/src/resources/OrganizationJobAutoDeploy.yaml b/src/resources/OrganizationJobAutoDeploy.yaml new file mode 100644 index 00000000..a4382439 --- /dev/null +++ b/src/resources/OrganizationJobAutoDeploy.yaml @@ -0,0 +1,33 @@ +post: + summary: 'Auto deploy jobs' + description: | + Triggers a new job deploy in each environment matching the following conditions + - environment should have the auto-deploy enabled + - the job should have the same image name and a different tag + operationId: autoDeployJobEnvironments + parameters: + - $ref: '../parameters/path/organizationId.yaml' + tags: + - Jobs + requestBody: + content: + application/json: + schema: + $ref: '../schemas/OrganizationJobAutoDeployRequest.yaml' + responses: + '202': + description: 'Deployed jobs' + 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/schemas/ApplicationEditRequest.yaml b/src/schemas/ApplicationEditRequest.yaml index 64a4033e..581af891 100644 --- a/src/schemas/ApplicationEditRequest.yaml +++ b/src/schemas/ApplicationEditRequest.yaml @@ -58,3 +58,7 @@ allOf: entrypoint: type: string description: optional entrypoint when launching container + auto_deploy: + type: boolean + nullable: true + description: Specify if the application will be automatically updated after receiving a new commit. diff --git a/src/schemas/ApplicationRequest.yaml b/src/schemas/ApplicationRequest.yaml index d9d32d76..9bbed58a 100644 --- a/src/schemas/ApplicationRequest.yaml +++ b/src/schemas/ApplicationRequest.yaml @@ -62,3 +62,7 @@ allOf: entrypoint: type: string description: optional entrypoint when launching container + auto_deploy: + type: boolean + nullable: true + description: Specify if the application will be automatically updated after receiving a new commit. diff --git a/src/schemas/ApplicationResponse.yaml b/src/schemas/ApplicationResponse.yaml index 14394788..697f700f 100644 --- a/src/schemas/ApplicationResponse.yaml +++ b/src/schemas/ApplicationResponse.yaml @@ -69,3 +69,6 @@ allOf: entrypoint: type: string description: optional entrypoint when launching container + auto_deploy: + type: boolean + description: Specify if the application will be automatically updated after receiving a new commit. diff --git a/src/schemas/ContainerRequest.yaml b/src/schemas/ContainerRequest.yaml index 9610808c..d0b59833 100644 --- a/src/schemas/ContainerRequest.yaml +++ b/src/schemas/ContainerRequest.yaml @@ -66,3 +66,9 @@ allOf: Indicates if the 'environment preview option' is enabled for this container. 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 + nullable: true + description: | + Specify if the container will be automatically updated after receiving a new image tag. + The new image tag shall be communicated via the "Auto Deploy container" endpoint https://api-doc.qovery.com/#tag/Containers/operation/autoDeployContainerEnvironments diff --git a/src/schemas/ContainerResponse.yaml b/src/schemas/ContainerResponse.yaml index f13db28e..884f9e8c 100644 --- a/src/schemas/ContainerResponse.yaml +++ b/src/schemas/ContainerResponse.yaml @@ -78,3 +78,9 @@ allOf: If not specified, it takes the value of the `auto_preview` property from the associated environment. ports: $ref: './ServicePortResponseList.yaml' + auto_deploy: + type: boolean + description: | + Specify if the container will be automatically updated after receiving a new image tag. + The new image tag shall be communicated via the "Auto Deploy container" endpoint https://api-doc.qovery.com/#tag/Containers/operation/autoDeployContainerEnvironments + diff --git a/src/schemas/OrganizationJobAutoDeployRequest.yaml b/src/schemas/OrganizationJobAutoDeployRequest.yaml new file mode 100644 index 00000000..2040b01d --- /dev/null +++ b/src/schemas/OrganizationJobAutoDeployRequest.yaml @@ -0,0 +1,8 @@ +type: object +properties: + image_name: + type: string + description: the job image name to deploy + tag: + type: string + description: the new tag to deploy \ No newline at end of file diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index d759acb3..026d79e1 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -684,3 +684,6 @@ StepMetricStatusEnum: $ref: ./enums/StepMetricStatus.yaml ServiceStepMetricNameEnum: $ref: ./enums/ServiceStepMetricName.yaml +OrganizationJobAutoDeployRequest: + $ref: ./OrganizationJobAutoDeployRequest.yaml + diff --git a/src/schemas/job/JobRequest.yaml b/src/schemas/job/JobRequest.yaml index e7dc5149..9d779c41 100644 --- a/src/schemas/job/JobRequest.yaml +++ b/src/schemas/job/JobRequest.yaml @@ -132,3 +132,10 @@ allOf: For example: `* * * * *` represent the cron to launch the job every minute. See https://crontab.guru/ to WISIWIG interface. Timezone is UTC + auto_deploy: + type: boolean + nullable: true + description: | + Specify if the job will be automatically updated after receiving a new image tag or a new commit according to the source type. + The new image tag shall be communicated via the "Auto Deploy job" endpoint https://api-doc.qovery.com/#tag/Jobs/operation/autoDeployJobEnvironments + diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index efcce68f..f8da9a26 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -153,3 +153,8 @@ allOf: For example: `* * * * *` represent the cron to launch the job every minute. See https://crontab.guru/ to WISIWIG interface. Timezone is UT + auto_deploy: + type: boolean + description: | + Specify if the job will be automatically updated after receiving a new image tag or a new commit according to the source type. + The new image tag shall be communicated via the "Auto Deploy job" endpoint https://api-doc.qovery.com/#tag/Jobs/operation/autoDeployJobEnvironments From f06ddbf94d96e27627c71c28687c63ad8e2e015a Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 15 Sep 2023 18:02:36 +0200 Subject: [PATCH 02/85] chore(Healthchecks): Make healthcheck object required --- src/schemas/ApplicationRequest.yaml | 1 + src/schemas/ContainerRequest.yaml | 1 + src/schemas/Healthcheck.yaml | 1 + src/schemas/job/JobRequest.yaml | 1 + 4 files changed, 4 insertions(+) diff --git a/src/schemas/ApplicationRequest.yaml b/src/schemas/ApplicationRequest.yaml index 9bbed58a..4cec03e0 100644 --- a/src/schemas/ApplicationRequest.yaml +++ b/src/schemas/ApplicationRequest.yaml @@ -5,6 +5,7 @@ allOf: required: - name - git_repository + - healthchecks properties: name: type: string diff --git a/src/schemas/ContainerRequest.yaml b/src/schemas/ContainerRequest.yaml index d0b59833..69c440b2 100644 --- a/src/schemas/ContainerRequest.yaml +++ b/src/schemas/ContainerRequest.yaml @@ -7,6 +7,7 @@ allOf: - registry_id - image_name - tag + - healthchecks properties: name: type: string diff --git a/src/schemas/Healthcheck.yaml b/src/schemas/Healthcheck.yaml index 56ab8a9d..bd9ac60d 100644 --- a/src/schemas/Healthcheck.yaml +++ b/src/schemas/Healthcheck.yaml @@ -1,4 +1,5 @@ type: object +nullable: false properties: readiness_probe: $ref: './Probe.yaml' diff --git a/src/schemas/job/JobRequest.yaml b/src/schemas/job/JobRequest.yaml index 9d779c41..f1620a37 100644 --- a/src/schemas/job/JobRequest.yaml +++ b/src/schemas/job/JobRequest.yaml @@ -2,6 +2,7 @@ allOf: - type: object required: - name + - healthchecks properties: name: type: string From 0149effdce18f10c777d4b459386d4b83c37c4ea Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 15 Sep 2023 18:23:06 +0200 Subject: [PATCH 03/85] chore(healthchecks): healthchecks are mandatory --- src/schemas/ApplicationResponse.yaml | 2 ++ src/schemas/ContainerResponse.yaml | 1 + src/schemas/job/JobResponse.yaml | 1 + 3 files changed, 4 insertions(+) diff --git a/src/schemas/ApplicationResponse.yaml b/src/schemas/ApplicationResponse.yaml index 697f700f..fa60b4a3 100644 --- a/src/schemas/ApplicationResponse.yaml +++ b/src/schemas/ApplicationResponse.yaml @@ -2,6 +2,8 @@ allOf: - $ref: './BaseResponse.yaml' - $ref: './ServiceStorageResponse.yaml' - type: object + required: + - healthchecks properties: environment: $ref: './ReferenceObject.yaml' diff --git a/src/schemas/ContainerResponse.yaml b/src/schemas/ContainerResponse.yaml index 884f9e8c..8ccfa2e2 100644 --- a/src/schemas/ContainerResponse.yaml +++ b/src/schemas/ContainerResponse.yaml @@ -15,6 +15,7 @@ allOf: - max_running_instances - maximum_cpu - maximum_memory + - healthchecks properties: environment: $ref: './ReferenceObject.yaml' diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index f8da9a26..1c18cfc6 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -14,6 +14,7 @@ allOf: - max_running_instances - maximum_cpu - maximum_memory + - healthchecks properties: environment: $ref: '../ReferenceObject.yaml' From b86265f087b0fc90a53705ce859e9d96cc7883ae Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Fri, 15 Sep 2023 18:24:55 +0200 Subject: [PATCH 04/85] fix: Set proper header for api key (#445) --- src/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openapi.yaml b/src/openapi.yaml index 8a3ddf42..fe8acbfc 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -772,7 +772,7 @@ components: ApiKeyAuth: type: apiKey in: header - name: Token + name: Authorization description: "Token API are generated by Qovery to manage machine to machine interaction and do not have a TTL. Curl Example ' curl https://console.qovery.com/organization -H \"Authorization: Token $qovery_token\" '" security: - bearerAuth: [] From 9f48f016be53d8eac8ac42985564a4da91e1ff3c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 15 Sep 2023 18:42:29 +0200 Subject: [PATCH 05/85] chore(healthchecks): healthchecks are mandatory --- src/schemas/ApplicationEditRequest.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schemas/ApplicationEditRequest.yaml b/src/schemas/ApplicationEditRequest.yaml index 581af891..b2ae37bd 100644 --- a/src/schemas/ApplicationEditRequest.yaml +++ b/src/schemas/ApplicationEditRequest.yaml @@ -1,6 +1,8 @@ allOf: - $ref: './ServiceStorageRequest.yaml' - type: object + required: + - healthchecks properties: name: type: string From 2e5fee7bf92e72a45d121f9ad5be8975b5d559d0 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Mon, 25 Sep 2023 13:21:51 +0200 Subject: [PATCH 06/85] chore: rename metrics to steps in status and add (#446) total_deployment_duration_in_seconds in environment status --- src/schemas/EnvironmentStatus.yaml | 3 +++ src/schemas/Stage.yaml | 2 +- src/schemas/Status.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/schemas/EnvironmentStatus.yaml b/src/schemas/EnvironmentStatus.yaml index e9c87823..cab4b4dd 100644 --- a/src/schemas/EnvironmentStatus.yaml +++ b/src/schemas/EnvironmentStatus.yaml @@ -18,3 +18,6 @@ properties: last_deployment_id: type: string nullable: true + total_deployment_duration_in_seconds: + type: integer + nullable: true diff --git a/src/schemas/Stage.yaml b/src/schemas/Stage.yaml index 8de63ce2..edfd7c3b 100644 --- a/src/schemas/Stage.yaml +++ b/src/schemas/Stage.yaml @@ -9,5 +9,5 @@ properties: name: type: string description: stage name - metrics: + steps: $ref: './StageStepMetrics.yaml' diff --git a/src/schemas/Status.yaml b/src/schemas/Status.yaml index 19f571c2..acd9ab54 100644 --- a/src/schemas/Status.yaml +++ b/src/schemas/Status.yaml @@ -16,6 +16,6 @@ properties: format: date-time is_part_last_deployment: type: boolean - metrics: + steps: $ref: './ServiceStepMetrics.yaml' From 3e86ecbc3054ac5b8fbe634bc8217b7af1e9c257 Mon Sep 17 00:00:00 2001 From: Pierre Gerbelot Date: Wed, 27 Sep 2023 10:50:52 +0200 Subject: [PATCH 07/85] feat: add role for token --- src/schemas/OrganizationApiTokenCreateRequest.yaml | 6 +++++- src/schemas/OrganizationApiTokenCreateResponse.yaml | 7 +++++-- src/schemas/OrganizationApiTokenResponse.yaml | 7 +++++-- src/schemas/enums/OrganizationApiTokenScope.yaml | 2 ++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/schemas/OrganizationApiTokenCreateRequest.yaml b/src/schemas/OrganizationApiTokenCreateRequest.yaml index 1a46c785..b89c4fde 100644 --- a/src/schemas/OrganizationApiTokenCreateRequest.yaml +++ b/src/schemas/OrganizationApiTokenCreateRequest.yaml @@ -1,7 +1,7 @@ type: object required: - name - - scope + - roleId properties: name: type: string @@ -9,3 +9,7 @@ properties: type: string scope: $ref: './enums/OrganizationApiTokenScope.yaml' + roleId: + type: string + format: uuid + nullable: true diff --git a/src/schemas/OrganizationApiTokenCreateResponse.yaml b/src/schemas/OrganizationApiTokenCreateResponse.yaml index d3fa318b..9a039938 100644 --- a/src/schemas/OrganizationApiTokenCreateResponse.yaml +++ b/src/schemas/OrganizationApiTokenCreateResponse.yaml @@ -9,5 +9,8 @@ allOf: token: type: string description: the generated token to send in 'Authorization' header prefixed by 'Token ' - scope: - $ref: './enums/OrganizationApiTokenScope.yaml' + roleName: + type: string + roleId: + type: string + format: uuid \ No newline at end of file diff --git a/src/schemas/OrganizationApiTokenResponse.yaml b/src/schemas/OrganizationApiTokenResponse.yaml index 567541eb..26760883 100644 --- a/src/schemas/OrganizationApiTokenResponse.yaml +++ b/src/schemas/OrganizationApiTokenResponse.yaml @@ -6,5 +6,8 @@ allOf: type: string description: type: string - scope: - $ref: './enums/OrganizationApiTokenScope.yaml' + roleName: + type: string + roleId: + type: string + format: uuid diff --git a/src/schemas/enums/OrganizationApiTokenScope.yaml b/src/schemas/enums/OrganizationApiTokenScope.yaml index 2dcba111..a0336876 100644 --- a/src/schemas/enums/OrganizationApiTokenScope.yaml +++ b/src/schemas/enums/OrganizationApiTokenScope.yaml @@ -1,3 +1,5 @@ type: string +nullable: true +description: deprecated enum: - ADMIN From 4038c672631797a405489e016b8fae6750ca4639 Mon Sep 17 00:00:00 2001 From: Pierre Gerbelot Date: Wed, 27 Sep 2023 12:14:10 +0200 Subject: [PATCH 08/85] add description in OrganizaitionApiTokenCreateRequest --- src/schemas/OrganizationApiTokenCreateRequest.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schemas/OrganizationApiTokenCreateRequest.yaml b/src/schemas/OrganizationApiTokenCreateRequest.yaml index b89c4fde..469f4b99 100644 --- a/src/schemas/OrganizationApiTokenCreateRequest.yaml +++ b/src/schemas/OrganizationApiTokenCreateRequest.yaml @@ -13,3 +13,4 @@ properties: type: string format: uuid nullable: true + description: the roleId provided by the "List organization custom roles" endpoint. From 8cc9a2b7d2b64afc3ace1eccc6ee74b1981f26f7 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Thu, 28 Sep 2023 11:10:09 +0200 Subject: [PATCH 09/85] fix: change roleId and roleName into role_id and role_name (#448) --- src/schemas/OrganizationApiTokenCreateRequest.yaml | 4 ++-- src/schemas/OrganizationApiTokenCreateResponse.yaml | 4 ++-- src/schemas/OrganizationApiTokenResponse.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/schemas/OrganizationApiTokenCreateRequest.yaml b/src/schemas/OrganizationApiTokenCreateRequest.yaml index 469f4b99..5ab38c8d 100644 --- a/src/schemas/OrganizationApiTokenCreateRequest.yaml +++ b/src/schemas/OrganizationApiTokenCreateRequest.yaml @@ -1,7 +1,7 @@ type: object required: - name - - roleId + - role_id properties: name: type: string @@ -9,7 +9,7 @@ properties: type: string scope: $ref: './enums/OrganizationApiTokenScope.yaml' - roleId: + role_id: type: string format: uuid nullable: true diff --git a/src/schemas/OrganizationApiTokenCreateResponse.yaml b/src/schemas/OrganizationApiTokenCreateResponse.yaml index 9a039938..1195bf52 100644 --- a/src/schemas/OrganizationApiTokenCreateResponse.yaml +++ b/src/schemas/OrganizationApiTokenCreateResponse.yaml @@ -9,8 +9,8 @@ allOf: token: type: string description: the generated token to send in 'Authorization' header prefixed by 'Token ' - roleName: + role_name: type: string - roleId: + role_id: type: string format: uuid \ No newline at end of file diff --git a/src/schemas/OrganizationApiTokenResponse.yaml b/src/schemas/OrganizationApiTokenResponse.yaml index 26760883..8fa02b55 100644 --- a/src/schemas/OrganizationApiTokenResponse.yaml +++ b/src/schemas/OrganizationApiTokenResponse.yaml @@ -6,8 +6,8 @@ allOf: type: string description: type: string - roleName: + role_name: type: string - roleId: + role_id: type: string format: uuid From 464dadafb3311832960586202c14f0fa519f67c3 Mon Sep 17 00:00:00 2001 From: Pierre Gerbelot Date: Thu, 28 Sep 2023 14:12:58 +0200 Subject: [PATCH 10/85] feat: add queueing steps in metrics --- src/schemas/enums/ServiceStepMetricName.yaml | 4 ++++ src/schemas/enums/StageStepMetricName.yaml | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/schemas/enums/ServiceStepMetricName.yaml b/src/schemas/enums/ServiceStepMetricName.yaml index ee169211..3bbb744d 100644 --- a/src/schemas/enums/ServiceStepMetricName.yaml +++ b/src/schemas/enums/ServiceStepMetricName.yaml @@ -2,13 +2,17 @@ type: string enum: - REGISTRY_CREATE_REPOSITORY - GIT_CLONE + - BUILD_QUEUEING - BUILD + - DEPLOYMENT_QUEUEING - DEPLOYMENT - ROUTER_DEPLOYMENT description: | The name of the deployment step at the service level: - REGISTRY_CREATE_REPOSITORY: The step to create the repository in the registry. - GIT_CLONE: The step to clone the source code repository. + - BUILD_QUEUEING: The step preceding the actual building step. - BUILD: The step to build the source code. + - DEPLOYMENT_QUEUEING: The step preceding the actual deployment step. - DEPLOYMENT: The step to deploy the service. - ROUTER_DEPLOYMENT: The step to deploy the router. diff --git a/src/schemas/enums/StageStepMetricName.yaml b/src/schemas/enums/StageStepMetricName.yaml index 3fa294fa..004a3962 100644 --- a/src/schemas/enums/StageStepMetricName.yaml +++ b/src/schemas/enums/StageStepMetricName.yaml @@ -1,6 +1,8 @@ type: string enum: + - QUEUEING - PROVISION_BUILDER description: | The name of the deployment step at the stage level: - - PROVISION_BUILDER: The step to provision builders before the actual build + - QUEUEING: The step preceding the actual stage deployment step. + - PROVISION_BUILDER: The step to provision builders before the actual build. From 74e75c1789f06d783b12473130e63bcf8289b4b4 Mon Sep 17 00:00:00 2001 From: acarranoqovery <105300721+acarranoqovery@users.noreply.github.com> Date: Thu, 28 Sep 2023 14:35:07 +0200 Subject: [PATCH 11/85] updated desc --- src/schemas/enums/ServiceStepMetricName.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schemas/enums/ServiceStepMetricName.yaml b/src/schemas/enums/ServiceStepMetricName.yaml index 3bbb744d..b70eca83 100644 --- a/src/schemas/enums/ServiceStepMetricName.yaml +++ b/src/schemas/enums/ServiceStepMetricName.yaml @@ -11,8 +11,8 @@ description: | The name of the deployment step at the service level: - REGISTRY_CREATE_REPOSITORY: The step to create the repository in the registry. - GIT_CLONE: The step to clone the source code repository. - - BUILD_QUEUEING: The step preceding the actual building step. + - BUILD_QUEUEING: The queuing time preceding the actual building step. - BUILD: The step to build the source code. - - DEPLOYMENT_QUEUEING: The step preceding the actual deployment step. + - DEPLOYMENT_QUEUEING: The queuing time preceding the actual deployment step. - DEPLOYMENT: The step to deploy the service. - ROUTER_DEPLOYMENT: The step to deploy the router. From 730ba2e5b818b7e71b597c72eb64cff7d1318460 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Mon, 2 Oct 2023 14:28:08 +0200 Subject: [PATCH 12/85] feat(COR-715) add INVALID_CREDENTIALS in cluster state (#452) --- src/schemas/ClusterResponse.yaml | 2 +- src/schemas/ClusterStatusGetResponse.yaml | 2 +- src/schemas/ClusterStatusResponse.yaml | 2 +- src/schemas/_index.yaml | 2 ++ src/schemas/enums/ClusterState.yaml | 25 +++++++++++++++++++++++ 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 src/schemas/enums/ClusterState.yaml diff --git a/src/schemas/ClusterResponse.yaml b/src/schemas/ClusterResponse.yaml index bbbff8db..6d8cb00e 100644 --- a/src/schemas/ClusterResponse.yaml +++ b/src/schemas/ClusterResponse.yaml @@ -45,7 +45,7 @@ allOf: type: integer description: This is an estimation of the cost this cluster will represent on your cloud proider bill, based on your current configuration status: - $ref: './enums/State.yaml' + $ref: './enums/ClusterState.yaml' has_access: type: boolean version: diff --git a/src/schemas/ClusterStatusGetResponse.yaml b/src/schemas/ClusterStatusGetResponse.yaml index b3d0bac9..fb268229 100644 --- a/src/schemas/ClusterStatusGetResponse.yaml +++ b/src/schemas/ClusterStatusGetResponse.yaml @@ -4,7 +4,7 @@ properties: type: string format: uuid status: - $ref: './enums/State.yaml' + $ref: './enums/ClusterState.yaml' is_deployed: type: boolean last_execution_id: diff --git a/src/schemas/ClusterStatusResponse.yaml b/src/schemas/ClusterStatusResponse.yaml index f8869615..94ef9ca9 100644 --- a/src/schemas/ClusterStatusResponse.yaml +++ b/src/schemas/ClusterStatusResponse.yaml @@ -4,6 +4,6 @@ properties: type: string format: uuid status: - $ref: './enums/State.yaml' + $ref: './enums/ClusterState.yaml' is_deployed: type: boolean diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 026d79e1..7b3ef3f8 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -616,6 +616,8 @@ SignUpRequest: $ref: ./SignUpRequest.yaml StateEnum: $ref: ./enums/State.yaml +ClusterStateEnum: + $ref: ./enums/ClusterState.yaml Status: $ref: ./Status.yaml Stage: diff --git a/src/schemas/enums/ClusterState.yaml b/src/schemas/enums/ClusterState.yaml new file mode 100644 index 00000000..0c60509a --- /dev/null +++ b/src/schemas/enums/ClusterState.yaml @@ -0,0 +1,25 @@ +type: string +enum: + - BUILDING + - BUILD_ERROR + - CANCELED + - CANCELING + - DELETED + - DELETE_ERROR + - DELETE_QUEUED + - DELETING + - DEPLOYED + - DEPLOYING + - DEPLOYMENT_ERROR + - DEPLOYMENT_QUEUED + - QUEUED + - READY + - STOPPED + - STOPPING + - STOP_ERROR + - STOP_QUEUED + - RESTART_QUEUED + - RESTARTING + - RESTARTED + - RESTART_ERROR + - INVALID_CREDENTIALS \ No newline at end of file From a5328a87e7ac85f0a50222f1d31a615a9f8c1629 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Mon, 2 Oct 2023 19:48:37 +0200 Subject: [PATCH 13/85] fix(schemas): fix registry type which can be null (#453) --- src/schemas/job/JobResponse.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index 1c18cfc6..2989ed2c 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -20,6 +20,7 @@ allOf: $ref: '../ReferenceObject.yaml' registry: $ref: '../ReferenceObject.yaml' + nullable: true maximum_cpu: type: integer description: Maximum cpu that can be allocated to the job based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu From 92f6234fe015d372131afbfd8153bf9eff49329d Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Tue, 3 Oct 2023 11:19:39 +0200 Subject: [PATCH 14/85] fix(schemas): turn option registry into optionnal (#454) --- src/schemas/job/JobResponse.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index 2989ed2c..34c64d3e 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -3,7 +3,6 @@ allOf: - type: object required: - environment - - registry - name - image_name - tag @@ -20,7 +19,6 @@ allOf: $ref: '../ReferenceObject.yaml' registry: $ref: '../ReferenceObject.yaml' - nullable: true maximum_cpu: type: integer description: Maximum cpu that can be allocated to the job based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu From ef7debdbd367fbee62bebf0d82cff7788184eefd Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Tue, 3 Oct 2023 15:15:48 +0200 Subject: [PATCH 15/85] feat: Add associated registry details in job & container response (#455) --- .../ContainerRegistryProviderDetailsResponse.yaml | 12 ++++++++++++ src/schemas/ContainerResponse.yaml | 2 +- src/schemas/_index.yaml | 2 ++ src/schemas/job/JobResponse.yaml | 4 ++-- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/schemas/ContainerRegistryProviderDetailsResponse.yaml diff --git a/src/schemas/ContainerRegistryProviderDetailsResponse.yaml b/src/schemas/ContainerRegistryProviderDetailsResponse.yaml new file mode 100644 index 00000000..4922b8f7 --- /dev/null +++ b/src/schemas/ContainerRegistryProviderDetailsResponse.yaml @@ -0,0 +1,12 @@ +type: object +properties: + id: + type: string + format: uuid + name: + type: string + url: + type: string + description: URL of the container registry + kind: + $ref: ./enums/ContainerRegistryKind.yaml diff --git a/src/schemas/ContainerResponse.yaml b/src/schemas/ContainerResponse.yaml index 8ccfa2e2..67da99e4 100644 --- a/src/schemas/ContainerResponse.yaml +++ b/src/schemas/ContainerResponse.yaml @@ -20,7 +20,7 @@ allOf: environment: $ref: './ReferenceObject.yaml' registry: - $ref: './ReferenceObject.yaml' + $ref: './ContainerRegistryProviderDetailsResponse.yaml' maximum_cpu: type: integer description: Maximum cpu that can be allocated to the container based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 7b3ef3f8..64d7f45b 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -160,6 +160,8 @@ ContainerRegistryRequest: $ref: ./ContainerRegistryRequest.yaml ContainerRegistryResponse: $ref: ./ContainerRegistryResponse.yaml +ContainerRegistryProviderDetailsResponse: + $ref: ./ContainerRegistryProviderDetailsResponse.yaml ContainerRegistryResponseList: $ref: ./ContainerRegistryResponseList.yaml ContainerRequest: diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index 34c64d3e..48c9e2a7 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -17,8 +17,6 @@ allOf: properties: environment: $ref: '../ReferenceObject.yaml' - registry: - $ref: '../ReferenceObject.yaml' maximum_cpu: type: integer description: Maximum cpu that can be allocated to the job based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu @@ -84,6 +82,8 @@ allOf: registry_id: type: string description: tag of the image container + registry: + $ref: '../ContainerRegistryProviderDetailsResponse.yaml' docker: type: object nullable: true From 7af580c1b51b9d7b5b8c7c9e4ce8f7cd76661945 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Tue, 3 Oct 2023 15:23:24 +0200 Subject: [PATCH 16/85] feat: Add mirror image step (#456) --- src/schemas/enums/ServiceStepMetricName.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schemas/enums/ServiceStepMetricName.yaml b/src/schemas/enums/ServiceStepMetricName.yaml index b70eca83..c2723ca8 100644 --- a/src/schemas/enums/ServiceStepMetricName.yaml +++ b/src/schemas/enums/ServiceStepMetricName.yaml @@ -7,6 +7,7 @@ enum: - DEPLOYMENT_QUEUEING - DEPLOYMENT - ROUTER_DEPLOYMENT + - MIRROR_IMAGE description: | The name of the deployment step at the service level: - REGISTRY_CREATE_REPOSITORY: The step to create the repository in the registry. @@ -16,3 +17,4 @@ description: | - DEPLOYMENT_QUEUEING: The queuing time preceding the actual deployment step. - DEPLOYMENT: The step to deploy the service. - ROUTER_DEPLOYMENT: The step to deploy the router. + - MIRROR_IMAGE: The step to mirror the image to the private registry. From 3c0a729f923b353ec6b2e671ed543265e35db523 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Tue, 3 Oct 2023 16:03:57 +0200 Subject: [PATCH 17/85] chore: remove auto deploy from environment and project deployment rule (#451) --- src/schemas/DeploymentRuleRequest.yaml | 3 --- src/schemas/EnvironmentDeploymentRuleEditRequest.yaml | 3 --- src/schemas/EnvironmentDeploymentRuleResponse.yaml | 3 --- src/schemas/ProjectDeploymentRuleRequest.yaml | 3 --- 4 files changed, 12 deletions(-) diff --git a/src/schemas/DeploymentRuleRequest.yaml b/src/schemas/DeploymentRuleRequest.yaml index 38265088..b4ef7654 100644 --- a/src/schemas/DeploymentRuleRequest.yaml +++ b/src/schemas/DeploymentRuleRequest.yaml @@ -15,9 +15,6 @@ properties: cluster: type: string format: uuid - auto_deploy: - type: boolean - default: true auto_stop: type: boolean default: false diff --git a/src/schemas/EnvironmentDeploymentRuleEditRequest.yaml b/src/schemas/EnvironmentDeploymentRuleEditRequest.yaml index 046bdc88..98b00844 100644 --- a/src/schemas/EnvironmentDeploymentRuleEditRequest.yaml +++ b/src/schemas/EnvironmentDeploymentRuleEditRequest.yaml @@ -5,9 +5,6 @@ required: - stop_time - weekdays properties: - auto_deploy: - type: boolean - default: true on_demand_preview: type: boolean default: false diff --git a/src/schemas/EnvironmentDeploymentRuleResponse.yaml b/src/schemas/EnvironmentDeploymentRuleResponse.yaml index 7faeb771..b2409379 100644 --- a/src/schemas/EnvironmentDeploymentRuleResponse.yaml +++ b/src/schemas/EnvironmentDeploymentRuleResponse.yaml @@ -7,9 +7,6 @@ allOf: - stop_time - weekdays properties: - auto_deploy: - type: boolean - default: true on_demand_preview: type: boolean default: false diff --git a/src/schemas/ProjectDeploymentRuleRequest.yaml b/src/schemas/ProjectDeploymentRuleRequest.yaml index 9d3a2dd4..da4c096c 100644 --- a/src/schemas/ProjectDeploymentRuleRequest.yaml +++ b/src/schemas/ProjectDeploymentRuleRequest.yaml @@ -22,9 +22,6 @@ properties: cluster_id: type: string format: uuid - auto_deploy: - type: boolean - default: false auto_stop: type: boolean default: false From 6759e98a1e68dfd4ef5a96e009ed03eba11920c0 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Tue, 3 Oct 2023 16:46:07 +0200 Subject: [PATCH 18/85] feat(COR-719) add generate certificate flag to custom domain (#450) * add generate certificate flag to custom domain * Update CustomDomainRequest.yaml * Update CustomDomainRequest.yaml --------- Co-authored-by: acarranoqovery <105300721+acarranoqovery@users.noreply.github.com> --- src/resources/ApplicationCustomDomainRef.yaml | 2 +- src/schemas/CustomDomainRequest.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/resources/ApplicationCustomDomainRef.yaml b/src/resources/ApplicationCustomDomainRef.yaml index 154e6496..63e9009c 100644 --- a/src/resources/ApplicationCustomDomainRef.yaml +++ b/src/resources/ApplicationCustomDomainRef.yaml @@ -1,7 +1,7 @@ put: summary: 'Edit a Custom Domain' - description: 'To edit a Custom Domain you must have the project user permission' + description: 'To edit a Custom Domain you must have the project user permission' operationId: editCustomDomain parameters: - $ref: '../parameters/path/applicationId.yaml' diff --git a/src/schemas/CustomDomainRequest.yaml b/src/schemas/CustomDomainRequest.yaml index e800edc4..5f1f9ee3 100644 --- a/src/schemas/CustomDomainRequest.yaml +++ b/src/schemas/CustomDomainRequest.yaml @@ -6,3 +6,6 @@ properties: type: string description: your custom domain example: my.domain.tld + generate_certificate: + type: boolean + description: to control if a certificate has to be generated for this custom domain by Qovery. The default value is `true`. This flag should be set to `false` if a CDN or other entities are managing the certificate for the specified domain and the traffic is proxied by the CDN to Qovery. From e6d09a0f4af28040340eed7c07a24c8ed2c98da6 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Tue, 3 Oct 2023 17:43:27 +0200 Subject: [PATCH 19/85] fix: add generate_certificate value when listing custom domains (#457) --- src/schemas/CustomDomainResponse.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/schemas/CustomDomainResponse.yaml b/src/schemas/CustomDomainResponse.yaml index 1ea9b984..ac3c7733 100644 --- a/src/schemas/CustomDomainResponse.yaml +++ b/src/schemas/CustomDomainResponse.yaml @@ -8,3 +8,7 @@ allOf: description: URL provided by Qovery. You must create a CNAME on your DNS provider using that URL status: $ref: './enums/CustomDomainStatus.yaml' + generate_certificate: + type: boolean + description: to control if a certificate has to be generated for this custom domain by Qovery. The default value is `true`. This flag should be set to `false` if a CDN or other entities are managing the certificate for the specified domain and the traffic is proxied by the CDN to Qovery. + From 341d67fd38886b54b798892e159061233ef6dd16 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Tue, 3 Oct 2023 18:36:50 +0200 Subject: [PATCH 20/85] fix(schemas): add missing required fields (#458) --- src/schemas/ContainerRegistryProviderDetailsResponse.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/schemas/ContainerRegistryProviderDetailsResponse.yaml b/src/schemas/ContainerRegistryProviderDetailsResponse.yaml index 4922b8f7..4a1ca08a 100644 --- a/src/schemas/ContainerRegistryProviderDetailsResponse.yaml +++ b/src/schemas/ContainerRegistryProviderDetailsResponse.yaml @@ -1,4 +1,9 @@ type: object +required: + - id + - name + - url + - kind properties: id: type: string From 5a7808843f33da89e84223a32fd8d454d1f89fb3 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Wed, 4 Oct 2023 14:02:37 +0200 Subject: [PATCH 21/85] feat: Add cluster delete mode (#459) --- src/resources/OrganizationClusterRef.yaml | 4 ++++ src/schemas/enums/ClusterDeleteMode.yaml | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/schemas/enums/ClusterDeleteMode.yaml diff --git a/src/resources/OrganizationClusterRef.yaml b/src/resources/OrganizationClusterRef.yaml index 2f8c3d63..04c20059 100644 --- a/src/resources/OrganizationClusterRef.yaml +++ b/src/resources/OrganizationClusterRef.yaml @@ -4,6 +4,10 @@ delete: parameters: - $ref: '../parameters/path/organizationId.yaml' - $ref: '../parameters/path/clusterId.yaml' + - in: query + name: deleteMode + schema: + $ref: '../schemas/enums/ClusterDeleteMode.yaml' tags: - Clusters responses: diff --git a/src/schemas/enums/ClusterDeleteMode.yaml b/src/schemas/enums/ClusterDeleteMode.yaml new file mode 100644 index 00000000..87360239 --- /dev/null +++ b/src/schemas/enums/ClusterDeleteMode.yaml @@ -0,0 +1,13 @@ +type: string +description: | + Indicates the mode to apply on cluster deletion + **"hard delete"** means that we delete directly from our database, this is different from a **"trigger delete"** that cleans the resource + - `DEFAULT`: this is the normal way, trigger delete the cluster only if no environment linked to this cluster remains + - `DELETE_CLUSTER_AND_QOVERY_CONFIG`: hard delete environments linked to this cluster then trigger delete the cluster + - `DELETE_QOVERY_CONFIG`: hard delete environments linked to this cluster then hard delete the cluster +enum: + - DEFAULT + - DELETE_CLUSTER_AND_QOVERY_CONFIG + - DELETE_QOVERY_CONFIG +example: DEFAULT +default: DEFAULT From 48cfaf5dc7e29adc1965b70bd058028fcbc79060 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Wed, 4 Oct 2023 17:15:24 +0200 Subject: [PATCH 22/85] fix: Add ClusterDeleteMode to enum (#460) --- src/schemas/_index.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 64d7f45b..f410e8ed 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -94,6 +94,8 @@ CloudProviderResponseList: $ref: ./CloudProviderResponseList.yaml Cluster: $ref: ./ClusterResponse.yaml +ClusterDeleteMode: + $ref: ./enums/ClusterDeleteMode.yaml ClusterLogs: $ref: ./ClusterLogsResponse.yaml ClusterCloudProviderInfo: From c7f13d88d1811c4a90f9e981589bb42a9d289457 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Wed, 4 Oct 2023 17:20:01 +0200 Subject: [PATCH 23/85] feat: Allow multiple services to be stopped or deleted (#461) --- src/openapi.yaml | 4 +++ src/resources/EnvironmentServiceDelete.yaml | 26 +++++++++++++++++++ src/resources/EnvironmentServiceStop.yaml | 26 +++++++++++++++++++ .../EnvironmentServiceIdsAllRequest.yaml | 22 ++++++++++++++++ src/schemas/_index.yaml | 2 ++ 5 files changed, 80 insertions(+) create mode 100644 src/resources/EnvironmentServiceDelete.yaml create mode 100644 src/resources/EnvironmentServiceStop.yaml create mode 100644 src/schemas/EnvironmentServiceIdsAllRequest.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index fe8acbfc..be970102 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -456,6 +456,10 @@ paths: $ref: './resources/EnvironmentServiceDeploy.yaml' /environment/{environmentId}/service/restart-service: $ref: './resources/EnvironmentServiceReboot.yaml' + /environment/{environmentId}/service/stop: + $ref: './resources/EnvironmentServiceStop.yaml' + /environment/{environmentId}/service/delete: + $ref: './resources/EnvironmentServiceDelete.yaml' /organization/{organizationId}/container/deploy: $ref: './resources/OrganizationContainerAutoDeploy.yaml' /organization/{organizationId}/container/preview: diff --git a/src/resources/EnvironmentServiceDelete.yaml b/src/resources/EnvironmentServiceDelete.yaml new file mode 100644 index 00000000..c8f604cc --- /dev/null +++ b/src/resources/EnvironmentServiceDelete.yaml @@ -0,0 +1,26 @@ +post: + summary: 'Delete services' + description: Delete selected services + operationId: deleteSelectedServices + parameters: + - $ref: '../parameters/path/environmentId.yaml' + tags: + - Environment Actions + requestBody: + content: + application/json: + schema: + $ref: '../schemas/EnvironmentServiceIdsAllRequest.yaml' + responses: + '200': + description: 'Services have been triggered to be deleted' + '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/EnvironmentServiceStop.yaml b/src/resources/EnvironmentServiceStop.yaml new file mode 100644 index 00000000..6a6cb632 --- /dev/null +++ b/src/resources/EnvironmentServiceStop.yaml @@ -0,0 +1,26 @@ +post: + summary: 'Stop services' + description: Stop selected services + operationId: stopSelectedServices + parameters: + - $ref: '../parameters/path/environmentId.yaml' + tags: + - Environment Actions + requestBody: + content: + application/json: + schema: + $ref: '../schemas/EnvironmentServiceIdsAllRequest.yaml' + responses: + '200': + description: 'Services have been triggered to be deleted' + '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/schemas/EnvironmentServiceIdsAllRequest.yaml b/src/schemas/EnvironmentServiceIdsAllRequest.yaml new file mode 100644 index 00000000..14045e4f --- /dev/null +++ b/src/schemas/EnvironmentServiceIdsAllRequest.yaml @@ -0,0 +1,22 @@ +type: object +properties: + application_ids: + type: array + items: + type: string + format: uuid + container_ids: + type: array + items: + type: string + format: uuid + database_ids: + type: array + items: + type: string + format: uuid + job_ids: + type: array + items: + type: string + format: uuid diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index f410e8ed..299125d3 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -328,6 +328,8 @@ EnvironmentVariableRequest: $ref: ./EnvironmentVariableRequest.yaml EnvironmentVariableResponseList: $ref: ./EnvironmentVariableResponseList.yaml +EnvironmentServiceIdsAllRequest: + $ref: ./EnvironmentServiceIdsAllRequest.yaml APIVariableScopeEnum: $ref: ./enums/APIVariableScope.yaml APIVariableTypeEnum: From c864a17c3a70c6e804a76761fa2206e9b7ef6e06 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Thu, 5 Oct 2023 10:55:33 +0200 Subject: [PATCH 24/85] fix: make generate_certificate required (#462) --- src/schemas/CustomDomainRequest.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schemas/CustomDomainRequest.yaml b/src/schemas/CustomDomainRequest.yaml index 5f1f9ee3..c970b6ed 100644 --- a/src/schemas/CustomDomainRequest.yaml +++ b/src/schemas/CustomDomainRequest.yaml @@ -1,6 +1,7 @@ type: object required: - domain + - generate_certificate properties: domain: type: string From e4ed37531d14fd03afe3b1fca07067d1092af2a9 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Thu, 5 Oct 2023 11:21:10 +0200 Subject: [PATCH 25/85] chore: upgrade typescript axios (#463) * bump typescript-axios * enable stringEnums for typescript-axios-ws --- .github/workflows/generate-clients.yaml | 2 +- generator/configs/typescript-axios-ws.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-clients.yaml b/.github/workflows/generate-clients.yaml index 8380fa30..cd6b38a9 100644 --- a/.github/workflows/generate-clients.yaml +++ b/.github/workflows/generate-clients.yaml @@ -33,7 +33,7 @@ jobs: deploy-ssh-key: SSH_DEPLOY_KEY_PYTHON deploy-ssh-key-ws: SSH_DEPLOY_KEY_WS_PYTHON - language: typescript-axios - version: 5.3.1 + version: 7.0.1 target-branch: main deploy-ssh-key: SSH_DEPLOY_KEY_TYPESCRIPT_AXIOS deploy-ssh-key-ws: SSH_DEPLOY_KEY_WS_TYPESCRIPT_AXIOS diff --git a/generator/configs/typescript-axios-ws.yaml b/generator/configs/typescript-axios-ws.yaml index 78f1d855..198cabb5 100644 --- a/generator/configs/typescript-axios-ws.yaml +++ b/generator/configs/typescript-axios-ws.yaml @@ -1,4 +1,5 @@ additionalProperties: supportsES6: true + stringEnums: true enumPropertyNaming: UPPERCASE npmName: qovery-ws-typescript-axios From c93d8b03e762ed51b2d3dca884ab93b71d1cf48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bonnet?= Date: Thu, 5 Oct 2023 14:49:38 +0200 Subject: [PATCH 26/85] fix: available role response required properties (#464) --- src/schemas/OrganizationAvailableRoleResponse.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/schemas/OrganizationAvailableRoleResponse.yaml b/src/schemas/OrganizationAvailableRoleResponse.yaml index c35d6de1..225a25ca 100644 --- a/src/schemas/OrganizationAvailableRoleResponse.yaml +++ b/src/schemas/OrganizationAvailableRoleResponse.yaml @@ -1,4 +1,7 @@ type: object +required: + - id + - name properties: id: type: string From 0ca152bede3c7fd3d85c8728815872b1aefac112 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Wed, 12 Jul 2023 16:11:03 +0200 Subject: [PATCH 27/85] chore: remove unused endpoints --- src/openapi.yaml | 10 +--------- src/resources/ApplicationEvent.yaml | 23 ----------------------- src/resources/ApplicationEventLastId.yaml | 22 ---------------------- src/resources/ApplicationEventTail.yaml | 22 ---------------------- src/resources/DatabaseEvent.yaml | 23 ----------------------- src/resources/DatabaseEventLastId.yaml | 22 ---------------------- src/resources/DatabaseEventTail.yaml | 22 ---------------------- 7 files changed, 1 insertion(+), 143 deletions(-) delete mode 100644 src/resources/ApplicationEvent.yaml delete mode 100644 src/resources/ApplicationEventLastId.yaml delete mode 100644 src/resources/ApplicationEventTail.yaml delete mode 100644 src/resources/DatabaseEvent.yaml delete mode 100644 src/resources/DatabaseEventLastId.yaml delete mode 100644 src/resources/DatabaseEventTail.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index be970102..8c340947 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -35,7 +35,6 @@ tags: - name: Container Database - name: Container Deployment History - name: Container Environment Variable - - name: Container Event - name: Container Logs - name: Container Main Calls - name: Container Metrics @@ -50,7 +49,6 @@ tags: - name: Job Deployment Restriction - name: Job Deployment History - name: Job Environment Variable - - name: Job Event - name: Job Logs - name: Job Main Calls - name: Job Metrics @@ -170,7 +168,6 @@ x-tagGroups: - Container Deployment History - Container Environment Variable - Container Secret - - Container Event - name: Database tags: - Database Main Calls @@ -194,7 +191,6 @@ x-tagGroups: - Job Deployment History - Job Environment Variable - Job Secret - - Job Event - name: Account tags: - Account Info @@ -538,8 +534,6 @@ paths: $ref: './resources/ApplicationReboot.yaml' /application/{applicationId}/deploymentHistory: $ref: './resources/ApplicationDeploymentHistory.yaml' - /application/{applicationId}/event: - $ref: './resources/ApplicationEvent.yaml' /application/{applicationId}/environmentVariable: $ref: './resources/ApplicationEnvironmentVariable.yaml' /application/{applicationId}/environmentVariable/import: @@ -674,8 +668,6 @@ paths: $ref: './resources/DatabaseBackup.yaml' /database/{databaseId}/backup/{backupId}: $ref: './resources/DatabaseBackupRef.yaml' - /database/{databaseId}/event: - $ref: './resources/DatabaseEvent.yaml' /database/{databaseId}/clone: $ref: './resources/DatabaseClone.yaml' /account: @@ -783,4 +775,4 @@ security: - ApiKeyAuth: [] - + diff --git a/src/resources/ApplicationEvent.yaml b/src/resources/ApplicationEvent.yaml deleted file mode 100644 index d913d99e..00000000 --- a/src/resources/ApplicationEvent.yaml +++ /dev/null @@ -1,23 +0,0 @@ -get: - summary: 'List application events' - description: By default it returns the 20 last results. The response is paginated. In order to request the next page, you can use the startId query parameter - operationId: listApplicationEvent - parameters: - - $ref: '../parameters/path/applicationId.yaml' - - $ref: '../parameters/query/startId.yaml' - tags: - - Application Event - responses: - '200': - description: 'List events' - content: - application/json: - schema: - $ref: '../schemas/EventPaginatedResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' - '403': - $ref: '../responses/Forbidden.yaml' - '404': - $ref: '../responses/NotFound.yaml' - diff --git a/src/resources/ApplicationEventLastId.yaml b/src/resources/ApplicationEventLastId.yaml deleted file mode 100644 index 6a4776ab..00000000 --- a/src/resources/ApplicationEventLastId.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - summary: 'List all the last application events after a certain event Id' - description: Returns all last events that happened on the application, after the event ID you specify in the lastId query parameter. Response is not paginated - operationId: listApplicationEventLastId - parameters: - - $ref: '../parameters/path/applicationId.yaml' - - $ref: '../parameters/query/lastId.yaml' - tags: - - Application Event - responses: - '200': - description: 'List events' - content: - application/json: - schema: - $ref: '../schemas/EventResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' - '403': - $ref: '../responses/Forbidden.yaml' - '404': - $ref: '../responses/NotFound.yaml' diff --git a/src/resources/ApplicationEventTail.yaml b/src/resources/ApplicationEventTail.yaml deleted file mode 100644 index 4252fb9f..00000000 --- a/src/resources/ApplicationEventTail.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - summary: 'List XX last application events' - description: Returns all last XX events. Response is not paginated - operationId: listApplicationEventTail - parameters: - - $ref: '../parameters/path/applicationId.yaml' - - $ref: '../parameters/query/tail.yaml' - tags: - - Application Event - responses: - '200': - description: 'List events' - content: - application/json: - schema: - $ref: '../schemas/EventResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' - '403': - $ref: '../responses/Forbidden.yaml' - '404': - $ref: '../responses/NotFound.yaml' diff --git a/src/resources/DatabaseEvent.yaml b/src/resources/DatabaseEvent.yaml deleted file mode 100644 index 1b759326..00000000 --- a/src/resources/DatabaseEvent.yaml +++ /dev/null @@ -1,23 +0,0 @@ -get: - summary: 'List database events' - description: By default it returns the 20 last results. The response is paginated. In order to request the next page, you can use the startId query parameter - operationId: listDatabaseEvent - parameters: - - $ref: '../parameters/path/databaseId.yaml' - - $ref: '../parameters/query/startId.yaml' - tags: - - Database Event - responses: - '200': - description: 'List events' - content: - application/json: - schema: - $ref: '../schemas/EventPaginatedResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' - '403': - $ref: '../responses/Forbidden.yaml' - '404': - $ref: '../responses/NotFound.yaml' - diff --git a/src/resources/DatabaseEventLastId.yaml b/src/resources/DatabaseEventLastId.yaml deleted file mode 100644 index 4dac47bb..00000000 --- a/src/resources/DatabaseEventLastId.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - summary: 'List all the last database events after a certain event Id' - description: Returns all last events that happened on the database , after the event ID you specify in the lastId query parameter. Response is not paginated - operationId: listDatabaseEventLastId - parameters: - - $ref: '../parameters/path/databaseId.yaml' - - $ref: '../parameters/query/lastId.yaml' - tags: - - Database Event - responses: - '200': - description: 'List events' - content: - application/json: - schema: - $ref: '../schemas/EventResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' - '403': - $ref: '../responses/Forbidden.yaml' - '404': - $ref: '../responses/NotFound.yaml' diff --git a/src/resources/DatabaseEventTail.yaml b/src/resources/DatabaseEventTail.yaml deleted file mode 100644 index 583869a0..00000000 --- a/src/resources/DatabaseEventTail.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - summary: 'List XX last database events' - description: Returns all last XX events. Response is not paginated - operationId: listDatabaseEventTail - parameters: - - $ref: '../parameters/path/databaseId.yaml' - - $ref: '../parameters/query/tail.yaml' - tags: - - Database Event - responses: - '200': - description: 'List events' - content: - application/json: - schema: - $ref: '../schemas/EventResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' - '403': - $ref: '../responses/Forbidden.yaml' - '404': - $ref: '../responses/NotFound.yaml' From 9037730fb368454270ce061bd53954237303cd73 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Fri, 6 Oct 2023 11:56:46 +0200 Subject: [PATCH 28/85] doc: Update cluster delete mode description (#466) --- src/schemas/enums/ClusterDeleteMode.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/enums/ClusterDeleteMode.yaml b/src/schemas/enums/ClusterDeleteMode.yaml index 87360239..1d2db74f 100644 --- a/src/schemas/enums/ClusterDeleteMode.yaml +++ b/src/schemas/enums/ClusterDeleteMode.yaml @@ -4,7 +4,7 @@ description: | **"hard delete"** means that we delete directly from our database, this is different from a **"trigger delete"** that cleans the resource - `DEFAULT`: this is the normal way, trigger delete the cluster only if no environment linked to this cluster remains - `DELETE_CLUSTER_AND_QOVERY_CONFIG`: hard delete environments linked to this cluster then trigger delete the cluster - - `DELETE_QOVERY_CONFIG`: hard delete environments linked to this cluster then hard delete the cluster + - `DELETE_QOVERY_CONFIG`: ⚠️ ⚠️ ⚠️ hard delete environments linked to this cluster then hard delete the cluster - whole cluster ressources **are not deleted** on our side and must be deleted on your side enum: - DEFAULT - DELETE_CLUSTER_AND_QOVERY_CONFIG From 45239645283ae1ba7bc27973748a3adb4c7307c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bonnet?= Date: Mon, 9 Oct 2023 17:40:17 +0200 Subject: [PATCH 29/85] fix: config typescript axios stringEnum (#467) --- generator/configs/typescript-axios-ws.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/generator/configs/typescript-axios-ws.yaml b/generator/configs/typescript-axios-ws.yaml index 198cabb5..78f1d855 100644 --- a/generator/configs/typescript-axios-ws.yaml +++ b/generator/configs/typescript-axios-ws.yaml @@ -1,5 +1,4 @@ additionalProperties: supportsES6: true - stringEnums: true enumPropertyNaming: UPPERCASE npmName: qovery-ws-typescript-axios From e78d4dcb240c993337c76cc5b8fbf492abe2c8f9 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Tue, 10 Oct 2023 11:43:30 +0200 Subject: [PATCH 30/85] chore: Add npm test step CI (#465) * chore: Add npm test step CI * fix: Remove openapi errors --- .github/workflows/openapi-test.yaml | 18 ++++++++++++++++++ src/schemas/ClusterRequest.yaml | 3 +-- src/schemas/ClusterResponse.yaml | 3 +-- src/schemas/CommitResponse.yaml | 1 + src/schemas/EnvironmentVariableResponse.yaml | 3 --- src/schemas/Healthcheck.yaml | 2 -- src/schemas/InviteMemberRequest.yaml | 1 - src/schemas/InviteMemberResponse.yaml | 1 - src/schemas/MemberResponse.yaml | 1 - src/schemas/OrganizationEventResponse.yaml | 4 ---- src/schemas/Probe.yaml | 1 + src/schemas/SecretResponse.yaml | 3 --- src/schemas/enums/Kubernetes.yaml | 3 ++- src/schemas/enums/LinkedServiceType.yaml | 4 +--- .../enums/OrganizationEventSubTargetType.yaml | 1 + .../job/DeploymentHistoryJobResponse.yaml | 1 - src/schemas/variable/VariableResponse.yaml | 5 ++--- 17 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/openapi-test.yaml diff --git a/.github/workflows/openapi-test.yaml b/.github/workflows/openapi-test.yaml new file mode 100644 index 00000000..613eb04b --- /dev/null +++ b/.github/workflows/openapi-test.yaml @@ -0,0 +1,18 @@ +name: OpenAPI Test + +on: + pull_request: + +jobs: + npm-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + - name: Test + run: | + npm install -g @apidevtools/swagger-cli + npm install -g @stoplight/spectral + npm run test diff --git a/src/schemas/ClusterRequest.yaml b/src/schemas/ClusterRequest.yaml index e13d88b3..44c75dba 100644 --- a/src/schemas/ClusterRequest.yaml +++ b/src/schemas/ClusterRequest.yaml @@ -29,8 +29,7 @@ properties: example: "T3A_LARGE" description: the instance type to be used for this cluster. The list of values can be retrieved via the endpoint /{CloudProvider}/instanceType kubernetes: - $ref: ./enums/Kubernetes.yaml - default: "MANAGED" + $ref: './enums/Kubernetes.yaml' production: type: boolean description: specific flag to indicate that this cluster is a production one diff --git a/src/schemas/ClusterResponse.yaml b/src/schemas/ClusterResponse.yaml index 6d8cb00e..d1b85440 100644 --- a/src/schemas/ClusterResponse.yaml +++ b/src/schemas/ClusterResponse.yaml @@ -31,8 +31,7 @@ allOf: example: "T3A_LARGE" description: the instance type to be used for this cluster. The list of values can be retrieved via the endpoint /{CloudProvider}/instanceType kubernetes: - $ref: ./enums/Kubernetes.yaml - default: "MANAGED" + $ref: './enums/Kubernetes.yaml' cpu: type: integer example: 10000 diff --git a/src/schemas/CommitResponse.yaml b/src/schemas/CommitResponse.yaml index 9dccd570..01b55e2c 100644 --- a/src/schemas/CommitResponse.yaml +++ b/src/schemas/CommitResponse.yaml @@ -1,4 +1,5 @@ type: object +nullable: true required: - git_commit_id - created_at diff --git a/src/schemas/EnvironmentVariableResponse.yaml b/src/schemas/EnvironmentVariableResponse.yaml index ee8762a9..ef601b3b 100644 --- a/src/schemas/EnvironmentVariableResponse.yaml +++ b/src/schemas/EnvironmentVariableResponse.yaml @@ -16,13 +16,10 @@ allOf: service_id: type: string format: uuid - description: present only for `BUILT_IN` variable service_name: type: string - description: present only for `BUILT_IN` variable service_type: $ref: './enums/LinkedServiceType.yaml' - description: present only for `BUILT_IN` variable owned_by: type: string description: "Entity that created/own the variable (i.e: Qovery, Doppler)" diff --git a/src/schemas/Healthcheck.yaml b/src/schemas/Healthcheck.yaml index bd9ac60d..23755b6f 100644 --- a/src/schemas/Healthcheck.yaml +++ b/src/schemas/Healthcheck.yaml @@ -3,7 +3,5 @@ nullable: false properties: readiness_probe: $ref: './Probe.yaml' - nullable: true liveness_probe: $ref: './Probe.yaml' - nullable: true diff --git a/src/schemas/InviteMemberRequest.yaml b/src/schemas/InviteMemberRequest.yaml index 71e58e8c..8473d928 100644 --- a/src/schemas/InviteMemberRequest.yaml +++ b/src/schemas/InviteMemberRequest.yaml @@ -6,7 +6,6 @@ properties: type: string role: $ref: './enums/InviteMemberRole.yaml' - description: deprecated role_id: type: string format: uuid diff --git a/src/schemas/InviteMemberResponse.yaml b/src/schemas/InviteMemberResponse.yaml index 4b39c09f..6b2a4379 100644 --- a/src/schemas/InviteMemberResponse.yaml +++ b/src/schemas/InviteMemberResponse.yaml @@ -13,7 +13,6 @@ format: email role: $ref: './enums/InviteMemberRole.yaml' - description: deprecated invitation_link: type: string format: uri diff --git a/src/schemas/MemberResponse.yaml b/src/schemas/MemberResponse.yaml index 26d697f9..8431e1e0 100644 --- a/src/schemas/MemberResponse.yaml +++ b/src/schemas/MemberResponse.yaml @@ -20,7 +20,6 @@ allOf: description: last time the user was connected role: $ref: './enums/InviteMemberRole.yaml' - description: deprecated role_name: type: string description: the role linked to the user diff --git a/src/schemas/OrganizationEventResponse.yaml b/src/schemas/OrganizationEventResponse.yaml index dac641d7..c888c16f 100644 --- a/src/schemas/OrganizationEventResponse.yaml +++ b/src/schemas/OrganizationEventResponse.yaml @@ -15,16 +15,12 @@ properties: target_name: type: string target_type: - type: string $ref: './enums/OrganizationEventTargetType.yaml' sub_target_type: - type: string - nullable: true $ref: './enums/OrganizationEventSubTargetType.yaml' change: type: string origin: - type: string $ref: './enums/OrganizationEventOrigin.yaml' triggered_by: type: string diff --git a/src/schemas/Probe.yaml b/src/schemas/Probe.yaml index 9e86c460..b28c885c 100644 --- a/src/schemas/Probe.yaml +++ b/src/schemas/Probe.yaml @@ -1,4 +1,5 @@ type: object +nullable: true properties: type: type: object diff --git a/src/schemas/SecretResponse.yaml b/src/schemas/SecretResponse.yaml index d2019701..20ce1613 100644 --- a/src/schemas/SecretResponse.yaml +++ b/src/schemas/SecretResponse.yaml @@ -19,13 +19,10 @@ allOf: service_id: type: string format: uuid - description: present only for `BUILT_IN` variable service_name: type: string - description: present only for `BUILT_IN` variable service_type: $ref: './enums/LinkedServiceType.yaml' - description: present only for `BUILT_IN` variable owned_by: type: string description: "Entity that created/own the variable (i.e: Qovery, Doppler)" diff --git a/src/schemas/enums/Kubernetes.yaml b/src/schemas/enums/Kubernetes.yaml index 0768082c..4cd4234b 100644 --- a/src/schemas/enums/Kubernetes.yaml +++ b/src/schemas/enums/Kubernetes.yaml @@ -1,4 +1,5 @@ type: string enum: - "K3S" - - "MANAGED" \ No newline at end of file + - "MANAGED" +default: "MANAGED" diff --git a/src/schemas/enums/LinkedServiceType.yaml b/src/schemas/enums/LinkedServiceType.yaml index 44c4e44f..fb324c37 100644 --- a/src/schemas/enums/LinkedServiceType.yaml +++ b/src/schemas/enums/LinkedServiceType.yaml @@ -1,7 +1,5 @@ type: string -description: | - type of the service (application, database, job, gateway...) - present only for `BUILT_IN` variable +description: type of the service (application, database, job, gateway...) enum: - APPLICATION - CONTAINER diff --git a/src/schemas/enums/OrganizationEventSubTargetType.yaml b/src/schemas/enums/OrganizationEventSubTargetType.yaml index 315c4e3d..7281d51b 100644 --- a/src/schemas/enums/OrganizationEventSubTargetType.yaml +++ b/src/schemas/enums/OrganizationEventSubTargetType.yaml @@ -1,5 +1,6 @@ type: string description: Type of the organization event +nullable: true enum: - ADVANCED_SETTINGS - API_TOKEN diff --git a/src/schemas/job/DeploymentHistoryJobResponse.yaml b/src/schemas/job/DeploymentHistoryJobResponse.yaml index 20094b24..f874344f 100644 --- a/src/schemas/job/DeploymentHistoryJobResponse.yaml +++ b/src/schemas/job/DeploymentHistoryJobResponse.yaml @@ -13,7 +13,6 @@ allOf: type: string commit: $ref: '../CommitResponse.yaml' - nullable: true schedule: type: object properties: diff --git a/src/schemas/variable/VariableResponse.yaml b/src/schemas/variable/VariableResponse.yaml index dbdd81e9..22634e93 100644 --- a/src/schemas/variable/VariableResponse.yaml +++ b/src/schemas/variable/VariableResponse.yaml @@ -15,13 +15,12 @@ allOf: service_id: type: string format: uuid - description: The id of the service referenced by this variable. present only for `BUILT_IN` variable + description: The id of the service referenced by this variable. service_name: type: string - description: The name of the service referenced by this variable. present only for `BUILT_IN` variable + description: The name of the service referenced by this variable. service_type: $ref: '../enums/LinkedServiceType.yaml' - description: present only for `BUILT_IN` variable owned_by: type: string description: "Entity that created/own the variable (i.e: Qovery, Doppler)" From 82864f073e5c46a5d69f021a2b26435fa8dae871 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Tue, 10 Oct 2023 16:06:57 +0200 Subject: [PATCH 31/85] fix(schemas): add missing required fields (#469) --- src/schemas/job/JobResponse.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index 48c9e2a7..fe810320 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -4,7 +4,6 @@ allOf: required: - environment - name - - image_name - tag - auto_preview - cpu @@ -67,6 +66,11 @@ allOf: image: type: object nullable: true + required: + - image_name + - tag + - registry_id + - registry properties: image_name: type: string From 914ccaed3d72998faf1e36217c287eeb4cbe8579 Mon Sep 17 00:00:00 2001 From: pggb25 Date: Wed, 11 Oct 2023 14:17:55 +0200 Subject: [PATCH 32/85] feat: add registry mirroring mode into the advanced settings of a cluster (#468) --- src/schemas/ClusterAdvancedSettings.yaml | 2 ++ src/schemas/_index.yaml | 3 +++ src/schemas/enums/RegistryMirroringMode.yaml | 9 +++++++++ 3 files changed, 14 insertions(+) create mode 100644 src/schemas/enums/RegistryMirroringMode.yaml diff --git a/src/schemas/ClusterAdvancedSettings.yaml b/src/schemas/ClusterAdvancedSettings.yaml index 241b651b..5db79b3d 100644 --- a/src/schemas/ClusterAdvancedSettings.yaml +++ b/src/schemas/ClusterAdvancedSettings.yaml @@ -85,3 +85,5 @@ properties: type: integer default: -1 deprecated: true + registry.mirroring_mode: + $ref: './enums/RegistryMirroringMode.yaml' diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 299125d3..544fb87b 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -694,4 +694,7 @@ ServiceStepMetricNameEnum: $ref: ./enums/ServiceStepMetricName.yaml OrganizationJobAutoDeployRequest: $ref: ./OrganizationJobAutoDeployRequest.yaml +RegistryMirroringModeEnum: + $ref: ./enums/RegistryMirroringMode.yaml + diff --git a/src/schemas/enums/RegistryMirroringMode.yaml b/src/schemas/enums/RegistryMirroringMode.yaml new file mode 100644 index 00000000..841bb2ad --- /dev/null +++ b/src/schemas/enums/RegistryMirroringMode.yaml @@ -0,0 +1,9 @@ +type: string +default: SERVICE +enum: + - CLUSTER + - SERVICE +description: | + Mirroring mode when deploying a service from a container registry + - CLUSTER: This is not available on Scaleway. Images within the mirroring registry are organized by "Qovery cluster", meaning that the application deployed on the same cluster are all mirrored on the same repository. + - SERVICE: Images within the mirroring registry are organized by "Qovery service", each service has its own repository \ No newline at end of file From fc971661010e4e2cdc04a83c9229675c7b3ff7a9 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Wed, 11 Oct 2023 18:17:48 +0200 Subject: [PATCH 33/85] fix: Set mandatory source for JobResponse (#471) --- .github/workflows/generate-clients.yaml | 2 +- src/schemas/ContainerResponse.yaml | 12 +----- src/schemas/ContainerSource.yaml | 22 +++++++++++ src/schemas/_index.yaml | 2 + src/schemas/job/JobResponse.yaml | 51 ++++++++----------------- 5 files changed, 42 insertions(+), 47 deletions(-) create mode 100644 src/schemas/ContainerSource.yaml diff --git a/.github/workflows/generate-clients.yaml b/.github/workflows/generate-clients.yaml index cd6b38a9..49b29548 100644 --- a/.github/workflows/generate-clients.yaml +++ b/.github/workflows/generate-clients.yaml @@ -18,7 +18,7 @@ jobs: matrix: include: - language: go - version: 6.0.1 + version: 7.0.1 target-branch: master deploy-ssh-key: SSH_DEPLOY_KEY_GO deploy-ssh-key-ws: SSH_DEPLOY_KEY_WS_GO diff --git a/src/schemas/ContainerResponse.yaml b/src/schemas/ContainerResponse.yaml index 67da99e4..27ae6fa4 100644 --- a/src/schemas/ContainerResponse.yaml +++ b/src/schemas/ContainerResponse.yaml @@ -1,13 +1,11 @@ allOf: - $ref: './BaseResponse.yaml' - $ref: './ServiceStorageResponse.yaml' + - $ref: './ContainerSource.yaml' - type: object required: - environment - - registry - name - - image_name - - tag - auto_preview - cpu - memory @@ -19,8 +17,6 @@ allOf: properties: environment: $ref: './ReferenceObject.yaml' - registry: - $ref: './ContainerRegistryProviderDetailsResponse.yaml' maximum_cpu: type: integer description: Maximum cpu that can be allocated to the container based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu @@ -35,12 +31,6 @@ allOf: description: type: string description: give a description to this container - image_name: - type: string - description: name of the image container - tag: - type: string - description: tag of the image container arguments: type: array items: diff --git a/src/schemas/ContainerSource.yaml b/src/schemas/ContainerSource.yaml new file mode 100644 index 00000000..73b00bcb --- /dev/null +++ b/src/schemas/ContainerSource.yaml @@ -0,0 +1,22 @@ +type: object +required: + - image_name + - tag + - registry +properties: + image_name: + type: string + description: | + The image name pattern differs according to chosen container registry provider: + * `ECR`: `repository` + * `SCALEWAY_CR`: `namespace/image` + * `DOCKER_HUB`: `image` or `repository/image` + * `PUBLIC_ECR`: `registry_alias/repository` + tag: + type: string + description: tag of the image container + registry_id: + type: string + description: tag of the image container + registry: + $ref: "./ContainerRegistryProviderDetailsResponse.yaml" diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 544fb87b..18f3d304 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -172,6 +172,8 @@ ContainerResponse: $ref: ./ContainerResponse.yaml ContainerResponseList: $ref: ./ContainerResponseList.yaml +ContainerSource: + $ref: ./ContainerSource.yaml Cost: $ref: ./CostResponse.yaml CostRange: diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index fe810320..8f76126a 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -13,6 +13,7 @@ allOf: - maximum_cpu - maximum_memory - healthchecks + - source properties: environment: $ref: '../ReferenceObject.yaml' @@ -61,43 +62,23 @@ allOf: description: Port where to run readiness and liveliness probes checks. The port will not be exposed externally default: null source: - type: object - properties: - image: - type: object - nullable: true - required: - - image_name - - tag - - registry_id - - registry + nullable: false + oneOf: + - type: object properties: - image_name: - type: string - description: | - The image name pattern differs according to chosen container registry provider: - * `ECR`: `repository` - * `SCALEWAY_CR`: `namespace/image` - * `DOCKER_HUB`: `image` or `repository/image` - * `PUBLIC_ECR`: `registry_alias/repository` - tag: - type: string - description: tag of the image container - registry_id: - type: string - description: tag of the image container - registry: - $ref: '../ContainerRegistryProviderDetailsResponse.yaml' - docker: - type: object - nullable: true + image: + $ref: '../ContainerSource.yaml' + - type: object properties: - dockerfile_path: - type: string - description: The path of the associated Dockerfile. Only if you are using build_mode = DOCKER - nullable: true - git_repository: - $ref: '../ApplicationGitRepositoryResponse.yaml' + docker: + type: object + properties: + dockerfile_path: + type: string + description: The path of the associated Dockerfile. Only if you are using build_mode = DOCKER + nullable: true + git_repository: + $ref: '../ApplicationGitRepositoryResponse.yaml' healthchecks: $ref: '../Healthcheck.yaml' schedule: From 33b6212cd4bdfe2aab38d889fecd589aa2d83cb7 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Thu, 12 Oct 2023 12:10:31 +0200 Subject: [PATCH 34/85] fix: remove the results fields inside the stages object in GetEnvironmentStatusesWithStages response (#472) --- src/schemas/DeploymentStageWithServiceStatusesList.yaml | 6 ------ src/schemas/EnvironmentStatusesWithStages.yaml | 4 +++- src/schemas/_index.yaml | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 src/schemas/DeploymentStageWithServiceStatusesList.yaml diff --git a/src/schemas/DeploymentStageWithServiceStatusesList.yaml b/src/schemas/DeploymentStageWithServiceStatusesList.yaml deleted file mode 100644 index 214e86d2..00000000 --- a/src/schemas/DeploymentStageWithServiceStatusesList.yaml +++ /dev/null @@ -1,6 +0,0 @@ -type: object -properties: - results: - type: array - items: - $ref: '../schemas/DeploymentStageWithServicesStatuses.yaml' diff --git a/src/schemas/EnvironmentStatusesWithStages.yaml b/src/schemas/EnvironmentStatusesWithStages.yaml index 3348542b..6a8e38b6 100644 --- a/src/schemas/EnvironmentStatusesWithStages.yaml +++ b/src/schemas/EnvironmentStatusesWithStages.yaml @@ -3,4 +3,6 @@ properties: environment: $ref: '../schemas/EnvironmentStatus.yaml' stages: - $ref: '../schemas/DeploymentStageWithServiceStatusesList.yaml' + type: array + items: + $ref: '../schemas/DeploymentStageWithServicesStatuses.yaml' diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 18f3d304..8044d8cf 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -390,8 +390,6 @@ DeploymentStageServiceResponseList: $ref: ./deploymentStage/DeploymentStageServiceResponseList.yaml DeploymentStageServiceResponse: $ref: ./deploymentStage/DeploymentStageServiceResponse.yaml -DeploymentStageWithServiceStatusesList: - $ref: ./DeploymentStageWithServiceStatusesList.yaml DeploymentStageWithServicesStatuses: $ref: ./DeploymentStageWithServicesStatuses.yaml JobRequest: From c6eca05f4b05ae8c4e12adca6b53e0e3825ee3c3 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Wed, 18 Oct 2023 17:00:31 +0200 Subject: [PATCH 35/85] fix(responses): add missing required fields (#474) --- src/schemas/ApplicationResponse.yaml | 2 ++ src/schemas/EnvironmentResponse.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/src/schemas/ApplicationResponse.yaml b/src/schemas/ApplicationResponse.yaml index fa60b4a3..2c7b9cd6 100644 --- a/src/schemas/ApplicationResponse.yaml +++ b/src/schemas/ApplicationResponse.yaml @@ -4,6 +4,8 @@ allOf: - type: object required: - healthchecks + - name + - environment properties: environment: $ref: './ReferenceObject.yaml' diff --git a/src/schemas/EnvironmentResponse.yaml b/src/schemas/EnvironmentResponse.yaml index 02c54ec8..ac37e9ce 100644 --- a/src/schemas/EnvironmentResponse.yaml +++ b/src/schemas/EnvironmentResponse.yaml @@ -6,6 +6,7 @@ allOf: - cloud_provider - mode - cluster_id + - project properties: name: type: string From f8f1fca4aea4cfdc50e058ba6c7adcf57893ec11 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Fri, 20 Oct 2023 14:01:47 +0200 Subject: [PATCH 36/85] feat: Add git token api (#475) * feat: Add git token api * feat: Be able to use to git token to retrieve repositories & branches --- src/openapi.yaml | 2 ++ src/resources/GitToken.yaml | 21 +++++++++++++++++++ ...nizationAccountGitRepositoryBitbucket.yaml | 6 ++++++ ...onAccountGitRepositoryBitbucketBranch.yaml | 6 ++++++ ...rganizationAccountGitRepositoryGithub.yaml | 6 ++++++ ...ationAccountGitRepositoryGithubBranch.yaml | 6 ++++++ ...rganizationAccountGitRepositoryGitlab.yaml | 6 ++++++ ...ationAccountGitRepositoryGitlabBranch.yaml | 6 ++++++ .../ApplicationGitRepositoryRequest.yaml | 5 +++++ src/schemas/GitTokenResponse.yaml | 13 ++++++++++++ src/schemas/GitTokenResponseList.yaml | 6 ++++++ src/schemas/_index.yaml | 2 ++ 12 files changed, 85 insertions(+) create mode 100644 src/resources/GitToken.yaml create mode 100644 src/schemas/GitTokenResponse.yaml create mode 100644 src/schemas/GitTokenResponseList.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 8c340947..ae3b5f7d 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -218,6 +218,8 @@ paths: $ref: './resources/OrganizationApiTokenRef.yaml' /organization/{organizationId}/availableRole: $ref: './resources/OrganizationAvailableRole.yaml' + /organization/{organizationId}/gitToken: + $ref: './resources/GitToken.yaml' /organization/{organizationId}/member: $ref: './resources/OrganizationMember.yaml' /organization/{organizationId}/inviteMember: diff --git a/src/resources/GitToken.yaml b/src/resources/GitToken.yaml new file mode 100644 index 00000000..21a971be --- /dev/null +++ b/src/resources/GitToken.yaml @@ -0,0 +1,21 @@ +get: + summary: 'List organization git tokens' + description: 'List organization git tokens' + operationId: listOrganizationGitTokens + parameters: + - $ref: '../parameters/path/organizationId.yaml' + tags: + - Organization Main Calls + responses: + '200': + description: 'List organization git tokens' + content: + application/json: + schema: + $ref: '../schemas/GitTokenResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' diff --git a/src/resources/OrganizationAccountGitRepositoryBitbucket.yaml b/src/resources/OrganizationAccountGitRepositoryBitbucket.yaml index 2baad41b..081882ee 100644 --- a/src/resources/OrganizationAccountGitRepositoryBitbucket.yaml +++ b/src/resources/OrganizationAccountGitRepositoryBitbucket.yaml @@ -3,6 +3,12 @@ get: operationId: getOrganizationBitbucketRepositories parameters: - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application tags: - Organization Account Git Repositories responses: diff --git a/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml b/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml index 6bf9a864..dc7414fe 100644 --- a/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml +++ b/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml @@ -5,6 +5,12 @@ get: - Organization Account Git Repositories parameters: - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application - in: query name: name schema: diff --git a/src/resources/OrganizationAccountGitRepositoryGithub.yaml b/src/resources/OrganizationAccountGitRepositoryGithub.yaml index 78a817f9..d9f05e59 100644 --- a/src/resources/OrganizationAccountGitRepositoryGithub.yaml +++ b/src/resources/OrganizationAccountGitRepositoryGithub.yaml @@ -3,6 +3,12 @@ get: operationId: getOrganizationGithubRepositories parameters: - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application tags: - Organization Account Git Repositories responses: diff --git a/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml b/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml index 5847a6cb..31748956 100644 --- a/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml +++ b/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml @@ -5,6 +5,12 @@ get: - Organization Account Git Repositories parameters: - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application - in: query name: name schema: diff --git a/src/resources/OrganizationAccountGitRepositoryGitlab.yaml b/src/resources/OrganizationAccountGitRepositoryGitlab.yaml index ae55353f..66927b74 100644 --- a/src/resources/OrganizationAccountGitRepositoryGitlab.yaml +++ b/src/resources/OrganizationAccountGitRepositoryGitlab.yaml @@ -3,6 +3,12 @@ get: operationId: getOrganizationGitlabRepositories parameters: - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application tags: - Organization Account Git Repositories responses: diff --git a/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml b/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml index 7e163513..8322d8d3 100644 --- a/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml +++ b/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml @@ -5,6 +5,12 @@ get: - Organization Account Git Repositories parameters: - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application - in: query name: name schema: diff --git a/src/schemas/ApplicationGitRepositoryRequest.yaml b/src/schemas/ApplicationGitRepositoryRequest.yaml index 7b7c47fa..2b5b2a26 100644 --- a/src/schemas/ApplicationGitRepositoryRequest.yaml +++ b/src/schemas/ApplicationGitRepositoryRequest.yaml @@ -19,3 +19,8 @@ properties: type: string default: / description: indicates the root path of the application. + git_token_id: + type: string + format: uuid + description: The git token id on Qovery side + nullable: true diff --git a/src/schemas/GitTokenResponse.yaml b/src/schemas/GitTokenResponse.yaml new file mode 100644 index 00000000..ca4357b2 --- /dev/null +++ b/src/schemas/GitTokenResponse.yaml @@ -0,0 +1,13 @@ +allOf: + - $ref: './BaseResponse.yaml' + - type: object + required: + - name + - type + properties: + name: + type: string + description: + type: string + type: + $ref: './enums/GitProvider.yaml' diff --git a/src/schemas/GitTokenResponseList.yaml b/src/schemas/GitTokenResponseList.yaml new file mode 100644 index 00000000..3b7622ae --- /dev/null +++ b/src/schemas/GitTokenResponseList.yaml @@ -0,0 +1,6 @@ +type: object +properties: + results: + type: array + items: + $ref: './GitTokenResponse.yaml' diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 8044d8cf..06eecac6 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -358,6 +358,8 @@ GitRepositoryBranchResponseList: $ref: ./GitRepositoryBranchResponseList.yaml GitRepositoryResponseList: $ref: ./GitRepositoryResponseList.yaml +GitTokenResponse: + $ref: ./GitTokenResponse.yaml Healthcheck: $ref: ./Healthcheck.yaml Instance: From f0d01d33ebc0723e2527259d5db340955cc1f142 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Fri, 20 Oct 2023 14:43:18 +0200 Subject: [PATCH 37/85] fix: Fix structure git token list (#476) --- src/schemas/_index.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 06eecac6..45b84d47 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -360,6 +360,8 @@ GitRepositoryResponseList: $ref: ./GitRepositoryResponseList.yaml GitTokenResponse: $ref: ./GitTokenResponse.yaml +GitTokenResponseList: + $ref: ./GitTokenResponseList.yaml Healthcheck: $ref: ./Healthcheck.yaml Instance: From e94d1736988f8b1097aba815eaf42ad7d946a55c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 23 Oct 2023 11:42:32 +0200 Subject: [PATCH 38/85] 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..dc76a6b7 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' From a039248a7c8e2880cc1e8105cd088f9f91f9ccfe Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Tue, 24 Oct 2023 11:23:56 +0200 Subject: [PATCH 39/85] feat: Add git token id in service git repo response (#478) --- src/schemas/ApplicationGitRepositoryResponse.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/schemas/ApplicationGitRepositoryResponse.yaml b/src/schemas/ApplicationGitRepositoryResponse.yaml index b1680f62..cb75f7da 100644 --- a/src/schemas/ApplicationGitRepositoryResponse.yaml +++ b/src/schemas/ApplicationGitRepositoryResponse.yaml @@ -32,4 +32,8 @@ properties: description: Git commit user corresponding to the deployed version of the app deployed_commit_tag: type: string - example: "v1.0.1" \ No newline at end of file + example: "v1.0.1" + git_token_id: + type: string + format: uuid + nullable: true From 3a2c023be20d613532966f0d7cc879ae9b57d087 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 24 Oct 2023 14:27:42 +0200 Subject: [PATCH 40/85] feat(helm): Add deployment history --- src/openapi.yaml | 2 -- src/schemas/helm/DeploymentHistoryHelmResponse.yaml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/openapi.yaml b/src/openapi.yaml index 0f27d48a..2262c328 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -802,8 +802,6 @@ paths: $ref: './resources/variable/VariableOverride.yaml' /variable/{variableId}: $ref: './resources/variable/VariableRef.yaml' - #/organization/{organizationId}/job/preview: - #/organization/{organizationId}/job/deploy: components: parameters: $ref: './parameters/_index.yaml' diff --git a/src/schemas/helm/DeploymentHistoryHelmResponse.yaml b/src/schemas/helm/DeploymentHistoryHelmResponse.yaml index 6753fe2d..e93edb4d 100644 --- a/src/schemas/helm/DeploymentHistoryHelmResponse.yaml +++ b/src/schemas/helm/DeploymentHistoryHelmResponse.yaml @@ -7,3 +7,15 @@ allOf: description: name of the helm status: $ref: '../enums/State.yaml' + commit: + $ref: '../CommitResponse.yaml' + repository: + type: object + nullable: true + description: If the chart source if from a repository, the chart name and its version + properties: + chart_name: + type: string + version: + type: string + From 85e1d70506ff1615100bf90b9378f0aba033b92f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 24 Oct 2023 17:25:39 +0200 Subject: [PATCH 41/85] fix(helm): Display helm section under environment --- src/openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openapi.yaml b/src/openapi.yaml index 2262c328..10b32f09 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -145,6 +145,7 @@ x-tagGroups: - Containers - Databases - Jobs + - Helms - Environment Actions - Environment Logs - Environment Deployment History From be5b92cf78754e8106b67d3ef97c55fec783f440 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Wed, 25 Oct 2023 14:02:55 +0200 Subject: [PATCH 42/85] fix(git-tokens): preserve previous params order (#482) TS generated client relies on params declaration order to generate function like `func(param1, param2)`. So order MUST be preserved even if this is named param. --- ...rganizationAccountGitRepositoryBitbucketBranch.yaml | 10 +++++----- .../OrganizationAccountGitRepositoryGithubBranch.yaml | 10 +++++----- .../OrganizationAccountGitRepositoryGitlabBranch.yaml | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml b/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml index dc7414fe..458bf142 100644 --- a/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml +++ b/src/resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml @@ -6,16 +6,16 @@ get: parameters: - $ref: '../parameters/path/organizationId.yaml' - in: query - name: gitTokenId + name: name schema: type: string - format: uuid - description: The git token id that must be used for the application + description: The name of the repository where to retrieve the branches - in: query - name: name + name: gitTokenId schema: type: string - description: The name of the repository where to retrieve the branches + format: uuid + description: The git token id that must be used for the application responses: '200': description: 'Get bitbucket repository branches' diff --git a/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml b/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml index 31748956..82a99618 100644 --- a/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml +++ b/src/resources/OrganizationAccountGitRepositoryGithubBranch.yaml @@ -6,16 +6,16 @@ get: parameters: - $ref: '../parameters/path/organizationId.yaml' - in: query - name: gitTokenId + name: name schema: type: string - format: uuid - description: The git token id that must be used for the application + description: The name of the repository where to retrieve the branches - in: query - name: name + name: gitTokenId schema: type: string - description: The name of the repository where to retrieve the branches + format: uuid + description: The git token id that must be used for the application responses: '200': description: 'Get github repository branches' diff --git a/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml b/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml index 8322d8d3..1d9b2c35 100644 --- a/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml +++ b/src/resources/OrganizationAccountGitRepositoryGitlabBranch.yaml @@ -6,16 +6,16 @@ get: parameters: - $ref: '../parameters/path/organizationId.yaml' - in: query - name: gitTokenId + name: name schema: type: string - format: uuid - description: The git token id that must be used for the application + description: The name of the repository to retrieve the branches - in: query - name: name + name: gitTokenId schema: type: string - description: The name of the repository to retrieve the branches + format: uuid + description: The git token id that must be used for the application responses: '200': description: 'Get gitlab repository branches' From 19f591f93d4c6b318e4a94fccc7303bc8f2efaeb Mon Sep 17 00:00:00 2001 From: Pierre G Date: Wed, 25 Oct 2023 16:13:28 +0200 Subject: [PATCH 43/85] feat: add nginx in cluster advanced settings (#483) --- src/schemas/ClusterAdvancedSettings.yaml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/schemas/ClusterAdvancedSettings.yaml b/src/schemas/ClusterAdvancedSettings.yaml index 5db79b3d..f3a345f9 100644 --- a/src/schemas/ClusterAdvancedSettings.yaml +++ b/src/schemas/ClusterAdvancedSettings.yaml @@ -87,3 +87,35 @@ properties: deprecated: true registry.mirroring_mode: $ref: './enums/RegistryMirroringMode.yaml' + nginx.vcpu.request_in_milli: + type: integer + default: 100 + description: vcpu request in millicores + nginx.vcpu.limit_in_milli: + type: integer + default: 500 + description: vcpu limit in millicores + nginx.memory.request_in_mib: + type: integer + default: 768 + description: memory request in MiB + nginx.memory.limit_in_mib: + type: integer + default: 768 + description: memory limit in MiB + nginx.hpa.cpu_utilization_percentage_threshold: + type: integer + default: 50 + description: hpa cpu threshold in percentage + nginx.hpa.memory_utilization_percentage_threshold: + type: integer + default: 50 + description: hpa memory threshold in percentage + nginx.hpa.min_number_instances: + type: integer + default: 2 + description: hpa minimum number of instances + nginx.hpa.max_number_instances: + type: integer + default: 25 + description: hpa maximum number of instances From 79a55cde0b0b1319c6bd9321c757a5ef0fa7c71b Mon Sep 17 00:00:00 2001 From: Pierre G Date: Thu, 26 Oct 2023 15:24:30 +0200 Subject: [PATCH 44/85] fix: NGINX advanced settings naming (#484) --- src/schemas/ClusterAdvancedSettings.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/schemas/ClusterAdvancedSettings.yaml b/src/schemas/ClusterAdvancedSettings.yaml index f3a345f9..f2c0dec6 100644 --- a/src/schemas/ClusterAdvancedSettings.yaml +++ b/src/schemas/ClusterAdvancedSettings.yaml @@ -87,11 +87,11 @@ properties: deprecated: true registry.mirroring_mode: $ref: './enums/RegistryMirroringMode.yaml' - nginx.vcpu.request_in_milli: + nginx.vcpu.request_in_milli_cpu: type: integer default: 100 description: vcpu request in millicores - nginx.vcpu.limit_in_milli: + nginx.vcpu.limit_in_milli_cpu: type: integer default: 500 description: vcpu limit in millicores @@ -107,10 +107,6 @@ properties: type: integer default: 50 description: hpa cpu threshold in percentage - nginx.hpa.memory_utilization_percentage_threshold: - type: integer - default: 50 - description: hpa memory threshold in percentage nginx.hpa.min_number_instances: type: integer default: 2 From dd629b8696a9e14751dfd0e97e85aaf9b139e410 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Thu, 26 Oct 2023 16:46:22 +0200 Subject: [PATCH 45/85] feat: Add git token crud api (#480) --- src/openapi.yaml | 2 ++ src/parameters/_index.yaml | 2 ++ src/parameters/path/gitTokenId.yaml | 7 +++++ src/resources/GitToken.yaml | 26 +++++++++++++++++ src/resources/GitTokenRef.yaml | 45 +++++++++++++++++++++++++++++ src/schemas/GitTokenRequest.yaml | 18 ++++++++++++ src/schemas/GitTokenResponse.yaml | 3 ++ src/schemas/_index.yaml | 2 ++ 8 files changed, 105 insertions(+) create mode 100644 src/parameters/path/gitTokenId.yaml create mode 100644 src/resources/GitTokenRef.yaml create mode 100644 src/schemas/GitTokenRequest.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 10b32f09..6a395db9 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -245,6 +245,8 @@ paths: $ref: './resources/OrganizationAvailableRole.yaml' /organization/{organizationId}/gitToken: $ref: './resources/GitToken.yaml' + /organization/{organizationId}/gitToken/{gitTokenId}: + $ref: './resources/GitTokenRef.yaml' /organization/{organizationId}/member: $ref: './resources/OrganizationMember.yaml' /organization/{organizationId}/inviteMember: diff --git a/src/parameters/_index.yaml b/src/parameters/_index.yaml index 328adc5e..4421f6c9 100644 --- a/src/parameters/_index.yaml +++ b/src/parameters/_index.yaml @@ -44,6 +44,8 @@ jobId: # QUERY gitCommitId: $ref: ./query/gitCommitId.yaml +gitTokenId: + $ref: ./path/gitTokenId.yaml instanceId: $ref: ./path/instanceId.yaml invoiceId: diff --git a/src/parameters/path/gitTokenId.yaml b/src/parameters/path/gitTokenId.yaml new file mode 100644 index 00000000..eca863bc --- /dev/null +++ b/src/parameters/path/gitTokenId.yaml @@ -0,0 +1,7 @@ +name: gitTokenId +in: path +description: Git Token ID +required: true +schema: + type: string + format: uuid diff --git a/src/resources/GitToken.yaml b/src/resources/GitToken.yaml index 21a971be..c61bfdea 100644 --- a/src/resources/GitToken.yaml +++ b/src/resources/GitToken.yaml @@ -19,3 +19,29 @@ get: $ref: '../responses/Forbidden.yaml' '404': $ref: '../responses/NotFound.yaml' +post: + summary: 'Create a git token' + description: Create a new git token to be used as a git provider by a service + operationId: createGitToken + parameters: + - $ref: '../parameters/path/organizationId.yaml' + tags: + - Organization Main Calls + requestBody: + content: + application/json: + schema: + $ref: '../schemas/GitTokenRequest.yaml' + responses: + '201': + description: 'Git token created' + content: + application/json: + schema: + $ref: '../schemas/GitTokenResponse.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' diff --git a/src/resources/GitTokenRef.yaml b/src/resources/GitTokenRef.yaml new file mode 100644 index 00000000..3c785fcf --- /dev/null +++ b/src/resources/GitTokenRef.yaml @@ -0,0 +1,45 @@ +put: + summary: 'Edit a git token' + operationId: editGitToken + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - $ref: '../parameters/path/gitTokenId.yaml' + tags: + - Organization Main Calls + requestBody: + content: + application/json: + schema: + $ref: '../schemas/GitTokenRequest.yaml' + responses: + '200': + description: 'Git token edited' + content: + application/json: + schema: + $ref: '../schemas/GitTokenResponse.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 git token' + operationId: deleteGitToken + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - $ref: '../parameters/path/gitTokenId.yaml' + tags: + - Organization 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/schemas/GitTokenRequest.yaml b/src/schemas/GitTokenRequest.yaml new file mode 100644 index 00000000..1636d25e --- /dev/null +++ b/src/schemas/GitTokenRequest.yaml @@ -0,0 +1,18 @@ +type: object +required: + - name + - type + - token +properties: + name: + type: string + description: + type: string + type: + $ref: './enums/GitProvider.yaml' + token: + type: string + description: The token from your git provider side + workspace: + type: string + description: Mandatory only for BITBUCKET git provider, to allow us to fetch repositories at creation/edition of a service diff --git a/src/schemas/GitTokenResponse.yaml b/src/schemas/GitTokenResponse.yaml index ca4357b2..39aa8b1e 100644 --- a/src/schemas/GitTokenResponse.yaml +++ b/src/schemas/GitTokenResponse.yaml @@ -11,3 +11,6 @@ allOf: type: string type: $ref: './enums/GitProvider.yaml' + expired_at: + type: string + format: date diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index dc76a6b7..0d669b97 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -358,6 +358,8 @@ GitRepositoryBranchResponseList: $ref: ./GitRepositoryBranchResponseList.yaml GitRepositoryResponseList: $ref: ./GitRepositoryResponseList.yaml +GitTokenRequest: + $ref: ./GitTokenRequest.yaml GitTokenResponse: $ref: ./GitTokenResponse.yaml GitTokenResponseList: From 1ca5e9fd7a6d5e8a7b7bd877a2092f7f197211b5 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Thu, 26 Oct 2023 17:48:35 +0200 Subject: [PATCH 46/85] feat: Add git token name in service response (#485) --- src/schemas/ApplicationGitRepositoryResponse.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/schemas/ApplicationGitRepositoryResponse.yaml b/src/schemas/ApplicationGitRepositoryResponse.yaml index cb75f7da..dc4f578a 100644 --- a/src/schemas/ApplicationGitRepositoryResponse.yaml +++ b/src/schemas/ApplicationGitRepositoryResponse.yaml @@ -37,3 +37,6 @@ properties: type: string format: uuid nullable: true + git_token_name: + type: string + nullable: true From 37b14b835a81bb28fbf5e99509608f7da81baee8 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Fri, 27 Oct 2023 14:33:21 +0200 Subject: [PATCH 47/85] chore: Temporary endpoints to migrate git (#486) --- src/openapi.yaml | 8 +++++++ ...rganizationAccountGitAuthProviderTemp.yaml | 16 ++++++++++++++ ...tionAccountGitRepositoryBitbucketTemp.yaml | 22 +++++++++++++++++++ ...izationAccountGitRepositoryGithubTemp.yaml | 22 +++++++++++++++++++ ...izationAccountGitRepositoryGitlabTemp.yaml | 22 +++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 src/resources/OrganizationAccountGitAuthProviderTemp.yaml create mode 100644 src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml create mode 100644 src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml create mode 100644 src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 6a395db9..36e4bba4 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -315,16 +315,24 @@ paths: $ref: './resources/OrganizationGithubAppDisconnect.yaml' /organization/{organizationId}/account/gitAuthProvider: $ref: './resources/OrganizationAccountGitAuthProvider.yaml' + /organization/{organizationId}/account/gitAuthProviderTemp: + $ref: './resources/OrganizationAccountGitAuthProviderTemp.yaml' /organization/{organizationId}/account/github/repository: $ref: './resources/OrganizationAccountGitRepositoryGithub.yaml' + /organization/{organizationId}/account/github/repositoryTemp: + $ref: './resources/OrganizationAccountGitRepositoryGithubTemp.yaml' /organization/{organizationId}/account/github/repository/branch: $ref: './resources/OrganizationAccountGitRepositoryGithubBranch.yaml' /organization/{organizationId}/account/gitlab/repository: $ref: './resources/OrganizationAccountGitRepositoryGitlab.yaml' + /organization/{organizationId}/account/gitlab/repositoryTemp: + $ref: './resources/OrganizationAccountGitRepositoryGitlabTemp.yaml' /organization/{organizationId}/account/gitlab/repository/branch: $ref: './resources/OrganizationAccountGitRepositoryGitlabBranch.yaml' /organization/{organizationId}/account/bitbucket/repository: $ref: './resources/OrganizationAccountGitRepositoryBitbucket.yaml' + /organization/{organizationId}/account/bitbucket/repositoryTemp: + $ref: './resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml' /organization/{organizationId}/account/bitbucket/repository/branch: $ref: './resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml' /organization/{organizationId}/webhook: diff --git a/src/resources/OrganizationAccountGitAuthProviderTemp.yaml b/src/resources/OrganizationAccountGitAuthProviderTemp.yaml new file mode 100644 index 00000000..629800f4 --- /dev/null +++ b/src/resources/OrganizationAccountGitAuthProviderTemp.yaml @@ -0,0 +1,16 @@ +get: + summary: 'Get git provider accounts' + operationId: getOrganizationGitProviderAccountTemp + parameters: + - $ref: '../parameters/path/organizationId.yaml' + tags: + - Organization Account Git Repositories + responses: + '200': + description: 'Get account' + content: + application/json: + schema: + $ref: '../schemas/GitAuthProviderResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' diff --git a/src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml b/src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml new file mode 100644 index 00000000..6fa87da5 --- /dev/null +++ b/src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml @@ -0,0 +1,22 @@ +get: + summary: 'Get bitbucket repositories of the connected user' + operationId: getOrganizationBitbucketRepositoriesTemp + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application + tags: + - Organization Account Git Repositories + responses: + '200': + description: 'Get bitbucket repositories' + content: + application/json: + schema: + $ref: '../schemas/GitRepositoryResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' diff --git a/src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml b/src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml new file mode 100644 index 00000000..ed4d010f --- /dev/null +++ b/src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml @@ -0,0 +1,22 @@ +get: + summary: 'Get github repositories of the connected user' + operationId: getOrganizationGithubRepositoriesTemp + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application + tags: + - Organization Account Git Repositories + responses: + '200': + description: 'Get github repositories' + content: + application/json: + schema: + $ref: '../schemas/GitRepositoryResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' diff --git a/src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml b/src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml new file mode 100644 index 00000000..8b2cb06e --- /dev/null +++ b/src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml @@ -0,0 +1,22 @@ +get: + summary: 'Get gitlab repositories of the connected user' + operationId: getOrganizationGitlabRepositoriesTemp + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - in: query + name: gitTokenId + schema: + type: string + format: uuid + description: The git token id that must be used for the application + tags: + - Organization Account Git Repositories + responses: + '200': + description: 'Get gitlab repositories' + content: + application/json: + schema: + $ref: '../schemas/GitRepositoryResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' From 9ee8f12b335310bc907bf2583d9dcd2377d66b3c Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Fri, 27 Oct 2023 14:54:34 +0200 Subject: [PATCH 48/85] feat: Get single token & associated services (#487) --- src/openapi.yaml | 2 ++ src/resources/GitTokenAssociatedServices.yaml | 22 +++++++++++++++ src/resources/GitTokenRef.yaml | 22 +++++++++++++++ .../GitTokenAssociatedServiceResponse.yaml | 27 +++++++++++++++++++ ...itTokenAssociatedServicesResponseList.yaml | 6 +++++ src/schemas/GitTokenResponse.yaml | 4 +++ src/schemas/_index.yaml | 6 +++++ .../enums/GitTokenAssociatedServiceType.yaml | 5 ++++ 8 files changed, 94 insertions(+) create mode 100644 src/resources/GitTokenAssociatedServices.yaml create mode 100644 src/schemas/GitTokenAssociatedServiceResponse.yaml create mode 100644 src/schemas/GitTokenAssociatedServicesResponseList.yaml create mode 100644 src/schemas/enums/GitTokenAssociatedServiceType.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 36e4bba4..b4260836 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -247,6 +247,8 @@ paths: $ref: './resources/GitToken.yaml' /organization/{organizationId}/gitToken/{gitTokenId}: $ref: './resources/GitTokenRef.yaml' + /organization/{organizationId}/gitToken/{gitTokenId}/associatedServices: + $ref: './resources/GitTokenAssociatedServices.yaml' /organization/{organizationId}/member: $ref: './resources/OrganizationMember.yaml' /organization/{organizationId}/inviteMember: diff --git a/src/resources/GitTokenAssociatedServices.yaml b/src/resources/GitTokenAssociatedServices.yaml new file mode 100644 index 00000000..98bb5d09 --- /dev/null +++ b/src/resources/GitTokenAssociatedServices.yaml @@ -0,0 +1,22 @@ +get: + summary: 'Get organization git token associated services' + description: 'Get organization git tokens associated services' + operationId: getGitTokenAssociatedServices + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - $ref: '../parameters/path/gitTokenId.yaml' + tags: + - Organization Main Calls + responses: + '200': + description: 'Get organization git token associated services' + content: + application/json: + schema: + $ref: '../schemas/GitTokenAssociatedServicesResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' diff --git a/src/resources/GitTokenRef.yaml b/src/resources/GitTokenRef.yaml index 3c785fcf..ec88c8e7 100644 --- a/src/resources/GitTokenRef.yaml +++ b/src/resources/GitTokenRef.yaml @@ -1,3 +1,25 @@ +get: + summary: 'Get organization git token' + description: 'Get organization git tokens' + operationId: getOrganizationGitTokens + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - $ref: '../parameters/path/gitTokenId.yaml' + tags: + - Organization Main Calls + responses: + '200': + description: 'Get organization git token' + content: + application/json: + schema: + $ref: '../schemas/GitTokenResponse.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' put: summary: 'Edit a git token' operationId: editGitToken diff --git a/src/schemas/GitTokenAssociatedServiceResponse.yaml b/src/schemas/GitTokenAssociatedServiceResponse.yaml new file mode 100644 index 00000000..d8b7f0e4 --- /dev/null +++ b/src/schemas/GitTokenAssociatedServiceResponse.yaml @@ -0,0 +1,27 @@ +type: object +required: + - project_id + - project_name + - environment_id + - environment_name + - service_id + - service_name + - service_type +properties: + project_id: + type: string + format: uuid + project_name: + type: string + environment_id: + type: string + format: uuid + environment_name: + type: string + service_id: + type: string + format: uuid + service_name: + type: string + service_type: + $ref: "./enums/GitTokenAssociatedServiceType.yaml" diff --git a/src/schemas/GitTokenAssociatedServicesResponseList.yaml b/src/schemas/GitTokenAssociatedServicesResponseList.yaml new file mode 100644 index 00000000..a07b692d --- /dev/null +++ b/src/schemas/GitTokenAssociatedServicesResponseList.yaml @@ -0,0 +1,6 @@ +type: object +properties: + results: + type: array + items: + $ref: './GitTokenAssociatedServiceResponse.yaml' diff --git a/src/schemas/GitTokenResponse.yaml b/src/schemas/GitTokenResponse.yaml index 39aa8b1e..d2ec30ad 100644 --- a/src/schemas/GitTokenResponse.yaml +++ b/src/schemas/GitTokenResponse.yaml @@ -4,6 +4,7 @@ allOf: required: - name - type + - associated_services_count properties: name: type: string @@ -14,3 +15,6 @@ allOf: expired_at: type: string format: date + associated_services_count: + type: number + description: The number of services using this git token diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 0d669b97..146c8fe8 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -358,6 +358,12 @@ GitRepositoryBranchResponseList: $ref: ./GitRepositoryBranchResponseList.yaml GitRepositoryResponseList: $ref: ./GitRepositoryResponseList.yaml +GitTokenAssociatedServiceType: + $ref: ./enums/GitTokenAssociatedServiceType.yaml +GitTokenAssociatedServiceResponse: + $ref: ./GitTokenAssociatedServiceResponse.yaml +GitTokenAssociatedServicesResponseList: + $ref: ./GitTokenAssociatedServicesResponseList.yaml GitTokenRequest: $ref: ./GitTokenRequest.yaml GitTokenResponse: diff --git a/src/schemas/enums/GitTokenAssociatedServiceType.yaml b/src/schemas/enums/GitTokenAssociatedServiceType.yaml new file mode 100644 index 00000000..2ee6468a --- /dev/null +++ b/src/schemas/enums/GitTokenAssociatedServiceType.yaml @@ -0,0 +1,5 @@ +type: string +enum: + - APPLICATION + - JOB + - HELM From 5ff23d0ab6ee2f17a43fe59b64a66f88b1d43125 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 31 Oct 2023 10:34:07 +0100 Subject: [PATCH 49/85] feat(helm): Add helm in deployment with statuses --- src/schemas/DeploymentStageWithServicesStatuses.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/schemas/DeploymentStageWithServicesStatuses.yaml b/src/schemas/DeploymentStageWithServicesStatuses.yaml index 8e6228d8..6758cf8f 100644 --- a/src/schemas/DeploymentStageWithServicesStatuses.yaml +++ b/src/schemas/DeploymentStageWithServicesStatuses.yaml @@ -16,5 +16,9 @@ properties: type: array items: $ref: '../schemas/Status.yaml' + helms: + type: array + items: + $ref: '../schemas/Status.yaml' stage: $ref: '../schemas/Stage.yaml' From c2143f5cffa226090a6f8cc293bfe271ee46c526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bonnet?= Date: Tue, 31 Oct 2023 13:43:08 +0100 Subject: [PATCH 50/85] fix: add workspace for the git token list (#489) --- src/schemas/GitTokenResponse.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/schemas/GitTokenResponse.yaml b/src/schemas/GitTokenResponse.yaml index d2ec30ad..7427d0a5 100644 --- a/src/schemas/GitTokenResponse.yaml +++ b/src/schemas/GitTokenResponse.yaml @@ -15,6 +15,9 @@ allOf: expired_at: type: string format: date + workspace: + type: string + description: Mandatory only for BITBUCKET git provider associated_services_count: type: number description: The number of services using this git token From 92e6907cf9c8cd4f7527429db96ac625629f4a96 Mon Sep 17 00:00:00 2001 From: Melvin Zottola Date: Thu, 2 Nov 2023 11:49:16 +0100 Subject: [PATCH 51/85] fix: Get organization git token (#490) --- src/resources/GitTokenRef.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/GitTokenRef.yaml b/src/resources/GitTokenRef.yaml index ec88c8e7..2be95b6a 100644 --- a/src/resources/GitTokenRef.yaml +++ b/src/resources/GitTokenRef.yaml @@ -1,7 +1,7 @@ get: summary: 'Get organization git token' - description: 'Get organization git tokens' - operationId: getOrganizationGitTokens + description: 'Get organization git token' + operationId: getOrganizationGitToken parameters: - $ref: '../parameters/path/organizationId.yaml' - $ref: '../parameters/path/gitTokenId.yaml' From 29c6ef20c53a48f207211c0badb06844ebf2195b Mon Sep 17 00:00:00 2001 From: Melvin Zottola <37779145+mzottola@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:36:49 +0100 Subject: [PATCH 52/85] feat: Update audit logs types (#491) Co-authored-by: Melvin Zottola --- src/schemas/enums/OrganizationEventSubTargetType.yaml | 1 + src/schemas/enums/OrganizationEventTargetType.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/schemas/enums/OrganizationEventSubTargetType.yaml b/src/schemas/enums/OrganizationEventSubTargetType.yaml index 7281d51b..89589c66 100644 --- a/src/schemas/enums/OrganizationEventSubTargetType.yaml +++ b/src/schemas/enums/OrganizationEventSubTargetType.yaml @@ -17,6 +17,7 @@ enum: - DEPLOYMENT_STAGE - GITHUB_APP - GIT_REPOSITORY + - GIT_TOKEN - INVITATION - MEMBER_ROLE - PLAN diff --git a/src/schemas/enums/OrganizationEventTargetType.yaml b/src/schemas/enums/OrganizationEventTargetType.yaml index 4ea65b86..665819d7 100644 --- a/src/schemas/enums/OrganizationEventTargetType.yaml +++ b/src/schemas/enums/OrganizationEventTargetType.yaml @@ -8,6 +8,7 @@ enum: - DATABASE - ENVIRONMENT - JOB + - HELM - MEMBERS_AND_ROLES - ORGANIZATION - PROJECT From 5203020aa53294f1a9f4274fdc82da67db276437 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Mon, 6 Nov 2023 13:19:06 +0100 Subject: [PATCH 53/85] feat: add source in deployment history (#493) --- src/schemas/DeploymentHistoryEnvironmentResponse.yaml | 4 ++++ src/schemas/EnvironmentStatus.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/schemas/DeploymentHistoryEnvironmentResponse.yaml b/src/schemas/DeploymentHistoryEnvironmentResponse.yaml index eaf23a2d..e112e863 100644 --- a/src/schemas/DeploymentHistoryEnvironmentResponse.yaml +++ b/src/schemas/DeploymentHistoryEnvironmentResponse.yaml @@ -4,6 +4,10 @@ allOf: properties: status: $ref: './enums/State.yaml' + origin: + $ref: './enums/OrganizationEventOrigin.yaml' + triggered_by: + type: string applications: type: array items: diff --git a/src/schemas/EnvironmentStatus.yaml b/src/schemas/EnvironmentStatus.yaml index cab4b4dd..82d6fbd3 100644 --- a/src/schemas/EnvironmentStatus.yaml +++ b/src/schemas/EnvironmentStatus.yaml @@ -21,3 +21,7 @@ properties: total_deployment_duration_in_seconds: type: integer nullable: true + origin: + $ref: './enums/OrganizationEventOrigin.yaml' + triggered_by: + type: string From 3fc9811257604e289e9c6ace71da51f4e6487c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Mon, 6 Nov 2023 14:00:44 +0100 Subject: [PATCH 54/85] Bump websocket api --- websocket/websocket-openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/websocket/websocket-openapi.yaml b/websocket/websocket-openapi.yaml index 2ba86f66..c8c94e32 100644 --- a/websocket/websocket-openapi.yaml +++ b/websocket/websocket-openapi.yaml @@ -601,3 +601,4 @@ components: enum: - mCPU - MiB + - GiB From f6aaf0f99bb45357d4de3b39bdc86e7a42c672ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Mon, 6 Nov 2023 15:54:06 +0100 Subject: [PATCH 55/85] Bump websocket api --- websocket/websocket-openapi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/websocket/websocket-openapi.yaml b/websocket/websocket-openapi.yaml index c8c94e32..8046bef8 100644 --- a/websocket/websocket-openapi.yaml +++ b/websocket/websocket-openapi.yaml @@ -433,6 +433,7 @@ components: - containers - databases - jobs + - helms properties: applications: type: array @@ -446,6 +447,10 @@ components: type: array items: $ref: '#/components/schemas/DatabaseStatusDto' + helms: + type: array + items: + $ref: '#/components/schemas/ApplicationStatusDto' id: type: string jobs: From 1ecba027e07cb747cfb98dee673fc0d2ec4404c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Mon, 6 Nov 2023 16:46:15 +0100 Subject: [PATCH 56/85] Bump websocket api --- websocket/websocket-openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/websocket/websocket-openapi.yaml b/websocket/websocket-openapi.yaml index 8046bef8..92e83774 100644 --- a/websocket/websocket-openapi.yaml +++ b/websocket/websocket-openapi.yaml @@ -598,6 +598,7 @@ components: - CONTAINER - DATABASE - JOB + - HELM Timestamp: type: integer description: Unix timestamp with millisecond precision From e0e70638c02f614df9cc682dbb3694873692c1b1 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 7 Nov 2023 13:56:09 +0100 Subject: [PATCH 57/85] fix(helm): Fix repository for helm response --- src/schemas/helm/HelmResponse.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/schemas/helm/HelmResponse.yaml b/src/schemas/helm/HelmResponse.yaml index 89efb85f..8af1f79f 100644 --- a/src/schemas/helm/HelmResponse.yaml +++ b/src/schemas/helm/HelmResponse.yaml @@ -39,17 +39,25 @@ allOf: 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 + repository: + type: object + properties: + id: + type: string + format: UUID + description: The id of the helm repository + name: + type: string + description: The name of the helm repository + url: + type: string + description: The name url the helm repository arguments: type: array description: The extra arguments to pass to helm From aeed530603906c0c22c13e3cba61b0b9a1564eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C3=A8be=20-=20Romain=20Gerard?= Date: Tue, 7 Nov 2023 15:01:59 +0100 Subject: [PATCH 58/85] Update src/schemas/helm/HelmResponse.yaml Co-authored-by: Melvin Zottola <37779145+mzottola@users.noreply.github.com> --- src/schemas/helm/HelmResponse.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/helm/HelmResponse.yaml b/src/schemas/helm/HelmResponse.yaml index 8af1f79f..9f60260c 100644 --- a/src/schemas/helm/HelmResponse.yaml +++ b/src/schemas/helm/HelmResponse.yaml @@ -57,7 +57,7 @@ allOf: description: The name of the helm repository url: type: string - description: The name url the helm repository + description: The url the helm repository arguments: type: array description: The extra arguments to pass to helm From 337ee2c545e5d38256fe14bee1de850ae34548c7 Mon Sep 17 00:00:00 2001 From: Melvin Zottola <37779145+mzottola@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:25:09 +0100 Subject: [PATCH 59/85] feat: Set advanced settings default values to the qovery doc (#492) * feat: Set advanced settings default values to the qovery doc * Update ApplicationAdvancedSettings.yaml * Update ContainerAdvancedSettings.yaml * Update DefaultApplicationAdvancedSettings.yaml * Update DefaultClusterAdvancedSettings.yaml * Update DefaultContainerAdvancedSettings.yaml * Update OrganizationClusterAdvancedSettings.yaml * Update JobAdvancedSettings.yaml --------- Co-authored-by: acarranoqovery <105300721+acarranoqovery@users.noreply.github.com> --- .../ApplicationAdvancedSettings.yaml | 4 ++- src/resources/ContainerAdvancedSettings.yaml | 4 ++- .../DefaultApplicationAdvancedSettings.yaml | 1 + .../DefaultClusterAdvancedSettings.yaml | 1 + .../DefaultContainerAdvancedSettings.yaml | 1 + src/resources/DefaultJobAdvancedSettings.yaml | 1 + .../OrganizationClusterAdvancedSettings.yaml | 4 ++- src/resources/job/JobAdvancedSettings.yaml | 4 ++- src/schemas/ApplicationAdvancedSettings.yaml | 36 ------------------- src/schemas/ClusterAdvancedSettings.yaml | 24 ------------- src/schemas/ContainerAdvancedSettings.yaml | 30 ---------------- src/schemas/job/JobAdvancedSettings.yaml | 10 ------ 12 files changed, 16 insertions(+), 104 deletions(-) diff --git a/src/resources/ApplicationAdvancedSettings.yaml b/src/resources/ApplicationAdvancedSettings.yaml index 72d7a345..921074b6 100644 --- a/src/resources/ApplicationAdvancedSettings.yaml +++ b/src/resources/ApplicationAdvancedSettings.yaml @@ -1,6 +1,8 @@ get: summary: 'Get advanced settings' - description: Get list and values of the advanced settings of the application. + description: | + Get list and values of the advanced settings of the application. + Default values for each setting are available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/advanced-settings/) operationId: getAdvancedSettings parameters: - $ref: '../parameters/path/applicationId.yaml' diff --git a/src/resources/ContainerAdvancedSettings.yaml b/src/resources/ContainerAdvancedSettings.yaml index b994ff24..d9923b8c 100644 --- a/src/resources/ContainerAdvancedSettings.yaml +++ b/src/resources/ContainerAdvancedSettings.yaml @@ -1,6 +1,8 @@ get: summary: 'Get advanced settings' - description: Get list and values of the advanced settings of the container. + description: | + Get list and values of the advanced settings of the container. + Default values for each setting are available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/advanced-settings/) operationId: getContainerAdvancedSettings parameters: - $ref: '../parameters/path/containerId.yaml' diff --git a/src/resources/DefaultApplicationAdvancedSettings.yaml b/src/resources/DefaultApplicationAdvancedSettings.yaml index 4942e4f3..32930364 100644 --- a/src/resources/DefaultApplicationAdvancedSettings.yaml +++ b/src/resources/DefaultApplicationAdvancedSettings.yaml @@ -1,6 +1,7 @@ get: summary: 'List default application advanced settings' operationId: getDefaultApplicationAdvancedSettings + description: 'Default values for each setting are available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/advanced-settings/)' tags: - Applications responses: diff --git a/src/resources/DefaultClusterAdvancedSettings.yaml b/src/resources/DefaultClusterAdvancedSettings.yaml index 0d00919d..0f677d1d 100644 --- a/src/resources/DefaultClusterAdvancedSettings.yaml +++ b/src/resources/DefaultClusterAdvancedSettings.yaml @@ -1,5 +1,6 @@ get: summary: 'List default cluster advanced settings' + description: 'Default values for each setting are available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/cluster-advanced-settings/)' operationId: getDefaultClusterAdvancedSettings tags: - Clusters diff --git a/src/resources/DefaultContainerAdvancedSettings.yaml b/src/resources/DefaultContainerAdvancedSettings.yaml index 6c7b9137..1640361e 100644 --- a/src/resources/DefaultContainerAdvancedSettings.yaml +++ b/src/resources/DefaultContainerAdvancedSettings.yaml @@ -1,5 +1,6 @@ get: summary: 'List default container advanced settings' + description: 'Default values for each setting are available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/advanced-settings/)' operationId: getDefaultContainerAdvancedSettings tags: - Containers diff --git a/src/resources/DefaultJobAdvancedSettings.yaml b/src/resources/DefaultJobAdvancedSettings.yaml index 4cebd736..7276a6a7 100644 --- a/src/resources/DefaultJobAdvancedSettings.yaml +++ b/src/resources/DefaultJobAdvancedSettings.yaml @@ -1,5 +1,6 @@ get: summary: 'List default job advanced settings' + description: 'Default values for each setting is available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/advanced-settings/)' operationId: getDefaultJobAdvancedSettings tags: - Jobs diff --git a/src/resources/OrganizationClusterAdvancedSettings.yaml b/src/resources/OrganizationClusterAdvancedSettings.yaml index 9d136380..13161158 100644 --- a/src/resources/OrganizationClusterAdvancedSettings.yaml +++ b/src/resources/OrganizationClusterAdvancedSettings.yaml @@ -1,6 +1,8 @@ get: summary: 'Get advanced settings' - description: Get list and values of the advanced settings of the cluster. + description: | + Get the list and values of the advanced settings of the cluster. + Default values for each setting are available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/cluster-advanced-settings/) operationId: getClusterAdvancedSettings parameters: - $ref: '../parameters/path/organizationId.yaml' diff --git a/src/resources/job/JobAdvancedSettings.yaml b/src/resources/job/JobAdvancedSettings.yaml index 5bb943e5..c1994bd1 100644 --- a/src/resources/job/JobAdvancedSettings.yaml +++ b/src/resources/job/JobAdvancedSettings.yaml @@ -1,6 +1,8 @@ get: summary: 'Get advanced settings' - description: Get list and values of the advanced settings of the job. + description: | + Get list and values of the advanced settings of the job. + Default values for each setting are available in [our documentation](https://hub.qovery.com/docs/using-qovery/configuration/advanced-settings/) operationId: getJobAdvancedSettings parameters: - $ref: '../../parameters/path/jobId.yaml' diff --git a/src/schemas/ApplicationAdvancedSettings.yaml b/src/schemas/ApplicationAdvancedSettings.yaml index 60389210..3b7053f0 100644 --- a/src/schemas/ApplicationAdvancedSettings.yaml +++ b/src/schemas/ApplicationAdvancedSettings.yaml @@ -3,11 +3,9 @@ properties: deployment.custom_domain_check_enabled: type: boolean description: disable custom domain check when deploying an application - default: true deployment.termination_grace_period_seconds: type: integer description: define how long in seconds an application is supposed to be stopped gracefully - default: 60 deployment.affinity.node.required: type: object additionalProperties: @@ -15,7 +13,6 @@ properties: description: Set pod placement on specific Kubernetes nodes labels deployment.antiaffinity.pod: type: string - default: Preferred enum: - Preferred - Requirred @@ -28,79 +25,56 @@ properties: enum: - RollingUpdate - Recreate - default: RollingUpdate description: | * `RollingUpdate` gracefully rollout new versions, and automatically rollback if the new version fails to start * `Recreate` stop all current versions and create new ones once all old ones have been shutdown deployment.update_strategy.rolling_update.max_unavailable_percent: type: integer - default: 25 description: Define the percentage of a maximum number of pods that can be unavailable during the update process deployment.update_strategy.rolling_update.max_surge_percent: type: integer - default: 25 description: Define the percentage of the maximum number of pods that can be created over the desired number of pods build.timeout_max_sec: type: integer - default: 1800 build.cpu_max_in_milli: type: integer description: define the max cpu resources (in milli) - default: 4000 build.ram_max_in_gib: type: integer description: define the max ram resources (in gib) - default: 8 network.ingress.proxy_body_size_mb: type: integer - default: 100 network.ingress.enable_cors: type: boolean - default: false network.ingress.cors_allow_origin: type: string - default: "*" network.ingress.cors_allow_methods: type: string - default: GET, PUT, POST, DELETE, PATCH, OPTIONS network.ingress.cors_allow_headers: type: string - default: DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization network.ingress.proxy_buffer_size_kb: type: integer - default: 4 description: header buffer size used while reading response header from upstream network.ingress.keepalive_time_seconds: type: integer - default: 3600 description: Limits the maximum time (in seconds) during which requests can be processed through one keepalive connection network.ingress.keepalive_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) during which an idle keepalive connection to an upstream server will stay open. network.ingress.send_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for transmitting a response to the client network.ingress.proxy_connect_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for establishing a connection to a proxied server network.ingress.proxy_send_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for transmitting a request to the proxied server network.ingress.proxy_read_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for reading a response from the proxied server network.ingress.proxy_buffering: type: string - default: "on" - description: Allows to enable or disable nginx `proxy-buffering` - network.ingress.proxy_request_buffering: - type: string - default: "on" description: Allows to enable or disable nginx `proxy-request-buffering` network.ingress.whitelist_source_range: type: string @@ -109,49 +83,39 @@ properties: This property can be used to whitelist source IP ranges for ingress proxy. The value is a comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1 To allow all source ranges, set 0.0.0.0/0. - default: "0.0.0.0/0" network.ingress.denylist_source_range: type: string - default: "" description: | list of source ranges to deny access to ingress proxy. This property can be used to blacklist source IP ranges for ingress proxy. The value is a comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1 network.ingress.basic_auth_env_var: type: string - default: "" description: | Set the name of an environment variable to use as a basic authentication (`login:crypted_password`) from `htpasswd` command. network.ingress.enable_sticky_session: type: boolean - default: false description: | Enable the load balancer to bind a user's session to a specific target. This ensures that all requests from the user during the session are sent to the same target network.ingress.grpc_send_timeout_seconds: type: integer description: Sets a timeout (in seconds) for transmitting a request to the grpc server - default: 60 network.ingress.grpc_read_timeout_seconds: type: integer description: Sets a timeout (in seconds) for transmitting a request to the grpc server - default: 60 network.ingress.extra_headers: type: string - default: "{}" description: Allows to define response headers example: '{"X-Frame-Options":"DENY ","X-Content-Type-Options":"nosniff"}' hpa.cpu.average_utilization_percent: type: integer description: Percentage value of cpu usage at which point pods should scale up. - default: 60 security.service_account_name: type: string - default: "" description: | Allows you to set an existing Kubernetes service account name security.read_only_root_filesystem: type: boolean - default: false description: | Mounts the container's root filesystem as read-only diff --git a/src/schemas/ClusterAdvancedSettings.yaml b/src/schemas/ClusterAdvancedSettings.yaml index f2c0dec6..d23a6767 100644 --- a/src/schemas/ClusterAdvancedSettings.yaml +++ b/src/schemas/ClusterAdvancedSettings.yaml @@ -2,23 +2,18 @@ type: object properties: aws.cloudwatch.eks_logs_retention_days: type: integer - default: 90 description: Set the number of retention days for EKS Cloudwatch logs aws.vpc.enable_s3_flow_logs: type: boolean - default: false description: Enable flow logs for on the VPC and store them in an S3 bucket aws.vpc.flow_logs_retention_days: type: integer - default: 365 description: Set the number of retention days for flow logs. Disable with value "0" loki.log_retention_in_week: type: integer - default: 12 description: For how long in week loki is going to keep logs of your applications registry.image_retention_time: type: integer - default: 31536000 description: Configure the number of seconds before cleaning images in the registry cloud_provider.container_registry.tags: type: object @@ -27,55 +22,44 @@ properties: description: Add additional tags on the cluster dedicated registry load_balancer.size: type: string - default: "lb-s" description: Select the size of the main load_balancer (only effective for Scaleway) database.postgresql.deny_public_access: type: boolean - default: false description: Deny public access to any PostgreSQL database database.postgresql.allowed_cidrs: type: array - default: ["0.0.0.0/0"] items: type: string description: List of CIDRs allowed to access the PostgreSQL database database.mysql.deny_public_access: type: boolean - default: false description: Deny public access to any MySql database database.mysql.allowed_cidrs: type: array - default: ["0.0.0.0/0"] items: type: string description: List of CIDRs allowed to access the MySql database database.mongodb.deny_public_access: type: boolean - default: false description: Deny public access to any MongoDB/DocumentDB database database.mongodb.allowed_cidrs: type: array - default: ["0.0.0.0/0"] items: type: string description: List of CIDRs allowed to access the MongoDB/DocumentDB database database.redis.deny_public_access: type: boolean - default: false description: Deny public access to any Redis database database.redis.allowed_cidrs: type: array - default: ["0.0.0.0/0"] items: type: string description: List of CIDRs allowed to access the Redis database aws.iam.admin_group: type: string - default: "Admins" description: AWS IAM group name with cluster access aws.eks.ec2.metadata_imds: type: string - default: "optional" enum: ["optional", "required"] description: > Specify the [IMDS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) version you want to use: @@ -83,35 +67,27 @@ properties: * `optional`: IMDS V1 + V2 pleco.resources_ttl: type: integer - default: -1 deprecated: true registry.mirroring_mode: $ref: './enums/RegistryMirroringMode.yaml' nginx.vcpu.request_in_milli_cpu: type: integer - default: 100 description: vcpu request in millicores nginx.vcpu.limit_in_milli_cpu: type: integer - default: 500 description: vcpu limit in millicores nginx.memory.request_in_mib: type: integer - default: 768 description: memory request in MiB nginx.memory.limit_in_mib: type: integer - default: 768 description: memory limit in MiB nginx.hpa.cpu_utilization_percentage_threshold: type: integer - default: 50 description: hpa cpu threshold in percentage nginx.hpa.min_number_instances: type: integer - default: 2 description: hpa minimum number of instances nginx.hpa.max_number_instances: type: integer - default: 25 description: hpa maximum number of instances diff --git a/src/schemas/ContainerAdvancedSettings.yaml b/src/schemas/ContainerAdvancedSettings.yaml index 6c99628e..7246571f 100644 --- a/src/schemas/ContainerAdvancedSettings.yaml +++ b/src/schemas/ContainerAdvancedSettings.yaml @@ -3,11 +3,9 @@ properties: deployment.custom_domain_check_enabled: type: boolean description: disable custom domain check when deploying an application - default: true deployment.termination_grace_period_seconds: type: integer description: define how long in seconds an application is supposed to be stopped gracefully - default: 60 deployment.affinity.node.required: type: object additionalProperties: @@ -15,7 +13,6 @@ properties: description: Set pod placement on specific Kubernetes nodes labels deployment.antiaffinity.pod: type: string - default: Preferred enum: - Preferred - Requirred @@ -28,77 +25,58 @@ properties: enum: - RollingUpdate - Recreate - default: RollingUpdate description: | * `RollingUpdate` gracefully rollout new versions, and automatically rollback if the new version fails to start * `Recreate` stop all current versions and create new ones once all old ones have been shutdown deployment.update_strategy.rolling_update.max_unavailable_percent: type: integer - default: 25 description: Define the percentage of a maximum number of pods that can be unavailable during the update process deployment.update_strategy.rolling_update.max_surge_percent: type: integer - default: 25 description: Define the percentage of the maximum number of pods that can be created over the desired number of pods network.ingress.proxy_body_size_mb: type: integer - default: 100 network.ingress.enable_cors: type: boolean - default: false network.ingress.cors_allow_origin: type: string - default: "*" network.ingress.cors_allow_methods: type: string - default: GET, PUT, POST, DELETE, PATCH, OPTIONS network.ingress.cors_allow_headers: type: string - default: DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization network.ingress.proxy_buffer_size_kb: type: integer - default: 4 description: header buffer size used while reading response header from upstream network.ingress.keepalive_time_seconds: type: integer - default: 3600 description: Limits the maximum time (in seconds) during which requests can be processed through one keepalive connection network.ingress.keepalive_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) during which an idle keepalive connection to an upstream server will stay open. network.ingress.send_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for transmitting a response to the client network.ingress.proxy_connect_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for establishing a connection to a proxied server network.ingress.proxy_send_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for transmitting a request to the proxied server network.ingress.proxy_read_timeout_seconds: type: integer - default: 60 description: Sets a timeout (in seconds) for reading a response from the proxied server network.ingress.proxy_buffering: type: string - default: "on" description: Allows to enable or disable nginx `proxy-buffering` network.ingress.proxy_request_buffering: type: string - default: "on" description: Allows to enable or disable nginx `proxy-request-buffering` network.ingress.grpc_send_timeout_seconds: type: integer description: Sets a timeout (in seconds) for transmitting a request to the grpc server - default: 60 network.ingress.grpc_read_timeout_seconds: type: integer description: Sets a timeout (in seconds) for transmitting a request to the grpc server - default: 60 network.ingress.whitelist_source_range: type: string description: | @@ -106,41 +84,33 @@ properties: This property can be used to whitelist source IP ranges for ingress proxy. The value is a comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1 To allow all source ranges, set 0.0.0.0/0. - default: "0.0.0.0/0" network.ingress.denylist_source_range: type: string - default: "" description: | list of source ranges to deny access to ingress proxy. This property can be used to blacklist source IP ranges for ingress proxy. The value is a comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1 network.ingress.extra_headers: type: string - default: "{}" description: Allows to define response headers example: '{"X-Frame-Options":"DENY ","X-Content-Type-Options":"nosniff"}' network.ingress.basic_auth_env_var: type: string - default: "" description: | Set the name of an environment variable to use as a basic authentication (`login:crypted_password`) from `htpasswd` command. You can add multiples comma separated values. network.ingress.enable_sticky_session: type: boolean - default: false description: | Enable the load balancer to bind a user's session to a specific target. This ensures that all requests from the user during the session are sent to the same target security.service_account_name: type: string - default: "" description: | Allows you to set an existing Kubernetes service account name hpa.cpu.average_utilization_percent: type: integer description: Percentage value of cpu usage at which point pods should scale up. - default: 60 security.read_only_root_filesystem: type: boolean - default: false description: | Mounts the container's root filesystem as read-only diff --git a/src/schemas/job/JobAdvancedSettings.yaml b/src/schemas/job/JobAdvancedSettings.yaml index 444514b6..a3690634 100644 --- a/src/schemas/job/JobAdvancedSettings.yaml +++ b/src/schemas/job/JobAdvancedSettings.yaml @@ -3,19 +3,15 @@ properties: build.timeout_max_sec: type: integer description: define the max timeout for the build - default: 1800 build.cpu_max_in_milli: type: integer description: define the max cpu resources (in milli) - default: 4000 build.ram_max_in_gib: type: integer description: define the max ram resources (in gib) - default: 8 deployment.termination_grace_period_seconds: type: integer description: define how long in seconds an application is supposed to be stopped gracefully - default: 60 deployment.affinity.node.required: type: object additionalProperties: @@ -24,23 +20,17 @@ properties: job.delete_ttl_seconds_after_finished: type: integer nullable: true - default: null cronjob.concurrency_policy: type: string - default: "Forbid" cronjob.failed_jobs_history_limit: type: integer - default: 1 cronjob.success_jobs_history_limit: type: integer - default: 1 security.service_account_name: type: string - default: "" description: | Allows you to set an existing Kubernetes service account name security.read_only_root_filesystem: type: boolean - default: false description: | Mounts the container's root filesystem as read-only From b3bfba003d43f4481113b8a8a36e433dc6369153 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 7 Nov 2023 15:14:00 +0100 Subject: [PATCH 60/85] feat(helm): Add available helm repository endpoint --- src/openapi.yaml | 5 ++++- src/resources/AvailableHelmRepository.yaml | 19 +++++++++++++++++++ .../AvailableHelmRepositoryResponse.yaml | 9 +++++++++ .../AvailableHelmRepositoryResponseList.yaml | 6 ++++++ src/schemas/_index.yaml | 6 ++++++ src/schemas/enums/HelmRepositoryKind.yaml | 6 ++++++ 6 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/resources/AvailableHelmRepository.yaml create mode 100644 src/schemas/AvailableHelmRepositoryResponse.yaml create mode 100644 src/schemas/AvailableHelmRepositoryResponseList.yaml create mode 100644 src/schemas/enums/HelmRepositoryKind.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index b4260836..99ec3b94 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -65,7 +65,7 @@ tags: - name: Helm Logs - name: Helm Main Calls - name: Helm Metrics - - name: Helm Registry + - name: Helm Repository - name: Helm Secret - name: Helms - name: Backups @@ -112,6 +112,7 @@ tags: - name: Projects - name: Referral & Rewards - name: Container Registries + - name: Helm Repositories - name: User Sign Up - name: Variable Main Calls x-tagGroups: @@ -131,6 +132,7 @@ x-tagGroups: - Cloud Provider Credentials - Github App - Container Registries + - Helm Repositories - name: Project tags: - Project Main Calls @@ -216,6 +218,7 @@ x-tagGroups: - Helm Deployment History - Helm Environment Variable - Helm Secret + - Helm Repository - name: Account tags: - Account Info diff --git a/src/resources/AvailableHelmRepository.yaml b/src/resources/AvailableHelmRepository.yaml new file mode 100644 index 00000000..a75038c3 --- /dev/null +++ b/src/resources/AvailableHelmRepository.yaml @@ -0,0 +1,19 @@ +get: + summary: 'List supported helm repository' + description: List supported helm repository by Qovery and get the mandatory authentification configuration. + operationId: listAvailableHelmRepository + tags: + - Helm Repositories + responses: + '200': + description: 'supported helm repositories' + content: + application/json: + schema: + $ref: '../schemas/AvailableHelmRepositoryResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' diff --git a/src/schemas/AvailableHelmRepositoryResponse.yaml b/src/schemas/AvailableHelmRepositoryResponse.yaml new file mode 100644 index 00000000..9ab7b864 --- /dev/null +++ b/src/schemas/AvailableHelmRepositoryResponse.yaml @@ -0,0 +1,9 @@ +type: object +properties: + kind: + $ref: ./enums/HelmRepositoryKind.yaml + required_config: + type: object + additionalProperties: true + is_mandatory: + type: boolean diff --git a/src/schemas/AvailableHelmRepositoryResponseList.yaml b/src/schemas/AvailableHelmRepositoryResponseList.yaml new file mode 100644 index 00000000..99ac2273 --- /dev/null +++ b/src/schemas/AvailableHelmRepositoryResponseList.yaml @@ -0,0 +1,6 @@ +type: object +properties: + results: + type: array + items: + $ref: './AvailableHelmRepositoryResponse.yaml' diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 146c8fe8..f4c292be 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -44,6 +44,10 @@ AvailableContainerRegistryResponse: $ref: ./AvailableContainerRegistryResponse.yaml AvailableContainerRegistryResponseList: $ref: ./AvailableContainerRegistryResponseList.yaml +AvailableHelmRepositoryResponse: + $ref: ./AvailableHelmRepositoryResponse.yaml +AvailableHelmRepositoryResponseList: + $ref: ./AvailableHelmRepositoryResponseList.yaml AwsCredentialsRequest: $ref: ./AwsCredentialsRequest.yaml Backup: @@ -158,6 +162,8 @@ ContainerDeployRequest: $ref: ./ContainerDeployRequest.yaml ContainerRegistryKindEnum: $ref: ./enums/ContainerRegistryKind.yaml +HelmRepositoryKindEnum: + $ref: ./enums/HelmRepositoryKind.yaml ContainerRegistryRequest: $ref: ./ContainerRegistryRequest.yaml ContainerRegistryResponse: diff --git a/src/schemas/enums/HelmRepositoryKind.yaml b/src/schemas/enums/HelmRepositoryKind.yaml new file mode 100644 index 00000000..965c1c5b --- /dev/null +++ b/src/schemas/enums/HelmRepositoryKind.yaml @@ -0,0 +1,6 @@ +type: string +enum: + - HTTPS + - OCI +description: The type of your helm repository + From dee80f391d429c6da536174074dc9a998d0abc75 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 7 Nov 2023 16:29:39 +0100 Subject: [PATCH 61/85] feat(helm): Add helm repository endpoints --- src/resources/OrganizationHelmRepository.yaml | 48 +++++++++++++ .../OrganizationHelmRepositoryRef.yaml | 70 +++++++++++++++++++ src/schemas/HelmRepositoryRequest.yaml | 32 +++++++++ src/schemas/HelmRepositoryResponse.yaml | 13 ++++ src/schemas/HelmRepositoryResponseList.yaml | 6 ++ src/schemas/_index.yaml | 6 ++ 6 files changed, 175 insertions(+) create mode 100644 src/resources/OrganizationHelmRepository.yaml create mode 100644 src/resources/OrganizationHelmRepositoryRef.yaml create mode 100644 src/schemas/HelmRepositoryRequest.yaml create mode 100644 src/schemas/HelmRepositoryResponse.yaml create mode 100644 src/schemas/HelmRepositoryResponseList.yaml diff --git a/src/resources/OrganizationHelmRepository.yaml b/src/resources/OrganizationHelmRepository.yaml new file mode 100644 index 00000000..68608134 --- /dev/null +++ b/src/resources/OrganizationHelmRepository.yaml @@ -0,0 +1,48 @@ +get: + summary: 'List organization helm repositories' + operationId: listHelmRepository + parameters: + - $ref: '../parameters/path/organizationId.yaml' + tags: + - Helm Repositories + responses: + '200': + description: 'List helm repositories' + content: + application/json: + schema: + $ref: '../schemas/HelmRepositoryResponseList.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' + +post: + summary: 'Create a helm repository' + operationId: createHelmRepository + parameters: + - $ref: '../parameters/path/organizationId.yaml' + tags: + - Helm Repositories + requestBody: + content: + application/json: + schema: + $ref: '../schemas/HelmRepositoryRequest.yaml' + responses: + '201': + description: 'Create a helm repository' + content: + application/json: + schema: + $ref: '../schemas/HelmRepositoryResponse.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/OrganizationHelmRepositoryRef.yaml b/src/resources/OrganizationHelmRepositoryRef.yaml new file mode 100644 index 00000000..251649bd --- /dev/null +++ b/src/resources/OrganizationHelmRepositoryRef.yaml @@ -0,0 +1,70 @@ +get: + summary: 'Get a helm repository' + operationId: getHelmRepository + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - $ref: '../parameters/path/helmRepositoryId.yaml' + tags: + - Helm Repositories + responses: + '200': + description: 'The helm repository' + content: + application/json: + schema: + $ref: '../schemas/HelmRepositoryResponse.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' + +delete: + summary: 'Delete a helm repository' + operationId: deleteHelmRepository + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - $ref: '../parameters/path/helmRepositoryId.yaml' + tags: + - Helm Repositories + responses: + '204': + $ref: '../responses/Deleted.yaml' + '401': + $ref: '../responses/NotAuthorized.yaml' + '403': + $ref: '../responses/Forbidden.yaml' + '404': + $ref: '../responses/NotFound.yaml' + +put: + summary: 'Edit a helm repository' + operationId: editHelmRepository + parameters: + - $ref: '../parameters/path/organizationId.yaml' + - $ref: '../parameters/path/helmRepositoryId.yaml' + + tags: + - Helm Repositories + requestBody: + content: + application/json: + schema: + $ref: '../schemas/HelmRepositoryRequest.yaml' + + responses: + '200': + description: 'Edited the helm repository' + content: + application/json: + schema: + $ref: '../schemas/HelmRepositoryResponse.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/HelmRepositoryRequest.yaml b/src/schemas/HelmRepositoryRequest.yaml new file mode 100644 index 00000000..6e303b28 --- /dev/null +++ b/src/schemas/HelmRepositoryRequest.yaml @@ -0,0 +1,32 @@ +type: object +required: + - name + - kind + - config +properties: + name: + type: string + kind: + $ref: ../schemas/enums/HelmRepositoryKind.yaml + description: + type: string + url: + type: string + format: uri + description: | + URL of the helm chart repository: + * For `OCI`: it must start by oci:// + * For `HTTPS`: it must be start by https:// + config: + type: object + properties: + skip_tls_verification: + type: boolean + default: false + description: Bypass tls certificate verification when connecting to repository + login: + type: string + description: Required if the repository is private + password: + type: string + description: Required if the repository is private diff --git a/src/schemas/HelmRepositoryResponse.yaml b/src/schemas/HelmRepositoryResponse.yaml new file mode 100644 index 00000000..46c9f85a --- /dev/null +++ b/src/schemas/HelmRepositoryResponse.yaml @@ -0,0 +1,13 @@ +allOf: + - $ref: './BaseResponse.yaml' + - type: object + properties: + name: + type: string + kind: + $ref: ../schemas/enums/HelmRepositoryKind.yaml + description: + type: string + url: + type: string + description: URL of the helm repository diff --git a/src/schemas/HelmRepositoryResponseList.yaml b/src/schemas/HelmRepositoryResponseList.yaml new file mode 100644 index 00000000..6159d824 --- /dev/null +++ b/src/schemas/HelmRepositoryResponseList.yaml @@ -0,0 +1,6 @@ +type: object +properties: + results: + type: array + items: + $ref: './HelmRepositoryResponse.yaml' diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index f4c292be..7ffd8359 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -172,6 +172,12 @@ ContainerRegistryProviderDetailsResponse: $ref: ./ContainerRegistryProviderDetailsResponse.yaml ContainerRegistryResponseList: $ref: ./ContainerRegistryResponseList.yaml +HelmRepositoryRequest: + $ref: ./HelmRepositoryRequest.yaml +HelmRepositoryResponse: + $ref: ./HelmRepositoryResponse.yaml +HelmRepositoryResponseList: + $ref: ./HelmRepositoryResponseList.yaml ContainerRequest: $ref: ./ContainerRequest.yaml ContainerResponse: From 5858ffdb55de373bdece332935092814592efc87 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 8 Nov 2023 08:45:58 +0100 Subject: [PATCH 62/85] feat(helm): add helm repository --- src/openapi.yaml | 6 ++++++ src/parameters/path/helmRepositoryId.yaml | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 src/parameters/path/helmRepositoryId.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 99ec3b94..f128c291 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -406,6 +406,12 @@ paths: $ref: './resources/ContainerRegistryContainerStatus.yaml' /availableContainerRegistry: $ref: './resources/AvailableContainerRegistry.yaml' + /availableHelmRepository: + $ref: './resources/AvailableHelmRepository.yaml' + /organization/{organizationId}/helmRepository: + $ref: './resources/OrganizationHelmRepository.yaml' + /organization/{organizationId}/helmRepository/{helmRepositoryId}: + $ref: './resources/OrganizationHelmRepositoryRef.yaml' /project/{projectId}: $ref: './resources/Project.yaml' /project/{projectId}/deploymentRule: diff --git a/src/parameters/path/helmRepositoryId.yaml b/src/parameters/path/helmRepositoryId.yaml new file mode 100644 index 00000000..5ef8c822 --- /dev/null +++ b/src/parameters/path/helmRepositoryId.yaml @@ -0,0 +1,7 @@ +name: helmRepositoryId +in: path +description: Helm chart repository ID +required: true +schema: + type: string + format: uuid From 4e05ca144605884751e5b525cb362aa46ee2c852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bonnet?= Date: Thu, 9 Nov 2023 15:19:31 +0100 Subject: [PATCH 63/85] fix: add brand for credit card response (#499) --- src/schemas/CreditCardResponse.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/schemas/CreditCardResponse.yaml b/src/schemas/CreditCardResponse.yaml index e9170a5d..0fd7f6c5 100644 --- a/src/schemas/CreditCardResponse.yaml +++ b/src/schemas/CreditCardResponse.yaml @@ -6,6 +6,7 @@ required: - expiry_year - last_digit - is_expired + - brand properties: id: type: string @@ -24,5 +25,5 @@ properties: example: "7890" is_expired: type: boolean - - + brand: + type: string From 698e96e8d7c533a6a70281ce348a5331eba248b0 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 10 Nov 2023 15:03:18 +0100 Subject: [PATCH 64/85] fix(helm): Correctly mark required field --- src/schemas/helm/HelmRequest.yaml | 5 ++++- src/schemas/helm/HelmResponse.yaml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/schemas/helm/HelmRequest.yaml b/src/schemas/helm/HelmRequest.yaml index 50bdbc27..bbcc4659 100644 --- a/src/schemas/helm/HelmRequest.yaml +++ b/src/schemas/helm/HelmRequest.yaml @@ -2,7 +2,10 @@ allOf: - type: object required: - name - - healthchecks + - source + - values_override + - arguments + - auto_deploy properties: name: type: string diff --git a/src/schemas/helm/HelmResponse.yaml b/src/schemas/helm/HelmResponse.yaml index 9f60260c..46923f62 100644 --- a/src/schemas/helm/HelmResponse.yaml +++ b/src/schemas/helm/HelmResponse.yaml @@ -4,10 +4,12 @@ allOf: required: - environment - name - - tag - auto_preview - auto_deploy - source + - values_override + - arguments + - allow_cluster_wide_resources properties: environment: $ref: '../ReferenceObject.yaml' From 873540152b108536ffcc68a777f3473a4cc6e0db Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 10 Nov 2023 15:27:57 +0100 Subject: [PATCH 65/85] feat(helm): Use oneOf for object --- src/schemas/helm/HelmResponse.yaml | 50 ++++++++++++++++-------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/schemas/helm/HelmResponse.yaml b/src/schemas/helm/HelmResponse.yaml index 46923f62..1fc89b8d 100644 --- a/src/schemas/helm/HelmResponse.yaml +++ b/src/schemas/helm/HelmResponse.yaml @@ -29,37 +29,39 @@ allOf: 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 + nullable: false + oneOf: + - type: object properties: - git_repository: - $ref: '../ApplicationGitRepositoryRequest.yaml' - repository: - type: object - nullable: true + git: + type: object + properties: + git_repository: + $ref: '../ApplicationGitRepositoryRequest.yaml' + - type: object properties: - 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 repository: type: object properties: - id: - type: string - format: UUID - description: The id of the helm repository - name: + chart_name: type: string - description: The name of the helm repository - url: + description: The name of the chart in the repository + chart_version: type: string - description: The url the helm repository + description: The version of the chart to use + repository: + type: object + properties: + id: + type: string + format: UUID + description: The id of the helm repository + name: + type: string + description: The name of the helm repository + url: + type: string + description: The url the helm repository arguments: type: array description: The extra arguments to pass to helm From 75cc34499d922e164028014ff5b551c4abba6da5 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Fri, 10 Nov 2023 15:40:58 +0100 Subject: [PATCH 66/85] feat(helm): add api to get chart default values (#500) --- src/openapi.yaml | 2 ++ src/resources/helm/HelmDefaultValues.yaml | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/resources/helm/HelmDefaultValues.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index f128c291..0e6da45f 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -766,6 +766,8 @@ paths: $ref: './resources/helm/HelmDeploymentRestriction.yaml' /helm/{helmId}/deploymentRestriction/{deploymentRestrictionId}: $ref: './resources/helm/HelmDeploymentRestrictionRef.yaml' + /helm/{helmId}/defaultValues: + $ref: './resources/helm/HelmDefaultValues.yaml' /environment/{environmentId}/job: $ref: './resources/job/EnvironmentJob.yaml' /environment/{environmentId}/job/status: diff --git a/src/resources/helm/HelmDefaultValues.yaml b/src/resources/helm/HelmDefaultValues.yaml new file mode 100644 index 00000000..472ed86d --- /dev/null +++ b/src/resources/helm/HelmDefaultValues.yaml @@ -0,0 +1,20 @@ +get: + summary: 'Display the contents of the values.yaml file' + operationId: getDefaultValues + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Helm Main Calls + responses: + '200': + description: 'Display the contents of the values.yaml file' + content: + text/plain: + schema: + type: string + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' From e1c7ee1d8b3a29e7e6a784d50af0e736b5fb6aca Mon Sep 17 00:00:00 2001 From: Melvin Zottola <37779145+mzottola@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:35:40 +0100 Subject: [PATCH 67/85] Revert "chore: Temporary endpoints to migrate git (#486)" (#488) This reverts commit 37b14b835a81bb28fbf5e99509608f7da81baee8. Co-authored-by: Melvin Zottola --- src/openapi.yaml | 8 ------- ...rganizationAccountGitAuthProviderTemp.yaml | 16 -------------- ...tionAccountGitRepositoryBitbucketTemp.yaml | 22 ------------------- ...izationAccountGitRepositoryGithubTemp.yaml | 22 ------------------- ...izationAccountGitRepositoryGitlabTemp.yaml | 22 ------------------- 5 files changed, 90 deletions(-) delete mode 100644 src/resources/OrganizationAccountGitAuthProviderTemp.yaml delete mode 100644 src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml delete mode 100644 src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml delete mode 100644 src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 0e6da45f..1505a6bf 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -320,24 +320,16 @@ paths: $ref: './resources/OrganizationGithubAppDisconnect.yaml' /organization/{organizationId}/account/gitAuthProvider: $ref: './resources/OrganizationAccountGitAuthProvider.yaml' - /organization/{organizationId}/account/gitAuthProviderTemp: - $ref: './resources/OrganizationAccountGitAuthProviderTemp.yaml' /organization/{organizationId}/account/github/repository: $ref: './resources/OrganizationAccountGitRepositoryGithub.yaml' - /organization/{organizationId}/account/github/repositoryTemp: - $ref: './resources/OrganizationAccountGitRepositoryGithubTemp.yaml' /organization/{organizationId}/account/github/repository/branch: $ref: './resources/OrganizationAccountGitRepositoryGithubBranch.yaml' /organization/{organizationId}/account/gitlab/repository: $ref: './resources/OrganizationAccountGitRepositoryGitlab.yaml' - /organization/{organizationId}/account/gitlab/repositoryTemp: - $ref: './resources/OrganizationAccountGitRepositoryGitlabTemp.yaml' /organization/{organizationId}/account/gitlab/repository/branch: $ref: './resources/OrganizationAccountGitRepositoryGitlabBranch.yaml' /organization/{organizationId}/account/bitbucket/repository: $ref: './resources/OrganizationAccountGitRepositoryBitbucket.yaml' - /organization/{organizationId}/account/bitbucket/repositoryTemp: - $ref: './resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml' /organization/{organizationId}/account/bitbucket/repository/branch: $ref: './resources/OrganizationAccountGitRepositoryBitbucketBranch.yaml' /organization/{organizationId}/webhook: diff --git a/src/resources/OrganizationAccountGitAuthProviderTemp.yaml b/src/resources/OrganizationAccountGitAuthProviderTemp.yaml deleted file mode 100644 index 629800f4..00000000 --- a/src/resources/OrganizationAccountGitAuthProviderTemp.yaml +++ /dev/null @@ -1,16 +0,0 @@ -get: - summary: 'Get git provider accounts' - operationId: getOrganizationGitProviderAccountTemp - parameters: - - $ref: '../parameters/path/organizationId.yaml' - tags: - - Organization Account Git Repositories - responses: - '200': - description: 'Get account' - content: - application/json: - schema: - $ref: '../schemas/GitAuthProviderResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' diff --git a/src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml b/src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml deleted file mode 100644 index 6fa87da5..00000000 --- a/src/resources/OrganizationAccountGitRepositoryBitbucketTemp.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - summary: 'Get bitbucket repositories of the connected user' - operationId: getOrganizationBitbucketRepositoriesTemp - parameters: - - $ref: '../parameters/path/organizationId.yaml' - - in: query - name: gitTokenId - schema: - type: string - format: uuid - description: The git token id that must be used for the application - tags: - - Organization Account Git Repositories - responses: - '200': - description: 'Get bitbucket repositories' - content: - application/json: - schema: - $ref: '../schemas/GitRepositoryResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' diff --git a/src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml b/src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml deleted file mode 100644 index ed4d010f..00000000 --- a/src/resources/OrganizationAccountGitRepositoryGithubTemp.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - summary: 'Get github repositories of the connected user' - operationId: getOrganizationGithubRepositoriesTemp - parameters: - - $ref: '../parameters/path/organizationId.yaml' - - in: query - name: gitTokenId - schema: - type: string - format: uuid - description: The git token id that must be used for the application - tags: - - Organization Account Git Repositories - responses: - '200': - description: 'Get github repositories' - content: - application/json: - schema: - $ref: '../schemas/GitRepositoryResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' diff --git a/src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml b/src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml deleted file mode 100644 index 8b2cb06e..00000000 --- a/src/resources/OrganizationAccountGitRepositoryGitlabTemp.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - summary: 'Get gitlab repositories of the connected user' - operationId: getOrganizationGitlabRepositoriesTemp - parameters: - - $ref: '../parameters/path/organizationId.yaml' - - in: query - name: gitTokenId - schema: - type: string - format: uuid - description: The git token id that must be used for the application - tags: - - Organization Account Git Repositories - responses: - '200': - description: 'Get gitlab repositories' - content: - application/json: - schema: - $ref: '../schemas/GitRepositoryResponseList.yaml' - '401': - $ref: '../responses/NotAuthorized.yaml' From 0ab90a908c7812734e7ad490b71c5220dd332dca Mon Sep 17 00:00:00 2001 From: Pierre G Date: Tue, 14 Nov 2023 17:35:27 +0100 Subject: [PATCH 68/85] fix: set parent_id and scope required when listing variables (#502) --- src/resources/variable/Variable.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/resources/variable/Variable.yaml b/src/resources/variable/Variable.yaml index 15fcb90f..502f8ebf 100644 --- a/src/resources/variable/Variable.yaml +++ b/src/resources/variable/Variable.yaml @@ -5,12 +5,14 @@ get: parameters: - in: query name: parent_id + required: true schema: type: string format: uuid description: it filters the list by returning only the variables accessible by the selected parent_id. This field shall contain the id of a project, environment or service depending on the selected scope. Example, if scope = APPLICATION and parent_id=, the result will contain any variable accessible by the application. The result will contain also any variable declared at an higher scope. - in: query name: scope + required: true schema: $ref: '../../schemas/enums/APIVariableScope.yaml' description: the type of the parent_id (application, project, environment etc..). From 07fe9a1328e830ea525b9a1c5497350562e8b16c Mon Sep 17 00:00:00 2001 From: Pierre G Date: Tue, 14 Nov 2023 18:35:47 +0100 Subject: [PATCH 69/85] fix: add value and key in Variable response (#503) * fix: add value and key in Variable response * set value as required and nullable --- src/schemas/variable/VariableResponse.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/schemas/variable/VariableResponse.yaml b/src/schemas/variable/VariableResponse.yaml index 22634e93..77cf4769 100644 --- a/src/schemas/variable/VariableResponse.yaml +++ b/src/schemas/variable/VariableResponse.yaml @@ -3,7 +3,14 @@ allOf: - type: object required: - scope + - key + - value properties: + key: + type: string + value: + type: string + nullable: true overridden_variable: $ref: './VariableOverride.yaml' aliased_variable: From e2784caa65a9a535750c0e3bcf2da3db08af5940 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Wed, 15 Nov 2023 11:59:29 +0100 Subject: [PATCH 70/85] fix: add mount_path in VariableResponse (#504) * fix: add mount_path in VariableResponse * fix: remove extra comma in VariableResponse --- src/schemas/variable/VariableResponse.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/schemas/variable/VariableResponse.yaml b/src/schemas/variable/VariableResponse.yaml index 77cf4769..fd08faee 100644 --- a/src/schemas/variable/VariableResponse.yaml +++ b/src/schemas/variable/VariableResponse.yaml @@ -11,6 +11,9 @@ allOf: value: type: string nullable: true + mount_path: + type: string + nullable: true overridden_variable: $ref: './VariableOverride.yaml' aliased_variable: From 9fea0ced72af34c0f1cccbe28ee87df6874c5f3a Mon Sep 17 00:00:00 2001 From: Pierre G Date: Thu, 16 Nov 2023 14:43:36 +0100 Subject: [PATCH 71/85] feat: add import to variable (#505) --- src/openapi.yaml | 2 ++ src/resources/variable/VariablesImport.yaml | 40 +++++++++++++++++++++ src/schemas/enums/APIVariableScope.yaml | 1 + 3 files changed, 43 insertions(+) create mode 100644 src/resources/variable/VariablesImport.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 1505a6bf..c1da9037 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -818,6 +818,8 @@ paths: $ref: './resources/variable/VariableOverride.yaml' /variable/{variableId}: $ref: './resources/variable/VariableRef.yaml' + /variable/import: + $ref: './resources/variable/VariablesImport.yaml' components: parameters: $ref: './parameters/_index.yaml' diff --git a/src/resources/variable/VariablesImport.yaml b/src/resources/variable/VariablesImport.yaml new file mode 100644 index 00000000..ed3d4582 --- /dev/null +++ b/src/resources/variable/VariablesImport.yaml @@ -0,0 +1,40 @@ +post: + summary: 'Import variables' + description: Import environment variables in a defined scope, with a defined visibility. + operationId: importEnvironmentVariables + parameters: + - in: query + name: service_id + required: true + schema: + type: string + format: uuid + description: service id + - in: query + name: scope + required: true + schema: + $ref: '../../schemas/enums/APIVariableScope.yaml' + description: scope + tags: + - Variable Main Calls + 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/enums/APIVariableScope.yaml b/src/schemas/enums/APIVariableScope.yaml index 9ca4b77d..d625f2c7 100644 --- a/src/schemas/enums/APIVariableScope.yaml +++ b/src/schemas/enums/APIVariableScope.yaml @@ -6,3 +6,4 @@ enum: - PROJECT - CONTAINER - JOB + - HELM From 11ee7209910e232354e6a110377d789dce75bc95 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Thu, 16 Nov 2023 17:40:25 +0100 Subject: [PATCH 72/85] fix: change to service_type into variables import (#508) --- src/resources/variable/VariablesImport.yaml | 6 +++--- src/schemas/_index.yaml | 2 ++ src/schemas/enums/LinkedServiceType.yaml | 1 + src/schemas/enums/ServiceTypeForVariable.yaml | 7 +++++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/schemas/enums/ServiceTypeForVariable.yaml diff --git a/src/resources/variable/VariablesImport.yaml b/src/resources/variable/VariablesImport.yaml index ed3d4582..4dbb6f1f 100644 --- a/src/resources/variable/VariablesImport.yaml +++ b/src/resources/variable/VariablesImport.yaml @@ -11,11 +11,11 @@ post: format: uuid description: service id - in: query - name: scope + name: service_type required: true schema: - $ref: '../../schemas/enums/APIVariableScope.yaml' - description: scope + $ref: '../../schemas/enums/ServiceTypeForVariable.yaml' + description: service type tags: - Variable Main Calls requestBody: diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 7ffd8359..6990ab04 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -742,3 +742,5 @@ OrganizationJobAutoDeployRequest: $ref: ./OrganizationJobAutoDeployRequest.yaml RegistryMirroringModeEnum: $ref: ./enums/RegistryMirroringMode.yaml +ServiceTypeForVariableEnum: + $ref: ./enums/ServiceTypeForVariable.yaml diff --git a/src/schemas/enums/LinkedServiceType.yaml b/src/schemas/enums/LinkedServiceType.yaml index fb324c37..c77d12e8 100644 --- a/src/schemas/enums/LinkedServiceType.yaml +++ b/src/schemas/enums/LinkedServiceType.yaml @@ -5,3 +5,4 @@ enum: - CONTAINER - DATABASE - JOB + - HELM diff --git a/src/schemas/enums/ServiceTypeForVariable.yaml b/src/schemas/enums/ServiceTypeForVariable.yaml new file mode 100644 index 00000000..088a1889 --- /dev/null +++ b/src/schemas/enums/ServiceTypeForVariable.yaml @@ -0,0 +1,7 @@ +type: string +description: type of the service +enum: + - APPLICATION + - CONTAINER + - JOB + - HELM From 2891a446c285ebb69739b046fb81de97485d057c Mon Sep 17 00:00:00 2001 From: Pierre G Date: Fri, 17 Nov 2023 16:41:07 +0100 Subject: [PATCH 73/85] feat: add ports to helm request and helm response (#506) --- src/schemas/_index.yaml | 8 +++++++ src/schemas/enums/HelmPortProtocol.yaml | 5 +++++ src/schemas/helm/HelmPortRequest.yaml | 26 ++++++++++++++++++++++ src/schemas/helm/HelmPortResponse.yaml | 26 ++++++++++++++++++++++ src/schemas/helm/HelmPortResponseList.yaml | 3 +++ src/schemas/helm/HelmRequest.yaml | 1 + src/schemas/helm/HelmResponse.yaml | 4 +++- 7 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/schemas/enums/HelmPortProtocol.yaml create mode 100644 src/schemas/helm/HelmPortRequest.yaml create mode 100644 src/schemas/helm/HelmPortResponse.yaml create mode 100644 src/schemas/helm/HelmPortResponseList.yaml diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 6990ab04..b82745fa 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -454,12 +454,20 @@ HelmDeploymentRestrictionResponse: $ref: ./helm/HelmDeploymentRestrictionResponse.yaml HelmDeploymentRestrictionResponseList: $ref: ./helm/HelmDeploymentRestrictionResponseList.yaml +HelmPortRequest: + $ref: ./helm/HelmPortRequest.yaml +HelmPortResponse: + $ref: ./helm/HelmResponse.yaml +HelmPortResponseList: + $ref: ./helm/HelmResponseList.yaml #HelmScheduleEvent: # $ref: ./enums/HelmScheduleEvent.yaml HelmForceEvent: $ref: ./enums/HelmForceEvent.yaml #DeploymentHistoryHelmResponse: # $ref: ./helm/DeploymentHistoryHelmResponse.yaml +HelmPortProtocolEnum: + $ref: ./enums/HelmPortProtocol.yaml Key: $ref: ./Key.yaml KubernetesEnum: diff --git a/src/schemas/enums/HelmPortProtocol.yaml b/src/schemas/enums/HelmPortProtocol.yaml new file mode 100644 index 00000000..dbf6e329 --- /dev/null +++ b/src/schemas/enums/HelmPortProtocol.yaml @@ -0,0 +1,5 @@ +type: string +default: HTTP +enum: + - HTTP + - GRPC diff --git a/src/schemas/helm/HelmPortRequest.yaml b/src/schemas/helm/HelmPortRequest.yaml new file mode 100644 index 00000000..50564877 --- /dev/null +++ b/src/schemas/helm/HelmPortRequest.yaml @@ -0,0 +1,26 @@ +type: object +properties: + ports: + type: array + items: + type: object + required: + - service_name + - internal_port + properties: + name: + type: string + internal_port: + type: integer + example: 8080 + description: The listening port of your service. + external_port: + type: integer + example: 8080 + description: The exposed port for your service. This is optional. If not set a default port will be used. + service_name: + type: string + namespace: + type: string + protocol: + $ref: '../enums/HelmPortProtocol.yaml' diff --git a/src/schemas/helm/HelmPortResponse.yaml b/src/schemas/helm/HelmPortResponse.yaml new file mode 100644 index 00000000..37271306 --- /dev/null +++ b/src/schemas/helm/HelmPortResponse.yaml @@ -0,0 +1,26 @@ +type: object +required: + - id + - internal_port + - protocol + - service_name +properties: + id: + type: string + format: uuid + name: + type: string + internal_port: + type: integer + example: 8080 + description: The listening port of your service. + external_port: + type: integer + example: 8080 + description: The exposed port for your service. This is optional. If not set a default port will be used. + service_name: + type: string + namespace: + type: string + protocol: + $ref: '../enums/HelmPortProtocol.yaml' diff --git a/src/schemas/helm/HelmPortResponseList.yaml b/src/schemas/helm/HelmPortResponseList.yaml new file mode 100644 index 00000000..46781df8 --- /dev/null +++ b/src/schemas/helm/HelmPortResponseList.yaml @@ -0,0 +1,3 @@ +type: array +items: + $ref: './HelmPortResponse.yaml' diff --git a/src/schemas/helm/HelmRequest.yaml b/src/schemas/helm/HelmRequest.yaml index bbcc4659..35f8e43b 100644 --- a/src/schemas/helm/HelmRequest.yaml +++ b/src/schemas/helm/HelmRequest.yaml @@ -1,4 +1,5 @@ allOf: + - $ref: './HelmPortRequest.yaml' - type: object required: - name diff --git a/src/schemas/helm/HelmResponse.yaml b/src/schemas/helm/HelmResponse.yaml index 1fc89b8d..b64602af 100644 --- a/src/schemas/helm/HelmResponse.yaml +++ b/src/schemas/helm/HelmResponse.yaml @@ -27,7 +27,9 @@ allOf: 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. + Specify if the service will be automatically updated after receiving a new image tag or a new commit according to the source type. + ports: + $ref: './HelmPortResponseList.yaml' source: nullable: false oneOf: From 0ceee90fd363f32c05c50ab29494cf98d62f695f Mon Sep 17 00:00:00 2001 From: Melvin Zottola <37779145+mzottola@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:55:13 +0100 Subject: [PATCH 74/85] chore: Use oneOf for job type (#509) * chore: Use oneOf for job type * chore: Refacto --- src/schemas/_index.yaml | 6 + src/schemas/job/BaseJobResponse.yaml | 88 +++++++++++++ src/schemas/job/CronJobResponse.yaml | 35 +++++ src/schemas/job/JobResponse.yaml | 153 ++-------------------- src/schemas/job/LifecycleJobResponse.yaml | 44 +++++++ 5 files changed, 181 insertions(+), 145 deletions(-) create mode 100644 src/schemas/job/BaseJobResponse.yaml create mode 100644 src/schemas/job/CronJobResponse.yaml create mode 100644 src/schemas/job/LifecycleJobResponse.yaml diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index b82745fa..be32e91e 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -752,3 +752,9 @@ RegistryMirroringModeEnum: $ref: ./enums/RegistryMirroringMode.yaml ServiceTypeForVariableEnum: $ref: ./enums/ServiceTypeForVariable.yaml +LifecycleJobResponse: + $ref: ./job/LifecycleJobResponse.yaml +CronJobResponse: + $ref: ./job/CronJobResponse.yaml +BaseJobResponse: + $ref: ./job/BaseJobResponse.yaml diff --git a/src/schemas/job/BaseJobResponse.yaml b/src/schemas/job/BaseJobResponse.yaml new file mode 100644 index 00000000..c3177763 --- /dev/null +++ b/src/schemas/job/BaseJobResponse.yaml @@ -0,0 +1,88 @@ +allOf: + - $ref: '../BaseResponse.yaml' + - type: object + required: + - environment + - name + - tag + - auto_preview + - cpu + - memory + - min_running_instances + - max_running_instances + - maximum_cpu + - maximum_memory + - healthchecks + - source + properties: + environment: + $ref: '../ReferenceObject.yaml' + maximum_cpu: + type: integer + description: Maximum cpu that can be allocated to the job based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu + example: 16000 + maximum_memory: + type: integer + description: Maximum memory that can be allocated to the job based on organization cluster configuration. unit is MB. 1024 MB = 1GB + example: 16384 + name: + type: string + description: name is case insensitive + description: + type: string + cpu: + type: integer + description: unit is millicores (m). 1000m = 1 cpu + example: 1250 + memory: + type: integer + description: unit is MB. 1024 MB = 1GB + example: 1024 + max_nb_restart: + type: integer + minimum: 0 + description: | + Maximum number of restart allowed before the job is considered as failed + 0 means that no restart/crash of the job is allowed + max_duration_seconds: + type: integer + minimum: 0 + description: | + Maximum number of seconds allowed for the job to run before killing it and mark it as failed + auto_preview: + type: boolean + description: | + Indicates if the 'environment preview option' is enabled for this container. + 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. + port: + type: integer + nullable: true + minimum: 1 + description: Port where to run readiness and liveliness probes checks. The port will not be exposed externally + default: null + source: + nullable: false + oneOf: + - type: object + properties: + image: + $ref: '../ContainerSource.yaml' + - type: object + properties: + docker: + type: object + properties: + dockerfile_path: + type: string + description: The path of the associated Dockerfile. Only if you are using build_mode = DOCKER + nullable: true + git_repository: + $ref: '../ApplicationGitRepositoryResponse.yaml' + healthchecks: + $ref: '../Healthcheck.yaml' + auto_deploy: + type: boolean + description: | + Specify if the job will be automatically updated after receiving a new image tag or a new commit according to the source type. + The new image tag shall be communicated via the "Auto Deploy job" endpoint https://api-doc.qovery.com/#tag/Jobs/operation/autoDeployJobEnvironments diff --git a/src/schemas/job/CronJobResponse.yaml b/src/schemas/job/CronJobResponse.yaml new file mode 100644 index 00000000..453f878d --- /dev/null +++ b/src/schemas/job/CronJobResponse.yaml @@ -0,0 +1,35 @@ +allOf: + - $ref: './BaseJobResponse.yaml' + - type: object + required: + - schedule + - job_type + properties: + job_type: + type: string + enum: + - CRON + schedule: + type: object + properties: + cronjob: + type: object + required: + - scheduled_at + properties: + arguments: + type: array + items: + type: string + entrypoint: + type: string + description: optional entrypoint when launching container + scheduled_at: + type: string + format: cron + description: | + Can only be set if the event is CRON. + Represent the cron format for the job schedule without seconds. + For example: `* * * * *` represent the cron to launch the job every minute. + See https://crontab.guru/ to WISIWIG interface. + Timezone is UT diff --git a/src/schemas/job/JobResponse.yaml b/src/schemas/job/JobResponse.yaml index 8f76126a..3609b784 100644 --- a/src/schemas/job/JobResponse.yaml +++ b/src/schemas/job/JobResponse.yaml @@ -1,145 +1,8 @@ -allOf: - - $ref: '../BaseResponse.yaml' - - type: object - required: - - environment - - name - - tag - - auto_preview - - cpu - - memory - - min_running_instances - - max_running_instances - - maximum_cpu - - maximum_memory - - healthchecks - - source - properties: - environment: - $ref: '../ReferenceObject.yaml' - maximum_cpu: - type: integer - description: Maximum cpu that can be allocated to the job based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu - example: 16000 - maximum_memory: - type: integer - description: Maximum memory that can be allocated to the job based on organization cluster configuration. unit is MB. 1024 MB = 1GB - example: 16384 - name: - type: string - description: name is case insensitive - description: - type: string - cpu: - type: integer - description: unit is millicores (m). 1000m = 1 cpu - example: 1250 - memory: - type: integer - description: unit is MB. 1024 MB = 1GB - example: 1024 - max_nb_restart: - type: integer - minimum: 0 - description: | - Maximum number of restart allowed before the job is considered as failed - 0 means that no restart/crash of the job is allowed - max_duration_seconds: - type: integer - minimum: 0 - description: | - Maximum number of seconds allowed for the job to run before killing it and mark it as failed - auto_preview: - type: boolean - description: | - Indicates if the 'environment preview option' is enabled for this container. - 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. - port: - type: integer - nullable: true - minimum: 1 - description: Port where to run readiness and liveliness probes checks. The port will not be exposed externally - default: null - source: - nullable: false - oneOf: - - type: object - properties: - image: - $ref: '../ContainerSource.yaml' - - type: object - properties: - docker: - type: object - properties: - dockerfile_path: - type: string - description: The path of the associated Dockerfile. Only if you are using build_mode = DOCKER - nullable: true - git_repository: - $ref: '../ApplicationGitRepositoryResponse.yaml' - healthchecks: - $ref: '../Healthcheck.yaml' - schedule: - type: object - description: | - If you want to define a Cron job, only the `cronjob` property must be filled - A Lifecycle job should contain at least one property `on_XXX` among the 3 properties: `on_start`, `on_stop`, `on_delete` - properties: - on_start: - type: object - properties: - arguments: - type: array - items: - type: string - entrypoint: - type: string - description: optional entrypoint when launching container - on_stop: - type: object - properties: - arguments: - type: array - items: - type: string - entrypoint: - type: string - description: optional entrypoint when launching container - on_delete: - type: object - properties: - arguments: - type: array - items: - type: string - entrypoint: - type: string - description: optional entrypoint when launching container - cronjob: - type: object - required: - - scheduled_at - properties: - arguments: - type: array - items: - type: string - entrypoint: - type: string - description: optional entrypoint when launching container - scheduled_at: - type: string - format: cron - description: | - Can only be set if the event is CRON. - Represent the cron format for the job schedule without seconds. - For example: `* * * * *` represent the cron to launch the job every minute. - See https://crontab.guru/ to WISIWIG interface. - Timezone is UT - auto_deploy: - type: boolean - description: | - Specify if the job will be automatically updated after receiving a new image tag or a new commit according to the source type. - The new image tag shall be communicated via the "Auto Deploy job" endpoint https://api-doc.qovery.com/#tag/Jobs/operation/autoDeployJobEnvironments +oneOf: + - $ref: './LifecycleJobResponse.yaml' + - $ref: './CronJobResponse.yaml' +discriminator: + propertyName: job_type + mapping: + LIFECYCLE: '#/components/schemas/LifecycleJobResponse' + CRON: '#/components/schemas/CronJobResponse' diff --git a/src/schemas/job/LifecycleJobResponse.yaml b/src/schemas/job/LifecycleJobResponse.yaml new file mode 100644 index 00000000..18656ba8 --- /dev/null +++ b/src/schemas/job/LifecycleJobResponse.yaml @@ -0,0 +1,44 @@ +allOf: + - $ref: './BaseJobResponse.yaml' + - type: object + required: + - schedule + - job_type + properties: + job_type: + type: string + enum: + - LIFECYCLE + schedule: + type: object + properties: + on_start: + type: object + properties: + arguments: + type: array + items: + type: string + entrypoint: + type: string + description: optional entrypoint when launching container + on_stop: + type: object + properties: + arguments: + type: array + items: + type: string + entrypoint: + type: string + description: optional entrypoint when launching container + on_delete: + type: object + properties: + arguments: + type: array + items: + type: string + entrypoint: + type: string + description: optional entrypoint when launching container From cbfa061ee9ce975b1393585edd10e6bab6019a3d Mon Sep 17 00:00:00 2001 From: Pierre G Date: Tue, 21 Nov 2023 12:09:26 +0100 Subject: [PATCH 75/85] feat: remove the double git sub-object in the helm request (#510) --- src/schemas/HelmGitRepositoryRequest.yaml | 27 +++++++++++++++++++++++ src/schemas/_index.yaml | 2 ++ src/schemas/helm/HelmRequest.yaml | 10 +++------ 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 src/schemas/HelmGitRepositoryRequest.yaml diff --git a/src/schemas/HelmGitRepositoryRequest.yaml b/src/schemas/HelmGitRepositoryRequest.yaml new file mode 100644 index 00000000..c4e25b59 --- /dev/null +++ b/src/schemas/HelmGitRepositoryRequest.yaml @@ -0,0 +1,27 @@ +type: object +nullable: true +required: + - provider + - owner + - name + - url +properties: + url: + type: string + description: application git repository URL + example: https://github.com/Qovery/simple-node-app + branch: + type: string + description: | + Name of the branch to use. This is optional + If not specified, then the branch used is the `main` or `master` one + example: feat/text_xxx + root_path: + type: string + default: / + description: indicates the root path of the application. + git_token_id: + type: string + format: uuid + description: The git token id on Qovery side + nullable: true diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index be32e91e..d909c501 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -758,3 +758,5 @@ CronJobResponse: $ref: ./job/CronJobResponse.yaml BaseJobResponse: $ref: ./job/BaseJobResponse.yaml +HelmGitRepositoryRequest: + $ref: ./HelmGitRepositoryRequest.yaml diff --git a/src/schemas/helm/HelmRequest.yaml b/src/schemas/helm/HelmRequest.yaml index 35f8e43b..14c17646 100644 --- a/src/schemas/helm/HelmRequest.yaml +++ b/src/schemas/helm/HelmRequest.yaml @@ -33,13 +33,9 @@ allOf: source: type: object properties: - git: - type: object - nullable: true - properties: - git_repository: - $ref: '../ApplicationGitRepositoryRequest.yaml' - repository: + git_repository: + $ref: '../HelmGitRepositoryRequest.yaml' + helm_repository: type: object nullable: true properties: From da9a099aacba94d18fe8a38a41edf4d9467aa03b Mon Sep 17 00:00:00 2001 From: Melvin Zottola <37779145+mzottola@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:31:56 +0100 Subject: [PATCH 76/85] feat: Allow environment status origin & trigger nullable (#512) --- src/schemas/EnvironmentStatus.yaml | 3 ++- src/schemas/_index.yaml | 2 ++ src/schemas/enums/EnvironmentStatusEventOrigin.yaml | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/schemas/enums/EnvironmentStatusEventOrigin.yaml diff --git a/src/schemas/EnvironmentStatus.yaml b/src/schemas/EnvironmentStatus.yaml index 82d6fbd3..d8cc53af 100644 --- a/src/schemas/EnvironmentStatus.yaml +++ b/src/schemas/EnvironmentStatus.yaml @@ -22,6 +22,7 @@ properties: type: integer nullable: true origin: - $ref: './enums/OrganizationEventOrigin.yaml' + $ref: './enums/EnvironmentStatusEventOrigin.yaml' triggered_by: + nullable: true type: string diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index d909c501..18bbeaf4 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -324,6 +324,8 @@ EnvironmentStatsResponseList: $ref: ./EnvironmentStatsResponseList.yaml EnvironmentStatuses: $ref: ./EnvironmentStatuses.yaml +EnvironmentStatusEventOriginEnum: + $ref: ./enums/EnvironmentStatusEventOrigin.yaml EnvironmentStatusesWithStages: $ref: ./EnvironmentStatusesWithStages.yaml EnvironmentStatusList: diff --git a/src/schemas/enums/EnvironmentStatusEventOrigin.yaml b/src/schemas/enums/EnvironmentStatusEventOrigin.yaml new file mode 100644 index 00000000..8dbbd727 --- /dev/null +++ b/src/schemas/enums/EnvironmentStatusEventOrigin.yaml @@ -0,0 +1,11 @@ +type: string +nullable: true +description: Origin of the organization event +enum: + - API + - CLI + - CONSOLE + - GIT + - QOVERY_INTERNAL + - TERRAFORM_PROVIDER +example: API From 070938e2185d3dd96f21e46cfd01edc2bf4d05f7 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Tue, 21 Nov 2023 17:50:57 +0100 Subject: [PATCH 77/85] feat(database): turn environment as required (#513) --- src/schemas/DatabaseResponse.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schemas/DatabaseResponse.yaml b/src/schemas/DatabaseResponse.yaml index 015d10cd..7f0d5360 100644 --- a/src/schemas/DatabaseResponse.yaml +++ b/src/schemas/DatabaseResponse.yaml @@ -2,6 +2,8 @@ allOf: - $ref: './BaseResponse.yaml' - $ref: './DatabaseRequest.yaml' - type: object + required: + - environment properties: environment: $ref: './ReferenceObject.yaml' From a63e09eab5ed553311b33080c064f554e65dc467 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Wed, 22 Nov 2023 10:09:08 +0100 Subject: [PATCH 78/85] =?UTF-8?q?feat:=20remove=20the=20double=20git=20sub?= =?UTF-8?q?-object=20in=20the=20helm=20request=20for=20values=E2=80=A6=20(?= =?UTF-8?q?#511)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/schemas/HelmGitRepositoryRequest.yaml | 1 - .../HelmValuesGitRepositoryRequest.yaml | 26 ++++++++++ src/schemas/_index.yaml | 2 + src/schemas/helm/HelmRequest.yaml | 51 ++++++++----------- 4 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 src/schemas/HelmValuesGitRepositoryRequest.yaml diff --git a/src/schemas/HelmGitRepositoryRequest.yaml b/src/schemas/HelmGitRepositoryRequest.yaml index c4e25b59..2b5b2a26 100644 --- a/src/schemas/HelmGitRepositoryRequest.yaml +++ b/src/schemas/HelmGitRepositoryRequest.yaml @@ -1,5 +1,4 @@ type: object -nullable: true required: - provider - owner diff --git a/src/schemas/HelmValuesGitRepositoryRequest.yaml b/src/schemas/HelmValuesGitRepositoryRequest.yaml new file mode 100644 index 00000000..025362a2 --- /dev/null +++ b/src/schemas/HelmValuesGitRepositoryRequest.yaml @@ -0,0 +1,26 @@ +type: object +required: + - url + - branch + - paths +properties: + url: + type: string + description: application git repository URL + example: https://github.com/Qovery/simple-node-app + branch: + type: string + description: | + Name of the branch to use. This is optional + If not specified, then the branch used is the `main` or `master` one + example: feat/text_xxx + paths: + type: array + description: List of path inside your git repository to locate values file. Must start by a / + items: + type: string + git_token_id: + type: string + format: uuid + description: The git token id on Qovery side + nullable: true diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 18bbeaf4..761d1460 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -762,3 +762,5 @@ BaseJobResponse: $ref: ./job/BaseJobResponse.yaml HelmGitRepositoryRequest: $ref: ./HelmGitRepositoryRequest.yaml +HelmValuesGitRepositoryRequest: + $ref: ./HelmValuesGitRepositoryRequest.yaml diff --git a/src/schemas/helm/HelmRequest.yaml b/src/schemas/helm/HelmRequest.yaml index 14c17646..a2c7d207 100644 --- a/src/schemas/helm/HelmRequest.yaml +++ b/src/schemas/helm/HelmRequest.yaml @@ -31,25 +31,27 @@ allOf: 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_repository: - $ref: '../HelmGitRepositoryRequest.yaml' - helm_repository: - type: object - nullable: true + oneOf: + - type: object 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 + git_repository: + $ref: '../HelmGitRepositoryRequest.yaml' + - type: object + properties: + helm_repository: + type: object + 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 @@ -103,14 +105,5 @@ allOf: 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 + git_repository: + $ref: '../HelmValuesGitRepositoryRequest.yaml' From b309743677bb6cbff19656a9e09b58b0d74ef917 Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Wed, 22 Nov 2023 10:11:52 +0100 Subject: [PATCH 79/85] refactor(services): factorize clone requests (#514) * refactor: rename CloneRequest -> CloneEnvironmentRequest * refactor: factory clone service requests --- src/resources/ApplicationClone.yaml | 2 +- src/resources/ContainerClone.yaml | 2 +- src/resources/DatabaseClone.yaml | 2 +- src/resources/EnvironmentClone.yaml | 2 +- src/resources/JobClone.yaml | 2 +- src/schemas/CloneContainerRequest.yaml | 10 ---------- src/schemas/CloneDatabaseRequest.yaml | 10 ---------- ...neRequest.yaml => CloneEnvironmentRequest.yaml} | 0 src/schemas/CloneJobRequest.yaml | 10 ---------- ...cationRequest.yaml => CloneServiceRequest.yaml} | 0 src/schemas/_index.yaml | 14 ++++---------- 11 files changed, 9 insertions(+), 45 deletions(-) delete mode 100644 src/schemas/CloneContainerRequest.yaml delete mode 100644 src/schemas/CloneDatabaseRequest.yaml rename src/schemas/{CloneRequest.yaml => CloneEnvironmentRequest.yaml} (100%) delete mode 100644 src/schemas/CloneJobRequest.yaml rename src/schemas/{CloneApplicationRequest.yaml => CloneServiceRequest.yaml} (100%) diff --git a/src/resources/ApplicationClone.yaml b/src/resources/ApplicationClone.yaml index 733f6068..25df27e8 100644 --- a/src/resources/ApplicationClone.yaml +++ b/src/resources/ApplicationClone.yaml @@ -10,7 +10,7 @@ post: content: application/json: schema: - $ref: '../schemas/CloneApplicationRequest.yaml' + $ref: '../schemas/CloneServiceRequest.yaml' responses: '202': description: 'Application clone has been requested' diff --git a/src/resources/ContainerClone.yaml b/src/resources/ContainerClone.yaml index 8fd1526e..cda79409 100644 --- a/src/resources/ContainerClone.yaml +++ b/src/resources/ContainerClone.yaml @@ -10,7 +10,7 @@ post: content: application/json: schema: - $ref: '../schemas/CloneContainerRequest.yaml' + $ref: '../schemas/CloneServiceRequest.yaml' responses: '202': description: 'Container clone has been requested' diff --git a/src/resources/DatabaseClone.yaml b/src/resources/DatabaseClone.yaml index 7fd0dca6..8a59b772 100644 --- a/src/resources/DatabaseClone.yaml +++ b/src/resources/DatabaseClone.yaml @@ -10,7 +10,7 @@ post: content: application/json: schema: - $ref: '../schemas/CloneDatabaseRequest.yaml' + $ref: '../schemas/CloneServiceRequest.yaml' responses: '202': description: 'Database clone has been requested' diff --git a/src/resources/EnvironmentClone.yaml b/src/resources/EnvironmentClone.yaml index 2c56d46c..bab34ba1 100644 --- a/src/resources/EnvironmentClone.yaml +++ b/src/resources/EnvironmentClone.yaml @@ -10,7 +10,7 @@ post: content: application/json: schema: - $ref: '../schemas/CloneRequest.yaml' + $ref: '../schemas/CloneEnvironmentRequest.yaml' responses: '202': description: 'Environment clone has been requested' diff --git a/src/resources/JobClone.yaml b/src/resources/JobClone.yaml index d52cb00a..bb14a6d3 100644 --- a/src/resources/JobClone.yaml +++ b/src/resources/JobClone.yaml @@ -10,7 +10,7 @@ post: content: application/json: schema: - $ref: '../schemas/CloneJobRequest.yaml' + $ref: '../schemas/CloneServiceRequest.yaml' responses: '202': description: 'Job clone has been requested' diff --git a/src/schemas/CloneContainerRequest.yaml b/src/schemas/CloneContainerRequest.yaml deleted file mode 100644 index d21dafee..00000000 --- a/src/schemas/CloneContainerRequest.yaml +++ /dev/null @@ -1,10 +0,0 @@ -type: object -required: - - name - - environment_id -properties: - name: - type: string - environment_id: - type: string - format: uuid diff --git a/src/schemas/CloneDatabaseRequest.yaml b/src/schemas/CloneDatabaseRequest.yaml deleted file mode 100644 index d21dafee..00000000 --- a/src/schemas/CloneDatabaseRequest.yaml +++ /dev/null @@ -1,10 +0,0 @@ -type: object -required: - - name - - environment_id -properties: - name: - type: string - environment_id: - type: string - format: uuid diff --git a/src/schemas/CloneRequest.yaml b/src/schemas/CloneEnvironmentRequest.yaml similarity index 100% rename from src/schemas/CloneRequest.yaml rename to src/schemas/CloneEnvironmentRequest.yaml diff --git a/src/schemas/CloneJobRequest.yaml b/src/schemas/CloneJobRequest.yaml deleted file mode 100644 index d21dafee..00000000 --- a/src/schemas/CloneJobRequest.yaml +++ /dev/null @@ -1,10 +0,0 @@ -type: object -required: - - name - - environment_id -properties: - name: - type: string - environment_id: - type: string - format: uuid diff --git a/src/schemas/CloneApplicationRequest.yaml b/src/schemas/CloneServiceRequest.yaml similarity index 100% rename from src/schemas/CloneApplicationRequest.yaml rename to src/schemas/CloneServiceRequest.yaml diff --git a/src/schemas/_index.yaml b/src/schemas/_index.yaml index 761d1460..b4581e08 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -80,16 +80,10 @@ BuildModeEnum: $ref: ./enums/BuildMode.yaml BuildPackLanguageEnum: $ref: ./enums/BuildPackLanguage.yaml -CloneRequest: - $ref: ./CloneRequest.yaml -CloneApplicationRequest: - $ref: ./CloneApplicationRequest.yaml -CloneContainerRequest: - $ref: ./CloneContainerRequest.yaml -CloneDatabaseRequest: - $ref: ./CloneDatabaseRequest.yaml -CloneJobRequest: - $ref: ./CloneJobRequest.yaml +CloneEnvironmentRequest: + $ref: ./CloneEnvironmentRequest.yaml +CloneServiceRequest: + $ref: ./CloneServiceRequest.yaml CloudProvider: $ref: ./CloudProviderResponse.yaml CloudProviderEnum: From af9d4413a7d71828fdd2825797ac41ba3f66f5a7 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Thu, 23 Nov 2023 09:44:06 +0100 Subject: [PATCH 80/85] feat: add helm clone (#515) --- src/openapi.yaml | 6 ++++-- src/resources/helm/HelmClone.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/resources/helm/HelmClone.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index c1da9037..16562a00 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -665,7 +665,7 @@ paths: /container/{containerId}/link: $ref: './resources/ContainerLink.yaml' /container/{containerId}/clone: - $ref: './resources/ContainerClone.yaml' + $ref: './resources/ContainerClone.yaml' /environment/{environmentId}/database: $ref: './resources/EnvironmentDatabase.yaml' /environment/{environmentId}/database/status: @@ -760,6 +760,8 @@ paths: $ref: './resources/helm/HelmDeploymentRestrictionRef.yaml' /helm/{helmId}/defaultValues: $ref: './resources/helm/HelmDefaultValues.yaml' + /helm/{helmId}/clone: + $ref: './resources/helm/HelmClone.yaml' /environment/{environmentId}/job: $ref: './resources/job/EnvironmentJob.yaml' /environment/{environmentId}/job/status: @@ -807,7 +809,7 @@ paths: /job/{jobId}/commit: $ref: './resources/JobCommit.yaml' /job/{jobId}/clone: - $ref: './resources/JobClone.yaml' + $ref: './resources/JobClone.yaml' /service/{serviceId}/deploymentStage: $ref: './resources/deploymentStage/ServiceDeploymentStage.yaml' /variable: diff --git a/src/resources/helm/HelmClone.yaml b/src/resources/helm/HelmClone.yaml new file mode 100644 index 00000000..c1b543da --- /dev/null +++ b/src/resources/helm/HelmClone.yaml @@ -0,0 +1,28 @@ +post: + summary: 'Clone helm' + description: This will create a new helm with the same configuration on the targeted environment Id. + operationId: cloneHelm + parameters: + - $ref: '../../parameters/path/helmId.yaml' + tags: + - Containers + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/CloneServiceRequest.yaml' + responses: + '202': + description: 'Helm clone has been requested' + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmResponse.yaml' + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' + '409': + description: 'Operation is in progress' From 244bc58dd6ad694287191c13e5d1a24628354659 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Fri, 24 Nov 2023 12:13:31 +0100 Subject: [PATCH 81/85] feat: add GCP_ARTIFACT_REGISTRY into ContainerRegistryKind (#516) --- src/schemas/enums/ContainerRegistryKind.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schemas/enums/ContainerRegistryKind.yaml b/src/schemas/enums/ContainerRegistryKind.yaml index 5676433a..c1d1308c 100644 --- a/src/schemas/enums/ContainerRegistryKind.yaml +++ b/src/schemas/enums/ContainerRegistryKind.yaml @@ -8,5 +8,6 @@ enum: - PUBLIC_ECR - DOCR - GENERIC_CR + - GCP_ARTIFACT_REGISTRY description: The type of your container registry From 8c8c91492894fefb84397b108ae08d1da46646a5 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Fri, 24 Nov 2023 16:46:01 +0100 Subject: [PATCH 82/85] fix: add helmRepositoryId in index.yaml (#517) --- src/parameters/_index.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/parameters/_index.yaml b/src/parameters/_index.yaml index 4421f6c9..5db0c089 100644 --- a/src/parameters/_index.yaml +++ b/src/parameters/_index.yaml @@ -82,3 +82,5 @@ variableId: $ref: ./path/variableId.yaml helmId: $ref: ./path/helmId.yaml +helmRepositoryId: + $ref: ./path/helmRepositoryId.yaml From ccb61b10a94adf5dbe5f5396f556963f029f9c18 Mon Sep 17 00:00:00 2001 From: Melvin Zottola <37779145+mzottola@users.noreply.github.com> Date: Mon, 27 Nov 2023 09:58:23 +0100 Subject: [PATCH 83/85] feat: Set default cluster disk size to 40Gb (#518) --- src/schemas/Cluster.yaml | 4 ++-- src/schemas/ClusterRequest.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schemas/Cluster.yaml b/src/schemas/Cluster.yaml index 2d664ca6..8fd7acad 100644 --- a/src/schemas/Cluster.yaml +++ b/src/schemas/Cluster.yaml @@ -28,5 +28,5 @@ properties: disk_size: type: integer example: 50 - default: 20 - description: Unit is in GB. The disk size to be used for the node configuration + default: 40 + description: Unit is in GB. The disk size to be used for the node configuration diff --git a/src/schemas/ClusterRequest.yaml b/src/schemas/ClusterRequest.yaml index 44c75dba..e06388dc 100644 --- a/src/schemas/ClusterRequest.yaml +++ b/src/schemas/ClusterRequest.yaml @@ -22,7 +22,7 @@ properties: disk_size: type: integer example: 50 - default: 20 + default: 40 description: Unit is in GB. The disk size to be used for the node configuration instance_type: type: string From 7488500e5af8103b8f94a81248ce2257c5396861 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Mon, 27 Nov 2023 11:34:38 +0100 Subject: [PATCH 84/85] fix: add required fieds in AvailableHelmRepositoryResponse and AvailableContainerRegistryResponse (#519) --- src/schemas/AvailableContainerRegistryResponse.yaml | 4 ++++ src/schemas/AvailableHelmRepositoryResponse.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/schemas/AvailableContainerRegistryResponse.yaml b/src/schemas/AvailableContainerRegistryResponse.yaml index 9cc832e9..41fd5246 100644 --- a/src/schemas/AvailableContainerRegistryResponse.yaml +++ b/src/schemas/AvailableContainerRegistryResponse.yaml @@ -1,4 +1,8 @@ type: object +required: + - kind + - required_config + - is_mandatory properties: kind: $ref: ./enums/ContainerRegistryKind.yaml diff --git a/src/schemas/AvailableHelmRepositoryResponse.yaml b/src/schemas/AvailableHelmRepositoryResponse.yaml index 9ab7b864..3443ceff 100644 --- a/src/schemas/AvailableHelmRepositoryResponse.yaml +++ b/src/schemas/AvailableHelmRepositoryResponse.yaml @@ -1,4 +1,8 @@ type: object +required: + - kind + - required_config + - is_mandatory properties: kind: $ref: ./enums/HelmRepositoryKind.yaml From b950b853651ceef754bbcd0faf56d930dab7cf22 Mon Sep 17 00:00:00 2001 From: Pierre G Date: Mon, 27 Nov 2023 18:02:07 +0100 Subject: [PATCH 85/85] feat: change api to get helm default values (#520) --- src/openapi.yaml | 4 +-- .../helm/EnvironmentHelmDefaultValues.yaml | 25 +++++++++++++++++ src/resources/helm/HelmDefaultValues.yaml | 20 -------------- src/schemas/_index.yaml | 2 ++ .../helm/HelmDefaultValuesRequest.yaml | 27 +++++++++++++++++++ 5 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 src/resources/helm/EnvironmentHelmDefaultValues.yaml delete mode 100644 src/resources/helm/HelmDefaultValues.yaml create mode 100644 src/schemas/helm/HelmDefaultValuesRequest.yaml diff --git a/src/openapi.yaml b/src/openapi.yaml index 16562a00..8e9bd69e 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -736,6 +736,8 @@ paths: $ref: './resources/UserSignUp.yaml' /environment/{environmentId}/helm: $ref: './resources/helm/EnvironmentHelm.yaml' + /environment/{environmentId}/helmDefaultValues: + $ref: './resources/helm/EnvironmentHelmDefaultValues.yaml' /environment/{environmentId}/helm/status: $ref: './resources/helm/EnvironmentHelmStatus.yaml' /helm/{helmId}: @@ -758,8 +760,6 @@ paths: $ref: './resources/helm/HelmDeploymentRestriction.yaml' /helm/{helmId}/deploymentRestriction/{deploymentRestrictionId}: $ref: './resources/helm/HelmDeploymentRestrictionRef.yaml' - /helm/{helmId}/defaultValues: - $ref: './resources/helm/HelmDefaultValues.yaml' /helm/{helmId}/clone: $ref: './resources/helm/HelmClone.yaml' /environment/{environmentId}/job: diff --git a/src/resources/helm/EnvironmentHelmDefaultValues.yaml b/src/resources/helm/EnvironmentHelmDefaultValues.yaml new file mode 100644 index 00000000..feb69ce0 --- /dev/null +++ b/src/resources/helm/EnvironmentHelmDefaultValues.yaml @@ -0,0 +1,25 @@ +post: + summary: 'Get helm default values' + operationId: createHelmDefaultValues + parameters: + - $ref: '../../parameters/path/environmentId.yaml' + tags: + - Helms + requestBody: + content: + application/json: + schema: + $ref: '../../schemas/helm/HelmDefaultValuesRequest.yaml' + responses: + '201': + description: 'helm values' + content: + text/plain: + schema: + type: string + '401': + $ref: '../../responses/NotAuthorized.yaml' + '403': + $ref: '../../responses/Forbidden.yaml' + '404': + $ref: '../../responses/NotFound.yaml' diff --git a/src/resources/helm/HelmDefaultValues.yaml b/src/resources/helm/HelmDefaultValues.yaml deleted file mode 100644 index 472ed86d..00000000 --- a/src/resources/helm/HelmDefaultValues.yaml +++ /dev/null @@ -1,20 +0,0 @@ -get: - summary: 'Display the contents of the values.yaml file' - operationId: getDefaultValues - parameters: - - $ref: '../../parameters/path/helmId.yaml' - tags: - - Helm Main Calls - responses: - '200': - description: 'Display the contents of the values.yaml file' - content: - text/plain: - schema: - type: string - '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 b4581e08..4409ab32 100644 --- a/src/schemas/_index.yaml +++ b/src/schemas/_index.yaml @@ -464,6 +464,8 @@ HelmForceEvent: # $ref: ./helm/DeploymentHistoryHelmResponse.yaml HelmPortProtocolEnum: $ref: ./enums/HelmPortProtocol.yaml +HelmDefaultValuesRequest: + $ref: ./helm/HelmDefaultValuesRequest.yaml Key: $ref: ./Key.yaml KubernetesEnum: diff --git a/src/schemas/helm/HelmDefaultValuesRequest.yaml b/src/schemas/helm/HelmDefaultValuesRequest.yaml new file mode 100644 index 00000000..422246ab --- /dev/null +++ b/src/schemas/helm/HelmDefaultValuesRequest.yaml @@ -0,0 +1,27 @@ +allOf: + - type: object + required: + - source + properties: + source: + oneOf: + - type: object + properties: + git_repository: + $ref: '../HelmGitRepositoryRequest.yaml' + - type: object + properties: + helm_repository: + type: object + 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