Humanitec Registry API

Humanitec can be used to manage registry credentials. The Registry object represents how to match credentials to a particular registry. Humanitec supports all Docker compatible registries as well as the custom authentication formats used by AWS Elastic Container Registry and Google Container Registry. It also supports the injection of a specific secret to be copied from an existing namespace in the cluster.

OpenAPI Specification

humanitec-registry-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Humanitec AccountType Registry API
  version: 0.28.24
  description: '# Introduction

    The *Humanitec API* allows you to automate and integrate Humanitec into your developer and operational workflows.

    The API is a REST based API. It is based around a set of concepts:


    * Core

    * External Resources

    * Sets and Deltas


    ## Authentication


    Almost all requests made to the Humanitec API require Authentication. See our [Developer Docs on API Authentication](https://developer.humanitec.com/platform-orchestrator/reference/api-references/#authentication) for instructions.


    ## Content Types

    The Humanitec API, unless explicitly specified, only accepts content types of `application/json` and will always return valid `application/json` or an empty response.


    ## Response Codes

    ### Success

    Any response code in the `2xx` range should be regarded as success.


    | **Code** | **Meaning**                         |

    |----------|-------------------------------------|

    | `200`    | Success                             |

    | `201`    | Success, a new resource was created |

    | `204`    | Success, but no content in response |


    _Note: We plan to simplify the interface by replacing 201 with 200 status codes._


    ### Failure

    Any response code in the `4xx` range should be regarded as an error that can be rectified by the client. `5xx` error codes indicate errors that cannot be corrected by the client.


    | **Code** | **Meaning**                                                                                                           |

    |----------|-----------------------------------------------------------------------------------------------------------------------|

    | `400`    | General error. (Body will contain details)                                                                            |

    | `401`    | Attempt to access protected resource without `Authorization` Header.                                                  |

    | `403`    | The `Bearer` or `JWT` does not grant access to the requested resource.                                                |

    | `404`    | Resource not found.                                                                                                   |

    | `405`    | Method not allowed                                                                                                    |

    | `409`    | Conflict. Usually indicated a resource with that ID already exists.                                                   |

    | `422`    | Unprocessable Entity. The body was not valid JSON, was empty or contained an object different from what was expected. |

    | `429`    | Too many requests - request rate limit has been reached.                                                              |

    | `500`    | Internal Error. If it occurs repeatedly, contact support.                                                             |

    '
  contact:
    name: Humanitec Support
    email: support@humanitec.com
  x-logo:
    url: humanitec-logo.png
    altText: Humanitec logo
servers:
- url: https://api.humanitec.io/
tags:
- name: Registry
  x-displayName: Registry
  description: 'Humanitec can be used to manage registry credentials. The Registry object represents how to match credentials to a particular registry.


    Humanitec supports all Docker compatible registries as well as the custom authentication formats used by AWS Elastic Container Registry and Google Container Registry. It also supports the injection of a specific secret to be copied from an existing namespace in the cluster.

    <SchemaDefinition schemaRef="#/components/schemas/RegistryRequest" />

    '
paths:
  /orgs/{orgId}/registries:
    get:
      tags:
      - Registry
      summary: Lists available registries for the organization.
      parameters:
      - name: orgId
        in: path
        description: 'Unique (alpha-numerical) organization identifier.


          '
        required: true
        schema:
          type: string
      responses:
        '200':
          description: 'A Possibly empty list of Registries.


            '
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/RegistryResponse'
                type: array
        '400':
          description: 'Request parameters are incomplete or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '404':
          description: 'Specified ''orgId'' does not match any record.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
    post:
      tags:
      - Registry
      summary: Creates a new registry record.
      parameters:
      - name: orgId
        in: path
        description: 'Unique (alpha-numerical) organization identifier.


          '
        required: true
        schema:
          type: string
      requestBody:
        description: 'A new record details.


          '
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegistryRequest'
      responses:
        '201':
          description: 'A newly created record details.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryResponse'
        '400':
          description: 'Request parameters or payload are incomplete or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '401':
          description: 'Authentication token is missing or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '404':
          description: 'Specified ''orgId'' does not match any record.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '409':
          description: 'The record with the same ID or name (prefix) already exists within the organization.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
  /orgs/{orgId}/registries/{regId}:
    get:
      tags:
      - Registry
      summary: Loads a registry record details.
      parameters:
      - name: orgId
        in: path
        description: 'Unique (alpha-numerical) organization identifier.


          '
        required: true
        schema:
          type: string
      - name: regId
        in: path
        description: 'Unique (alpha-numerical) registry identifier.


          '
        required: true
        schema:
          type: string
      responses:
        '200':
          description: 'A registry details.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryResponse'
        '400':
          description: 'Request parameters are incomplete or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '404':
          description: 'Specified ''orgId'' or ''regId'' do not match any record.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
    delete:
      tags:
      - Registry
      summary: Deletes an existing registry record and all associated credentials and secrets.
      description: _Deletions are currently irreversible._
      parameters:
      - name: orgId
        in: path
        description: 'Unique (alpha-numerical) organization identifier.


          '
        required: true
        schema:
          type: string
      - name: regId
        in: path
        description: 'Unique (alpha-numerical) registry identifier.


          '
        required: true
        schema:
          type: string
      responses:
        '204':
          description: 'Deleted successfully.


            '
        '400':
          description: 'Request parameters are incomplete or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '403':
          description: 'Built-in ''humanitec'' registry can''t be deleted.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '404':
          description: 'Specified ''orgId'' or ''regId'' do not match any record.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
    patch:
      tags:
      - Registry
      summary: Updates (patches) an existing registry record.
      parameters:
      - name: orgId
        in: path
        description: 'Unique (alpha-numerical) organization identifier.


          '
        required: true
        schema:
          type: string
      - name: regId
        in: path
        description: 'Unique (alpha-numerical) registry identifier.


          '
        required: true
        schema:
          type: string
      requestBody:
        description: 'Record details to update.


          '
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegistryRequest'
      responses:
        '200':
          description: 'Updated record details.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryResponse'
        '400':
          description: 'Request parameters or payload are incomplete or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '403':
          description: 'Built-in ''humanitec'' registry can''t be changed.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '404':
          description: 'Specified ''orgId'' or ''regId'' do not match any record.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '409':
          description: 'The record with the same name (prefix) already exists within the organization.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
  /orgs/{orgId}/registries/{regId}/creds:
    get:
      tags:
      - Registry
      summary: Returns current account credentials or secret details for the registry.
      parameters:
      - name: orgId
        in: path
        description: 'Unique (alpha-numerical) organization identifier.


          '
        required: true
        schema:
          type: string
      - name: regId
        in: path
        description: 'Unique (alpha-numerical) registry identifier.


          '
        required: true
        schema:
          type: string
      responses:
        '200':
          description: 'Current account credentials or secret details for the registry.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryCredsResponse'
        '400':
          description: 'Request parameters are incomplete or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '401':
          description: 'Authentication token is missing or invalid.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
        '404':
          description: 'Specified ''orgId'' or ''regId'' do not match any record.


            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfoResponse'
components:
  schemas:
    RegistryCredsResponse:
      description: RegistryCreds represents current registry credentials (either, username- or token-based).
      example:
        expires: '2020-05-22T14:53:27Z'
        password: ''
        registry: registry.io/project
        secrets:
          '*':
            namespace: dev-secrets
            secret: custom-regcred
          cluster-A:
            namespace: prod-secrets
            secret: custom-regcred
        username: ''
      properties:
        expires:
          description: Account credentials expiration timestamp.
          example: '2020-06-22T09:37:23.523Z'
          nullable: true
          pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z$
          title: Simplified extended ISO format date/time string.
          type: string
        password:
          description: Account password or token secret.
          type: string
        registry:
          description: Registry name, usually in a "{domain}" or "{domain}/{project}" format.
          type: string
        secrets:
          $ref: '#/components/schemas/ClusterSecretsMapResponse'
          description: A list of Kuberenetes secret references for the target deployment clusters.
        username:
          description: Security account login or token.
          type: string
      required:
      - registry
      type: object
    ClusterSecretsMapResponse:
      additionalProperties:
        $ref: '#/components/schemas/ClusterSecretResponse'
      description: ClusterSecretsMap stores a list of Kuberenetes secret references for the target deployment clusters.
      example:
        '*':
          namespace: dev-secrets
          secret: custom-regcred
        cluster-A:
          namespace: prod-secrets
          secret: custom-regcred
      type: object
    ClusterSecretsMapRequest:
      additionalProperties:
        $ref: '#/components/schemas/ClusterSecretRequest'
      description: ClusterSecretsMap stores a list of Kuberenetes secret references for the target deployment clusters.
      example:
        '*':
          namespace: dev-secrets
          secret: custom-regcred
        cluster-A:
          namespace: prod-secrets
          secret: custom-regcred
      type: object
    ClusterSecretResponse:
      description: ClusterSecret represents Kubernetes secret reference.
      example:
        namespace: dev-secrets
        secret: custom-regcred
      properties:
        namespace:
          description: Namespace to look for the Kubernetes secret definition in.
          type: string
        secret:
          description: Name that identifies the Kubernetes secret.
          type: string
      required:
      - namespace
      - secret
      type: object
    RegistryResponse:
      description: 'Humanitec can be used to manage registry credentials. The Registry object represents how to match credentials to a particular registry.


        Humanitec supports all Docker compatible registries as well as the custom authentication formats used by AWS Elastic Container Registry and Google Container Registry. It also supports the injection of a specific secret to be copied from an existing namespace in the cluster.'
      example:
        created_at: '2020-05-22T14:53:27Z'
        created_by: a.user@example.com
        enable_ci: false
        id: humanitec
        registry: registry.humanitec.io
        secrets:
          '*':
            namespace: dev-secrets
            secret: custom-regcred
          cluster-A:
            namespace: prod-secrets
            secret: custom-regcred
        type: basic
      properties:
        created_at:
          description: The timestamp of when this record was created.
          example: '2020-06-22T09:37:23.523Z'
          nullable: true
          pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z$
          title: Simplified extended ISO format date/time string.
          type: string
        created_by:
          description: The user who created this record.
          type: string
        enable_ci:
          description: Indicates if registry secrets and credentials should be exposed to CI agents.
          type: boolean
        id:
          description: Registry ID, unique within the Organization.
          pattern: ^[a-z0-9][a-z0-9-]+[a-z0-9]$
          type: string
        registry:
          description: Registry name, usually in a "{domain}" or "{domain}/{project}" format.
          type: string
        secrets:
          $ref: '#/components/schemas/ClusterSecretsMapResponse'
          description: Secrets stores references to the Kubernetes secret objects to be copied to the target clusters, identified by the map key.
        type:
          description: 'Registry type, describes the registry authentication method, and defines the schema for the credentials.


            Supported values:


            - `public`


            - `basic`


            - `google_gcr`


            - `amazon_ecr`


            - `secret_ref`'
          type: string
      required:
      - id
      - registry
      - type
      - enable_ci
      type: object
    AccountCredsRequest:
      description: AccountCreds represents an account credentials (either, username- or token-based).
      example:
        expires: '2020-05-22T14:53:27Z'
        password: ''
        username: ''
      properties:
        expires:
          description: Account credentials expiration timestamp.
          example: '2020-06-22T09:37:23.523Z'
          nullable: true
          pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z$
          title: Simplified extended ISO format date/time string.
          type: string
        password:
          description: Account password or token secret.
          type: string
        username:
          description: Security account login or token.
          type: string
      required:
      - username
      - password
      type: object
    RegistryRequest:
      description: 'Humanitec can be used to manage registry credentials. The Registry object represents how to match credentials to a particular registry.


        Humanitec supports all Docker compatible registries as well as the custom authentication formats used by AWS Elastic Container Registry and Google Container Registry. It also supports the injection of a specific secret to be copied from an existing namespace in the cluster.'
      example:
        created_at: '2020-05-22T14:53:27Z'
        created_by: a.user@example.com
        enable_ci: false
        id: humanitec
        registry: registry.humanitec.io
        secrets:
          '*':
            namespace: dev-secrets
            secret: custom-regcred
          cluster-A:
            namespace: prod-secrets
            secret: custom-regcred
        type: basic
      properties:
        creds:
          $ref: '#/components/schemas/AccountCredsRequest'
          description: Registry security account credentials.
        enable_ci:
          description: Indicates if registry secrets and credentials should be exposed to CI agents.
          type: boolean
        id:
          description: Registry ID, unique within the Organization.
          pattern: ^[a-z0-9][a-z0-9-]+[a-z0-9]$
          type: string
        registry:
          description: Registry name, usually in a "{domain}" or "{domain}/{project}" format.
          type: string
        secrets:
          $ref: '#/components/schemas/ClusterSecretsMapRequest'
          description: Secrets stores references to the Kubernetes secret objects to be copied to the target clusters, identified by the map key.
        type:
          description: 'Registry type, describes the registry authentication method, and defines the schema for the credentials.


            Supported values:


            - `public`


            - `basic`


            - `google_gcr`


            - `amazon_ecr`


            - `secret_ref`'
          type: string
      required:
      - id
      - registry
      - type
      type: object
    ErrorInfoResponse:
      description: ErrorInfo is returned by a handler in case of an error.
      properties:
        error:
          description: An error details
          type: string
      required:
      - error
      type: object
    ClusterSecretRequest:
      description: ClusterSecret represents Kubernetes secret reference.
      example:
        namespace: dev-secrets
        secret: custom-regcred
      properties:
        namespace:
          description: Namespace to look for the Kubernetes secret definition in.
          type: string
        secret:
          description: Name that identifies the Kubernetes secret.
          type: string
      required:
      - namespace
      - secret
      type: object
externalDocs:
  description: Find out more about how to use Humanitec in your every-day development work.
  url: https://developer.humanitec.com/
x-tagGroups:
- name: Core
  tags:
  - Agents
  - Application
  - Artefact
  - ArtefactVersion
  - AuditLogs
  - Logs
  - Deployment
  - EnvironmentType
  - Environment
  - Image
  - PublicKeys
  - Organization
  - Registry
  - RuntimeInfo
  - SecretStore
  - Value
  - ValueSetVersion
- name: App Configuration
  tags:
  - Delta
  - Set
  - WorkloadProfile
- name: Resources
  tags:
  - ActiveResource
  - DriverDefinition
  - MatchingCriteria
  - ResourceDefinition
  - ResourceDefinitionVersion
  - ResourceProvision
  - AccountType
  - ResourceAccount
  - ResourceType
  - ResourceClass
- name: Automation
  tags:
  - AutomationRule
  - Event
  - Pipelines
  - PipelineRuns
  - PipelineApprovals
- name: Users
  tags:
  - UserProfile
  - UserRole
  - Group
  - TokenInfo