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

# plerion workload-scans

> Scan one workload now and check the scan's status.

With **plerion workload-scans**, you can scan one EC2 instance or Amazon Machine Image (AMI) now instead of waiting for the next scheduled scan, then check on the scan.

<Tip>
  For more about workload scanning, see [Workload scanning](/guides/platform/cwpp/overview).
</Tip>

***

## Synopsis

```bash theme={"system"}
plerion workload-scans <subcommand> [options]
```

***

## Subcommands

### request

Name the workload by its Plerion asset ID, or by its resource type, region, and ID together.

```bash theme={"system"}
plerion workload-scans request --integration-id <id> --asset-id <asset-id>
plerion workload-scans request --integration-id <id> --resource-type <type> --resource-region <region> --resource-id <id>
```

| Option | Type | Description |
| - | - | - |
| `--integration-id` | string | **(required)** Integration the workload belongs to |
| `--asset-id` | string | Plerion asset ID of the workload. Can't be combined with the `--resource-*` options |
| `--resource-type` | string | `ec2:instance` or `ec2:image`, when `--asset-id` isn't given |
| `--resource-region` | string | Region of the resource (e.g. `ap-southeast-2`), when `--asset-id` isn't given |
| `--resource-id` | string | Resource ID (e.g. `i-0123456789abcdef0`), when `--asset-id` isn't given |

<Note>
  Pass either `--asset-id`, or all three of `--resource-type`, `--resource-region`, and `--resource-id`. If a scan of the same workload is already pending, its scan ID is returned instead of starting another.
</Note>

### get

```bash theme={"system"}
plerion workload-scans get <scan-id>
```

Returns the status of a requested scan. Poll until the status is `SUCCESSFUL`, `COMPLETED`, `COMPLETED_WITH_ERRORS`, or `FAILED`.

***

## Examples

```bash theme={"system"}
# Scan an EC2 instance by its resource ID
plerion workload-scans request \
  --integration-id 458511a1-9bc2-4fce-97a0-0e3139588e6e \
  --resource-type ec2:instance \
  --resource-region ap-southeast-2 \
  --resource-id i-0123456789abcdef0

# Scan a workload by its Plerion asset ID and keep only the scan ID
plerion workload-scans request \
  --integration-id 458511a1-9bc2-4fce-97a0-0e3139588e6e \
  --asset-id <asset-id> \
  --output json --query 'scanId'

# Check on the scan
plerion workload-scans get <scan-id>
```

***

## Output columns (request)

| Column | Description |
| - | - |
| SCAN ID | Scan ID to pass to `get` |
| STATUS | Scan status |
| EXECUTION ID | Scan execution ID |

## Output columns (get)

| Column | Description |
| - | - |
| ID | Scan ID |
| STATUS | `NOT_SCANNED`, `PENDING`, `STARTED`, `COMPLETED`, `COMPLETED_WITH_ERRORS`, `FAILED`, or `SUCCESSFUL` |
| STATUS MESSAGE | Detail on the status |
| TYPE | Scan type |
| ASSET ID | Scanned asset ID |
| INTEGRATION ID | Integration ID |
| APPLIANCE ID | ID of the scanner that ran the scan |
| EXECUTION ID | Scan execution ID |
| STARTED AT | Start timestamp |
| COMPLETED AT | Completion timestamp |
| UPDATED AT | Update timestamp |
| ERROR CODE | Error code, if the scan failed |
| ERROR MESSAGE | Error message, if the scan failed |
| TENANT ID | Tenant ID |
| ORG ID | Organization ID |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.