-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiRegistry Beta API #944
base: main
Are you sure you want to change the base?
Changes from all commits
2f96a5a
8075611
6db6f21
c5b53c1
85995e1
caa8750
5c535be
41c1caf
df4b5dc
dea9984
7785fe2
aa27aa2
6d6556f
754d60d
f1156f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/registry" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X POST \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
-d '{"name": "example", "region": "fra1"}' \ | ||
"https://api.digitalocean.com/v2/registries" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X DELETE \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/registries/example" |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,6 @@ | ||||||
lang: cURL | ||||||
source: |- | ||||||
curl -X GET \ | ||||||
-H "Content-Type: application/json" \ | ||||||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||||||
"https://api.digitalocean.com/v2/registries" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/registries" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/registries/example/docker-credentials" |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,13 @@ | ||||||
lang: Python | ||||||
source: |- | ||||||
import os | ||||||
from pydo import Client | ||||||
|
||||||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||||||
|
||||||
req = { | ||||||
"name": "example", | ||||||
"region": "fra1" | ||||||
} | ||||||
|
||||||
resp = client.registry.create(body=req) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
As mentioned, these are generated from the operation ID. So at the moment, that would actually be |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
type: object | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is nearly identical to the existing registry model. It's just missing the Maybe something like rename this to type: object
allOf:
- $ref: 'registry_base.yml'
- type: object
properties:
subscription:
allOf:
- readOnly: true
- $ref: 'subscription.yml' |
||
|
||
properties: | ||
name: | ||
type: string | ||
maxLength: 63 | ||
pattern: '^[a-z0-9-]{1,63}$' | ||
example: example | ||
description: A globally unique name for the container registry. Must be | ||
lowercase and be composed only of numbers, letters and `-`, up to a limit | ||
of 63 characters. | ||
|
||
created_at: | ||
type: string | ||
format: date-time | ||
readOnly: true | ||
example: '2020-03-21T16:02:37Z' | ||
description: A time value given in ISO8601 combined date and time format | ||
that represents when the registry was created. | ||
|
||
region: | ||
type: string | ||
example: fra1 | ||
description: Slug of the region where registry data is stored | ||
|
||
storage_usage_bytes: | ||
type: integer | ||
readOnly: true | ||
example: 29393920 | ||
description: The amount of storage used in the registry in bytes. | ||
|
||
storage_usage_bytes_updated_at: | ||
type: string | ||
format: date-time | ||
readOnly: true | ||
example: '2020-11-04T21:39:49.530562231Z' | ||
description: The time at which the storage usage was updated. Storage usage | ||
is calculated asynchronously, and may not immediately reflect pushes to | ||
the registry. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
type: object | ||
|
||
properties: | ||
name: | ||
type: string | ||
maxLength: 63 | ||
pattern: '^[a-z0-9-]{1,63}$' | ||
example: example | ||
description: A globally unique name for the container registry. Must be | ||
lowercase and be composed only of numbers, letters and `-`, up to a limit | ||
of 63 characters. | ||
|
||
region: | ||
type: string | ||
enum: | ||
- nyc3 | ||
- sfo3 | ||
- sfo2 | ||
- ams3 | ||
- sgp1 | ||
- fra1 | ||
- blr1 | ||
- syd1 | ||
example: fra1 | ||
description: Slug of the region where registry data is stored. When not provided, a region will be selected. | ||
|
||
required: | ||
- name |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,51 @@ | ||||||
operationId: multiregistry_create | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The operation ID is used by generated clients to name methods. So that we are consistent with godo and other resources, we probably want to use |
||||||
|
||||||
summary: Create Container Registry By Name (Beta) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Let's put the beta tag up front for clarity. |
||||||
|
||||||
description: | | ||||||
To create your container registry, send a POST request to `/v2/registries`. | ||||||
|
||||||
The `name` becomes part of the URL for images stored in the registry. For | ||||||
example, if your registry is called `example`, an image in it will have the | ||||||
URL `registry.digitalocean.com/example/image:tag`. | ||||||
|
||||||
tags: | ||||||
- Container Registry | ||||||
|
||||||
parameters: | ||||||
- $ref: 'parameters.yml#/registry_name' | ||||||
|
||||||
requestBody: | ||||||
required: true | ||||||
|
||||||
content: | ||||||
application/json: | ||||||
schema: | ||||||
$ref: 'models/multiregistry_create.yml' | ||||||
|
||||||
responses: | ||||||
'201': | ||||||
$ref: 'responses/multiregistry_info.yml' | ||||||
|
||||||
'401': | ||||||
$ref: '../../shared/responses/unauthorized.yml' | ||||||
|
||||||
'404': | ||||||
$ref: '../../shared/responses/not_found.yml' | ||||||
|
||||||
'429': | ||||||
$ref: '../../shared/responses/too_many_requests.yml' | ||||||
|
||||||
'500': | ||||||
$ref: '../../shared/responses/server_error.yml' | ||||||
|
||||||
default: | ||||||
$ref: '../../shared/responses/unexpected_error.yml' | ||||||
|
||||||
x-codeSamples: | ||||||
- $ref: 'examples/curl/multiregistry_create.yml' | ||||||
# - $ref: 'examples/python/multiregistry_create.yml' | ||||||
|
||||||
security: | ||||||
- bearer_auth: | ||||||
- 'registry:create' |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||||||||||||
operationId: multiregistry_delete | ||||||||||||||
|
||||||||||||||
summary: Delete Container Registry By Name (Beta) | ||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
description: To delete your container registry, destroying all container image | ||||||||||||||
data stored in it, send a DELETE request to `/v2/registries/{registry_name}`. | ||||||||||||||
|
||||||||||||||
tags: | ||||||||||||||
- Container Registry | ||||||||||||||
|
||||||||||||||
parameters: | ||||||||||||||
- $ref: 'parameters.yml#/registry_name' | ||||||||||||||
|
||||||||||||||
responses: | ||||||||||||||
'204': | ||||||||||||||
$ref: '../../shared/responses/no_content.yml' | ||||||||||||||
|
||||||||||||||
'401': | ||||||||||||||
$ref: '../../shared/responses/unauthorized.yml' | ||||||||||||||
|
||||||||||||||
'404': | ||||||||||||||
$ref: '../../shared/responses/not_found.yml' | ||||||||||||||
|
||||||||||||||
'429': | ||||||||||||||
$ref: '../../shared/responses/too_many_requests.yml' | ||||||||||||||
|
||||||||||||||
'500': | ||||||||||||||
$ref: '../../shared/responses/server_error.yml' | ||||||||||||||
|
||||||||||||||
default: | ||||||||||||||
$ref: '../../shared/responses/unexpected_error.yml' | ||||||||||||||
|
||||||||||||||
x-codeSamples: | ||||||||||||||
- $ref: 'examples/curl/multiregistry_delete.yml' | ||||||||||||||
# - $ref: 'examples/python/registry_delete.yml' | ||||||||||||||
|
||||||||||||||
security: | ||||||||||||||
- bearer_auth: | ||||||||||||||
- 'registry:delete' |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||||||||||||
operationId: multiregistry_get | ||||||||||||||
|
||||||||||||||
summary: Get Container Registry By Name (Beta) | ||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
description: To get information about any container registry in your account, send a GET | ||||||||||||||
request to `/v2/registries/{registry_name}`. | ||||||||||||||
|
||||||||||||||
tags: | ||||||||||||||
- Container Registry | ||||||||||||||
|
||||||||||||||
parameters: | ||||||||||||||
- $ref: 'parameters.yml#/registry_name' | ||||||||||||||
|
||||||||||||||
responses: | ||||||||||||||
'200': | ||||||||||||||
$ref: 'responses/multiregistry_info.yml' | ||||||||||||||
|
||||||||||||||
'401': | ||||||||||||||
$ref: '../../shared/responses/unauthorized.yml' | ||||||||||||||
|
||||||||||||||
'404': | ||||||||||||||
$ref: '../../shared/responses/not_found.yml' | ||||||||||||||
|
||||||||||||||
'429': | ||||||||||||||
$ref: '../../shared/responses/too_many_requests.yml' | ||||||||||||||
|
||||||||||||||
'500': | ||||||||||||||
$ref: '../../shared/responses/server_error.yml' | ||||||||||||||
|
||||||||||||||
default: | ||||||||||||||
$ref: '../../shared/responses/unexpected_error.yml' | ||||||||||||||
|
||||||||||||||
x-codeSamples: | ||||||||||||||
- $ref: 'examples/curl/multiregistry_get.yml' | ||||||||||||||
# - $ref: 'examples/python/registry_get.yml' | ||||||||||||||
|
||||||||||||||
security: | ||||||||||||||
- bearer_auth: | ||||||||||||||
- 'registry:read' |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,33 @@ | ||||||||||||||
operationId: multiregistry_get_all | ||||||||||||||
|
||||||||||||||
summary: Get All Container Registries (Beta) | ||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
description: To get information about any container registry in your account, send a GET | ||||||||||||||
request to `/v2/registries/`. | ||||||||||||||
|
||||||||||||||
tags: | ||||||||||||||
- Container Registry | ||||||||||||||
|
||||||||||||||
responses: | ||||||||||||||
'200': | ||||||||||||||
$ref: 'responses/all_registries_info.yml' | ||||||||||||||
|
||||||||||||||
'401': | ||||||||||||||
$ref: '../../shared/responses/unauthorized.yml' | ||||||||||||||
|
||||||||||||||
'429': | ||||||||||||||
$ref: '../../shared/responses/too_many_requests.yml' | ||||||||||||||
|
||||||||||||||
'500': | ||||||||||||||
$ref: '../../shared/responses/server_error.yml' | ||||||||||||||
|
||||||||||||||
default: | ||||||||||||||
$ref: '../../shared/responses/unexpected_error.yml' | ||||||||||||||
|
||||||||||||||
x-codeSamples: | ||||||||||||||
- $ref: 'examples/curl/multiregistry_get_all.yml' | ||||||||||||||
# - $ref: 'examples/python/registry_get.yml' | ||||||||||||||
|
||||||||||||||
security: | ||||||||||||||
- bearer_auth: | ||||||||||||||
- 'registry:read' |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,61 @@ | ||||||||||||||
operationId: multiregistry_get_dockerCredentials | ||||||||||||||
|
||||||||||||||
summary: Get Docker Credentials By Registry Name (Beta) | ||||||||||||||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
description: | | ||||||||||||||
In order to access your container registry with the Docker client or from a | ||||||||||||||
Kubernetes cluster, you will need to configure authentication. The necessary | ||||||||||||||
JSON configuration can be retrieved by sending a GET request to | ||||||||||||||
`/v2/registries/{registry_name}/docker-credentials`. | ||||||||||||||
|
||||||||||||||
The response will be in the format of a Docker `config.json` file. To use the | ||||||||||||||
config in your Kubernetes cluster, create a Secret with: | ||||||||||||||
|
||||||||||||||
kubectl create secret generic docr \ | ||||||||||||||
--from-file=.dockerconfigjson=config.json \ | ||||||||||||||
--type=kubernetes.io/dockerconfigjson | ||||||||||||||
|
||||||||||||||
By default, the returned credentials have read-only access to your registry | ||||||||||||||
and cannot be used to push images. This is appropriate for most Kubernetes | ||||||||||||||
clusters. To retrieve read/write credentials, suitable for use with the Docker | ||||||||||||||
client or in a CI system, read_write may be provided as query parameter. For | ||||||||||||||
example: `/v2/registries/{registry_name}/docker-credentials?read_write=true` | ||||||||||||||
|
||||||||||||||
By default, the returned credentials will not expire. To retrieve credentials | ||||||||||||||
with an expiry set, expiry_seconds may be provided as a query parameter. For | ||||||||||||||
example: `/v2/registries/{registry_name}/docker-credentials?expiry_seconds=3600` will return | ||||||||||||||
credentials that expire after one hour. | ||||||||||||||
|
||||||||||||||
tags: | ||||||||||||||
- Container Registry | ||||||||||||||
|
||||||||||||||
parameters: | ||||||||||||||
- $ref: 'parameters.yml#/registry_name' | ||||||||||||||
|
||||||||||||||
responses: | ||||||||||||||
'200': | ||||||||||||||
$ref: 'responses/docker_credentials.yml' | ||||||||||||||
|
||||||||||||||
'404': | ||||||||||||||
$ref: '../../shared/responses/not_found.yml' | ||||||||||||||
|
||||||||||||||
'401': | ||||||||||||||
$ref: '../../shared/responses/unauthorized.yml' | ||||||||||||||
|
||||||||||||||
'429': | ||||||||||||||
$ref: '../../shared/responses/too_many_requests.yml' | ||||||||||||||
|
||||||||||||||
'500': | ||||||||||||||
$ref: '../../shared/responses/server_error.yml' | ||||||||||||||
|
||||||||||||||
default: | ||||||||||||||
$ref: '../../shared/responses/unexpected_error.yml' | ||||||||||||||
|
||||||||||||||
x-codeSamples: | ||||||||||||||
- $ref: 'examples/curl/multiregistry_get_dockerCredentials.yml' | ||||||||||||||
- $ref: 'examples/python/registry_get_dockerCredentials.yml' | ||||||||||||||
|
||||||||||||||
security: | ||||||||||||||
- bearer_auth: | ||||||||||||||
- 'registry:read' | ||||||||||||||
- 'registry:update' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
description: The response will be a JSON object with the key `registry` | ||
containing information about your registry. | ||
|
||
headers: | ||
ratelimit-limit: | ||
$ref: '../../../shared/headers.yml#/ratelimit-limit' | ||
ratelimit-remaining: | ||
$ref: '../../../shared/headers.yml#/ratelimit-remaining' | ||
ratelimit-reset: | ||
$ref: '../../../shared/headers.yml#/ratelimit-reset' | ||
|
||
content: | ||
application/json: | ||
schema: | ||
properties: | ||
registries: | ||
type: array | ||
items: | ||
oneOf: | ||
- $ref: '../models/registry.yml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.