Conventions & catalog

Once you know the response envelope, the rest of the API is mostly knowing the names. Functions group into namespaces; common verbs repeat across namespaces with the same shape.

Naming#

Function names are <namespace>.<action>. Namespaces are singular and lowerCamelCase — deployment, serviceAccount, workloadIdentity. Actions are short verbs:

VerbShape
list(project[, location]){ items: […] }
get(project, …id fields) → the resource
create(project, …spec) → resource or empty
update(project, …id fields, …spec) → resource or empty
delete(project, …id fields) → empty

Resources scoped to a location (deployments, domains, routes, disks, pull secrets, workload identities) take both project and location on every call. Project-only resources (roles, service accounts, env groups, audit-log) take only project.

Partial updates#

Most update calls replace the whole resource — pass the full desired state. A few resources have a partial-update model because the full state would be unwieldy to re-state on every change. The biggest one is deployment.deploy:

  • env replaces all environment variables.
  • addEnv / removeEnv operate on top of the previous revision’s env.
  • envGroups replaces the list of group references.
  • addEnvGroups / removeEnvGroups operate on top of the previous list.

This same model could appear on other functions in the future; assume replace by default unless the schema explicitly has an add* / remove* pair.

Pagination#

List endpoints return all items in one response today. If your project grows beyond a thousand or so of any resource type, expect pagination tokens to appear in the response — they’ll be added compatibly.

Idempotency#

create calls are idempotent on their (project[, location], name): a second call with the same identifier and the same spec returns success without creating a duplicate. A second call with a different spec is treated as an update of the existing resource (so be careful — there’s no “create only if not exists” mode).

Function catalog#

The big picture. Each row is a fully-qualified API function.

Identity#

FunctionWhat it does
me.getCurrent user/service-account profile
me.authorizedCheck if a principal has a given permission

Workspace#

FunctionWhat it does
location.list / .getClusters available to you
project.list / .get / .create / .update / .deleteProject CRUD
project.usageMonth-to-date usage for one project

Deployments#

FunctionWhat it does
deployment.list / .getList or fetch deployments
deployment.deployCreate or update; rolls out a new revision
deployment.deleteDelete
deployment.pause / .resumeStop / restart without losing config
deployment.rollbackRe-apply an older revision as a new revision
deployment.revisionsHistory of revisions
deployment.metricsCPU / mem / requests / egress time-series

Routing#

FunctionWhat it does
domain.list / .get / .create / .deleteDomain CRUD
domain.purgeCacheCDN cache purge for a domain
route.list / .create / .createV2 / .deleteRoute CRUD
waf.list / .get / .set / .deleteFirewall zone CRUD
waf.metricsFirewall match counts over time

Storage and registry#

FunctionWhat it does
disk.list / .get / .create / .update / .deleteDisk CRUD
disk.metricsDisk usage time-series
registry.list / .deleteRepositories in the project
registry.getTags / .untagTag inspection and deletion
registry.getManifests / .deleteManifestManifest inspection and deletion
registry.metrics / .getProjectStorageStorage usage
pullSecret.list / .get / .create / .deletePull-secret CRUD

Access#

FunctionWhat it does
role.list / .get / .create / .deleteRole CRUD
role.bindSet the role list for a principal
role.usersWho has access to this project
role.permissionsThe catalog of permission strings
serviceAccount.list / .get / .create / .update / .deleteAccount CRUD
serviceAccount.createKey / .deleteKeyKey lifecycle
workloadIdentity.list / .get / .create / .deleteGCP federation CRUD
envGroup.list / .get / .create / .update / .deleteEnv group CRUD
auditLog.listAudit entries with filters

Billing#

FunctionWhat it does
billing.list / .get / .create / .update / .deleteBilling account CRUD
billing.projectSet the billing account on a project
billing.reportUsage rolled up over a date range
billing.listInvoices / .getInvoice / .downloadInvoiceInvoices
billing.uploadTransferSlipSubmit a bank-transfer receipt

Other#

FunctionWhat it does
email.listEmail domains attached to the project
dropbox.list / .metricsDropbox uploads (alpha)

Typed clients#

If you’re calling the API from Go, the github.com/deploys-app/api/client package wraps every function in a typed client — the same client the deploys CLI uses internally.

c := &client.Client{
    Auth: func(r *http.Request) {
        r.Header.Set("Authorization", "Bearer "+token)
    },
}
port := 8080
resp, err := c.Deployment().Deploy(ctx, &api.DeploymentDeploy{
    Project:  "acme",
    Location: "gke.cluster-rcf2",
    Name:     "web",
    Image:    "registry.deploys.app/acme/web:v2.4.1",
    Type:     api.DeploymentTypeWebService,
    Port:     &port,
})