# Method: folders.locations.reservations.query

- [HTTP request](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/folders.locations.reservations/query#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/folders.locations.reservations/query#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/folders.locations.reservations/query#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/folders.locations.reservations/query#body.request_body)
- [Response body](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/folders.locations.reservations/query#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/folders.locations.reservations/query#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/folders.locations.reservations/query#body.aspect_1)

Returns a list of the reservations that are in the parent parameter and match your specified filters.

### HTTP request

`GET https://capacityplanner.googleapis.com/v1beta/{parent=folders/*/locations/*}/reservations:query`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The compute engine resource and location for the time series values to return. The format is: projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location} |

### Query parameters

| Parameters ||
|---|---|
| `locationLevel` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/LocationType`)`` Optional. The location level of the reservations usage timeseries. |
| `machineFamily` | `string` Optional. The machine family to use to select the aggregate reserved values to return. Possible values include "n1", and "n2d" etc. Empty machineFamily will return results matching all machine families. |
| `machineShape` | ``object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/MachineShape`)`` Optional. The machineShape as a filter to select matching reservations. |
| `gpuType` | `string` Optional. The GPU type for the reserved values to return. Sample values are "nvidia-tesla-t4", and "nvidia-tesla-a100". See <https://cloud.google.com/compute/docs/gpus> for a list. Empty gpuType will return results matching all GPUs. |
| `cloudResourceType` | `string` Required. The resource for the reserved values to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", "gce-gpu" and "gce-vm". |
| `reservationType` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/ReservationType`)`` Required. The Reservation type for example, future reservation request and allocation. If unspecified, all types are included. |
| `shareType` | ``enum (`ShareType`)`` Optional. Types of share settings to filter reservations in response. If unspecified, all types are included. |
| `ownershipType` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/OwnershipType`)`` Optional. Types of ownerships to filter reservations based on. In case of OWNED, it filters reservations which are owned by selected parent project/folder/organization. If unspecified, all types are included. |
| `reservationDataLevel` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/ReservationDataLevel`)`` Required. Reservations output data format. |
| `includeUnapprovedReservations` | `boolean` Optional. Whether to include pending for approval reservations in the response. This field is only applicable for future reservations. |
| `aggregationMethod` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/AggregationMethod`)`` Optional. Aggregation Method of the historical reservation usage |
| `startDate` | ``object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/Date`)`` Optional. The start date of reservations usage. |
| `endDate` | ``object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/Date`)`` Optional. The end date of reservations usage. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/QueryReservationsResponse`.

### Authorization scopes

Requires one of the following OAuth scopes:

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

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:

- `capacityplanner.usageHistories.list`

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