创建部署
POST /application/v1/workers/{worker_id}/deployments
Deploy one version to serve the Worker. Unlike Cloudflare, a deployment holds exactly one version at 100 percent (no gradual rollout), so strategy must be percentage. Deployment is asynchronous; poll the deployment until praxis.status is active or failed.
支持状态: supported
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
请求体 (application/json)
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| strategy | string | Rollout strategy. |
| versions | array<object> | Exactly one version at 100 percent. |
| versions[].version_id | string | Version to deploy. |
| versions[].percentage | number | Must be 100. |
| force | boolean | Own face only; on the compatible face use the force query parameter. |
| annotations | object | Free-form annotations. |
| annotations.workers/message | string | Deployment message. |
{ "type": "object", "required": [ "strategy", "versions" ], "properties": { "strategy": { "type": "string", "description": "Rollout strategy.", "enum": [ "percentage" ], "x-enum-descriptions": { "percentage": "Split traffic by percentage; only a single version at 100 is accepted." }, "example": "percentage" }, "versions": { "type": "array", "description": "Exactly one version at 100 percent.", "items": { "type": "object", "required": [ "version_id", "percentage" ], "properties": { "version_id": { "type": "string", "description": "Version to deploy." }, "percentage": { "type": "number", "description": "Must be 100." } } } }, "force": { "type": "boolean", "description": "Own face only; on the compatible face use the force query parameter." }, "annotations": { "type": "object", "description": "Free-form annotations.", "required": [], "properties": { "workers/message": { "type": "string", "description": "Deployment message." } } } }}响应
HTTP 200
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Deployment ID, prefixed dep_. |
| created_on | string | When the deployment was created. |
| source | string | Origin: api, sdk, console or rollback. |
| strategy | string | Rollout strategy. |
| versions | array<object> | Exactly one version at 100 percent. |
| versions[].version_id | string | Deployed version. |
| versions[].percentage | number | Traffic share; always 100. |
| annotations | object | Free-form annotations. |
| annotations.workers/message | string | Deployment message. |
| annotations.workers/triggered_by | string | What triggered the deployment. |
| author_email | string | null | Who created the deployment. |
| praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
| praxis.worker_id | string | Owning Worker. |
| praxis.status | string | Deployment status: pending (queued), uploading (pushing components and assets), activating (switching traffic), active (serving), superseded (replaced by a later deployment), failed (see error), cancelled (replaced before it finished). |
| praxis.progress | object | null | Upload progress. |
| praxis.error | object | null | Why the deployment failed. |
| praxis.finished_on | string | null | When the deployment reached a final status. |