# Method: projects.locations.osPolicyAssignments.list

- [HTTP request](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.request_body)
- [Response body](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.ListOSPolicyAssignmentsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/list#try-it)

List the OS policy assignments under the parent resource.

For each OS policy assignment, the latest revision is returned.

### HTTP request

`GET https://osconfig.googleapis.com/v1/{parent=projects/*/locations/*}/osPolicyAssignments`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource name. |

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` The maximum number of assignments to return. |
| `pageToken` | `string` A pagination token returned from a previous call to `osPolicyAssignments.list` that indicates where this listing should continue from. |

### Request body

The request body must be empty.

### Response body

A response message for listing all assignments under given parent.

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

| JSON representation |
|---|
| ``` { "osPolicyAssignments": [ { object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/Shared.Types/OSPolicyAssignment`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `osPolicyAssignments[]` | ``object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/Shared.Types/OSPolicyAssignment`)`` The list of assignments |
| `nextPageToken` | `string` The pagination token to retrieve the next page of OS policy assignments. |

### Authorization scopes

Requires the following OAuth scope:

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

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

### IAM Permissions

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

- `osconfig.osPolicyAssignments.list`

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