> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# workload

> cpln workload — Manage workloads that run containerized applications within a GVC.

Manage workloads within a global virtual cloud

For a detailed overview, please visit the [workload's](/reference/workload) reference page.

```none theme={null}
cpln workload [SUBCOMMAND]
```

```text theme={null}
Commands:
  cpln workload access-report <ref>          Show the access report for the referenced workload
  cpln workload audit [ref]                  Retrieve audit trail events for the referenced workload
  cpln workload clone <ref>                  Create a clone of the referenced workload; this will only duplicate its spec.  [aliases: copy]
  cpln workload connect <ref>                Connect to a replica of the workload
  cpln workload create                       Create a new workload
  cpln workload cron                         Manage cron workloads
  cpln workload delete <ref...>              Delete one or more referenced workloads
  cpln workload edit <ref>                   Edit the referenced workload, as YAML, within an editor
  cpln workload eventlog <ref>               Show the event log of the referenced workload  [aliases: log]
  cpln workload exec <ref>                   Exec a command on a replica of the workload
  cpln workload force-redeployment <ref...>  Force redeployment of the workload(s)
  cpln workload get [ref...]                 Retrieve one or more referenced workloads
  cpln workload get-deployments <ref>        Retrieve the current deployments of the referenced workload
  cpln workload get-replicas <ref>           Get the replicas of the referenced workload in a given location  [deprecated: This subcommand is deprecated, use 'replica get' instead.]
  cpln workload open <ref>                   Open the referenced workload's endpoint in your browser
  cpln workload patch <ref>                  Update the referenced workload's metadata using an input file
  cpln workload permissions                  Show the grantable permissions for a workload object type
  cpln workload query                        Find all the workloads based on the given query
  cpln workload replica                      Manage workload replicas
  cpln workload run                          Run a command with a workload instance
  cpln workload start <ref...>               Start the workload(s)
  cpln workload stop <ref...>                Stop the workload(s)
  cpln workload tag <ref...>                 Manage the tags belonging to one or more referenced workloads
  cpln workload update <ref>                 Update properties of the referenced workload

Options:
  --help  Show help  [boolean]
```

***

#### workload access-report

Show the access report for the referenced workload

**Usage**

```none theme={null}
cpln workload access-report <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Display the user / service account / group permissions for the 'demo-workload' workload withing the 'demo-cpln-gvc' global virtual cloud within the 'demo-cpln-organization' organization

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload access-report demo-workload --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +----------------------+--------------------------------------------------------+--------+
    |PERMISSION            |PRINCIPAL                                               |GRANTED |
    |----------------------|--------------------------------------------------------|--------|
    |configureLoadBalancer |/org/demo-cpln-organization/group/superusers            |manage  |
    |configureLoadBalancer |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |connect               |/org/demo-cpln-organization/group/superusers            |manage  |
    |connect               |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |create                |/org/demo-cpln-organization/group/superusers            |manage  |
    |create                |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |delete                |/org/demo-cpln-organization/group/superusers            |manage  |
    |delete                |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |edit                  |/org/demo-cpln-organization/group/superusers            |manage  |
    |edit                  |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |exec                  |/org/demo-cpln-organization/group/superusers            |manage  |
    |exec                  |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |exec.runCronWorkload  |/org/demo-cpln-organization/group/superusers            |manage  |
    |exec.runCronWorkload  |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |exec.stopReplica      |/org/demo-cpln-organization/group/superusers            |manage  |
    |exec.stopReplica      |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |manage                |/org/demo-cpln-organization/group/superusers            |manage  |
    |manage                |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |view                  |/org/demo-cpln-organization/group/viewers               |view    |
    |view                  |/org/demo-cpln-organization/group/superusers            |manage  |
    |view                  |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    +----------------------+--------------------------------------------------------+--------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload audit

Retrieve audit trail events for the referenced workload

**Usage**

```none theme={null}
cpln workload audit [ref] [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.

  Command options:
    --subject  Filter by subject (serviceaccount name or user email)  [string]
    --context  Audit context name (the 'cpln' context displays Control Plane actions)  [string] [default: "cpln"]
    --since    Relative lookback window from now (e.g., 1h, 24h, 7d). Mutually exclusive with --from/--to  [string] [default: "7d"]
    --from     Start time for audit events (ISO 8601 format or relative duration, e.g., 2025-10-23T07:00:00Z, 7d, 1h). Cannot be used with --since  [string]
    --to       End time for audit events (ISO 8601 format or relative duration, e.g., 2025-10-23T07:00:00Z, 1d, 30m)  [string]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### workload clone

Create a clone of the referenced workload; this will only duplicate its spec.

**Usage**

```none theme={null}
cpln workload clone <ref> --name CLONE_NAME [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --name         Set the name for the clone  [required]
    --description  Optional description, defaults to the name if not set
    --tag          Attach tags (e.g., --tag drink=water)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload clone demo-workload --name demo-workload-clone --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+-----------------------+------------------+------+--------+-------------------------------------------------------------------+--------------+
    |NAME                |DESCRIPTION            |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS          |
    |--------------------|-----------------------|------------------|------|--------|-------------------------------------------------------------------|--------------|
    |demo-workload-clone |Clone of demo-workload |demo-gvc-workload |      |Now     |https://demo-workload-clone-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |drink="water" |
    +--------------------+-----------------------+------------------+------+--------+-------------------------------------------------------------------+--------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload connect

Connect to a replica of the workload

If multiple replicas are running, use the --replica flag to specify the replica. Use the subcommand
[get-replicas](#workload-get-replicas) to view the current list of replicas.

Refer to the [cpln workload connect guide](/guides/cli/workload/connect) for additional details.

**Usage**

```none theme={null}
cpln workload connect <ref> --location LOCATION [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --location   A global virtual cloud location  [string]
    --replica    Replica of the deployment
    --container  Container name of the workload
    --shell, -s  Shell to open on replica  [default: "bash"]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### workload create

Create a new workload

**Usage**

```none theme={null}
cpln workload create --name WORKLOAD_NAME --image IMAGE_NAME [OPTIONS]
```

<Tip>
  When creating a new workload and the image was pushed to your org's private repository,
  use the image name shortcut `//image/IMAGE_NAME`.

  For Example: `cpln workload create --name WORKLOAD_NAME --image //image/IMAGE_NAME`
</Tip>

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --name                 Name of the new workload  [required]
    --description, --desc  Optional description, defaults to the name if not set
    --type                 Workload type  [choices: "serverless", "standard"] [default: "standard"]
    --image                Name of the container image  [required]
    --port                 Port to expose  [number] [default: 8080]
    --env                  Environment variables in KEY=VALUE format
    --public               Unconstrained ingress & egress for the workload  [boolean]
    --identity             Attach the named identity to the workload spec
    --enable-debug         Enables debug response headers when the headers "x-cpln-debug: true" is in the request.  [boolean] [default: false]
    --inherit-env          Inherits the environment variables set at GVC level.  [boolean] [default: false]
    --container-name       Name of the container item
    --cpu                  Allocate CPU resources  [default: "50m"]
    --memory, --mem        Allocate Memory  [default: "128Mi"]
    --volume               Mount Object Store (S3, GCS, AzureBlob) buckets as file system. E.g. s3://backups@/mnt/storage
    --tag                  Attach tags (e.g., --tag drink=water)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Options">
  * `name`
    * Type: string
    * Minimum Length: 3
    * Maximum Length: 64
    * Only lowercase characters
    * Must begin with a character
    * Allowed special characters: -
  * `image`
    * Type: string
  * `port`
    * Type: number
    * Default: 8080
    * Minimum Value: 80
    * Maximum Value: 65535
  * `cpu`
    * Type: string
    * Default: 150m
  * `memory`
    * Type: string
    * Default: 128Mi

  **NOTE:** The ratio between CPU to Memory can be at most 1/8.
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload create --name demo-workload --image gcr.io/knative-samples/helloworld-go --desc demo-workload --tag drink=water --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------+--------------+------------------+------+--------+-------------------------------------------------------------+--------------+
    |NAME          |DESCRIPTION   |GVC               |READY |CREATED |ENDPOINT                                                     |TAGS          |
    |--------------|--------------|------------------|------|--------|-------------------------------------------------------------|--------------|
    |demo-workload |demo-workload |demo-gvc-workload |      |Now     |https://demo-workload-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |drink="water" |
    +--------------+--------------+------------------+------+--------+-------------------------------------------------------------+--------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload cron

Manage cron workloads

```none theme={null}
cpln workload cron [SUBCOMMAND]
```

```text theme={null}
Commands:
  cpln workload cron get <ref>    Get a list of job executions for the referenced workload
  cpln workload cron run          Run a command with a cron workload instance. Use -- at the end to specify the command (e.g., cpln workload cron run --gvc my-gvc -- echo hello)
  cpln workload cron start <ref>  Start a cron job
  cpln workload cron stop <ref>   Stop a cron job

Options:
  --help  Show help  [boolean]
```

#### workload cron get

Get a list of job executions for the referenced workload

**Usage**

```none theme={null}
cpln workload cron get <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --location  A global virtual cloud location  [string]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload cron get demo-cron-workload
    ```

    ```text Output theme={null}
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------------+
    |WORKLOAD           |LOCATION         |NAME OR COMMAND ID                   |STATUS |START TIME            |COMPLETION TIME       |
    |-------------------|-----------------|-------------------------------------|-------|----------------------|----------------------|
    |demo-cron-workload │aws-eu-central-1 |ce770d2b-2b7f-4415-b41e-961f161bcd86 |Active |3/30/2024, 3:29:47 AM |3/30/2024, 3:30:14 AM |
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload cron run

Run a command using a persistent cron workload runner.

Refer to the [cpln workload cron run guide](/guides/cli/workload/cron-run) for additional details.

<Note>
  The runner workload is created on first use and reused for subsequent runs, avoiding the overhead of creating and deleting a workload each time.

  `--interactive` and `--background` are mutually exclusive.
</Note>

**Usage**

```none theme={null}
cpln workload cron run [OPTIONS] -- <command>
```

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --tag              Attach tags (e.g., --tag drink=water)
    --image            Override image
    --interactive, -i  Make the session interactive  [boolean] [default: false]
    --background, -b   Run in background without waiting for completion (fire and forget)  [boolean] [default: false]
    --timeout, -t      Maximum time to wait for job completion in seconds  [number] [default: 600]
    --cpu              Set allocated CPU for the main container
    --memory, --mem    Set allocated memory for the main container
    --env              Environment variables in KEY=VALUE format
    --shell, -s        Shell to use, only valid when interactive flag is true  [default: "bash"]
    --location         Location to run the command
    --container        Which container to run the command in
    --identity         Attach the named identity to the runner workload
    --                 Command to execute. Must be at the end of the command (e.g., -- echo hello world)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Default (wait for completion) theme={null}
    cpln workload cron run --org demo-cpln-organization --gvc demo-gvc -- echo "Hello from Control Plane!"
    ```

    ```bash Background (fire and forget) theme={null}
    cpln workload cron run --org demo-cpln-organization --gvc demo-gvc --background -- npm run db:migrate
    ```

    ```bash Interactive session theme={null}
    cpln workload cron run --org demo-cpln-organization --gvc demo-gvc --interactive -- bash
    ```
  </CodeGroup>
</Accordion>

***

#### workload cron start

Start a cron job

**Usage**

```none theme={null}
cpln workload cron start <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --location                 A global virtual cloud location  [string]
    --container-name           Name of the container  [string]
    --env                      One or more environment variables in KEY=VALUE format  [string]
    --command                  Override the entrypoint  [string]
    --arg                      One or more custom command line argument that will be sent to the container  [string]
    --active-deadline-seconds  Maximum duration in seconds for the cron job to complete. Used by the deadline reconciler to detect orphaned commands.  [number]
    --file, -f                 File to load and use for the command. Use `--file -` to enable input from stdin.

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Basic Usage

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload cron start demo-cron-workload
    ```

    ```text Output theme={null}
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------+
    |WORKLOAD           |LOCATION         |NAME OR COMMAND ID                   |STATUS |START TIME            |COMPLETION TIME |
    |-------------------|-----------------|-------------------------------------|-------|----------------------|----------------|
    |demo-cron-workload │aws-eu-central-1 |ce770d2b-2b7f-4415-b41e-961f161bcd86 |Active |3/30/2024, 3:29:47 AM |                |
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------+
    ```
  </CodeGroup>

  * Override Container Through Arguments

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload cron start demo-cron-workload --container-name demo --command bash --arg echo --arg hello --arg world --env APP_MODE=dev --location aws-eu-central-1
    ```

    ```text Output theme={null}
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------+
    |WORKLOAD           |LOCATION         |NAME OR COMMAND ID                   |STATUS |START TIME            |COMPLETION TIME |
    |-------------------|-----------------|-------------------------------------|-------|----------------------|----------------|
    |demo-cron-workload │aws-eu-central-1 |2afa5cbc-049d-455b-96bc-db4cf459def3 |Active |3/30/2024, 3:29:47 AM |                |
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------+
    ```
  </CodeGroup>

  * Override Multiple Containers Through a File

  **Example File**

  ```yaml YAML theme={null}
  name: demo
  env:
    - name: APP_MODE
      value: dev
  command: bash
  args:
    - echo
    - hello
    - world
  ---
  name: demo
  env:
    - name: APP_MODE
      value: prod
  command: bash
  args:
    - ls
  ```

  **Usage**

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload cron start demo-cron-workload --file overrideContainerFile.yaml --location aws-eu-central-1
    ```

    ```text Output theme={null}
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------+
    |WORKLOAD           |LOCATION         |NAME OR COMMAND ID                   |STATUS |START TIME            |COMPLETION TIME |
    |-------------------|-----------------|-------------------------------------|-------|----------------------|----------------|
    |demo-cron-workload │aws-eu-central-1 |beac030b-8e54-46c1-acbe-aa19e1682258 |Active |3/30/2024, 3:29:47 AM |                |
    +-------------------+-----------------+-------------------------------------+-------+----------------------+----------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload cron stop

Stop a cron job

**Usage**

```none theme={null}
cpln workload cron stop <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --replica-name  Name of the replica  [string] [required]
    --location      A global virtual cloud location  [string] [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### workload delete

Delete one or more referenced workloads

**Usage**

```none theme={null}
cpln workload delete <ref...> [OPTIONS]
```

<Note>
  Deleting a workload will remove all associated resources (containers, etc.)
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Delete a workload

  <CodeGroup>
    ```bash Command theme={null}
    cpln cpln workload delete demo-workload-1 --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    If the delete was successful, a new command prompt will be shown.
    ```
  </CodeGroup>

  * Delete multiple workloads

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload delete demo-workload-1 demo-workload-2 --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    If the delete was successful, a new command prompt will be shown.
    ```
  </CodeGroup>
</Accordion>

***

#### workload edit

Edit the referenced workload, as YAML, within an editor

**Usage**

```none theme={null}
cpln workload edit <ref> [OPTIONS]
```

<Note>
  The default editor can be set by using the EDITOR environment variable.
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --replace, -r  Replace instead of patch/merge  [boolean] [default: false]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload edit demo-workload --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    Your default editor will be launched.

    Once any modifications are saved, the updates will be sent to the API.
    ```
  </CodeGroup>
</Accordion>

***

#### workload eventlog

Show the event log of the referenced workload

**Usage**

```none theme={null}
cpln workload eventlog <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload eventlog demo-workload --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    The event log for the referenced workload will be shown.
    ```
  </CodeGroup>
</Accordion>

***

#### workload exec

Exec a command on a replica of the workload.

Refer to the [cpln workload exec guide](/guides/cli/workload/exec) for additional details.

**Usage**

```none theme={null}
cpln workload exec <ref> --location LOCATION -- COMMAND ARG1 ARG2 [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --location   A global virtual cloud location  [string]
    --replica    Replica of the deployment
    --container  Container name of the workload
    --stdin, -i  Pass stdin to the container  [boolean] [default: false]
    --tty, -t    Stdin is a TTY  [boolean] [default: false]
    --quiet, -q  Only print output from the remote session  [boolean] [default: false]
    --           Command to execute on replica

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Execute a command

  ```bash theme={null}
  cpln workload exec index --location aws-eu-central-1 -- ls /etc | grep group
  ```
</Accordion>

***

#### workload force-redeployment

Force redeployment of the referenced workload(s).

**Usage**

```none theme={null}
cpln workload force-redeployment <ref...> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### workload get

Retrieve one or more referenced workloads

**Usage**

```none theme={null}
cpln workload get [ref...] [OPTIONS]
```

<Note>
  An empty reference will return all references
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Command options:
    --all-gvcs  Show workloads from all the global virtual clouds within the current or overridden organization  [boolean]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Get all workloads

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload get --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED        |ENDPOINT                                                           |TAGS          |
    |--------------------|--------------------|------------------|------|---------------|-------------------------------------------------------------------|--------------|
    |demo-workload       |demo-workload       |demo-gvc-workload |true  |11 minutes ago |https://demo-workload-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app       |drink="water" |
    |demo-workload-get-2 |demo-workload-get-2 |demo-gvc-workload |false |Now            |                                                                   |              |
    |demo-workload-get-1 |demo-workload-get-1 |demo-gvc-workload |false |Now            |https://demo-workload-get-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    ```
  </CodeGroup>

  * Get one workload

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload get demo-workload-get-1 --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|-----|
    |demo-workload-get-1 |demo-workload-get-1 |demo-gvc-workload |false |Now     |https://demo-workload-get-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |     |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    ```
  </CodeGroup>

  * Get multiple workloads

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload get demo-workload-get-1 demo-workload-get-2 --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|-----|
    |demo-workload-get-1 |demo-workload-get-1 |demo-gvc-workload |false |Now     |https://demo-workload-get-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |     |
    |demo-workload-get-2 |demo-workload-get-2 |demo-gvc-workload |false |Now     |                                                                   |     |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    ```
  </CodeGroup>
</Accordion>

***

#### workload get-deployments

Retrieve the current deployments of the referenced workload

**Usage**

```none theme={null}
cpln workload get-deployments <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload get-deployments demo-workload-get-deployments --gvc demo-gvc-get-deployments --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------+--------------+---------------------------------------------------------------------------------+
    |NAME/LOCATION    |MODIFIED      |STATUS                                                                           |
    |-----------------|--------------|---------------------------------------------------------------------------------|
    |aws-eu-central-1 |0 minutes ago |endpoint="https://demo-workload-get-deployments-dta8cb6daad8a.aws-eu-central-... |
    |                 |              |expectedDeploymentVersion=2                                                      |
    |                 |              |internal={"podStatus":{},"podsValidZone":true,"timestamp":"2024-02-29T22:04:0... |
    |                 |              |lastProcessedVersion=2                                                           |
    |                 |              |message=""                                                                       |
    |                 |              |ready=true                                                                       |
    |                 |              |message=""                                                                       |
    |                 |              |ready=true                                                                       |
    |                 |              |remote="https://a4e2dc319c383ac09ceeed0475a71f33.remote.cpln.io"                 |
    |                 |              |versions=[{"message":"Replica(s) Initializing...","ready":true,"containers":{... |
    |                 |              |versions=[{"message":"Replica(s) Initializing...","ready":true,"containers":{... |
    +-----------------+--------------+---------------------------------------------------------------------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload get-replicas

Get the replicas of the referenced workload in a given location

**Usage**

```none theme={null}
cpln workload get-replicas <ref> --location LOCATION [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --location  A global virtual cloud location  [string]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload get-replicas demo-workload --location aws-eu-central-1 --gvc demo-gvc --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------------------------+
    |REPLICA                                        |
    |-----------------------------------------------|
    |demo-workload-00118-deployment-655f87bffb-nmxxr|
    +-----------------------------------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload open

Open the referenced workload's endpoint in your browser

**Usage**

```none theme={null}
cpln workload open <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Open the endpoint of the referenced workload

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload open demo-workload --gvc demo-gvc --org $2
    ```

    ```text Output theme={null}
    The endpoint for this workload will be opened in the default browser
    ```
  </CodeGroup>
</Accordion>

***

#### workload patch

Update the referenced workload's metadata using an input file

**Usage**

```none theme={null}
cpln workload patch <ref> --file FILE_NAME [OPTIONS]
```

<Note>
  Running this command with the option **`--file -`** sets the input to stdin. The input is required to be a valid JSON or YAML string (e.g., `{"description": "My new description"}` or `description: My new description`). To complete the update, press Control-D (or Control-Z if you are using Windows).
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --file, -f  File to load the patch from. Use `--file -` to enable input from stdin.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload patch demo-workload --file workload-update.json --org $2
    ```

    ```text Output theme={null}
    The changes within the JSON file will be performed against the referenced workload.
    ```
  </CodeGroup>

  To update the workload options (i.e., Capacity AI, Scaling Strategy) using the CLI, use the example below to pipe the updated JSON or YAML text to the patch command:

  ```bash theme={null}
  echo '{"spec": {"defaultOptions": {"autoscaling": {"metric": "cpu", "target": 90}, "capacityAI": false}}}' | cpln workload patch WORKLOAD_NAME --f - --org ORG_NAME --gvc GVC_NAME
  ```
</Accordion>

***

#### workload permissions

Show the grantable permissions for a workload object type

**Usage**

```none theme={null}
cpln workload permissions [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload permissions --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +----------------------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------+
    |NAME                  |DESCRIPTION                              |IMPLIES                                                                                                          |
    |----------------------|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------|
    |configureLoadBalancer |Principal can configure LB               |                                                                                                                 |
    |connect               |Connect to replica (open an interacti... |                                                                                                                 |
    |create                |Create new workloads                     |                                                                                                                 |
    |delete                |Delete existing workloads                |                                                                                                                 |
    |edit                  |Modify existing workloads                |view                                                                                                             |
    |exec                  |Execute commands                         |exec.runCronWorkload, exec.stopReplica                                                                           |
    |exec.runCronWorkload  |Force a cron-workload to run             |                                                                                                                 |
    |exec.stopReplica      |Force a replica to be stopped            |                                                                                                                 |
    |manage                |Full access                              |configureLoadBalancer, connect, create, delete, edit, exec, exec.runCronWorkload, exec.stopReplica, manage, view |
    |view                  |Read-only access                         |                                                                                                                 |
    +----------------------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload query

Find all the workloads based on the given query

**Usage**

```none theme={null}
cpln workload query QUERY_OPTIONS [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Query options:
    --match             Query filter type  [choices: "all", "none", "any"] [default: "all"]
    --property, --prop  Property to query
    --tag               Tag to query
    --rel               Relation to query

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <Note>
    Use the `--match` option to display **all**, **none**, or **any** of the results based on a given property or tag
  </Note>

  * Search for a workload based on the name property

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload query --match any --prop name=demo-workload --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED        |ENDPOINT                                                           |TAGS          |
    |--------------------|--------------------|------------------|------|---------------|-------------------------------------------------------------------|--------------|
    |demo-workload       |demo-workload       |demo-gvc-workload |      |11 minutes ago |https://demo-workload-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app       |drink="water" |
    |demo-workload-get-2 |demo-workload-get-2 |demo-gvc-workload |      |Now            |https://demo-workload-get-2-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    |demo-workload-get-1 |demo-workload-get-1 |demo-gvc-workload |      |Now            |https://demo-workload-get-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    ```
  </CodeGroup>

  * Search for a workload based on the description property

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload query --match any --prop description="demo-workload" --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED        |ENDPOINT                                                           |TAGS          |
    |--------------------|--------------------|------------------|------|---------------|-------------------------------------------------------------------|--------------|
    |demo-workload       |demo-workload       |demo-gvc-workload |      |11 minutes ago |https://demo-workload-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app       |drink="water" |
    |demo-workload-get-2 |demo-workload-get-2 |demo-gvc-workload |      |Now            |https://demo-workload-get-2-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    |demo-workload-get-1 |demo-workload-get-1 |demo-gvc-workload |      |Now            |https://demo-workload-get-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    ```
  </CodeGroup>

  * Search for a workload based on a tag

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload query --match any --tag drink=water --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED        |ENDPOINT                                                           |TAGS          |
    |--------------------|--------------------|------------------|------|---------------|-------------------------------------------------------------------|--------------|
    |demo-workload       |demo-workload       |demo-gvc-workload |      |11 minutes ago |https://demo-workload-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app       |drink="water" |
    |demo-workload-get-2 |demo-workload-get-2 |demo-gvc-workload |      |Now            |https://demo-workload-get-2-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    |demo-workload-get-1 |demo-workload-get-1 |demo-gvc-workload |      |Now            |https://demo-workload-get-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    ```
  </CodeGroup>

  * Search for a workload based on a property and tag

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload query --match any --prop description="demo-workload" --tag drink=water --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED        |ENDPOINT                                                           |TAGS          |
    |--------------------|--------------------|------------------|------|---------------|-------------------------------------------------------------------|--------------|
    |demo-workload       |demo-workload       |demo-gvc-workload |      |11 minutes ago |https://demo-workload-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app       |drink="water" |
    |demo-workload-get-2 |demo-workload-get-2 |demo-gvc-workload |      |Now            |https://demo-workload-get-2-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    |demo-workload-get-1 |demo-workload-get-1 |demo-gvc-workload |      |Now            |https://demo-workload-get-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |              |
    +--------------------+--------------------+------------------+------+---------------+-------------------------------------------------------------------+--------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload replica

Manage workload replicas

```none theme={null}
cpln workload replica [SUBCOMMAND]
```

```text theme={null}
Commands:
  cpln workload replica get <ref>   Get the replica of the referenced workload in a given location
  cpln workload replica stop <ref>  Stop the replica of the referenced workload in a given location

Options:
  --help  Show help  [boolean]
```

#### workload replica get

Get the replica of the referenced workload in a given location

**Usage**

```none theme={null}
cpln workload replica get <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --replica-name  Name of the replica  [string]
    --location      A global virtual cloud location  [string]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### workload replica stop

Stop the replica of the referenced workload in a given location

**Usage**

```none theme={null}
cpln workload replica stop <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --replica-name  Name of the replica  [string] [required]
    --location      A global virtual cloud location  [string] [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln workload replica stop demo-workload --replica-name demo-workload-0 --location aws-eu-central-1
    ```

    ```text Output theme={null}
    +-----------------+-----------------+-------------------+---------+----------------------+----------------+
    |WORKLOAD         |LOCATION         |REPLICA            |STATUS   |START TIME            |COMPLETION TIME |
    |-----------------|-----------------|-------------------|---------|----------------------|----------------|
    |demo-workload    |aws-eu-central-1 |demo-workload-0    |Stopping |3/30/2024, 4:02:12 AM |                |
    +-----------------+-----------------+-------------------+---------+----------------------+----------------+
    ```
  </CodeGroup>
</Accordion>

***

#### workload run

Run a command with a workload instance.

Refer to the [cpln workload run guide](/guides/cli/workload/run) for additional details.

<Tip>
  **Recommendation:** Consider using [`cpln workload cron run`](#workload-cron-run) instead — it's significantly faster and the preferred way to run commands going forward. It uses a persistent cron workload runner that is reused across executions, eliminating the overhead of creating and tearing down a workload each time.
</Tip>

<Note>
  Most basic usage is `cpln workload run -- ls -al`.

  This will create a new workload to execute the command, it uses an ubuntu base image.

  Other examples are:

  If you have a workload you want to reuse: `cpln workload run --clone WORKLOAD_NAME -- ls -al`

  `-- <command>`: Must always be at the end.

  Optional flags:

  `--rm`: To clean up afterwards.

  `-i`: To connect to the session.

  `--cpu` and `--mem`: To override the default resources.

  `--location`: To override the location. (By default the first location fetched from your gvc).
</Note>

**Usage**

```none theme={null}
cpln workload run -- COMMAND [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --clone            Clone a workload
    --tag              Attach tags (e.g., --tag drink=water)
    --image            Override image
    --interactive, -i  Make the session interactive  [boolean] [default: false]
    --remove, --rm     Deletes the workload after the command is run  [boolean] [default: false]
    --cpu              Set allocated CPU for the main container
    --memory, --mem    Set allocated memory for the main container
    --env              Environment variables in KEY=VALUE format
    --command, -c      Container command
    --arg, -a          Container args
    --shell, -s        Shell to use, only valid when interactive flag is true  [default: "bash"]
    --location         Location to run the command
    --container        Which container to run the command in, only used when "clone" option is used

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  ```bash theme={null}
  cpln workload run --org demo-cpln-organization --gvc demo-gvc -- ls -al
  ```
</Accordion>

***

#### workload start

Start the workload(s)

**Usage**

```none theme={null}
cpln workload start <ref...> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  ```bash theme={null}
  cpln workload start demo-workload --org demo-cpln-organization --gvc demo-gvc
  ```
</Accordion>

***

#### workload stop

Stop the workload(s)

**Usage**

```none theme={null}
cpln workload stop <ref...> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  ```bash theme={null}
  cpln workload stop demo-workload --org demo-cpln-organization --gvc demo-gvc
  ```
</Accordion>

***

#### workload tag

Manage the tags belonging to one or more referenced workloads

**Usage**

```none theme={null}
cpln workload tag <ref...> --tag KEY=VALUE [OPTIONS]
```

<Note>
  Built-in tags, which begin with cpln/\*, can't be modified.
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Command options:
    --tag         Attach tags (e.g., --tag drink=water)
    --remove-tag  Remove tags (e.g., --remove-tag tagname)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Add a tag to a workload

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload tag demo-workload-tag-1 --tag drink=water --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+--------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS          |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|--------------|
    |demo-workload-tag-1 |demo-workload-tag-1 |demo-gvc-workload |      |Now     |https://demo-workload-tag-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |drink="water" |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+--------------+
    ```
  </CodeGroup>

  * Update same tag (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload tag demo-workload-tag-1 --tag drink=coffee --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+---------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS           |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|---------------|
    |demo-workload-tag-1 |demo-workload-tag-1 |demo-gvc-workload |      |Now     |https://demo-workload-tag-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |drink="coffee" |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+---------------+
    ```
  </CodeGroup>

  * Remove tag (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload tag demo-workload-tag-1 --remove drink --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|-----|
    |demo-workload-tag-1 |demo-workload-tag-1 |demo-gvc-workload |      |Now     |https://demo-workload-tag-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |     |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    ```
  </CodeGroup>

  * Add same tag to multiple workloads

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload tag demo-workload-tag-1 demo-workload-tag-2 --tag multiple-workloads=true --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+--------------------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS                      |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|--------------------------|
    |demo-workload-tag-1 |demo-workload-tag-1 |demo-gvc-workload |      |Now     |https://demo-workload-tag-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |multiple-workloads="true" |
    |demo-workload-tag-2 |demo-workload-tag-2 |demo-gvc-workload |      |Now     |https://demo-workload-tag-2-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |multiple-workloads="true" |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+--------------------------+
    ```
  </CodeGroup>

  * Update same tag on multiple workloads (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload tag demo-workload-tag-1 demo-workload-tag-2 --tag multiple-workloads=demo-workload --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----------------------------------+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS                               |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|-----------------------------------|
    |demo-workload-tag-1 |demo-workload-tag-1 |demo-gvc-workload |      |Now     |https://demo-workload-tag-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |multiple-workloads="demo-workload" |
    |demo-workload-tag-2 |demo-workload-tag-2 |demo-gvc-workload |      |Now     |https://demo-workload-tag-2-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |multiple-workloads="demo-workload" |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----------------------------------+
    ```
  </CodeGroup>

  * Remove same tag from multiple workload (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload tag demo-workload-tag-1 demo-workload-tag-2 --remove multiple-workloads --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    |NAME                |DESCRIPTION         |GVC               |READY |CREATED |ENDPOINT                                                           |TAGS |
    |--------------------|--------------------|------------------|------|--------|-------------------------------------------------------------------|-----|
    |demo-workload-tag-1 |demo-workload-tag-1 |demo-gvc-workload |      |Now     |https://demo-workload-tag-1-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |     |
    |demo-workload-tag-2 |demo-workload-tag-2 |demo-gvc-workload |      |Now     |https://demo-workload-tag-2-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |     |
    +--------------------+--------------------+------------------+------+--------+-------------------------------------------------------------------+-----+
    ```
  </CodeGroup>
</Accordion>

***

#### workload update

Update properties of the referenced workload

**Usage**

```none theme={null}
cpln workload update <ref> --set UPDATE_PROPERTY [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Update Properties:
    --set    Update the following properties (e.g., --set description="Updated Description"):

             description                                           string
             tags.<key>                                            string
             spec.identityLink                                     string
             spec.containers.<name>.image                          string
             spec.containers.<name>.workingDir                     string
             spec.containers.<name>.metrics.port                   string
             spec.containers.<name>.metrics.path                   string
             spec.containers.<name>.cpu                            string
             spec.containers.<name>.memory                         string
             spec.containers.<name>.command                        string
             spec.containers.<name>.args                           string[]
             spec.containers.<name>.env.<name>.value               string
             spec.containers.<name>.env.<name>                     string
             spec.containers.<name>.inheritEnv                     boolean
             spec.firewallConfig.external.inboundAllowCIDR         string[]
             spec.firewallConfig.external.outboundAllowHostname    string[]
             spec.firewallConfig.external.outboundAllowCIDR        string[]
             spec.firewallConfig.internal.inboundAllowType         { 'none' | 'same-gvc' | 'same-org' | 'workload-list' }
             spec.firewallConfig.internal.inboundAllowWorkload     string[]
             spec.defaultOptions.autoscaling.metric                { 'concurrency' | 'cpu' | 'rps' }
             spec.defaultOptions.autoscaling.target                number
             spec.defaultOptions.autoscaling.minScale              number
             spec.defaultOptions.autoscaling.maxScale              number
             spec.defaultOptions.autoscaling.scaleToZeroDelay      number
             spec.defaultOptions.autoscaling.maxConcurrency        number
             spec.defaultOptions.timeoutSeconds                    number
             spec.defaultOptions.capacityAI                        boolean
             spec.defaultOptions.debug                             boolean
             spec.defaultOptions.suspend                           boolean
             spec.job.schedule                                     string
             spec.job.concurrencyPolicy                            { 'Forbid' | 'Replace' }
             spec.job.historyLimit                                 number
             spec.job.restartPolicy                                { 'OnFailure' | 'Never' }
             spec.job.activeDeadlineSeconds                        number
             spec.loadBalancer.direct.enabled                      boolean
             spec.loadBalancer.direct.ipSet                        string
             spec.loadBalancer.geoLocation.enabled                 boolean
             spec.loadBalancer.geoLocation.headers.asn             string
             spec.loadBalancer.geoLocation.headers.city            string
             spec.loadBalancer.geoLocation.headers.country         string
             spec.loadBalancer.geoLocation.headers.region          string
             spec.requestRetryPolicy.attempts                      number
             spec.requestRetryPolicy.retryOn                       string[]
             spec.extras                                           string
             spec.extras.affinity                                  string
             spec.extras.tolerations                               string
             spec.extras.topologySpreadConstraints                 string

             Arrays can be appended to, replaced, or removed using the `+=`, `=`, or `-=` operators, respectively.
    --unset  Unset a property (same paths as --set, e.g., --unset description)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Options">
  * The `--set` option allows the modification of the following workload properties:
    * \`description1
      * Description of the workload
      * Type: string
    * `tags`
      * Tags (key=value) associated with the workload
      * Type: string
    * `spec.identityLink`
      * The identity of the workload
      * Type: string
    * `spec.containers\.<name\>.image`
      * The name of the container image to be pulled
      * Type: string
    * `spec.containers\.<name\>.port`
      * The port to serve traffic over
      * Type: number
    * `spec.containers\.<name\>.cpu`
      * The amount of cpu units available to the workload
      * Default: 150m
      * Type: string
    * `spec.containers\.<name\>.memory`
      * The amount of memory available to the workload
      * Default: 128Mi
      * Type: string
    * `spec.containers\.<name\>.env\.<name\>.value`
      * The environment variables to be available to the workload
      * Type: string
    * `spec.firewallConfig.external.outboundAllowHostname`
      * The list of hostnames that the workload is allowed to call
      * Type: string\[]
    * `spec.firewallConfig.external.outboundAllowCIDR`
      * The list of CIDR values that the workload is allowed to call
      * Type: string\[]
    * `spec.firewallConfig.external.inboundAllowCIDR`
      * The list of CIDR values that are allowed to call the workload
      * Type: string\[]
      * Tip: Use the value `["0.0.0.0/0"]` to allow all inbound requests
    * `spec.firewallConfig.internal.inboundAllowType`
      * The allowed inbound types to a workload
      * Type: string
      * Allowed values: 'none' | 'same-gvc' | 'same-org' | 'workload-list'
    * `spec.firewallConfig.internal.inboundAllowWorkload`
      * If the inbound allow type is 'workload-list', this property will be active and contain the names of other workloads that can communicate with this workload
      * Type: string\[]
      * Allowed values: Other workload names within the same global virtual cloud

  **NOTE:** The ratio between CPU to Memory can be at most 1/8.
</Accordion>

<Accordion title="Example">
  * For the examples below, the initial workload is configured as:

  ```text theme={null}
  +---------------------+---------------------+------------------+------+--------+--------------------------------------------------------------------+-----+
  |NAME                 |DESCRIPTION          |GVC               |READY |CREATED |ENDPOINT                                                            |TAGS |
  |---------------------|---------------------|------------------|------|--------|--------------------------------------------------------------------|-----|
  |demo-workload-update |demo-workload-update |demo-gvc-workload |      |Now     |https://demo-workload-update-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |     |
  +---------------------+---------------------+------------------+------+--------+--------------------------------------------------------------------+-----+
  ```

  * Update an workload's description

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload update demo-workload-update --set description="new description" --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +---------------------+----------------+------------------+------+--------+--------------------------------------------------------------------+-----+
    |NAME                 |DESCRIPTION     |GVC               |READY |CREATED |ENDPOINT                                                            |TAGS |
    |---------------------|----------------|------------------|------|--------|--------------------------------------------------------------------|-----|
    |demo-workload-update |new description |demo-gvc-workload |      |Now     |https://demo-workload-update-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |     |
    +---------------------+----------------+------------------+------+--------+--------------------------------------------------------------------+-----+
    ```
  </CodeGroup>

  * Update an workload's tags

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload update demo-workload-update --set tags.demo-key=demo-value --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +---------------------+----------------+------------------+------+--------+--------------------------------------------------------------------+----------------------+
    |NAME                 |DESCRIPTION     |GVC               |READY |CREATED |ENDPOINT                                                            |TAGS                  |
    |---------------------|----------------|------------------|------|--------|--------------------------------------------------------------------|----------------------|
    |demo-workload-update |new description |demo-gvc-workload |      |Now     |https://demo-workload-update-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |demo-key="demo-value" |
    +---------------------+----------------+------------------+------+--------+--------------------------------------------------------------------+----------------------+
    ```
  </CodeGroup>

  * Update a workload's Image

  **NOTE:** Use the convention `//image/IMAGE:TAG` to reference an image residing within the current org's private repository.

  <CodeGroup>
    ```bash Command theme={null}
    cpln workload update demo-workload-update --set spec.containers.helloworld-go.image=gcr.io/knative-samples/helloworld-go:latest --org demo-cpln-organization --gvc demo-gvc-workload
    ```

    ```text Output theme={null}
    +---------------------+----------------+------------------+------+--------+--------------------------------------------------------------------+----------------------+
    |NAME                 |DESCRIPTION     |GVC               |READY |CREATED |ENDPOINT                                                            |TAGS                  |
    |---------------------|----------------|------------------|------|--------|--------------------------------------------------------------------|----------------------|
    |demo-workload-update |new description |demo-gvc-workload |      |Now     |https://demo-workload-update-jdjx75ayrp1ke.geta3p46gfrsp.t.cpln.app |demo-key="demo-value" |
    +---------------------+----------------+------------------+------+--------+--------------------------------------------------------------------+----------------------+
    ```
  </CodeGroup>
</Accordion>

***
