From dee80f391d429c6da536174074dc9a998d0abc75 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 7 Nov 2023 16:29:39 +0100 Subject: [PATCH] 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: