Compute V1 Client - Class Reservation (1.26.0)

Reference documentation and code samples for the Compute V1 Client class Reservation.

Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources.

Generated from protobuf message google.cloud.compute.v1.Reservation

Namespace

Google \ Cloud \ Compute \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
dataarray

Optional. Data for populating the Message object.

↳ aggregate_reservationAllocationAggregateReservation

Reservation for aggregated resources, providing shape flexibility.

↳ commitmentstring

[Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.

↳ creation_timestampstring

[Output Only] Creation timestamp in RFC3339 text format.

↳ descriptionstring

An optional description of this resource. Provide this property when you create the resource.

↳ idint|string

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

↳ kindstring

[Output Only] Type of the resource. Always compute#reservations for reservations.

↳ namestring

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.

↳ resource_policiesarray|Google\Protobuf\Internal\MapField

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.

↳ resource_statusAllocationResourceStatus

[Output Only] Status information for Reservation resource.

↳ satisfies_pzsbool

[Output Only] Reserved for future use.

↳ self_linkstring

[Output Only] Server-defined fully-qualified URL for this resource.

↳ share_settingsShareSettings

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.

↳ specific_reservationAllocationSpecificSKUReservation

Reservation for instances with specific machine shapes.

↳ specific_reservation_requiredbool

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.

↳ statusstring

[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. Check the Status enum for the list of possible values.

↳ zonestring

Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.

getAggregateReservation

Reservation for aggregated resources, providing shape flexibility.

Returns
TypeDescription
AllocationAggregateReservation|null

hasAggregateReservation

clearAggregateReservation

setAggregateReservation

Reservation for aggregated resources, providing shape flexibility.

Parameter
NameDescription
varAllocationAggregateReservation
Returns
TypeDescription
$this

getCommitment

[Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.

Returns
TypeDescription
string

hasCommitment

clearCommitment

setCommitment

[Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getCreationTimestamp

[Output Only] Creation timestamp in RFC3339 text format.

Returns
TypeDescription
string

hasCreationTimestamp

clearCreationTimestamp

setCreationTimestamp

[Output Only] Creation timestamp in RFC3339 text format.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getDescription

An optional description of this resource. Provide this property when you create the resource.

Returns
TypeDescription
string

hasDescription

clearDescription

setDescription

An optional description of this resource. Provide this property when you create the resource.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getId

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

Returns
TypeDescription
int|string

hasId

clearId

setId

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

Parameter
NameDescription
varint|string
Returns
TypeDescription
$this

getKind

[Output Only] Type of the resource. Always compute#reservations for reservations.

Returns
TypeDescription
string

hasKind

clearKind

setKind

[Output Only] Type of the resource. Always compute#reservations for reservations.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getName

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.

Returns
TypeDescription
string

hasName

clearName

setName

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.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getResourcePolicies

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.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setResourcePolicies

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.

Parameter
NameDescription
vararray|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getResourceStatus

[Output Only] Status information for Reservation resource.

Returns
TypeDescription
AllocationResourceStatus|null

hasResourceStatus

clearResourceStatus

setResourceStatus

[Output Only] Status information for Reservation resource.

Parameter
NameDescription
varAllocationResourceStatus
Returns
TypeDescription
$this

getSatisfiesPzs

[Output Only] Reserved for future use.

Returns
TypeDescription
bool

hasSatisfiesPzs

clearSatisfiesPzs

setSatisfiesPzs

[Output Only] Reserved for future use.

Parameter
NameDescription
varbool
Returns
TypeDescription
$this

[Output Only] Server-defined fully-qualified URL for this resource.

Returns
TypeDescription
string

[Output Only] Server-defined fully-qualified URL for this resource.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getShareSettings

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.

Returns
TypeDescription
ShareSettings|null

hasShareSettings

clearShareSettings

setShareSettings

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.

Parameter
NameDescription
varShareSettings
Returns
TypeDescription
$this

getSpecificReservation

Reservation for instances with specific machine shapes.

Returns
TypeDescription
AllocationSpecificSKUReservation|null

hasSpecificReservation

clearSpecificReservation

setSpecificReservation

Reservation for instances with specific machine shapes.

Parameter
NameDescription
varAllocationSpecificSKUReservation
Returns
TypeDescription
$this

getSpecificReservationRequired

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.

Returns
TypeDescription
bool

hasSpecificReservationRequired

clearSpecificReservationRequired

setSpecificReservationRequired

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.

Parameter
NameDescription
varbool
Returns
TypeDescription
$this

getStatus

[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.

Check the Status enum for the list of possible values.

Returns
TypeDescription
string

hasStatus

clearStatus

setStatus

[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.

Check the Status enum for the list of possible values.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getZone

Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.

Returns
TypeDescription
string

hasZone

clearZone

setZone

Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this