SDKs
Python reference
yet-sdk-python, by product and by service, as its source has it.Settings
client.settings.workspace
def get() -> dictThe company: slug, name, open_join, apps_off, domains, mail_domains.
company = client.settings.workspace.get()
print(company["name"], company["domains"])def rename(name: str) -> NoneThe name its people see, on every app and at sign-in.
client.settings.workspace.rename("Acme")def set_open_join(open: bool) -> NoneWhether anyone at the company's domains may join by themselves.
client.settings.workspace.set_open_join(True)client.settings.people
def list() -> dictEveryone: ``people`` with a mailbox here, ``members`` who only sign in.
everyone = client.settings.people.list()
for person in everyone["people"]:
print(person["full_name"], person["email"])def get(id: str) -> dictOne person with a mailbox here, by id.
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) -> strSomeone 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.
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) -> NoneTheir name: on their sign-in, and on their mailbox.
client.settings.people.rename("acc_1", "Ana Costa")def set_runs_settings(id: str, on: bool) -> NoneWhether the person may open the company's Settings.
client.settings.people.set_runs_settings("acc_1", True)def set_password(id: str, password: str) -> NoneA new password; they use it the next time they sign in.
client.settings.people.set_password("acc_1", "a-longer-passphrase")def remove(id: str) -> NoneTheir sign-in, and their mailbox with all its mail. It cannot be undone.
client.settings.people.remove("acc_1")def invite(email: str) -> NoneA 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.
client.settings.people.invite("ana@acme.dev")def remove_member(email: str) -> NoneSomeone with no mailbox here, let go.
client.settings.people.remove_member("ops@acme.dev")client.settings.apps
def off() -> listThe apps the company's people do not see.
print(client.settings.apps.off())def set_off(off: list) -> NoneThese off, every other on.
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.
found = client.settings.domains.list()
for domain in found["domains"]:
print(domain["name"], domain["mail"])def claim(name: str) -> dictAsks for a domain: ``domain``, and the ``txt`` its root must say.
claim = client.settings.domains.claim("acme.dev")
print(claim["txt"])def verify(name: str) -> strMakes 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.
print(client.settings.domains.verify("acme.dev"))def cancel_claim(name: str) -> NoneGives up asking for a domain.
client.settings.domains.cancel_claim("acme.dev")def host_claim_in_cloud(name: str) -> dictThe asked-for domain's zone in the company's Cloud, with the nameservers to point it to: once it answers, it is shown.
hosted = client.settings.domains.host_claim_in_cloud("acme.dev")
print(hosted["zone"]["nameservers"])def enable_mail(name: str) -> listMail on for the domain: the mail server, SES, a mailbox for each of its people. What did not go as it should, as warnings.
warnings = client.settings.domains.enable_mail("acme.dev")
print(warnings)def health(name: str) -> dictA domain with mail as DNS and SES see it, the week's numbers, its Cloud zone.
health = client.settings.domains.health("acme.dev")
print(health["ses"]["state"], health["stats"]["delivered"])def register_ses(name: str) -> NoneThe domain registered in the SES it sends through — or finished there.
client.settings.domains.register_ses("acme.dev")def set_paused(name: str, paused: bool) -> NonePauses or resumes the domain's sending in its SES.
client.settings.domains.set_paused("acme.dev", True)def publish_dns(name: str) -> dictThe domain's mail records put in Cloud, its zone made first if need be.
published = client.settings.domains.publish_dns("acme.dev")
print(published["added"], published["fixed"])def remove(name: str) -> NoneA domain with mail off the mail server and out of the company — only one with nobody on it.
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).
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) -> NoneAnother address for the person, ``name@`` their own domain.
client.settings.addresses.add_alias("acme.dev", "acc_1", "contact")def remove_alias(domain: str, account_id: str, name: str) -> NoneOne of the person's other addresses taken away; their own stays.
client.settings.addresses.remove_alias("acme.dev", "acc_1", "contact")def set_catch_all(domain: str, address: Optional[str]) -> NoneWhere mail to addresses that do not exist goes; None turns it off.
client.settings.addresses.set_catch_all("acme.dev", "ana@acme.dev")def create_list(domain: str, name: str, recipients: list, description: Optional[str]=None) -> dictOne address that delivers to several. The list, with its ``id``.
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) -> dictOne of the company's lists, by id.
finance = client.settings.addresses.get_list("list_1")
print(finance["address"], finance["recipients"])def update_list(id: str, recipients: list, description: Optional[str]=None) -> NoneIts recipients, whole — and its description, when given.
client.settings.addresses.update_list("list_1", ["ana@acme.dev"])def delete_list(id: str) -> NoneOne of the company's lists removed, by id.
client.settings.addresses.delete_list("list_1")client.settings.sending
def get() -> dict``sending`` — ``"yet"`` or ``"own"`` — and ``ses_allowed``.
sending = client.settings.sending.get()
print(sending["sending"], sending["ses_allowed"])def set(sending: str) -> listThrough Yet's SES (``"yet"``) or the company's own (``"own"``); its domains move to it. What did not move, as warnings.
warnings = client.settings.sending.set("own")
print(warnings)client.settings.connections.github
def get() -> dictHow it is connected: through Yet's GitHub App, a token, or not at all.
github = client.settings.connections.github.get()
print(github["account"], github["connected"])def set_token(token: str) -> dictConnected with a token, in place of Yet's GitHub App if it was installed.
github = client.settings.connections.github.set_token("github_pat_11ACME0example")
print(github["connected"])def remove() -> NoneDisconnected: builds and runners from it stop.
client.settings.connections.github.remove()def install_url(return_to: str) -> strWhere a person installs Yet's GitHub App, coming back to ``return_to`` after.
url = client.settings.connections.github.install_url("https://acme.yet.com.br/cloud")
print(url.split("?")[0])def repositories() -> listThose the connection reaches, to build from.
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.
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) -> listChecked with AWS, kept sealed; the company's domains registered in its SES when it sends through its own. Warnings, if any.
warnings = client.settings.connections.aws.connect(
"us-east-1", "AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
)
print(warnings)def disconnect() -> NoneForgets the key: a company sending through its own SES stops sending.
client.settings.connections.aws.disconnect()client.settings.storage
def get() -> Optional[dict]Drive's ``bucket`` and ``prefix`` in the company's AWS, or None.
storage = client.settings.storage.get()
print(storage["bucket"], storage["prefix"])def set(bucket: str, prefix: str='') -> NoneChecked by writing to it once, with the company's AWS key.
client.settings.storage.set("acme-drive", "drive/")def remove() -> NoneDrive keeps the files itself again; the bucket keeps what is in it.
client.settings.storage.remove()client.settings.logo
def get() -> Optional[dict]``content_type`` and ``data`` (the image's bytes), or None for Yet's mark.
logo = client.settings.logo.get()
print(logo["content_type"], len(logo["data"]))def set(content_type: str, data: bytes) -> NoneA PNG, JPEG, WebP, GIF or SVG under 256 KB, for the sign-in page.
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() -> NoneYet's own mark on the sign-in page again.
client.settings.logo.remove()IAM
client.iam.access
def list() -> listEvery role given — everywhere (``"*"``) or in one environment.
for grant in client.iam.access.list():
print(grant["email"], grant["environment"], grant["role"])client.iam.keys
def list() -> listThe key's person's own keys.
for key in client.iam.keys.list():
print(key["name"], key["prefix"])def delete(id: str) -> NoneRevokes one of the person's own keys.
client.iam.keys.delete("key_1")def list_all() -> listEveryone's keys, for the company's admins.
for key in client.iam.keys.list_all():
print(key["email"], key["name"])def revoke(id: str) -> NoneRevokes anyone's key, for the company's admins.
client.iam.keys.revoke("key_1")client.iam.activity
def list() -> listWhat was done, by whom and from where — the latest first.
for event in client.iam.activity.list():
print(event["actor"], event["action"], event["target"])Cloud
client.cloud
def me() -> dictWho the key is in Cloud: their role, everywhere and by environment.
me = client.cloud.me()
print(me["email"], me["role"])def stacks() -> listEvery way a runtime can be.
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) -> dictA rack, for Cloud admins; for now a local one — aws and gcp are coming.
rack = client.cloud.racks.create("Home Rack")
print(rack["id"], rack["kind"])def update(id: str, *, name: Optional[str]=None, description: Optional[str]=None) -> dictIts name or its description.
client.cloud.racks.update("rk_1", description="The machines at the office")def list() -> listEvery one; of environments, those the key's person has a role in.
for rack in client.cloud.racks.list():
print(rack["name"], rack["kind"])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
rack = client.cloud.racks.get("rk_1")
print(rack["name"])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
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) -> dictA server waiting for its machine; on the company's only local rack, unless said.
server = client.cloud.servers.create("home-2", rack_id="rk_1")
print(server["id"], server["status"])def rename(id: str, name: str) -> dictIts name: lowercase letters, digits and dashes, up to 32.
server = client.cloud.servers.rename("srv_1", "home-1")
print(server["name"])def join(id: str) -> dictA one-time token, and the commands that run the agent with it: ``command`` (Linux), ``docker``, ``mac``, ``windows``.
join = client.cloud.servers.join("srv_2")
print(join["command"])def list() -> listEvery one; of environments, those the key's person has a role in.
for server in client.cloud.servers.list():
print(server["name"], server["status"])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
server = client.cloud.servers.get("srv_1")
print(server["os"], server["arch"], server["capacity"]["cpus"])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
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) -> dictA runtime of a stack on one of the company's servers, for Cloud admins.
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) -> dictIts name or its ingress — not while its tunnel is its ingress.
runtime = client.cloud.runtimes.update("rt_1", ingress="203.0.113.10")
print(runtime["ingress"])def open_tunnel(id: str) -> dictThe runtime behind a Cloudflare tunnel: its edge.
runtime = client.cloud.runtimes.open_tunnel("rt_1")
print(runtime["tunnel_id"], runtime["ingress"])def close_tunnel(id: str) -> dictIts tunnel taken away, hostnames and all.
runtime = client.cloud.runtimes.close_tunnel("rt_1")
print(repr(runtime["tunnel_id"]))def containers(id: str) -> listA Docker runtime's containers; a secret's value comes back empty.
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``.
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) -> dictThe whole definition, as on creation; a secret sent empty keeps its value.
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) -> dictOff, the agent takes it away — its definition kept, secrets and all.
container = client.cloud.runtimes.enable_container("rt_2", "ct_1", False)
print(container["disabled"])def delete_container(id: str, container: str) -> NoneThe container removed, its definition with it.
client.cloud.runtimes.delete_container("rt_2", "ct_1")def runners(id: str) -> listA native runtime's GitHub runners, and how each copy is.
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.
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) -> dictThe whole definition; no ``github_token`` keeps the one it has.
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) -> NoneThe runner removed from the runtime.
client.cloud.runtimes.delete_runner("rt_3", "rn_1")def list() -> listEvery one; of environments, those the key's person has a role in.
for runtime in client.cloud.runtimes.list():
print(runtime["name"], runtime["stack"])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
runtime = client.cloud.runtimes.get("rt_1")
print(runtime["server"], runtime["status"])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
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``.
pool = client.cloud.pools.create("home", color="teal", runtime_ids=["rt_1"])
print(pool["id"], pool["color"])def update(id: str, **fields) -> dictIts fields; ``runtime_ids``, when given, are all its members: the rest leave it.
pool = client.cloud.pools.update("pl_1", description="The machines at the office")
print(pool["description"])def open_tunnel(id: str) -> dictThe pool behind a Cloudflare tunnel of its own, for every member.
pool = client.cloud.pools.open_tunnel("pl_1")
print(pool["tunnel_id"])def close_tunnel(id: str) -> dictIts tunnel taken away: its hostnames, and its environments' records with them.
pool = client.cloud.pools.close_tunnel("pl_1")
print(repr(pool["tunnel_id"]))def list() -> listEvery one; of environments, those the key's person has a role in.
for pool in client.cloud.pools.list():
print(pool["name"], [member["name"] for member in pool["members"]])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
pool = client.cloud.pools.get("pl_1")
print(pool["name"], [env["name"] for env in pool["environments"]])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
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) -> dictOn ``runtime_id`` or ``pool_id``; ``color``, ``zone_id``, ``prefix``.
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) -> dictIts fields but its name; once deployed to, it moves only between a pool and its members.
env = client.cloud.environments.update("env_1", color="amber")
print(env["color"])def list() -> listEvery one; of environments, those the key's person has a role in.
for env in client.cloud.environments.list():
print(env["name"], env["domain"])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
env = client.cloud.environments.get("env_2")
print(env["name"], env["pool_id"])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
client.cloud.environments.delete("env_1")client.cloud.namespaces
Groups of applications: a product, a team.
def create(name: str) -> dictA namespace, for developers everywhere and admins.
namespace = client.cloud.namespaces.create("shop")
print(namespace["id"])def rename(id: str, name: str) -> dictIts name.
namespace = client.cloud.namespaces.rename("ns_1", "shop")
print(namespace["name"])def list() -> listEvery one; of environments, those the key's person has a role in.
for namespace in client.cloud.namespaces.list():
print(namespace["id"], namespace["name"])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
namespace = client.cloud.namespaces.get("ns_1")
print(namespace["name"])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
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``…
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) -> dictIts fields; a repository just picked, or another branch, is built as it is now.
app = client.cloud.applications.update("app_1", replicas=2)
print(app["replicas"])def release(id: str, image: str) -> dictA numbered release of an image, deployed to its first stage: ``{"release": …, "deployment": …}``.
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) -> listIts latest 50 releases, the newest first.
for release in client.cloud.applications.releases("app_1"):
print(release["number"], release["image"])def deploy(id: str, environment_id: str, release_id: str) -> dictA release, sent to an environment.
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) -> dictWhat runs in one stage, to the next.
deployment = client.cloud.applications.promote("app_1", "env_1")
print(deployment["environment_id"], deployment["release_id"])def build(id: str, build: str) -> dictOne build (``build``), and how each runtime ran it, with its log (``runs``).
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) -> dictIts branch built as it is now, without waiting for a push.
build = client.cloud.applications.build_now("app_1")
print(build["id"], build["status"])def resources(id: str) -> listIts own databases, and its environments' it is attached to (``attached_as``).
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) -> dictA database of its own, beside it on each stage; changed as any, in ``databases``.
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) -> NoneOne of its own databases removed; its volume stays on each server.
client.cloud.applications.delete_resource("app_1", "res_1")def attach(id: str, database_id: str, env_var: Optional[str]=None) -> dictOne of its environments' databases, handed to it on its stage there.
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) -> NoneAn environment's database taken away from it; the database stays.
client.cloud.applications.detach("app_1", "db_1")def open_session(id: str, kind: str, environment_id: str, pod: Optional[str]=None) -> dictIts ``logs`` as they come, or a ``shell``: ``{"id", "url"}`` — a WebSocket, good for a few minutes.
session = client.cloud.applications.open_session("app_1", "logs", "env_2")
print(session["url"].split("?")[0])def list() -> listEvery one; of environments, those the key's person has a role in.
for app in client.cloud.applications.list():
print(app["name"], app["repository"])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
app = client.cloud.applications.get("app_1")
print(app["namespace"], app["stages"])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
client.cloud.applications.delete("app_1")client.cloud.databases
Environments' databases: Overlite, Postgres or Redis.
def create(kind: str, name: str, environment_id: str) -> dictA database of a kind — overlite, postgres, redis — in an environment.
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``…
db = client.cloud.databases.update("db_1", memory_mb=1024)
print(db["memory_mb"])def backups(id: str) -> dictHow it is copied, and its copies (``backups``), the latest first.
backups = client.cloud.databases.backups("db_1")
print(backups["every"], backups["keep"], backups["backups"][0]["status"])def back_up(id: str) -> listA copy now — one per stage it runs on.
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) -> dictHow 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``.
backups = client.cloud.databases.set_backups("db_1", every=6, keep=14)
print(backups["every"], backups["keep"])def download_url(id: str, backup: str) -> strWhere one copy downloads from, for a few minutes.
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) -> dictA 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``.
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) -> dictA query run before, as it stands now.
query = client.cloud.databases.get_query("db_1", "q_1")
print(query["status"], query["result"]["rows"])def list() -> listEvery one; of environments, those the key's person has a role in.
for db in client.cloud.databases.list():
print(db["name"], db["kind"])def get(id: str) -> dictOne, by id; a NotFoundError when there is none.
db = client.cloud.databases.get("db_1")
print(db["name"], db["version"], db["environment"])def delete(id: str) -> NoneRemoves one; one still in use — a server runtimes run on — is a ConflictError.
client.cloud.databases.delete("db_1")client.cloud.dns
Domains whose records Cloud keeps.
def zones() -> listEvery zone, with how many records it has.
for zone in client.cloud.dns.zones():
print(zone["name"], zone["status"], zone["records"])def zone(id: str) -> dictThe zone (``zone``) and its records (``records``).
found = client.cloud.dns.zone("zn_1")
for record in found["records"]:
print(record["fqdn"], record["type"], record["values"])def create_zone(name: str) -> dictA zone for a domain, for Cloud admins; its registrar points at its ``nameservers``.
zone = client.cloud.dns.create_zone("acme.dev")
print(zone["status"], zone["nameservers"])def verify_zone(id: str) -> dictThe domain's nameservers asked again, now; the zone as it is then.
zone = client.cloud.dns.verify_zone("zn_1")
print(zone["status"])def delete_zone(id: str) -> NoneRemoves the zone and its records, for Cloud admins; only one no environment answers under.
client.cloud.dns.delete_zone("zn_1")def create_record(zone_id: str, name: str, type: str, values: list, ttl: int=0) -> dictA record in the zone, for developers everywhere; ``""`` or ``"@"`` is its root.
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) -> dictA record's TTL and values; one Cloud keeps itself, for an environment, is refused.
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) -> NoneA record removed; one Cloud keeps itself, for an environment, is refused.
client.cloud.dns.delete_record("zn_1", "rec_1")