Deploy a compute instanceexperimental
post
/v2/projects/{ref}/compute/{name}/deployCreates the compute instance if it does not exist, building from a context staged through the uploads endpoint. The build runs asynchronously: this answers 202 and the compute instance reaches build_state active or failed later.
This endpoint is currently in its Alpha stage.
OAuth scopes
- edge_functions:write
The fine-grained token must include the following permissions to access this endpoint:
- workers_write
Path parameters
- refRequiredstring
Project ref
- nameRequiredstring
Body
- dataRequiredobject
Response codes
- 202
- 401
- 403
- 429
Response (202)
{ "data": { "type": "project_compute_instance", "id": "hello-world", "attributes": { "spec": { "runtime": "node", "size": "2gb-1vcpu", "exposure": "public", "instances": 1 }, "build_state": "building", "secret_generation": "lorem", "state_reason": "lorem", "image_version": "lorem", "deleting": true, "instances": { "declared": -9007199254740991, "live": -9007199254740991, "ready": -9007199254740991, "stale": -9007199254740991 }, "instances_error": "lorem" } }}{ "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "type": "string", "description": "Resource type.", "enum": [ "project_compute_instance" ] }, "id": { "type": "string", "description": "Compute instance name.", "example": "hello-world" }, "attributes": { "type": "object", "properties": { "spec": { "type": "object", "properties": { "runtime": { "example": "node", "type": "string" }, "size": { "type": "string", "example": "2gb-1vcpu" }, "exposure": { "type": "string", "example": "public" }, "instances": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "example": 1 } }, "required": [ "size", "exposure", "instances" ] }, "build_state": { "type": "string", "enum": [ "building", "active", "failed" ] }, "secret_generation": { "type": "string" }, "state_reason": { "type": "string" }, "image_version": { "type": "string" }, "deleting": { "type": "boolean" }, "instances": { "type": "object", "properties": { "declared": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "live": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "ready": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "stale": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "declared", "live", "ready", "stale" ] }, "instances_error": { "type": "string" } }, "required": [ "spec", "build_state", "secret_generation" ] } }, "required": [ "type", "id", "attributes" ] } }, "required": [ "data" ]}