Skip to main content

Registry API

Manage container registries via the API.

List Registries

GET /v1/registries

Response:

{
"data": [
{
"id": "reg_abc123",
"name": "my-images",
"status": "active",
"public": false,
"endpoint": "registry.sparbz.cloud/my-images",
"image_count": 15,
"storage_bytes": 2147483648,
"created_at": "2024-01-15T10:30:00Z"
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 20
}
}

Get Registry

GET /v1/registries/:id

Response:

{
"data": {
"id": "reg_abc123",
"name": "my-images",
"status": "active",
"public": false,
"endpoint": "registry.sparbz.cloud/my-images",
"image_count": 15,
"storage_bytes": 2147483648,
"quota": {
"storage_gb": 50,
"used_gb": 2
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}

Create Registry

POST /v1/registries

Request Body:

{
"name": "my-images",
"public": false
}

Response: 201 Created

{
"data": {
"id": "reg_abc123",
"name": "my-images",
"status": "creating",
"public": false,
"endpoint": "registry.sparbz.cloud/my-images"
}
}

Update Registry

PATCH /v1/registries/:id

Request Body:

{
"public": true
}

Response:

{
"data": {
"id": "reg_abc123",
"name": "my-images",
"public": true
}
}

Delete Registry

DELETE /v1/registries/:id

Query Parameters:

ParameterTypeDescription
forcebooleanDelete registry even if not empty

Response: 204 No Content

Get Credentials

GET /v1/registries/:id/credentials

Response:

{
"data": {
"username": "robot$my-images",
"password": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"endpoint": "registry.sparbz.cloud",
"docker_config": {
"auths": {
"registry.sparbz.cloud": {
"auth": "cm9ib3QkbXktaW1hZ2VzOmV5SmhiR..."
}
}
}
}
}

Rotate Credentials

POST /v1/registries/:id/rotate-credentials

Response:

{
"data": {
"username": "robot$my-images",
"password": "newPasswordGenerated..."
}
}

List Images

GET /v1/registries/:id/images

Response:

{
"data": [
{
"name": "api",
"tag_count": 5,
"size_bytes": 157286400,
"last_pushed": "2024-01-15T10:30:00Z"
},
{
"name": "web",
"tag_count": 3,
"size_bytes": 83886080,
"last_pushed": "2024-01-14T08:00:00Z"
}
]
}

List Tags

GET /v1/registries/:id/images/:name/tags

Response:

{
"data": [
{
"name": "latest",
"digest": "sha256:abc123...",
"size_bytes": 31457280,
"pushed_at": "2024-01-15T10:30:00Z"
},
{
"name": "v1.2.0",
"digest": "sha256:def456...",
"size_bytes": 31457280,
"pushed_at": "2024-01-14T08:00:00Z"
}
]
}

Delete Tag

DELETE /v1/registries/:id/images/:name/tags/:tag

Response: 204 No Content

Delete Image

DELETE /v1/registries/:id/images/:name

Deletes all tags for an image.

Response: 204 No Content

Garbage Collection

Trigger GC

POST /v1/registries/:id/gc

Triggers garbage collection to reclaim storage from deleted images.

Response:

{
"data": {
"job_id": "gc_abc123",
"status": "running",
"started_at": "2024-01-15T10:30:00Z"
}
}

Get GC Status

GET /v1/registries/:id/gc/:job_id

Response:

{
"data": {
"job_id": "gc_abc123",
"status": "completed",
"bytes_freed": 1073741824,
"started_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:35:00Z"
}
}