Method: folders.locations.reservations.query

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 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 (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 (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

Optional. 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 (ReservationType)

Optional. 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 (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 (ReservationDataLevel)

Optional. 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 (AggregationMethod)

Optional. Aggregation Method of the historical reservation usage

startDate

object (Date)

Optional. The start date of reservations usage.

endDate

object (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 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.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • capacityplanner.usageHistories.list

For more information, see the IAM documentation.