> Index of every page on this site: [llms.txt](https://docs.a-line.cloud/llms.txt)

# Registry

> The registry operations of the v1 API.

## List the organization's registry mirrors with the suggested remotes

`GET /v1/registry/mirrors` (operation ID `list_registry_mirrors`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Responses**

- `200`: The mirrors and presets. Body: [`RegistryMirrors`](/api/reference/schemas#registrymirrors).
- `401`: Missing, invalid or revoked API key.
- `403`: The key's scope does not allow this.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/registry/mirrors' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Add a registry mirror

`POST /v1/registry/mirrors` (operation ID `create_registry_mirror`)

A `pull` mirror copies tags of a remote repository into `{org}/{local_repository}` (normal pushes: events and deploy triggers fire); a `push` mirror copies that repository's tags to the remote. Tags are never deleted.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Request body**: [`MirrorBody`](/api/reference/schemas#mirrorbody) (required): Body of a mirror create or update (an update gives the full settings).

**Responses**

- `201`: The new mirror. Body: [`RegistryMirror`](/api/reference/schemas#registrymirror).
- `400`: A bad remote, repository, tag filter, schedule or credential, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `409`: The same mirror exists.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/registry/mirrors' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"direction":"example","local_repository":"example","remote_repository":"example","remote_url":"example"}'
```

## Get one registry mirror with its last run

`GET /v1/registry/mirrors/{id}` (operation ID `get_registry_mirror`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The mirror UUID

**Responses**

- `200`: The mirror. Body: [`RegistryMirror`](/api/reference/schemas#registrymirror).
- `401`: Missing, invalid or revoked API key.
- `404`: Unknown mirror.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/registry/mirrors/00000000-0000-4000-8000-000000000001' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Replace a registry mirror's settings

`PUT /v1/registry/mirrors/{id}` (operation ID `update_registry_mirror`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The mirror UUID

**Request body**: [`MirrorBody`](/api/reference/schemas#mirrorbody) (required): Body of a mirror create or update (an update gives the full settings).

**Responses**

- `200`: The changed mirror. Body: [`RegistryMirror`](/api/reference/schemas#registrymirror).
- `400`: A bad remote, repository, tag filter, schedule or credential, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `404`: Unknown mirror.
- `409`: The same mirror exists.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X PUT 'https://api.a-line.cloud/v1/registry/mirrors/00000000-0000-4000-8000-000000000001' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"direction":"example","local_repository":"example","remote_repository":"example","remote_url":"example"}'
```

## Delete a registry mirror

`DELETE /v1/registry/mirrors/{id}` (operation ID `delete_registry_mirror`)

Tags it copied stay.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The mirror UUID

**Responses**

- `200`: Removed. Body: [`DeletedRegistryMirror`](/api/reference/schemas#deletedregistrymirror).
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `404`: Unknown mirror.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X DELETE 'https://api.a-line.cloud/v1/registry/mirrors/00000000-0000-4000-8000-000000000001' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Run a registry mirror now

`POST /v1/registry/mirrors/{id}/sync` (operation ID `sync_registry_mirror`)

Run a registry mirror now; the worker starts it within a minute.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The mirror UUID

**Responses**

- `202`: Queued. Body: [`RegistryMirror`](/api/reference/schemas#registrymirror).
- `400`: The mirror is switched off.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `404`: Unknown mirror.
- `409`: A run is going.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/registry/mirrors/00000000-0000-4000-8000-000000000001/sync' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Test a registry mirror

`POST /v1/registry/mirrors/{id}/test` (operation ID `test_registry_mirror`)

Test a registry mirror: ask the remote's `/v2/` with the mirror's login.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The mirror UUID

**Responses**

- `200`: What the remote said. Body: [`PullCacheTest`](/api/reference/schemas#pullcachetest).
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `404`: Unknown mirror.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/registry/mirrors/00000000-0000-4000-8000-000000000001/test' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## List the organization's pull-through caches with the suggested upstreams

`GET /v1/registry/pull-caches` (operation ID `list_registry_pull_caches`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Responses**

- `200`: The rules and presets. Body: [`PullCacheRules`](/api/reference/schemas#pullcacherules).
- `401`: Missing, invalid or revoked API key.
- `403`: The key's scope does not allow this.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/registry/pull-caches' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Add a pull-through cache

`POST /v1/registry/pull-caches` (operation ID `create_registry_pull_cache`)

Pulling `{org}/pull_cache/{alias}/{image}:{tag}` then fills the cache from the upstream on demand.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Request body**: [`CreatePullCacheRule`](/api/reference/schemas#createpullcacherule) (required): Body of a rule create.

**Responses**

- `201`: The new rule. Body: [`PullCacheRule`](/api/reference/schemas#pullcacherule).
- `400`: A bad alias, upstream, refresh interval or credential, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `409`: A pull-through cache with this alias exists.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/registry/pull-caches' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"alias":"example","upstream_url":"example"}'
```

## Get one pull-through cache

`GET /v1/registry/pull-caches/{id}` (operation ID `get_registry_pull_cache`)

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The pull-through cache UUID

**Responses**

- `200`: The rule. Body: [`PullCacheRule`](/api/reference/schemas#pullcacherule).
- `401`: Missing, invalid or revoked API key.
- `404`: Unknown pull-through cache.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl 'https://api.a-line.cloud/v1/registry/pull-caches/00000000-0000-4000-8000-000000000001' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Replace a pull-through cache's upstream

`PUT /v1/registry/pull-caches/{id}` (operation ID `update_registry_pull_cache`)

Replace a pull-through cache's upstream, credential, refresh interval and switch. The alias stays.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The pull-through cache UUID

**Request body**: [`UpdatePullCacheRule`](/api/reference/schemas#updatepullcacherule) (required): Body of a rule update: the full new settings (the alias stays).

**Responses**

- `200`: The changed rule. Body: [`PullCacheRule`](/api/reference/schemas#pullcacherule).
- `400`: A bad upstream, refresh interval or credential, or malformed JSON.
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `404`: Unknown pull-through cache.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X PUT 'https://api.a-line.cloud/v1/registry/pull-caches/00000000-0000-4000-8000-000000000001' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key' \
  -H 'Content-Type: application/json' \
  -d '{"enabled":false,"refresh_minutes":1,"upstream_url":"example"}'
```

## Delete a pull-through cache

`DELETE /v1/registry/pull-caches/{id}` (operation ID `delete_registry_pull_cache`)

Cached images stay until retention drops them.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The pull-through cache UUID

**Responses**

- `200`: Removed. Body: [`DeletedPullCacheRule`](/api/reference/schemas#deletedpullcacherule).
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only, or the user is not an owner or admin.
- `404`: Unknown pull-through cache.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X DELETE 'https://api.a-line.cloud/v1/registry/pull-caches/00000000-0000-4000-8000-000000000001' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```

## Test a pull-through cache

`POST /v1/registry/pull-caches/{id}/test` (operation ID `test_registry_pull_cache`)

Test a pull-through cache: ask the upstream's `/v2/` with the rule's login.

Authentication: `api_key` ([how to authenticate](/api/authentication)).

**Parameters**

- `id` (path, required, `string`): The pull-through cache UUID

**Responses**

- `200`: What the upstream said. Body: [`PullCacheTest`](/api/reference/schemas#pullcachetest).
- `401`: Missing, invalid or revoked API key.
- `403`: The key is read-only.
- `404`: Unknown pull-through cache.
- `429`: This API key spent its request budget for the current window (code `rate_limited`); retry after `Retry-After` seconds. Body: [`V1Error`](/api/reference/schemas#v1error).

```bash
curl -X POST 'https://api.a-line.cloud/v1/registry/pull-caches/00000000-0000-4000-8000-000000000001/test' \
  -H 'Authorization: Bearer alc_test_EXAMPLE_not_a_real_key'
```
