reservations
Creates, updates, deletes, gets or lists a reservations
resource.
Overview
Name | reservations |
Type | Resource |
Id | google.compute.reservations |
Fields
Name | Datatype | Description |
---|---|---|
id | string | [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 with RFC1035. 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. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
aggregateReservation | object | This reservation type is specified by total resource amounts (e.g. total count of CPUs) and can account for multiple instance SKUs. In other words, one can create instances of varying shapes against this reservation. |
commitment | string | [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
kind | string | [Output Only] Type of the resource. Always compute#reservations for reservations. |
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] Contains output only fields. |
satisfiesPzs | boolean | [Output Only] Reserved for future use. |
selfLink | string | [Output Only] Server-defined fully-qualified URL for this resource. |
shareSettings | object | The share setting for reservations and sole tenancy node groups. |
specificReservation | object | This reservation type allows to pre allocate specific instance configuration. |
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] The status of the reservation. |
zone | string | Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
aggregated_list | SELECT | project | Retrieves an aggregated list of reservations. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true . |
get | SELECT | project, reservation, zone | Retrieves information about the specified reservation. |
list | SELECT | project, zone | A list of all the reservations that have been configured for the specified project in specified zone. |
insert | INSERT | project, zone | Creates a new reservation. For more information, read Reserving zonal resources. |
delete | DELETE | project, reservation, zone | Deletes the specified reservation. |
update | UPDATE | project, reservation, zone | Update share settings of the reservation. |
resize | EXEC | project, reservation, zone | Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. |
SELECT
examples
Retrieves an aggregated list of reservations. To prevent failure, Google recommends that you set the returnPartialSuccess
parameter to true
.
SELECT
id,
name,
description,
aggregateReservation,
commitment,
creationTimestamp,
kind,
resourcePolicies,
resourceStatus,
satisfiesPzs,
selfLink,
shareSettings,
specificReservation,
specificReservationRequired,
status,
zone
FROM google.compute.reservations
WHERE project = '{{ project }}';
INSERT
example
Use the following StackQL query and manifest file to create a new reservations
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.compute.reservations (
project,
zone,
zone,
description,
name,
specificReservation,
aggregateReservation,
commitment,
specificReservationRequired,
status,
shareSettings,
satisfiesPzs,
resourcePolicies,
resourceStatus
)
SELECT
'{{ project }}',
'{{ zone }}',
'{{ zone }}',
'{{ description }}',
'{{ name }}',
'{{ specificReservation }}',
'{{ aggregateReservation }}',
'{{ commitment }}',
{{ specificReservationRequired }},
'{{ status }}',
'{{ shareSettings }}',
{{ satisfiesPzs }},
'{{ resourcePolicies }}',
'{{ resourceStatus }}'
;
- name: your_resource_model_name
props:
- name: kind
value: string
- name: id
value: string
- name: creationTimestamp
value: string
- name: selfLink
value: string
- name: zone
value: string
- name: description
value: string
- name: name
value: string
- name: specificReservation
value:
- name: instanceProperties
value:
- name: machineType
value: string
- name: guestAccelerators
value:
- - name: acceleratorType
value: string
- name: acceleratorCount
value: integer
- name: minCpuPlatform
value: string
- name: localSsds
value:
- - name: diskSizeGb
value: string
- name: interface
value: string
- name: locationHint
value: string
- name: count
value: string
- name: inUseCount
value: string
- name: assuredCount
value: string
- name: sourceInstanceTemplate
value: string
- name: aggregateReservation
value:
- name: vmFamily
value: string
- name: reservedResources
value:
- - name: accelerator
value:
- name: acceleratorCount
value: integer
- name: acceleratorType
value: string
- name: inUseResources
value:
- []
- name: workloadType
value: string
- name: commitment
value: string
- name: specificReservationRequired
value: boolean
- name: status
value: string
- name: shareSettings
value:
- name: shareType
value: string
- name: projectMap
value: object
- name: satisfiesPzs
value: boolean
- name: resourcePolicies
value: object
- name: resourceStatus
value:
- name: specificSkuAllocation
value:
- name: sourceInstanceTemplateId
value: string
UPDATE
example
Updates a reservations
resource.
/*+ update */
UPDATE google.compute.reservations
SET
zone = '{{ zone }}',
description = '{{ description }}',
name = '{{ name }}',
specificReservation = '{{ specificReservation }}',
aggregateReservation = '{{ aggregateReservation }}',
commitment = '{{ commitment }}',
specificReservationRequired = true|false,
status = '{{ status }}',
shareSettings = '{{ shareSettings }}',
satisfiesPzs = true|false,
resourcePolicies = '{{ resourcePolicies }}',
resourceStatus = '{{ resourceStatus }}'
WHERE
project = '{{ project }}'
AND reservation = '{{ reservation }}'
AND zone = '{{ zone }}';
DELETE
example
Deletes the specified reservations
resource.
/*+ delete */
DELETE FROM google.compute.reservations
WHERE project = '{{ project }}'
AND reservation = '{{ reservation }}'
AND zone = '{{ zone }}';