# Method: organizations.locations.reservationsUsage.export

- [HTTP request](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/organizations.locations.reservationsUsage/export#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/organizations.locations.reservationsUsage/export#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/organizations.locations.reservationsUsage/export#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/organizations.locations.reservationsUsage/export#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/organizations.locations.reservationsUsage/export#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/organizations.locations.reservationsUsage/export#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/organizations.locations.reservationsUsage/export#body.aspect_1)

Exports reservations usage data requested by user into either an existing Cloud Storage bucket or a new/existing BigQuery table.

### HTTP request

`POST https://capacityplanner.googleapis.com/v1beta/{parent=organizations/*/locations/*}/reservationsUsage:export`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The compute engine resource and location of the reservationsusage. The format is: projects/{project}/locations/{location} or organizations/{organization}/locations/{location} or folders/{folder}/locations/{location} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "locationLevel": enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/LocationType`), "cloudResourceType": string, "usageAggregationMethod": enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/AggregationMethod`), "shareType": enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/ShareType`), "startDate": { object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/Date`) }, "endDate": { object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/Date`) }, "outputConfig": { object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/OutputConfig`) }, // Union field `resource` can be only one of the following: "machineFamily": string, "machineShape": { object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/MachineShape`) }, "gpuType": string // End of list of possible types for union field `resource`. } ``` |

| Fields ||
|---|---|
| `locationLevel` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/LocationType`)`` Optional. The location level of the reservations usage timeseries. |
| `cloudResourceType` | `string` Required. The resource for the `ReservationsUsage` values to return. Possible values include "gce-vcpus", "gce-ram", "gce-local-ssd", and "gce-gpu". |
| `usageAggregationMethod` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/AggregationMethod`)`` Required. The method that should be used to convert sampled reservations data to daily usage values. |
| `shareType` | ``enum (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/ShareType`)`` Optional. Type of share settings to filter reservations in response. If unspecified, all types are included. |
| `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. |
| `outputConfig` | ``object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/OutputConfig`)`` Required. Output configuration indicating where the results will be output to. |
| Union field `resource`. resource to query reservations and usage by. `resource` can be only one of the following: ||
| `machineFamily` | `string` Optional. The machine family to query reservations and usage by. For example: n1, n2d. |
| `machineShape` | ``object (`https://docs.cloud.google.com/capacity-planner/docs/reference/rest/v1beta/MachineShape`)`` Optional. The machineShape as a filter to select matching reservations and its usage. |
| `gpuType` | `string` Optional. The GPU type to query reservations and usage by. For example: NVIDIA T4. |

### Response body

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

### 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).