Skip to Content
Docs

Validate and pin an updated Worker before persistence

PUT
/workers/{workerId}

Authorization

jwt
headerAuthorizationBearer <JWT>

Path Parameters

Request Body

application/json
  1. body
name*string
Length1 <= length
description?string
size*string
Length1 <= length
minReplicas*integer
Range1 <= value <= 100
Default1
maxReplicas*integer
Range1 <= value <= 100
Default1
targetCpu*number
Range1 <= value <= 100
Default80
envVars?array<>
customDomain?string
Match^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$
schedule?string
Match^((\*(\/\d+)?|([0-5]?\d)(-([0-5]?\d)(\/\d+)?)?(,([0-5]?\d)(-([0-5]?\d)(\/\d+)?)?)*)\s+(\*(\/\d+)?|([01]?\d|2[0-3])(-([01]?\d|2[0-3])(\/\d+)?)?(,([01]?\d|2[0-3])(-([01]?\d|2[0-3])(\/\d+)?)?)*)\s+(\*(\/\d+)?|(0?[1-9]|[12]\d|3[01])(-(0?[1-9]|[12]\d|3[01])(\/\d+)?)?(,(0?[1-9]|[12]\d|3[01])(-(0?[1-9]|[12]\d|3[01])(\/\d+)?)?)*)\s+(\*(\/\d+)?|([1-9]|1[012])(-([1-9]|1[012])(\/\d+)?)?(,([1-9]|1[012])(-([1-9]|1[012])(\/\d+)?)?)*|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s+(\*(\/\d+)?|([0-6])(-([0-6])(\/\d+)?)?(,([0-6])(-([0-6])(\/\d+)?)?)*|mon|tue|wed|thu|fri|sat|sun)|(@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly))$
image?string
compose?
managed?
template?

Response Body

application/json
  1. response
name*string
Length1 <= length
description?string
size*string
Length1 <= length
minReplicas*integer
Range1 <= value <= 100
Default1
maxReplicas*integer
Range1 <= value <= 100
Default1
targetCpu*number
Range1 <= value <= 100
Default80
envVars?array<>
customDomain?string
Match^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$
schedule?string
Match^((\*(\/\d+)?|([0-5]?\d)(-([0-5]?\d)(\/\d+)?)?(,([0-5]?\d)(-([0-5]?\d)(\/\d+)?)?)*)\s+(\*(\/\d+)?|([01]?\d|2[0-3])(-([01]?\d|2[0-3])(\/\d+)?)?(,([01]?\d|2[0-3])(-([01]?\d|2[0-3])(\/\d+)?)?)*)\s+(\*(\/\d+)?|(0?[1-9]|[12]\d|3[01])(-(0?[1-9]|[12]\d|3[01])(\/\d+)?)?(,(0?[1-9]|[12]\d|3[01])(-(0?[1-9]|[12]\d|3[01])(\/\d+)?)?)*)\s+(\*(\/\d+)?|([1-9]|1[012])(-([1-9]|1[012])(\/\d+)?)?(,([1-9]|1[012])(-([1-9]|1[012])(\/\d+)?)?)*|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s+(\*(\/\d+)?|([0-6])(-([0-6])(\/\d+)?)?(,([0-6])(-([0-6])(\/\d+)?)?)*|mon|tue|wed|thu|fri|sat|sun)|(@yearly|@annually|@monthly|@weekly|@daily|@midnight|@hourly))$
id*string
Match^[a-z0-9]+(?:-[a-z0-9]+)*$
image?string
Match^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]+)?\/[a-z0-9]+(?:[._/-][a-z0-9]+)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?@sha256:[a-f0-9]{64}$
Lengthlength <= 512
compose?
managed?
template?
_metaData*
Example Request
curl -X PUT 'https://agents.your-tenant-id.my.contextual.io/api/v1/workers/{workerId}' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "size": "string",  "minReplicas": 1,  "maxReplicas": 1,  "targetCpu": 80}'
Example Response
{  "name": "string",  "description": "string",  "size": "string",  "minReplicas": 1,  "maxReplicas": 1,  "targetCpu": 80,  "envVars": [    {      "label": "string",      "value": "string"    }  ],  "customDomain": "string",  "schedule": "string",  "id": "string",  "image": "string",  "compose": {    "name": "string",    "services": {      "property1": {        "image": "string",        "command": [          "string"        ],        "entrypoint": [          "string"        ],        "environment": {          "property1": "string",          "property2": "string"        },        "ports": [          {            "target": 1,            "published": "string",            "protocol": "tcp",            "mode": "ingress"          }        ],        "expose": [          "string"        ],        "depends_on": {          "property1": {            "condition": "service_started",            "required": true,            "restart": false          },          "property2": {            "condition": "service_started",            "required": true,            "restart": false          }        },        "healthcheck": {          "test": [            "string"          ],          "interval": "string",          "timeout": "string",          "retries": 1,          "start_period": "string",          "start_interval": "string",          "disable": true        },        "volumes": [          {            "type": "volume",            "source": "string",            "target": "string",            "read_only": true,            "volume": {              "nocopy": true,              "subpath": "string"            }          }        ],        "configs": [          "string"        ],        "secrets": [          "string"        ],        "working_dir": "string",        "networks": {          "property1": null,          "property2": null        },        "x-contextual": {          "public": true,          "container_type": "primary",          "http_healthcheck": {            "path": "string",            "port": 1024          },          "features": [            "messaging"          ],          "scaling": {            "maxReplicas": 1,            "pollingInterval": 20,            "minReplicas": 0,            "cooldownPeriod": 5,            "lagThreshold": 100          }        }      },      "property2": {        "image": "string",        "command": [          "string"        ],        "entrypoint": [          "string"        ],        "environment": {          "property1": "string",          "property2": "string"        },        "ports": [          {            "target": 1,            "published": "string",            "protocol": "tcp",            "mode": "ingress"          }        ],        "expose": [          "string"        ],        "depends_on": {          "property1": {            "condition": "service_started",            "required": true,            "restart": false          },          "property2": {            "condition": "service_started",            "required": true,            "restart": false          }        },        "healthcheck": {          "test": [            "string"          ],          "interval": "string",          "timeout": "string",          "retries": 1,          "start_period": "string",          "start_interval": "string",          "disable": true        },        "volumes": [          {            "type": "volume",            "source": "string",            "target": "string",            "read_only": true,            "volume": {              "nocopy": true,              "subpath": "string"            }          }        ],        "configs": [          "string"        ],        "secrets": [          "string"        ],        "working_dir": "string",        "networks": {          "property1": null,          "property2": null        },        "x-contextual": {          "public": true,          "container_type": "primary",          "http_healthcheck": {            "path": "string",            "port": 1024          },          "features": [            "messaging"          ],          "scaling": {            "maxReplicas": 1,            "pollingInterval": 20,            "minReplicas": 0,            "cooldownPeriod": 5,            "lagThreshold": 100          }        }      }    },    "volumes": {      "property1": {        "name": "string"      },      "property2": {        "name": "string"      }    },    "configs": {      "property1": {        "content": "string",        "name": "string",        "file": null,        "environment": null      },      "property2": {        "content": "string",        "name": "string",        "file": null,        "environment": null      }    },    "secrets": {      "property1": {        "environment": "string",        "name": "string",        "file": null      },      "property2": {        "environment": "string",        "name": "string",        "file": null      }    },    "networks": {      "property1": null,      "property2": null    },    "x-contextual": {      "version": 1    }  },  "managed": {    "name": "string",    "version": "string",    "options": {      "property1": "string",      "property2": "string"    },    "digest": "string"  },  "template": {    "name": "string",    "version": "string",    "options": {      "property1": "string",      "property2": "string"    },    "digest": "string"  },  "_metaData": {    "id": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}