reservations
Creates, updates, deletes, gets or lists a reservations resource.
Overview
| Name | reservations |
| Type | Resource |
| Id | google.compute.reservations |
Fields
The following fields are returned by SELECT queries:
- get
- list
- aggregated_list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. (pattern: [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?) |
advancedDeploymentControl | object | Advanced control for cluster management, applicable only to DENSE deployment type reservations. (id: ReservationAdvancedDeploymentControl) |
aggregateReservation | object | Reservation for aggregated resources, providing shape flexibility. (id: AllocationAggregateReservation) |
commitment | string | Output only. [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. |
confidentialComputeType | string | (CONFIDENTIAL_COMPUTE_TYPE_TDX, CONFIDENTIAL_COMPUTE_TYPE_UNSPECIFIED) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
deleteAfterDuration | object | Duration time relative to reservation creation when Compute Engine will automatically delete this resource. (id: Duration) |
deleteAtTime | string | Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented inRFC3339 text format. |
deploymentType | string | Specifies the deployment strategy for this reservation. (DENSE, DEPLOYMENT_TYPE_UNSPECIFIED) |
description | string | An optional description of this resource. Provide this property when you create the resource. |
earlyAccessMaintenance | string | Indicates the early access maintenance for the reservation. If this field is absent or set to NO_EARLY_ACCESS, the reservation is not enrolled in early access maintenance and the standard notice applies. (NO_EARLY_ACCESS, WAVE1, WAVE2) |
enableEmergentMaintenance | boolean | Indicates whether Compute Engine allows unplanned maintenance for your VMs; for example, to fix hardware errors. |
kind | string | Output only. [Output Only] Type of the resource. Alwayscompute#reservations for reservations. (default: compute#reservation) |
linkedCommitments | array | Output only. [Output Only] Full or partial URL to parent commitments. This field displays for reservations that are tied to multiple commitments. |
params | object | Input only. Additional params passed with the request, but not persisted as part of resource payload. (id: ReservationParams) |
protectionTier | string | Protection tier for the workload which specifies the workload expectations in the event of infrastructure failures at data center (e.g. power and/or cooling failures). (CAPACITY_OPTIMIZED, PROTECTION_TIER_UNSPECIFIED, STANDARD) |
reservationSharingPolicy | object | Specify the reservation sharing policy. If unspecified, the reservation will not be shared with Google Cloud managed services. (id: AllocationReservationSharingPolicy) |
resourcePolicies | object | Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation. |
resourceStatus | object | Output only. [Output Only] Status information for Reservation resource. (id: AllocationResourceStatus) |
satisfiesPzs | boolean | Output only. [Output Only] Reserved for future use. |
schedulingType | string | The type of maintenance for the reservation. (GROUPED, GROUP_MAINTENANCE_TYPE_UNSPECIFIED, INDEPENDENT) |
selfLink | string | Output only. [Output Only] Server-defined fully-qualified URL for this resource. |
shareSettings | object | Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation. (id: ShareSettings) |
specificReservation | object | Reservation for instances with specific machine shapes. (id: AllocationSpecificSKUReservation) |
specificReservationRequired | boolean | Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. |
status | string | Output only. [Output Only] The status of the reservation. - CREATING: Reservation resources are being allocated. - READY: Reservation resources have been allocated, and the reservation is ready for use. - DELETING: Reservation deletion is in progress. - UPDATING: Reservation update is in progress. (CREATING, DELETING, INVALID, READY, UPDATING) |
zone | string | Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
items | array | [Output Only] A list of Allocation resources. |
kind | string | Output only. [Output Only] Type of resource.Always compute#reservationsList for listsof reservations (default: compute#reservationList) |
nextPageToken | string | [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |
selfLink | string | Output only. [Output Only] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. (pattern: [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?) |
advancedDeploymentControl | object | Advanced control for cluster management, applicable only to DENSE deployment type reservations. (id: ReservationAdvancedDeploymentControl) |
aggregateReservation | object | Reservation for aggregated resources, providing shape flexibility. (id: AllocationAggregateReservation) |
commitment | string | Output only. [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. |
confidentialComputeType | string | (CONFIDENTIAL_COMPUTE_TYPE_TDX, CONFIDENTIAL_COMPUTE_TYPE_UNSPECIFIED) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
deleteAfterDuration | object | Duration time relative to reservation creation when Compute Engine will automatically delete this resource. (id: Duration) |
deleteAtTime | string | Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented inRFC3339 text format. |
deploymentType | string | Specifies the deployment strategy for this reservation. (DENSE, DEPLOYMENT_TYPE_UNSPECIFIED) |
description | string | An optional description of this resource. Provide this property when you create the resource. |
earlyAccessMaintenance | string | Indicates the early access maintenance for the reservation. If this field is absent or set to NO_EARLY_ACCESS, the reservation is not enrolled in early access maintenance and the standard notice applies. (NO_EARLY_ACCESS, WAVE1, WAVE2) |
enableEmergentMaintenance | boolean | Indicates whether Compute Engine allows unplanned maintenance for your VMs; for example, to fix hardware errors. |
kind | string | Output only. [Output Only] Type of the resource. Alwayscompute#reservations for reservations. (default: compute#reservation) |
linkedCommitments | array | Output only. [Output Only] Full or partial URL to parent commitments. This field displays for reservations that are tied to multiple commitments. |
params | object | Input only. Additional params passed with the request, but not persisted as part of resource payload. (id: ReservationParams) |
protectionTier | string | Protection tier for the workload which specifies the workload expectations in the event of infrastructure failures at data center (e.g. power and/or cooling failures). (CAPACITY_OPTIMIZED, PROTECTION_TIER_UNSPECIFIED, STANDARD) |
reservationSharingPolicy | object | Specify the reservation sharing policy. If unspecified, the reservation will not be shared with Google Cloud managed services. (id: AllocationReservationSharingPolicy) |
resourcePolicies | object | Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation. |
resourceStatus | object | Output only. [Output Only] Status information for Reservation resource. (id: AllocationResourceStatus) |
satisfiesPzs | boolean | Output only. [Output Only] Reserved for future use. |
schedulingType | string | The type of maintenance for the reservation. (GROUPED, GROUP_MAINTENANCE_TYPE_UNSPECIFIED, INDEPENDENT) |
selfLink | string | Output only. [Output Only] Server-defined fully-qualified URL for this resource. |
shareSettings | object | Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation. (id: ShareSettings) |
specificReservation | object | Reservation for instances with specific machine shapes. (id: AllocationSpecificSKUReservation) |
specificReservationRequired | boolean | Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. |
status | string | Output only. [Output Only] The status of the reservation. - CREATING: Reservation resources are being allocated. - READY: Reservation resources have been allocated, and the reservation is ready for use. - DELETING: Reservation deletion is in progress. - UPDATING: Reservation update is in progress. (CREATING, DELETING, INVALID, READY, UPDATING) |
zone | string | Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, zone, reservation | Retrieves information about the specified reservation. | |
list | select | project, zone | filter, maxResults, pageToken, orderBy, returnPartialSuccess | A list of all the reservations that have been configured for the specified project in specified zone. |
aggregated_list | select | project | returnPartialSuccess, includeAllScopes, orderBy, maxResults, pageToken, filter, serviceProjectNumber | Retrieves an aggregated list of reservations. To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true. |
insert | insert | project, zone | requestId | Creates a new reservation. For more information, readReserving zonal resources. |
update | update | project, zone, reservation | paths, requestId, updateMask | Update share settings of the reservation. |
delete | delete | project, zone, reservation | requestId | Deletes the specified reservation. |
perform_maintenance | exec | project, zone, reservation | requestId | Perform maintenance on an extended reservation |
resize | exec | project, zone, reservation | requestId | Resizes the reservation (applicable to standalone reservations only). For more information, readModifying reservations. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
project | string | |
reservation | string | |
zone | string | |
filter | string | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
paths | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
- aggregated_list
Retrieves information about the specified reservation.
SELECT
id,
name,
advancedDeploymentControl,
aggregateReservation,
commitment,
confidentialComputeType,
creationTimestamp,
deleteAfterDuration,
deleteAtTime,
deploymentType,
description,
earlyAccessMaintenance,
enableEmergentMaintenance,
kind,
linkedCommitments,
params,
protectionTier,
reservationSharingPolicy,
resourcePolicies,
resourceStatus,
satisfiesPzs,
schedulingType,
selfLink,
shareSettings,
specificReservation,
specificReservationRequired,
status,
zone
FROM google.compute.reservations
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND reservation = '{{ reservation }}' -- required
;
A list of all the reservations that have been configured for the
specified project in specified zone.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.reservations
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
Retrieves an aggregated list of reservations.
To prevent failure, it is recommended that you set thereturnPartialSuccess parameter to true.
SELECT
id,
name,
advancedDeploymentControl,
aggregateReservation,
commitment,
confidentialComputeType,
creationTimestamp,
deleteAfterDuration,
deleteAtTime,
deploymentType,
description,
earlyAccessMaintenance,
enableEmergentMaintenance,
kind,
linkedCommitments,
params,
protectionTier,
reservationSharingPolicy,
resourcePolicies,
resourceStatus,
satisfiesPzs,
schedulingType,
selfLink,
shareSettings,
specificReservation,
specificReservationRequired,
status,
zone
FROM google.compute.reservations
WHERE project = '{{ project }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND orderBy = '{{ orderBy }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
;
INSERT examples
- insert
- Manifest
Creates a new reservation. For more information, readReserving zonal
resources.
INSERT INTO google.compute.reservations (
data__deleteAtTime,
data__name,
data__confidentialComputeType,
data__description,
data__deleteAfterDuration,
data__schedulingType,
data__earlyAccessMaintenance,
data__resourcePolicies,
data__advancedDeploymentControl,
data__deploymentType,
data__protectionTier,
data__shareSettings,
data__reservationSharingPolicy,
data__params,
data__zone,
data__aggregateReservation,
data__enableEmergentMaintenance,
data__specificReservation,
data__specificReservationRequired,
project,
zone,
requestId
)
SELECT
'{{ deleteAtTime }}',
'{{ name }}',
'{{ confidentialComputeType }}',
'{{ description }}',
'{{ deleteAfterDuration }}',
'{{ schedulingType }}',
'{{ earlyAccessMaintenance }}',
'{{ resourcePolicies }}',
'{{ advancedDeploymentControl }}',
'{{ deploymentType }}',
'{{ protectionTier }}',
'{{ shareSettings }}',
'{{ reservationSharingPolicy }}',
'{{ params }}',
'{{ zone }}',
'{{ aggregateReservation }}',
{{ enableEmergentMaintenance }},
'{{ specificReservation }}',
{{ specificReservationRequired }},
'{{ project }}',
'{{ zone }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;
# Description fields are for documentation purposes
- name: reservations
props:
- name: project
value: "{{ project }}"
description: Required parameter for the reservations resource.
- name: zone
value: "{{ zone }}"
description: Required parameter for the reservations resource.
- name: deleteAtTime
value: "{{ deleteAtTime }}"
description: |
Absolute time in future when the reservation will be
auto-deleted by Compute Engine. Timestamp is represented inRFC3339 text format.
- name: name
value: "{{ name }}"
description: |
The name of the resource, provided by the client when initially creating
the resource. The resource name must be 1-63 characters long, and comply
withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
character must be a lowercase letter, and all following characters must be
a dash, lowercase letter, or digit, except the last character, which cannot
be a dash.
- name: confidentialComputeType
value: "{{ confidentialComputeType }}"
valid_values: ['CONFIDENTIAL_COMPUTE_TYPE_TDX', 'CONFIDENTIAL_COMPUTE_TYPE_UNSPECIFIED']
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: deleteAfterDuration
description: |
Duration time relative to reservation creation when Compute Engine will
automatically delete this resource.
value:
nanos: {{ nanos }}
seconds: "{{ seconds }}"
- name: schedulingType
value: "{{ schedulingType }}"
description: |
The type of maintenance for the reservation.
valid_values: ['GROUPED', 'GROUP_MAINTENANCE_TYPE_UNSPECIFIED', 'INDEPENDENT']
- name: earlyAccessMaintenance
value: "{{ earlyAccessMaintenance }}"
description: |
Indicates the early access maintenance for the reservation.
If this field is absent or set to NO_EARLY_ACCESS, the reservation is not
enrolled in early access maintenance and the standard notice applies.
valid_values: ['NO_EARLY_ACCESS', 'WAVE1', 'WAVE2']
- name: resourcePolicies
value: "{{ resourcePolicies }}"
description: |
Resource policies to be added to this reservation. The key is defined by
user, and the value is resource policy url. This is to define placement
policy with reservation.
- name: advancedDeploymentControl
description: |
Advanced control for cluster management, applicable only to DENSE
deployment type reservations.
value:
reservationOperationalMode: "{{ reservationOperationalMode }}"
- name: deploymentType
value: "{{ deploymentType }}"
description: |
Specifies the deployment strategy for this reservation.
valid_values: ['DENSE', 'DEPLOYMENT_TYPE_UNSPECIFIED']
- name: protectionTier
value: "{{ protectionTier }}"
description: |
Protection tier for the workload which specifies the workload expectations
in the event of infrastructure failures at data center (e.g. power
and/or cooling failures).
valid_values: ['CAPACITY_OPTIMIZED', 'PROTECTION_TIER_UNSPECIFIED', 'STANDARD']
- name: shareSettings
description: |
Specify share-settings to create a shared reservation. This property is
optional. For more information about the syntax and options for this
field and its subfields, see the guide for creating
a shared reservation.
value:
shareType: "{{ shareType }}"
projectMap: "{{ projectMap }}"
- name: reservationSharingPolicy
description: |
Specify the reservation sharing policy. If unspecified, the reservation
will not be shared with Google Cloud managed services.
value:
serviceShareType: "{{ serviceShareType }}"
- name: params
description: |
Input only. Additional params passed with the request, but not persisted
as part of resource payload.
value:
resourceManagerTags: "{{ resourceManagerTags }}"
- name: zone
value: "{{ zone }}"
description: |
Zone in which the reservation resides. A zone must be provided if the
reservation is created within a commitment.
- name: aggregateReservation
description: |
Reservation for aggregated resources, providing shape flexibility.
value:
inUseResources:
- accelerator:
acceleratorCount: {{ acceleratorCount }}
acceleratorType: "{{ acceleratorType }}"
workloadType: "{{ workloadType }}"
vmFamily: "{{ vmFamily }}"
reservedResources:
- accelerator:
acceleratorCount: {{ acceleratorCount }}
acceleratorType: "{{ acceleratorType }}"
- name: enableEmergentMaintenance
value: {{ enableEmergentMaintenance }}
description: |
Indicates whether Compute Engine allows unplanned maintenance for your VMs;
for example, to fix hardware errors.
- name: specificReservation
description: |
Reservation for instances with specific machine shapes.
value:
assuredCount: "{{ assuredCount }}"
instanceProperties:
minCpuPlatform: "{{ minCpuPlatform }}"
guestAccelerators:
- acceleratorType: "{{ acceleratorType }}"
acceleratorCount: {{ acceleratorCount }}
localSsds:
- diskSizeGb: "{{ diskSizeGb }}"
interface: "{{ interface }}"
machineType: "{{ machineType }}"
locationHint: "{{ locationHint }}"
inUseCount: "{{ inUseCount }}"
sourceInstanceTemplate: "{{ sourceInstanceTemplate }}"
count: "{{ count }}"
- name: specificReservationRequired
value: {{ specificReservationRequired }}
description: |
Indicates whether the reservation can be consumed by VMs with affinity
for "any" reservation. If the field is set, then only VMs that target
the reservation by name can consume from this reservation.
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- update
Update share settings of the reservation.
UPDATE google.compute.reservations
SET
data__deleteAtTime = '{{ deleteAtTime }}',
data__name = '{{ name }}',
data__confidentialComputeType = '{{ confidentialComputeType }}',
data__description = '{{ description }}',
data__deleteAfterDuration = '{{ deleteAfterDuration }}',
data__schedulingType = '{{ schedulingType }}',
data__earlyAccessMaintenance = '{{ earlyAccessMaintenance }}',
data__resourcePolicies = '{{ resourcePolicies }}',
data__advancedDeploymentControl = '{{ advancedDeploymentControl }}',
data__deploymentType = '{{ deploymentType }}',
data__protectionTier = '{{ protectionTier }}',
data__shareSettings = '{{ shareSettings }}',
data__reservationSharingPolicy = '{{ reservationSharingPolicy }}',
data__params = '{{ params }}',
data__zone = '{{ zone }}',
data__aggregateReservation = '{{ aggregateReservation }}',
data__enableEmergentMaintenance = {{ enableEmergentMaintenance }},
data__specificReservation = '{{ specificReservation }}',
data__specificReservationRequired = {{ specificReservationRequired }}
WHERE
project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND reservation = '{{ reservation }}' --required
AND paths = '{{ paths}}'
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
DELETE examples
- delete
Deletes the specified reservation.
DELETE FROM google.compute.reservations
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND reservation = '{{ reservation }}' --required
AND requestId = '{{ requestId }}'
;
Lifecycle Methods
- perform_maintenance
- resize
Perform maintenance on an extended reservation
EXEC google.compute.reservations.perform_maintenance
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@reservation='{{ reservation }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"maintenanceScope": "{{ maintenanceScope }}"
}'
;
Resizes the reservation (applicable to standalone reservations only). For
more information, readModifying
reservations.
EXEC google.compute.reservations.resize
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@reservation='{{ reservation }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"specificSkuCount": "{{ specificSkuCount }}"
}'
;