SDKs

Python reference

Every method of yet-sdk-python, by product and by service, as its source has it.

Settings

client.settings.workspace

def get() -> dict

The company: slug, name, open_join, apps_off, domains, mail_domains.

Example
company = client.settings.workspace.get()
print(company["name"], company["domains"])
def rename(name: str) -> None

The name its people see, on every app and at sign-in.

Example
client.settings.workspace.rename("Acme")
def set_open_join(open: bool) -> None

Whether anyone at the company's domains may join by themselves.

Example
client.settings.workspace.set_open_join(True)

client.settings.people

def list() -> dict

Everyone: ``people`` with a mailbox here, ``members`` who only sign in.

Example
everyone = client.settings.people.list()
for person in everyone["people"]:
    print(person["full_name"], person["email"])
def get(id: str) -> dict

One person with a mailbox here, by id.

Example
ana = client.settings.people.get("acc_1")
print(ana["email"], ana["runs_settings"])
def add(*, via: str, full_name: str='', email: str='', password: Optional[str]=None, mailbox: Optional[str]=None, domains: Optional[list]=None, runs_settings: bool=False) -> str

Someone new: invited (``via="invite"``) or given a password now (``via="password"``); with a mailbox here — ``mailbox`` at the first of ``domains``, an alias at each of the others — or none. The address they sign in with.

Example
email = client.settings.people.add(
    via="password",
    full_name="Ana Costa",
    password="correct-horse-battery",
    mailbox="ana",
    domains=["acme.dev"],
)
print(email)
def rename(id: str, full_name: str) -> None

Their name: on their sign-in, and on their mailbox.

Example
client.settings.people.rename("acc_1", "Ana Costa")
def set_runs_settings(id: str, on: bool) -> None

Whether the person may open the company's Settings.

Example
client.settings.people.set_runs_settings("acc_1", True)
def set_password(id: str, password: str) -> None

A new password; they use it the next time they sign in.

Example
client.settings.people.set_password("acc_1", "a-longer-passphrase")
def remove(id: str) -> None

Their sign-in, and their mailbox with all its mail. It cannot be undone.

Example
client.settings.people.remove("acc_1")
def invite(email: str) -> None

A link to join, for a day, to someone at one of the company's domains. ``add(via="invite")`` invites at any address, with a mailbox or not.

Example
client.settings.people.invite("ana@acme.dev")
def remove_member(email: str) -> None

Someone with no mailbox here, let go.

Example
client.settings.people.remove_member("ops@acme.dev")

client.settings.apps

def off() -> list

The apps the company's people do not see.

Example
print(client.settings.apps.off())
def set_off(off: list) -> None

These off, every other on.

Example
client.settings.apps.set_off(["agile", "vault"])

client.settings.domains

def list() -> dict

``domains`` — the company's, each ``name`` and ``mail`` — and ``claims``, those asked for whose DNS has not shown them yet.

Example
found = client.settings.domains.list()
for domain in found["domains"]:
    print(domain["name"], domain["mail"])
def claim(name: str) -> dict

Asks for a domain: ``domain``, and the ``txt`` its root must say.

Example
claim = client.settings.domains.claim("acme.dev")
print(claim["txt"])
def verify(name: str) -> str

Makes an asked-for domain the company's once its DNS shows it — the TXT, or its zone in the company's Cloud answering: ``"txt"`` or ``"cloud"``. Not shown yet is a ConflictError.

Example
print(client.settings.domains.verify("acme.dev"))
def cancel_claim(name: str) -> None

Gives up asking for a domain.

Example
client.settings.domains.cancel_claim("acme.dev")
def host_claim_in_cloud(name: str) -> dict

The asked-for domain's zone in the company's Cloud, with the nameservers to point it to: once it answers, it is shown.

Example
hosted = client.settings.domains.host_claim_in_cloud("acme.dev")
print(hosted["zone"]["nameservers"])
def enable_mail(name: str) -> list

Mail on for the domain: the mail server, SES, a mailbox for each of its people. What did not go as it should, as warnings.

Example
warnings = client.settings.domains.enable_mail("acme.dev")
print(warnings)
def health(name: str) -> dict

A domain with mail as DNS and SES see it, the week's numbers, its Cloud zone.

Example
health = client.settings.domains.health("acme.dev")
print(health["ses"]["state"], health["stats"]["delivered"])
def register_ses(name: str) -> None

The domain registered in the SES it sends through — or finished there.

Example
client.settings.domains.register_ses("acme.dev")
def set_paused(name: str, paused: bool) -> None

Pauses or resumes the domain's sending in its SES.

Example
client.settings.domains.set_paused("acme.dev", True)
def publish_dns(name: str) -> dict

The domain's mail records put in Cloud, its zone made first if need be.

Example
published = client.settings.domains.publish_dns("acme.dev")
print(published["added"], published["fixed"])
def remove(name: str) -> None

A domain with mail off the mail server and out of the company — only one with nobody on it.

Example
client.settings.domains.remove("acme.dev")

client.settings.addresses

A domain's addresses that are not a person: aliases, lists, the catch-all.

def get(domain: str) -> dict

``aliases``, ``lists`` and ``catch_all`` (None: mail to nobody bounces).

Example
addresses = client.settings.addresses.get("acme.dev")
for alias in addresses["aliases"]:
    print(alias["address"], "->", alias["owner"])
def add_alias(domain: str, account_id: str, name: str) -> None

Another address for the person, ``name@`` their own domain.

Example
client.settings.addresses.add_alias("acme.dev", "acc_1", "contact")
def remove_alias(domain: str, account_id: str, name: str) -> None

One of the person's other addresses taken away; their own stays.

Example
client.settings.addresses.remove_alias("acme.dev", "acc_1", "contact")
def set_catch_all(domain: str, address: Optional[str]) -> None

Where mail to addresses that do not exist goes; None turns it off.

Example
client.settings.addresses.set_catch_all("acme.dev", "ana@acme.dev")
def create_list(domain: str, name: str, recipients: list, description: Optional[str]=None) -> dict

One address that delivers to several. The list, with its ``id``.

Example
finance = client.settings.addresses.create_list(
    "acme.dev", "finance", ["ana@acme.dev"], description="Invoices and payments"
)
print(finance["id"], finance["address"])
def get_list(id: str) -> dict

One of the company's lists, by id.

Example
finance = client.settings.addresses.get_list("list_1")
print(finance["address"], finance["recipients"])
def update_list(id: str, recipients: list, description: Optional[str]=None) -> None

Its recipients, whole — and its description, when given.

Example
client.settings.addresses.update_list("list_1", ["ana@acme.dev"])
def delete_list(id: str) -> None

One of the company's lists removed, by id.

Example
client.settings.addresses.delete_list("list_1")

client.settings.sending

def get() -> dict

``sending`` — ``"yet"`` or ``"own"`` — and ``ses_allowed``.

Example
sending = client.settings.sending.get()
print(sending["sending"], sending["ses_allowed"])
def set(sending: str) -> list

Through Yet's SES (``"yet"``) or the company's own (``"own"``); its domains move to it. What did not move, as warnings.

Example
warnings = client.settings.sending.set("own")
print(warnings)

client.settings.connections.github

def get() -> dict

How it is connected: through Yet's GitHub App, a token, or not at all.

Example
github = client.settings.connections.github.get()
print(github["account"], github["connected"])
def set_token(token: str) -> dict

Connected with a token, in place of Yet's GitHub App if it was installed.

Example
github = client.settings.connections.github.set_token("github_pat_11ACME0example")
print(github["connected"])
def remove() -> None

Disconnected: builds and runners from it stop.

Example
client.settings.connections.github.remove()
def install_url(return_to: str) -> str

Where a person installs Yet's GitHub App, coming back to ``return_to`` after.

Example
url = client.settings.connections.github.install_url("https://acme.yet.com.br/cloud")
print(url.split("?")[0])
def repositories() -> list

Those the connection reaches, to build from.

Example
for repo in client.settings.connections.github.repositories():
    print(repo["full_name"], repo["default_branch"])

client.settings.connections.aws

def get() -> Optional[dict]

The key connected — ``region``, ``access_key_id``, never the secret — or None.

Example
aws = client.settings.connections.aws.get()
print(aws["region"], aws["access_key_id"])
def connect(region: str, access_key_id: str, secret_access_key: str) -> list

Checked with AWS, kept sealed; the company's domains registered in its SES when it sends through its own. Warnings, if any.

Example
warnings = client.settings.connections.aws.connect(
    "us-east-1", "AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
)
print(warnings)
def disconnect() -> None

Forgets the key: a company sending through its own SES stops sending.

Example
client.settings.connections.aws.disconnect()

client.settings.storage

def get() -> Optional[dict]

Drive's ``bucket`` and ``prefix`` in the company's AWS, or None.

Example
storage = client.settings.storage.get()
print(storage["bucket"], storage["prefix"])
def set(bucket: str, prefix: str='') -> None

Checked by writing to it once, with the company's AWS key.

Example
client.settings.storage.set("acme-drive", "drive/")
def remove() -> None

Drive keeps the files itself again; the bucket keeps what is in it.

Example
client.settings.storage.remove()
def get() -> Optional[dict]

``content_type`` and ``data`` (the image's bytes), or None for Yet's mark.

Example
logo = client.settings.logo.get()
print(logo["content_type"], len(logo["data"]))
def set(content_type: str, data: bytes) -> None

A PNG, JPEG, WebP, GIF or SVG under 256 KB, for the sign-in page.

Example
svg = b'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"/>'
client.settings.logo.set("image/svg+xml", svg)
def remove() -> None

Yet's own mark on the sign-in page again.

Example
client.settings.logo.remove()

IAM

client.iam.access

def list() -> list

Every role given — everywhere (``"*"``) or in one environment.

Example
for grant in client.iam.access.list():
    print(grant["email"], grant["environment"], grant["role"])

client.iam.keys

def list() -> list

The key's person's own keys.

Example
for key in client.iam.keys.list():
    print(key["name"], key["prefix"])
def delete(id: str) -> None

Revokes one of the person's own keys.

Example
client.iam.keys.delete("key_1")
def list_all() -> list

Everyone's keys, for the company's admins.

Example
for key in client.iam.keys.list_all():
    print(key["email"], key["name"])
def revoke(id: str) -> None

Revokes anyone's key, for the company's admins.

Example
client.iam.keys.revoke("key_1")

client.iam.activity

def list() -> list

What was done, by whom and from where — the latest first.

Example
for event in client.iam.activity.list():
    print(event["actor"], event["action"], event["target"])

Cloud

client.cloud

def me() -> dict

Who the key is in Cloud: their role, everywhere and by environment.

Example
me = client.cloud.me()
print(me["email"], me["role"])
def stacks() -> list

Every way a runtime can be.

Example
for stack in client.cloud.stacks():
    if stack["available"]:
        print(stack["id"])

client.cloud.racks

Where servers and runtimes belong: the company's ``local`` machines, or what Cloud runs in an AWS account or a GCP project — the clouds themselves are connected under Connections.

def create(name: str, kind: str='local', description: Optional[str]=None) -> dict

A rack, for Cloud admins; for now a local one — aws and gcp are coming.

Example
rack = client.cloud.racks.create("Home Rack")
print(rack["id"], rack["kind"])
def update(id: str, *, name: Optional[str]=None, description: Optional[str]=None) -> dict

Its name or its description.

Example
client.cloud.racks.update("rk_1", description="The machines at the office")
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for rack in client.cloud.racks.list():
    print(rack["name"], rack["kind"])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
rack = client.cloud.racks.get("rk_1")
print(rack["name"])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.racks.delete("rk_1")

client.cloud.servers

Machines of a local rack, which yet's agent runs on.

def create(name: str, rack_id: Optional[str]=None) -> dict

A server waiting for its machine; on the company's only local rack, unless said.

Example
server = client.cloud.servers.create("home-2", rack_id="rk_1")
print(server["id"], server["status"])
def rename(id: str, name: str) -> dict

Its name: lowercase letters, digits and dashes, up to 32.

Example
server = client.cloud.servers.rename("srv_1", "home-1")
print(server["name"])
def join(id: str) -> dict

A one-time token, and the commands that run the agent with it: ``command`` (Linux), ``docker``, ``mac``, ``windows``.

Example
join = client.cloud.servers.join("srv_2")
print(join["command"])
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for server in client.cloud.servers.list():
    print(server["name"], server["status"])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
server = client.cloud.servers.get("srv_1")
print(server["os"], server["arch"], server["capacity"]["cpus"])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.servers.delete("srv_1")

client.cloud.runtimes

How things run on a server: k3s, Docker, or native.

def create(name: str, stack: str, server_id: str) -> dict

A runtime of a stack on one of the company's servers, for Cloud admins.

Example
runtime = client.cloud.runtimes.create("home-k3s", "local:traefik+k3s", "srv_1")
print(runtime["id"], runtime["kind"])
def update(id: str, *, name: Optional[str]=None, ingress: Optional[str]=None) -> dict

Its name or its ingress — not while its tunnel is its ingress.

Example
runtime = client.cloud.runtimes.update("rt_1", ingress="203.0.113.10")
print(runtime["ingress"])
def open_tunnel(id: str) -> dict

The runtime behind a Cloudflare tunnel: its edge.

Example
runtime = client.cloud.runtimes.open_tunnel("rt_1")
print(runtime["tunnel_id"], runtime["ingress"])
def close_tunnel(id: str) -> dict

Its tunnel taken away, hostnames and all.

Example
runtime = client.cloud.runtimes.close_tunnel("rt_1")
print(repr(runtime["tunnel_id"]))
def containers(id: str) -> list

A Docker runtime's containers; a secret's value comes back empty.

Example
for container in client.cloud.runtimes.containers("rt_2"):
    print(container["name"], container["image"], container["state"])
def create_container(id: str, name: str, image: str, **fields) -> dict

``command``, ``env`` (``[{"name", "value", "secret"}]``), ``privileged``, ``volumes`` (``"name:/path"``), ``replicas``.

Example
container = client.cloud.runtimes.create_container(
    "rt_2",
    "dind",
    "docker:27-dind",
    privileged=True,
    volumes=["dind-data:/var/lib/docker"],
)
print(container["id"], container["replicas"])
def update_container(id: str, container: str, name: str, image: str, **fields) -> dict

The whole definition, as on creation; a secret sent empty keeps its value.

Example
container = client.cloud.runtimes.update_container(
    "rt_2", "ct_1", "dind", "docker:27-dind", privileged=True, replicas=2
)
print(container["replicas"])
def enable_container(id: str, container: str, enabled: bool) -> dict

Off, the agent takes it away — its definition kept, secrets and all.

Example
container = client.cloud.runtimes.enable_container("rt_2", "ct_1", False)
print(container["disabled"])
def delete_container(id: str, container: str) -> None

The container removed, its definition with it.

Example
client.cloud.runtimes.delete_container("rt_2", "ct_1")
def runners(id: str) -> list

A native runtime's GitHub runners, and how each copy is.

Example
for runner in client.cloud.runtimes.runners("rt_3"):
    print(runner["name"], [copy["state"] for copy in runner["copies"]])
def create_runner(id: str, name: str, url: str, replicas: int=1, **fields) -> dict

``labels``, ``disabled``, ``github_token`` — its own; the company's GitHub connection's without one.

Example
runner = client.cloud.runtimes.create_runner(
    "rt_3", "macos", "https://github.com/acme", labels=["xcode"]
)
print(runner["id"], runner["labels"])
def update_runner(id: str, runner: str, name: str, url: str, replicas: int=1, **fields) -> dict

The whole definition; no ``github_token`` keeps the one it has.

Example
runner = client.cloud.runtimes.update_runner(
    "rt_3", "rn_1", "macos", "https://github.com/acme", replicas=2, labels=["xcode"]
)
print(runner["replicas"])
def delete_runner(id: str, runner: str) -> None

The runner removed from the runtime.

Example
client.cloud.runtimes.delete_runner("rt_3", "rn_1")
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for runtime in client.cloud.runtimes.list():
    print(runtime["name"], runtime["stack"])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
runtime = client.cloud.runtimes.get("rt_1")
print(runtime["server"], runtime["status"])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.runtimes.delete("rt_1")

client.cloud.pools

Runtimes that run the same environments together.

def create(name: str, **fields) -> dict

``description``, ``color``, ``runtime_ids``, ``move``.

Example
pool = client.cloud.pools.create("home", color="teal", runtime_ids=["rt_1"])
print(pool["id"], pool["color"])
def update(id: str, **fields) -> dict

Its fields; ``runtime_ids``, when given, are all its members: the rest leave it.

Example
pool = client.cloud.pools.update("pl_1", description="The machines at the office")
print(pool["description"])
def open_tunnel(id: str) -> dict

The pool behind a Cloudflare tunnel of its own, for every member.

Example
pool = client.cloud.pools.open_tunnel("pl_1")
print(pool["tunnel_id"])
def close_tunnel(id: str) -> dict

Its tunnel taken away: its hostnames, and its environments' records with them.

Example
pool = client.cloud.pools.close_tunnel("pl_1")
print(repr(pool["tunnel_id"]))
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for pool in client.cloud.pools.list():
    print(pool["name"], [member["name"] for member in pool["members"]])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
pool = client.cloud.pools.get("pl_1")
print(pool["name"], [env["name"] for env in pool["environments"]])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.pools.delete("pl_1")

client.cloud.environments

Where a stage of the company's applications runs, and the domain it answers at.

def create(name: str, **fields) -> dict

On ``runtime_id`` or ``pool_id``; ``color``, ``zone_id``, ``prefix``.

Example
env = client.cloud.environments.create(
    "staging", pool_id="pl_1", zone_id="zn_1", prefix="staging", color="amber"
)
print(env["id"], env["domain"])
def update(id: str, **fields) -> dict

Its fields but its name; once deployed to, it moves only between a pool and its members.

Example
env = client.cloud.environments.update("env_1", color="amber")
print(env["color"])
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for env in client.cloud.environments.list():
    print(env["name"], env["domain"])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
env = client.cloud.environments.get("env_2")
print(env["name"], env["pool_id"])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.environments.delete("env_1")

client.cloud.namespaces

Groups of applications: a product, a team.

def create(name: str) -> dict

A namespace, for developers everywhere and admins.

Example
namespace = client.cloud.namespaces.create("shop")
print(namespace["id"])
def rename(id: str, name: str) -> dict

Its name.

Example
namespace = client.cloud.namespaces.rename("ns_1", "shop")
print(namespace["name"])
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for namespace in client.cloud.namespaces.list():
    print(namespace["id"], namespace["name"])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
namespace = client.cloud.namespaces.get("ns_1")
print(namespace["name"])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.namespaces.delete("ns_1")

client.cloud.applications

What the company runs, through its stages.

def create(namespace_id: str, name: str, stages: list, **fields) -> dict

``repository``, ``branch``, ``port``, ``replicas``, ``env``, ``stage_env``, ``subdomain``, ``auto_promote``…

Example
app = client.cloud.applications.create(
    "ns_1",
    "storefront",
    ["env_1", "env_2"],
    repository="acme/storefront",
    branch="main",
    port=3000,
)
print(app["id"])
def update(id: str, **fields) -> dict

Its fields; a repository just picked, or another branch, is built as it is now.

Example
app = client.cloud.applications.update("app_1", replicas=2)
print(app["replicas"])
def release(id: str, image: str) -> dict

A numbered release of an image, deployed to its first stage: ``{"release": …, "deployment": …}``.

Example
made = client.cloud.applications.release("app_1", "ghcr.io/acme/storefront:1.4.0")
print(made["release"]["number"], made["deployment"]["status"])
def releases(id: str) -> list

Its latest 50 releases, the newest first.

Example
for release in client.cloud.applications.releases("app_1"):
    print(release["number"], release["image"])
def deploy(id: str, environment_id: str, release_id: str) -> dict

A release, sent to an environment.

Example
deployment = client.cloud.applications.deploy("app_1", "env_2", "rel_1")
print(deployment["environment_id"], deployment["status"])
def promote(id: str, from_environment_id: str) -> dict

What runs in one stage, to the next.

Example
deployment = client.cloud.applications.promote("app_1", "env_1")
print(deployment["environment_id"], deployment["release_id"])
def build(id: str, build: str) -> dict

One build (``build``), and how each runtime ran it, with its log (``runs``).

Example
build = client.cloud.applications.build("app_1", "bd_1")
print(build["build"]["status"], [run["status"] for run in build["runs"]])
def build_now(id: str) -> dict

Its branch built as it is now, without waiting for a push.

Example
build = client.cloud.applications.build_now("app_1")
print(build["id"], build["status"])
def resources(id: str) -> list

Its own databases, and its environments' it is attached to (``attached_as``).

Example
for db in client.cloud.applications.resources("app_1"):
    print(db["name"], db["kind"], db.get("attached_as", db["env_var"]))
def create_resource(id: str, kind: str, env_var: Optional[str]=None, placement: Optional[str]=None) -> dict

A database of its own, beside it on each stage; changed as any, in ``databases``.

Example
db = client.cloud.applications.create_resource(
    "app_1", "overlite", env_var="DATABASE_URL"
)
print(db["id"], db["kind"])
def delete_resource(id: str, resource: str) -> None

One of its own databases removed; its volume stays on each server.

Example
client.cloud.applications.delete_resource("app_1", "res_1")
def attach(id: str, database_id: str, env_var: Optional[str]=None) -> dict

One of its environments' databases, handed to it on its stage there.

Example
db = client.cloud.applications.attach("app_1", "db_1", env_var="ORDERS_URL")
print(db["name"], db["attached_as"])
def detach(id: str, database_id: str) -> None

An environment's database taken away from it; the database stays.

Example
client.cloud.applications.detach("app_1", "db_1")
def open_session(id: str, kind: str, environment_id: str, pod: Optional[str]=None) -> dict

Its ``logs`` as they come, or a ``shell``: ``{"id", "url"}`` — a WebSocket, good for a few minutes.

Example
session = client.cloud.applications.open_session("app_1", "logs", "env_2")
print(session["url"].split("?")[0])
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for app in client.cloud.applications.list():
    print(app["name"], app["repository"])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
app = client.cloud.applications.get("app_1")
print(app["namespace"], app["stages"])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.applications.delete("app_1")

client.cloud.databases

Environments' databases: Overlite, Postgres or Redis.

def create(kind: str, name: str, environment_id: str) -> dict

A database of a kind — overlite, postgres, redis — in an environment.

Example
db = client.cloud.databases.create("postgres", "orders", "env_1")
print(db["id"], db["kind"])
def update(id: str, **fields) -> dict

``name``, ``version``, ``memory_mb``, ``stopped``, ``features``…

Example
db = client.cloud.databases.update("db_1", memory_mb=1024)
print(db["memory_mb"])
def backups(id: str) -> dict

How it is copied, and its copies (``backups``), the latest first.

Example
backups = client.cloud.databases.backups("db_1")
print(backups["every"], backups["keep"], backups["backups"][0]["status"])
def back_up(id: str) -> list

A copy now — one per stage it runs on.

Example
for backup in client.cloud.databases.back_up("db_1"):
    print(backup["id"], backup["status"])
def set_backups(id: str, *, every: Optional[int]=None, keep: Optional[int]=None, target: Optional[str]=None, company: Optional[dict]=None) -> dict

How it is copied: every so many hours (0 is never), how many kept, and where — yet's bucket (``""``) or the company's (``"company"``, with ``company``: ``region``, ``access_key_id``, ``secret_access_key``, ``bucket``, ``prefix``). Answers as ``backups``.

Example
backups = client.cloud.databases.set_backups("db_1", every=6, keep=14)
print(backups["every"], backups["keep"])
def download_url(id: str, backup: str) -> str

Where one copy downloads from, for a few minutes.

Example
url = client.cloud.databases.download_url("db_1", "bk_1")
print(url.split("?")[0])
def query(id: str, statement: str, environment_id: Optional[str]=None) -> dict

A statement, run where it runs — an application's own database on its last stage, unless said. One still ``running`` is asked for again with ``get_query``.

Example
query = client.cloud.databases.query("db_1", "SELECT count(*) FROM orders", "env_1")
print(query["id"], query["status"])
def get_query(id: str, query: str) -> dict

A query run before, as it stands now.

Example
query = client.cloud.databases.get_query("db_1", "q_1")
print(query["status"], query["result"]["rows"])
def list() -> list

Every one; of environments, those the key's person has a role in.

Example
for db in client.cloud.databases.list():
    print(db["name"], db["kind"])
def get(id: str) -> dict

One, by id; a NotFoundError when there is none.

Example
db = client.cloud.databases.get("db_1")
print(db["name"], db["version"], db["environment"])
def delete(id: str) -> None

Removes one; one still in use — a server runtimes run on — is a ConflictError.

Example
client.cloud.databases.delete("db_1")

client.cloud.dns

Domains whose records Cloud keeps.

def zones() -> list

Every zone, with how many records it has.

Example
for zone in client.cloud.dns.zones():
    print(zone["name"], zone["status"], zone["records"])
def zone(id: str) -> dict

The zone (``zone``) and its records (``records``).

Example
found = client.cloud.dns.zone("zn_1")
for record in found["records"]:
    print(record["fqdn"], record["type"], record["values"])
def create_zone(name: str) -> dict

A zone for a domain, for Cloud admins; its registrar points at its ``nameservers``.

Example
zone = client.cloud.dns.create_zone("acme.dev")
print(zone["status"], zone["nameservers"])
def verify_zone(id: str) -> dict

The domain's nameservers asked again, now; the zone as it is then.

Example
zone = client.cloud.dns.verify_zone("zn_1")
print(zone["status"])
def delete_zone(id: str) -> None

Removes the zone and its records, for Cloud admins; only one no environment answers under.

Example
client.cloud.dns.delete_zone("zn_1")
def create_record(zone_id: str, name: str, type: str, values: list, ttl: int=0) -> dict

A record in the zone, for developers everywhere; ``""`` or ``"@"`` is its root.

Example
record = client.cloud.dns.create_record("zn_1", "www", "CNAME", ["acme.dev."], ttl=3600)
print(record["id"], record["fqdn"])
def update_record(zone_id: str, id: str, values: list, ttl: int=0) -> dict

A record's TTL and values; one Cloud keeps itself, for an environment, is refused.

Example
record = client.cloud.dns.update_record("zn_1", "rec_1", ["acme.dev."], ttl=300)
print(record["ttl"])
def delete_record(zone_id: str, id: str) -> None

A record removed; one Cloud keeps itself, for an environment, is refused.

Example
client.cloud.dns.delete_record("zn_1", "rec_1")