Skip to Content
kosemdocs
ReferenceAPIEnvironments

Create registry in project

Creates a registry of an organization, or a project's own, which kosem signs in to with a token, or without a key, to pull the private images under its prefix. Choosing its secret takes secrets.versions.access on it: the registry's prefix decides which host gets the secret's value. A registry of Artifact Registry or Amazon ECR signs in without a key, as a service account or a role that trusts kosem's identity tokens for it. A project's own registry applies to the project alone, is shared with no project, and is refused where a policy enforces environments.projectRegistriesDisabled.

POST
/v1/projects/{project}/registries

Creates a registry of an organization, or a project's own, which kosem signs in to with a token, or without a key, to pull the private images under its prefix.

Choosing its secret takes secrets.versions.access on it: the registry's prefix decides which host gets the secret's value. A registry of Artifact Registry or Amazon ECR signs in without a key, as a service account or a role that trusts kosem's identity tokens for it. A project's own registry applies to the project alone, is shared with no project, and is refused where a policy enforces environments.projectRegistriesDisabled.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request Body

application/json
  1. body
availability?

The projects whose environments pull with it. None, unless set. Setting it also takes environments.registries.setAvailability. A project's own registry takes none.

aws?

For a registry of Amazon ECR, such as 123456789012.dkr.ecr.us-east-1.amazonaws.com: the role kosem signs in as, without a key.

description?string

What the registry is for.

Lengthlength <= 500
google?

For a registry of Artifact Registry, such as us-docker.pkg.dev/acme: the service account kosem signs in as, without a key.

prefix*string

The images the registry covers: a host, and a path in it when it covers only part of it, such as ghcr.io/acme, without a scheme or a tag. Unique among its organization's, or its project's own.

Lengthlength <= 255
token?

The username and the secret that kosem signs in with. Exactly one of token, google and aws.

Response Body

Created

application/json
  1. response
availability*

For an organization's registry: the projects whose environments pull with it, without adopting it. A project's own applies to it alone, and is shared with none.

aws?

For a registry of Amazon ECR: the role kosem signs in as, without a key.

createTime*string

When the registry was created.

Formatdate-time
description*string

What the registry is for.

google?

For a registry of Artifact Registry: the service account kosem signs in as, without a key.

lastPullTime?string

When an environment last pulled an image with the registry; unset until one has.

Formatdate-time
name*string

Resource name, organizations/{organization_id}/registries/{registry_id}, or projects/{project_id}/registries/{registry_id} for a project's own.

prefix*string

The images the registry covers: a host, and a path in it when it covers only part of it, such as ghcr.io/acme. kosem signs in with the registry of the longest prefix that covers an image's repository, among a project's own and those its organization shares with it, and of two of the same prefix, the project's own. Set when the registry is created, and never changed.

state*string

NOT_CONNECTED for a registry that has yet to sign in: one without a key until a check or a pull signs in with it, and one with a token that a check found refused before anything pulled with it. NEEDS_ATTENTION once the registry refused kosem's sign-in, until how it signs in changes or a check takes it.

Value in"ACTIVE""NEEDS_ATTENTION""NOT_CONNECTED"
stateReason*string

Why the registry needs attention, when it does.

token?

The username and the secret that kosem signs in with, unless it signs in without a key.

trust?

For a registry that signs in without a key: what its cloud trusts, kosem's identity tokens for it.

updateTime*string

When the registry last changed.

Formatdate-time
verification?

What VerifyRegistry last found, until how the registry signs in changes.

Example Request
curl -X POST 'https://api.kosem.ai/v1/projects/string/registries' \
  -H 'Content-Type: application/json' \
  -d '{
  "prefix": "string"
}'
Example Response
{
  "availability": {
    "allProjects": true,
    "projects": [
      "string"
    ]
  },
  "aws": {
    "role": "string"
  },
  "createTime": "2019-08-24T14:15:22Z",
  "description": "string",
  "google": {
    "provider": "string",
    "serviceAccount": "string"
  },
  "lastPullTime": "2019-08-24T14:15:22Z",
  "name": "string",
  "prefix": "string",
  "state": "ACTIVE",
  "stateReason": "string",
  "token": {
    "secret": "string",
    "username": "string"
  },
  "trust": {
    "attributeCondition": "string",
    "audience": "string",
    "issuer": "string",
    "subject": "string"
  },
  "updateTime": "2019-08-24T14:15:22Z",
  "verification": {
    "steps": [
      {
        "said": "string",
        "state": "PASSED",
        "step": "TRUST"
      }
    ],
    "verifyTime": "2019-08-24T14:15:22Z"
  }
}