|
| 1 | +--- |
| 2 | +title: ALTER WORKER |
| 3 | +sidebar_position: 2 |
| 4 | +--- |
| 5 | + |
| 6 | +Modifies a worker's tags, options, or state. |
| 7 | + |
| 8 | +:::note |
| 9 | +This command requires cloud control to be enabled. |
| 10 | +::: |
| 11 | + |
| 12 | +## Syntax |
| 13 | + |
| 14 | +```sql |
| 15 | +ALTER WORKER <worker_name> SET TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] |
| 16 | + |
| 17 | +ALTER WORKER <worker_name> UNSET TAG <tag_name> [ , <tag_name> , ... ] |
| 18 | + |
| 19 | +ALTER WORKER <worker_name> SET <option_name> = '<option_value>' [ , <option_name> = '<option_value>' , ... ] |
| 20 | + |
| 21 | +ALTER WORKER <worker_name> UNSET <option_name> [ , <option_name> , ... ] |
| 22 | + |
| 23 | +ALTER WORKER <worker_name> SUSPEND |
| 24 | + |
| 25 | +ALTER WORKER <worker_name> RESUME |
| 26 | +``` |
| 27 | + |
| 28 | +## Parameters |
| 29 | + |
| 30 | +| Form | Description | |
| 31 | +|------|-------------| |
| 32 | +| `SET TAG` | Adds or updates worker tags. | |
| 33 | +| `UNSET TAG` | Removes one or more worker tags. | |
| 34 | +| `SET` | Adds or updates worker options. Option names are normalized to lowercase. | |
| 35 | +| `UNSET` | Removes one or more worker options. | |
| 36 | +| `SUSPEND` | Suspends the worker. | |
| 37 | +| `RESUME` | Resumes the worker. | |
| 38 | + |
| 39 | +## Examples |
| 40 | + |
| 41 | +Set tags on a worker: |
| 42 | + |
| 43 | +```sql |
| 44 | +ALTER WORKER ingest_worker |
| 45 | +SET TAG environment = 'prod', team = 'data-platform'; |
| 46 | +``` |
| 47 | + |
| 48 | +Update worker options: |
| 49 | + |
| 50 | +```sql |
| 51 | +ALTER WORKER ingest_worker |
| 52 | +SET region = 'us-west-2', pool = 'streaming'; |
| 53 | +``` |
| 54 | + |
| 55 | +Remove a tag and an option: |
| 56 | + |
| 57 | +```sql |
| 58 | +ALTER WORKER ingest_worker UNSET TAG team; |
| 59 | +ALTER WORKER ingest_worker UNSET pool; |
| 60 | +``` |
| 61 | + |
| 62 | +Change worker state: |
| 63 | + |
| 64 | +```sql |
| 65 | +ALTER WORKER ingest_worker SUSPEND; |
| 66 | +ALTER WORKER ingest_worker RESUME; |
| 67 | +``` |
0 commit comments