API Client represents a low level interface for Registry API. All API operation can be performed using this.
A Low-Level client for Registry API
from abeja.registry import APIClient
api_client = APIClient()
create a docker repository
API reference: POST /organizations/<organization_id>/registry/repositories
organization_id = "1410000000000"
name = "sample_repository"
description = "this is sample repository"
response = api_client.create_repository(
organization_id, name, description)
organization_id (str): ORGANIZATION_ID
name (str): repository name
description (str): description for this repository
dict
Response Syntax:
{
"id": "1234567890123",
"organization_id": "1410000000000",
"name": "sample_repository",
"description": "this is sample repository",
"tags": [],
"creator": {
"updated_at": "2018-01-04T03:02:12Z",
"role": "admin",
"is_registered": True,
"id": "1122334455660",
"email": "test@abeja.asia",
"display_name": None,
"created_at": "2017-05-26T01:38:46Z"
},
"created_at": "2018-06-07T04:42:34.913644Z",
"updated_at": "2018-06-07T04:42:34.913726Z"
}
BadRequest
Unauthorized: Authentication failed
InternalServerError
delete repository
API reference: DELETE /organizations/<organization_id>/registry/repositories/<repository_id>
organization_id = "1410000000000"
repository_id = "1510000000000"
response = api_client.delete_repository(organization_id, repository_id)
organization_id (str): ORGANIZATION_ID
repository (str): REPOSITORY_ID
dict
Response Syntax:
{
"id": "1234567890123",
"organization_id": "1410000000000",
"name": "sample_repository",
"description": None,
"tags": [],
"creator": {
"updated_at": "2018-01-04T03:02:12Z",
"role": "admin",
"is_registered": True,
"id": "1122334455660",
"email": "test@abeja.asia",
"display_name": None,
"created_at": "2017-05-26T01:38:46Z"
},
"created_at": "2018-06-07T04:42:34.913644Z",
"updated_at": "2018-06-07T04:42:34.913726Z"
}
BadRequest
Unauthorized: Authentication failed
InternalServerError
get repositories
API reference: GET /organizations/<organization_id>/registry/repositories
organization_id = "1410000000000"
response = api_client.get_repositories(organization_id)
organization_id (str): ORGANIZATION_ID
limit (int): max number of repositories to be returned [optional]
offset (int): offset of repositories ( which starts from 0 ) [optional]
dict
Response Syntax:
{
"offset": 0,
"limit": 10,
"has_next": False,
"organization_name": "test-org",
"organization_id": 1410000000000,
"created_at": "2019-05-23T05:13:13Z",
"updated_at": "2019-05-23T05:13:15Z",
"registry_repositories": [
{
"id": "1234567890123",
"organization_id": "1410000000000",
"name": "sample_repository",
"description": None,
"creator": {
"updated_at": "2018-01-04T03:02:12Z",
"role": "admin",
"is_registered": True,
"id": "1122334455660",
"email": "test@abeja.asia",
"display_name": None,
"created_at": "2017-05-26T01:38:46Z"
},
"created_at": "2018-06-07T04:42:34.913644Z",
"updated_at": "2018-06-07T04:42:34.913726Z"
}
]
}
BadRequest
Unauthorized: Authentication failed
InternalServerError
get repository
API reference: GET /organizations/<organization_id>/registry/repositories/<repository_id>
organization_id = "1410000000000"
repository_id = "1510000000000"
response = api_client.get_repository(organization_id, repository_id)
organization_id (str): ORGANIZATION_ID
repository (str): REPOSITORY_ID
dict
Response Syntax:
{
"id": "1234567890123",
"organization_id": "1410000000000",
"name": "sample_repository",
"description": None,
"tags": [],
"creator": {
"updated_at": "2018-01-04T03:02:12Z",
"role": "admin",
"is_registered": True,
"id": "1122334455660",
"email": "test@abeja.asia",
"display_name": None,
"created_at": "2017-05-26T01:38:46Z"
},
"created_at": "2018-06-07T04:42:34.913644Z",
"updated_at": "2018-06-07T04:42:34.913726Z"
}
BadRequest
Unauthorized: Authentication failed
InternalServerError
get tags of repository
API reference: GET /organizations/<organization_id>/registry/repositories/<repository_id>/tags
organization_id = "1410000000000"
repository_id = "1510000000000"
response = api_client.get_repository_tags(organization_id, repository_id)
organization_id (str): ORGANIZATION_ID
repository (str): REPOSITORY_ID
limit (int): max number of tags of repository to be returned [optional]
offset (int): offset of tags of repository ( which starts from 0 ) [optional]
dict
Response Syntax:
{
"offset": 0,
"limit": 10,
"has_next": False,
"registry_repository_id": "1700000000000",
"organization_name": "test-org",
"organization_id": "1410000000000",
"created_at": "2019-05-23T05:13:13Z",
"updated_at": "2019-05-23T05:13:15Z",
"tags": [
{
"size": 2757009,
"name": "0.0.4",
"media_type": "application/vnd.docker.distribution.manifest.v2+json",
"id": 1771682238503,
"digest": "sha256:5c40b3c27b9f13c873fefb2139765c56ce97fd50230f1f2d5c91e55dec171907",
"creator": {
"updated_at": "2018-01-04T03:02:12Z",
"role": "admin",
"is_registered": True,
"id": "1122334455660",
"email": "test@abeja.asia",
"display_name": None,
"created_at": "2017-05-26T01:38:46Z"
},
"created_at": "2019-05-23T05:13:13Z",
"updated_at": "2019-05-23T05:13:15Z"
}
]
}
BadRequest
Unauthorized: Authentication failed
InternalServerError