openapi: 3.1.0
info:
  title: DTZ Container Registry
  version: 2.0.2
  description: a generated client for the DTZ Container Registry API
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: Jens Walter
    email: jens@apimeister.com
externalDocs:
  description: dtz docs page
  url: https://docs.downtozero.cloud
servers:
- url: https://cr.dtz.rocks/api/{version}
  variables:
    version:
      default: "2023-12-28"
      enum:
        - "2023-12-28"
paths:
  /enable:
    post:
      summary: enable the container registry service
      description: enable the container registry service
      operationId: enableService
      responses:
        '200':
          description: service enabled
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorMessage"
        '500':
          description: internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorMessage"
        '503':
          description: service unavailable
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorMessage"
  /disable:
    post:
      summary: disable the container registry service
      description: disable the container registry service
      operationId: disableService
      responses:
        '200':
          description: service disabled
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorMessage"
  /stats:
    get:
      summary: get stats
      description: get stats
      operationId: getStats
      responses:
        '200':
          description: stats
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatsResponse"
        '401':
          description: unauthorized
  /v2/:
    get:
      summary: check authentication
      description: check authentication
      operationId: checkAuthentication
      responses:
        '200':
          description: success
        '401':
          description: unauthorized
  /v2/_catalog:
    get:
      summary: get catalog
      description: get catalog
      operationId: getCatalog
      responses:
        '200':
          description: catalog
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogResponse"
        '401':
          description: unauthorized
  /v2/{image}/manifests/{tag}:
    get:
      summary: get manifest for image and tag
      description: get manifest for image and tag
      operationId: getImageTagManifest
      parameters:
        - name: image
          in: path
          required: true
          schema:
            type: string
        - name: tag
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: manifest
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ManifestResponse"
        '401':
          description: unauthorized
        '404':
          description: manifest not found
    put:
      summary: upload manifest for image and tag or digest
      description: upload manifest document and register it by tag or digest reference
      operationId: putImageTagManifest
      parameters:
        - name: image
          in: path
          required: true
          schema:
            type: string
        - name: tag
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/vnd.docker.distribution.manifest.v2+json:
            schema:
              type: object
          application/vnd.oci.image.manifest.v1+json:
            schema:
              type: object
          application/vnd.oci.image.index.v1+json:
            schema:
              type: object
      responses:
        '201':
          description: manifest uploaded
        '400':
          description: invalid manifest upload request
        '401':
          description: unauthorized
  /v2/{image}/referrers/{digest}:
    get:
      summary: get referrers for image digest
      description: returns an OCI index containing manifests that reference the subject digest
      operationId: getImageDigestReferrers
      parameters:
        - name: image
          in: path
          required: true
          schema:
            type: string
        - name: digest
          in: path
          required: true
          schema:
            type: string
        - name: artifactType
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: referrers index
          headers:
            OCI-Filters-Applied:
              description: present when artifactType filtering was applied
              schema:
                type: string
          content:
            application/vnd.oci.image.index.v1+json:
              schema:
                $ref: "#/components/schemas/ReferrerResponse"
        '401':
          description: unauthorized
  /v2/{image}/tags/list:
    get:
      summary: get tags list
      description: get tags list
      operationId: getImageTagsList
      parameters:
        - name: image
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: tags list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TagsListResponse"
        '401':
          description: unauthorized
        '500':
          description: internal server error
components:
  schemas:
    ErrorMessage:
      type: object
      properties:
        msg:
          type: string
    StatsResponse:
      type: object
      properties:
        imageCount:
          type: integer
        serverUrl:
          type: string
    CatalogResponse:
      type: object
      properties:
        repositories:
          type: array
          items:
            type: string
    TagsListResponse:
      type: object
      properties:
        name:
          type: string
        tags:
          type: array
          items:
            type: string
    ManifestResponse:
      type: object
      properties:
        schemaVersion:
          type: integer
        mediaType:
          type: string
        manifests:
          type: array
          items:
            type: object
    ReferrerManifest:
      type: object
      properties:
        mediaType:
          type: string
        size:
          type: integer
        digest:
          type: string
        artifactType:
          type: string
        annotations:
          type: object
          additionalProperties:
            type: string
    ReferrerResponse:
      type: object
      properties:
        schemaVersion:
          type: integer
        mediaType:
          type: string
        manifests:
          type: array
          items:
            $ref: "#/components/schemas/ReferrerManifest"
  securitySchemes:
    dtz_auth:
      type: apiKey
      in: header
      name: X-API-KEY
    dtz_auth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://identity.dtz.rocks/api/2021-02-21/token/auth
          scopes:
            dummy:dummy: dummy
security:
  - dtz_auth: []
  - dtz_auth2: []