Worker Deployments
Create Deployment
POST /accounts/{account_id}/workers/scripts/{script_name}/deployments
Deployments configure how Worker Versions are deployed to traffic. A deployment can consist of one or two versions of a Worker.
Responses
200 Create Deployment response.
Data is at
body["result"]
{
"annotations": {
"workers/message": "*string*",
"workers/triggered_by": "*string*"
},
"author_email": "*string*",
"created_on": "*string*",
"id": "*string*",
"source": "*string*",
"strategy": "*string*",
"versions": [
{
"percentage": "*number*",
"version_id": "*string*"
}
]
}4XX Create Deployment response failure.
{
"errors": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"messages": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"result": {},
"success": "*boolean*"
}List Deployments
GET /accounts/{account_id}/workers/scripts/{script_name}/deployments
List of Worker Deployments. The first deployment in the list is the latest deployment actively serving traffic.
Responses
200 List Deployments response.
Data is at
body["result"]
{
"deployments": [
{
"annotations": {
"workers/message": "*string*",
"workers/triggered_by": "*string*"
},
"author_email": "*string*",
"created_on": "*string*",
"id": "*string*",
"source": "*string*",
"strategy": "*string*",
"versions": [
{
"percentage": null,
"version_id": null
}
]
}
]
}4XX List Deployments response failure.
{
"errors": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"messages": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"result": {},
"success": "*boolean*"
}Get Deployment
GET /accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
Get information about a Worker Deployment.
Responses
200 Get Deployment response.
Data is at
body["result"]
{
"annotations": {
"workers/message": "*string*",
"workers/triggered_by": "*string*"
},
"author_email": "*string*",
"created_on": "*string*",
"id": "*string*",
"source": "*string*",
"strategy": "*string*",
"versions": [
{
"percentage": "*number*",
"version_id": "*string*"
}
]
}4XX Get Deployment response failure.
{
"errors": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"messages": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"result": {},
"success": "*boolean*"
}Delete Deployment
DELETE /accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
Delete a Worker Deployment. The latest deployment, which is actively serving traffic, cannot be deleted. All other deployments can be deleted.
Responses
200 Delete Deployment response.
Data is at
body["result"]
{
"errors": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"messages": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"success": "*boolean*"
}4XX Delete Deployment response failure.
{
"errors": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"messages": [
{
"code": "*integer*",
"documentation_url": "*string*",
"message": "*string*",
"source": {
"pointer": "*string*"
}
}
],
"result": {},
"success": "*boolean*"
}
Summary
Functions
@spec client(Restlax.Resource.action_options()) :: module()
@spec create( body :: Restlax.Resource.action_body(), opts :: Restlax.Resource.action_options() ) :: {:ok, map()} | {:error, term()}
@spec create!( body :: Restlax.Resource.action_body(), opts :: Restlax.Resource.action_options() ) :: map() | no_return()
@spec delete(id :: term(), opts :: Restlax.Resource.action_options()) :: {:ok, map()} | {:error, term()}
@spec delete!(id :: term(), opts :: Restlax.Resource.action_options()) :: map() | no_return()
@spec index(opts :: Restlax.Resource.action_options()) :: {:ok, map()} | {:error, term()}
@spec index!(opts :: Restlax.Resource.action_options()) :: map() | no_return()
@spec show(id :: term(), opts :: Restlax.Resource.action_options()) :: {:ok, map()} | {:error, term()}
@spec show!(id :: term(), opts :: Restlax.Resource.action_options()) :: map() | no_return()