pydo.registry.validate_name()

Description

To validate that a container registry name is available for use, send a POST request to /v2/registry/validate-name.

If the name is both formatted correctly and available, the response code will be 204 and contain no body. If the name is already in use, the response will be a 409 Conflict.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "example"
}

resp = client.registry.validate_name(body=req)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

The action was successful and the response body is empty.

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

Conflict

Click to expand an example response.
{
  "id": "conflict",
  "message": "The request could not be completed due to a conflict."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}