Run a project action
RunProjectActionOne project action: start, stop or restart services, recreate one, back up, restore, cancel an operation, change the source or a database's size, delete an undeclared volume or the project. Recreate, back up, restore, set_database_size, delete and set_source's deploy run as operations (operation_id), waited for (wait_seconds), as is the end of a cancelled one; the others are done on return. Answers with the project as it then is. With no services, start_services starts those with a container and restart_services the running ones. restore_snapshot takes the project's own snapshots only: a deleted app's data in a shared database is in that database's snapshots. A database's snapshot as a new database beside it is CreateDatabase's, with from_snapshot_id.
delete_project: a final backup while backups are on, then containers, volumes, files, hosts, logs, and an app's user and database of its own in a shared database, data and all. Snapshots stay (GetMachine.deleted_projects), and restoring one brings the project back, source included; with backups off there is none, and it is gone for good. The databases it was linked to stay: delete each with its own delete_project.
set_database_size gives a database another of its engine's sizes (Machine.database_engines; its size now is Project.database.memory_limit_bytes): the machine writes its compose.yaml anew for that size, with the settings that follow from it, so never edit them by hand, and with the image it runs and the other flags of its command as they were written, a server setting added or changed there included; what else was written there goes. The database restarts, and its apps lose their connections for a few seconds: one that does not connect again shows as restarting (GetMachine). A size changes nothing on the bill: a smaller one only leaves memory to the other projects. A Valkey whose data is more than the size keeps (its maxmemory, 70 % of the size) is refused before anything changes, and the refusal gives both figures: FAILED_PRECONDITION + DatabaseSizeRefusal, as for a Valkey that does not answer now, asked to shrink, and a database whose data is in another volume than the one the file names. FAILED_PRECONDITION alone = the project is no database. INVALID_ARGUMENT = a size its engine does not offer (the message lists them).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "RunProjectAction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| back_up | No | Backs up the directory and volumes now, live. An operation. FAILED_PRECONDITION = backups off (Machine.backups_enabled). | |
| workspace | No | The workspace: its id or name (ListWorkspaces). Omit when the account has one. | |
| project_id | No | ||
| set_source | No | Changes the source. To files: keeps the current files. To github: only the fields set change, e.g. {github: {auto_deploy: true}} follows pushes again; from files, repository is required. Deploys the newest commit if auto_deploy is on and the files are not at it. FAILED_PRECONDITION = as CreateProject. Where the files come from (THE PROJECT IS ITS DIRECTORY). At most one of files, github. | |
| operation_id | No | As DeployProject's. | |
| wait_seconds | No | As DeployProject's. | |
| delete_volume | No | A volume compose.yaml no longer declares (Volume.declared false). Its data then lives only in snapshots. FAILED_PRECONDITION = declared or in use. | |
| stop_services | No | Stops services, each with its grace period. A machine restart may start them, per restart policy. | |
| delete_project | No | An operation: RunProjectAction's description says what goes and what stays. | |
| start_services | No | Starts stopped services and reruns jobs, not their dependencies. FAILED_PRECONDITION = no container yet (deploy or recreate_service), or a published machine port is taken. | |
| cancel_operation | No | Stops a running or starting operation: it ends CANCELLED, leaving what a failure would; one only starting answers CANCELLED from its own call. FAILED_PRECONDITION = a delete past its final backup. | |
| recreate_service | No | A new container: a fresh filesystem outside volumes. An operation. | |
| restart_services | No | Restarts processes in the same containers. Codes as start_services. | |
| restore_snapshot | No | From a snapshot of this project. An operation. | |
| set_database_size | No | A database's size. An operation: it restarts. |