# Compute V1 Client - Class Reservation (2.10.0)

2.10.0 (latest) 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.0.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.1 1.21.0 1.20.0 1.19.0 1.18.1 1.17.0 1.16.2 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.3 1.7.1 1.6.1 1.5.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** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ advanced_deployment_control` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationAdvancedDeploymentControl` Advanced control for cluster management, applicable only to DENSE deployment type reservations. |
| `↳ aggregate_reservation` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationAggregateReservation` Reservation for aggregated resources, providing shape flexibility. |
| `↳ 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. |
| `↳ confidential_compute_type` | `string` Check the ConfidentialComputeType enum for the list of possible values. |
| `↳ creation_timestamp` | `string` Output only. \[Output Only\] Creation timestamp inRFC3339 text format. |
| `↳ delete_after_duration` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Duration` Duration time relative to reservation creation when Compute Engine will automatically delete this resource. |
| `↳ delete_at_time` | `string` Absolute time in future when the reservation will be auto-deleted by Compute Engine. Timestamp is represented inRFC3339 text format. |
| `↳ deployment_type` | `string` Specifies the deployment strategy for this reservation. Check the DeploymentType enum for the list of possible values. |
| `↳ description` | `string` An optional description of this resource. Provide this property when you create the resource. |
| `↳ early_access_maintenance` | `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. Check the EarlyAccessMaintenance enum for the list of possible values. |
| `↳ enable_emergent_maintenance` | `bool` Indicates whether Compute Engine allows unplanned maintenance for your VMs; for example, to fix hardware errors. |
| `↳ id` | `int|string` Output only. \[Output Only\] The unique identifier for the resource. This identifier is defined by the server. |
| `↳ kind` | `string` Output only. \[Output Only\] Type of the resource. Alwayscompute#reservations for reservations. |
| `↳ linked_commitments` | `string[]` Output only. \[Output Only\] Full or partial URL to parent commitments. This field displays for reservations that are tied to multiple commitments. |
| `↳ 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. |
| `↳ params` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationParams` Input only. Additional params passed with the request, but not persisted as part of resource payload. |
| `↳ protection_tier` | `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). Check the ProtectionTier enum for the list of possible values. |
| `↳ reservation_sharing_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationReservationSharingPolicy` Specify the reservation sharing policy. If unspecified, the reservation will not be shared with Google Cloud managed services. |
| `↳ resource_policies` | `array|https://protobuf.dev/reference/php/api-docs/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_status` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationResourceStatus` Output only. \[Output Only\] Status information for Reservation resource. |
| `↳ satisfies_pzs` | `bool` Output only. \[Output Only\] Reserved for future use. |
| `↳ scheduling_type` | `string` The type of maintenance for the reservation. Check the SchedulingType enum for the list of possible values. |
| `↳ self_link` | `string` Output only. \[Output Only\] Server-defined fully-qualified URL for this resource. |
| `↳ share_settings` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ShareSettings` 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_reservation` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationSpecificSKUReservation` Reservation for instances with specific machine shapes. |
| `↳ specific_reservation_required` | `bool` 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. Check the Status enum for the list of possible values. |
| `↳ zone` | `string` Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. |

### getAdvancedDeploymentControl

Advanced control for cluster management, applicable only to DENSE
deployment type reservations.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationAdvancedDeploymentControl|null` |   |

### hasAdvancedDeploymentControl

### clearAdvancedDeploymentControl

### setAdvancedDeploymentControl

Advanced control for cluster management, applicable only to DENSE
deployment type reservations.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationAdvancedDeploymentControl` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAggregateReservation

Reservation for aggregated resources, providing shape flexibility.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationAggregateReservation|null` |   |

### hasAggregateReservation

### clearAggregateReservation

### setAggregateReservation

Reservation for aggregated resources, providing shape flexibility.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationAggregateReservation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCommitment

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasCommitment

### clearCommitment

### setCommitment

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConfidentialComputeType

Check the ConfidentialComputeType enum for the list of possible values.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasConfidentialComputeType

### clearConfidentialComputeType

### setConfidentialComputeType

Check the ConfidentialComputeType enum for the list of possible values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreationTimestamp

Output only. \[Output Only\] Creation timestamp inRFC3339
text format.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasCreationTimestamp

### clearCreationTimestamp

### setCreationTimestamp

Output only. \[Output Only\] Creation timestamp inRFC3339
text format.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDeleteAfterDuration

Duration time relative to reservation creation when Compute Engine will
automatically delete this resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Duration|null` |   |

### hasDeleteAfterDuration

### clearDeleteAfterDuration

### setDeleteAfterDuration

Duration time relative to reservation creation when Compute Engine will
automatically delete this resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDeleteAtTime

Absolute time in future when the reservation will be
auto-deleted by Compute Engine. Timestamp is represented inRFC3339 text format.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasDeleteAtTime

### clearDeleteAtTime

### setDeleteAtTime

Absolute time in future when the reservation will be
auto-deleted by Compute Engine. Timestamp is represented inRFC3339 text format.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDeploymentType

Specifies the deployment strategy for this reservation.

Check the DeploymentType enum for the list of possible values.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasDeploymentType

### clearDeploymentType

### setDeploymentType

Specifies the deployment strategy for this reservation.

Check the DeploymentType enum for the list of possible values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDescription

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasDescription

### clearDescription

### setDescription

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEarlyAccessMaintenance

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasEarlyAccessMaintenance

### clearEarlyAccessMaintenance

### setEarlyAccessMaintenance

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnableEmergentMaintenance

Indicates whether Compute Engine allows unplanned maintenance for your VMs;
for example, to fix hardware errors.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasEnableEmergentMaintenance

### clearEnableEmergentMaintenance

### setEnableEmergentMaintenance

Indicates whether Compute Engine allows unplanned maintenance for your VMs;
for example, to fix hardware errors.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getId

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### hasId

### clearId

### setId

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getKind

Output only. \[Output Only\] Type of the resource. Alwayscompute#reservations for reservations.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasKind

### clearKind

### setKind

Output only. \[Output Only\] Type of the resource. Alwayscompute#reservations for reservations.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLinkedCommitments

Output only. \[Output Only\] Full or partial URL to parent commitments. This field
displays for reservations that are tied to multiple commitments.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setLinkedCommitments

Output only. \[Output Only\] Full or partial URL to parent commitments. This field
displays for reservations that are tied to multiple commitments.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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
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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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
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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getParams

Input only. Additional params passed with the request, but not persisted
as part of resource payload.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationParams|null` |   |

### hasParams

### clearParams

### setParams

Input only. Additional params passed with the request, but not persisted
as part of resource payload.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ReservationParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProtectionTier

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

Check the ProtectionTier enum for the list of possible values.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasProtectionTier

### clearProtectionTier

### setProtectionTier

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

Check the ProtectionTier enum for the list of possible values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReservationSharingPolicy

Specify the reservation sharing policy. If unspecified, the reservation
will not be shared with Google Cloud managed services.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationReservationSharingPolicy|null` |   |

### hasReservationSharingPolicy

### clearReservationSharingPolicy

### setReservationSharingPolicy

Specify the reservation sharing policy. If unspecified, the reservation
will not be shared with Google Cloud managed services.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationReservationSharingPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/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** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceStatus

Output only. \[Output Only\] Status information for Reservation resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationResourceStatus|null` |   |

### hasResourceStatus

### clearResourceStatus

### setResourceStatus

Output only. \[Output Only\] Status information for Reservation resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationResourceStatus` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSatisfiesPzs

Output only. \[Output Only\] Reserved for future use.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasSatisfiesPzs

### clearSatisfiesPzs

### setSatisfiesPzs

Output only. \[Output Only\] Reserved for future use.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSchedulingType

The type of maintenance for the reservation.

Check the SchedulingType enum for the list of possible values.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasSchedulingType

### clearSchedulingType

### setSchedulingType

The type of maintenance for the reservation.

Check the SchedulingType enum for the list of possible values.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSelfLink

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasSelfLink

### clearSelfLink

### setSelfLink

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.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** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.ShareSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSpecificReservation

Reservation for instances with specific machine shapes.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationSpecificSKUReservation|null` |   |

### hasSpecificReservation

### clearSpecificReservation

### setSpecificReservation

Reservation for instances with specific machine shapes.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.AllocationSpecificSKUReservation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$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** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStatus

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasStatus

### clearStatus

### setStatus

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getZone

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasZone

### clearZone

### setZone

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |