- [HTTP request](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.request_body)
- [Response body](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.ListWorkloadsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v2/organizations.locations.workloads/list.md.txt#body.aspect_1)

Lists Assured Workloads in a given organization and location.

### HTTP request

`GET https://{endpoint}/v2/{parent=organizations/*/locations/*}/workloads`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/assured-workloads/docs/reference/rest.md.txt#rest_endpoints).

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent organization and location for which to list workloads. Format: `organizations/{organization}/locations/{location}` |

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` Optional. The maximum number of workloads to return. If unspecified, at most 50 workloads will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
| `pageToken` | `string` Optional. A page token received from a previous `workloads.list` call. Provide this to retrieve the subsequent page. |
| `filter` | `string` Optional. A filter expression that filters the listed workloads, as defined in [AIP-160: Filtering](https://google.aip.dev/160). Supported filter fields: - `workloadId` - `state` (supports `=`, `:`, and `!=` operators; for example, `state="ACTIVE"`) - `computedTargetResource` (for example, `computedTargetResource="projects/123"`) - `targetResourceDisplayName` - `framework.framework` - `createTime` - `updateTime` |

### Request body

The request body must be empty.

### Response body

Response message for `workloads.list`.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "workloads": [ { object (`Workload`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `workloads[]` | ``object (`Workload`)`` The list of workloads in the given organization and location. |
| `nextPageToken` | `string` A token to retrieve the next page of results. If this field is omitted, there are no subsequent pages. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/assuredworkloads`
- `https://www.googleapis.com/auth/assuredworkloads.readonly`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication.md.txt#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `assuredworkloads.workload.list`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).