Palbase Machines
Palbase's machines module: a project's machines — isolated compute instances that run its backend. A machine runs an image of its project's own and answers at its own address under the app domain, where its requests are its customers' own (no API key is asked for there). A machine of a shared size is put to sleep when it is idle and woken by the next request, which waits for it; a dedicated one never sleeps. A change of image, size or port rolls out beside the version that serves. Emits machine.created, machine.updated and machine.deleted. A project's databases live here too: Postgres 18 of its own, reached from anywhere with TLS and a password at <name>-<ref>.db.<domain> — 5432 direct to Postgres, 6543 through the transaction pooler — with pgvector and PostGIS; a database of a free or hobby size is put to sleep when it is idle and woken by the next connection, the other sizes never sleep. Emits database.created, database.updated, database.deleted, database.undeleted, database.purged and database.password_changed; database.restoring as a restore is asked for, and database.restore_failed when one does not bring the database back to its moment (project_id, database, database_id, to, reason, then: latest, brought back to the latest moment of its backups instead; kept, it serves as it was; failed, it could not be brought back at all); and, once a month for a Free project — every environment's together, told to the environment of the database it was read from — of the hours its free and preview databases share, database.awake_hours_warning at 80% of them and database.awake_hours_spent as they are spent (project_id: that environment, studio_project: the Studio project whose hours they are, when it is of one, database: the free database it was read from, database_id, month, threshold, awake_hours: the project's free and preview databases' between them, every environment's, deleted ones too, awake_hours_limit, database_awake_hours: that database's own) — the same event, by its id, whenever it is delivered. A database on dedicated storage that does not grow automatically (or cannot now) emits database.storage_warning at 90% of its storage and database.storage_full as it is full and turns read-only — or as it is down, its disk filled before its storage (out_of_disk true; used_bytes is then its last reading; wal_stuck true when its data is well under its storage and write logs could not be archived) — (project_id, database, database_id, threshold, used_bytes, storage_bytes, storage_autoscaling, out_of_disk, wal_stuck) — once at each storage it holds.
The contract itself: /openapi/machines.openapi.json
Machines
/machinesList machinesPOST/machinesOpen a machineGET/machines/sizesList machine sizesGET/machines/networkGet where machines reach the internet fromGET/machines/{name}Read a machinePATCH/machines/{name}Change a machineDELETE/machines/{name}Delete a machineGET/machines/{name}/buildsList a machine's buildsPOST/machines/{name}/buildsBuild and roll out the branch's headGET/machines/{name}/previewsList a machine's previewsPUT/machines/{name}/previews/{pull_request}Open or update a platform's pull request previewDELETE/machines/{name}/previews/{pull_request}Close a platform's pull request previewGET/machines/{name}/domainsList a machine's domainsPOST/machines/{name}/domainsAdd a domain to a machinePATCH/machines/{name}/domains/{host}Set where a machine's domain redirectsDELETE/machines/{name}/domains/{host}Delete a machine's domainGET/machines/{name}/builds/{build}Read a buildGET/machines/{name}/builds/{build}/logRead a build's logPOST/machines/{name}/rollbackReturn to a buildGET/machines/{name}/logsRead what a machine wrotePOST/machines/{name}/execRun a command in a machineGET/machines/{name}/execsList the commands run in a machineGET/machines/{name}/metricsRead what a machine used over timeGET/machines/{name}/openapiRead a machine's API contractGET/machines/{name}/cronsList a machine's cronsGET/machines/{name}/crons/{cron}/runsList a cron's runsPOST/machines/{name}/crons/{cron}/runRun a cron nowPOST/machines/{name}/crons/{cron}/pausePause a cronPOST/machines/{name}/crons/{cron}/resumeResume a cronGET/machines/{name}/tasksList a machine's tasksPOST/machines/{name}/tasksPut a task on a machine's queueGET/machines/{name}/tasks/{task}Read a taskPOST/machines/{name}/tasks/{task}/cancelCancel a taskPOST/machines/{name}/tasks/{task}/retryTry a task againGET/machines/{name}/task-typesList a machine's task typesPOST/machines/{name}/test-usersMake test users with a template's dataPOST/machines/{name}/test-users/{user}/templates/{template}Write a template for a test userDELETE/machines/{name}/test-users/{user}Delete a test user made with a templatePOST/machines/{name}/previews/{pull_request}/authorizeAuthorize a fork's pull request's previewPOST/machines/{name}/previews/{pull_request}/openOpen a machine's pull request preview againPOST/machines/{name}/moveMove a machine to another environment of its projectPOST/machines/{name}/builds/{build}/cancelCancel a buildGET/machines/{name}/hooksList a machine's deploy hooksPOST/machines/{name}/hooksMake a machine deploy hookDELETE/machines/{name}/hooks/{hook}Delete a machine deploy hookGET/machines/github/detectTell what a repository's directory isGitHub
/machines/github/connectConnect GitHubGET/machines/github/installationsList installationsPOST/machines/github/installationsConnect an installationPOST/machines/github/installations/shareShare an installation of the organizationDELETE/machines/github/installations/{installation}Disconnect an installationGET/machines/github/repositoriesList repositoriesDatabases
/databasesList the databasesPOST/databasesOpen a databaseGET/databases/sizesList database sizesGET/databases/{name}Read a databasePATCH/databases/{name}Change a databaseDELETE/databases/{name}Delete a databasePOST/databases/{name}/undeleteTake a database backPOST/databases/{name}/purgePurge a deleted databaseGET/databases/{name}/credentialsHow to connect to a databasePOST/databases/{name}/passwordMake a password newPOST/databases/{name}/restoreBring a database back to a momentGET/databases/{name}/schemaRead a database's tablesGET/databases/{name}/metricsRead a database's usage over timePOST/databases/{name}/sqlRun a statement against a databasePOST/databases/{name}/moveMove a database to another environment of its projectSites
/sitesList sitesPOST/sitesOpen a siteGET/sites/{name}Get a sitePATCH/sites/{name}Change a siteDELETE/sites/{name}Delete a siteGET/sites/{name}/releasesList a site's releasesPOST/sites/{name}/releasesStart a releasePUT/sites/{name}/releases/{release}/files/{digest}Send a release's filePOST/sites/{name}/releases/{release}/finishFinish a releasePOST/sites/{name}/rollbackReturn to a releaseGET/sites/{name}/buildsList a site's buildsPOST/sites/{name}/buildsBuild a site nowGET/sites/{name}/previewsList a site's previewsGET/sites/{name}/domainsList a site's domainsPOST/sites/{name}/domainsAdd a domain to a sitePATCH/sites/{name}/domains/{host}Set where a site's domain redirectsDELETE/sites/{name}/domains/{host}Delete a site's domainGET/sites/{name}/builds/{build}Get a site's buildPOST/sites/{name}/previews/{pull_request}/authorizeAuthorize a fork's pull request's previewPOST/sites/{name}/moveMove a site to another environment of its projectPOST/sites/{name}/builds/{build}/cancelCancel a site's buildGET/sites/{name}/hooksList a site's deploy hooksPOST/sites/{name}/hooksMake a site deploy hookDELETE/sites/{name}/hooks/{hook}Delete a site deploy hookPOST/sites/{name}/previews/passGive a member a pass to a previewGET/sites/{name}/previews/linksList a site's share linksPOST/sites/{name}/previews/linksMake a share link of a site's previewsDELETE/sites/{name}/previews/links/{link}Delete a share link