Class Reservation (1.22.0)

public final class Reservation extends GeneratedMessageV3 implements ReservationOrBuilder

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.

Protobuf type google.cloud.compute.v1.Reservation

Static Fields

COMMITMENT_FIELD_NUMBER

public static final int COMMITMENT_FIELD_NUMBER
Field Value
TypeDescription
int

CREATION_TIMESTAMP_FIELD_NUMBER

public static final int CREATION_TIMESTAMP_FIELD_NUMBER
Field Value
TypeDescription
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
TypeDescription
int

KIND_FIELD_NUMBER

public static final int KIND_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

RESOURCE_POLICIES_FIELD_NUMBER

public static final int RESOURCE_POLICIES_FIELD_NUMBER
Field Value
TypeDescription
int

RESOURCE_STATUS_FIELD_NUMBER

public static final int RESOURCE_STATUS_FIELD_NUMBER
Field Value
TypeDescription
int

SATISFIES_PZS_FIELD_NUMBER

public static final int SATISFIES_PZS_FIELD_NUMBER
Field Value
TypeDescription
int
public static final int SELF_LINK_FIELD_NUMBER
Field Value
TypeDescription
int

SHARE_SETTINGS_FIELD_NUMBER

public static final int SHARE_SETTINGS_FIELD_NUMBER
Field Value
TypeDescription
int

SPECIFIC_RESERVATION_FIELD_NUMBER

public static final int SPECIFIC_RESERVATION_FIELD_NUMBER
Field Value
TypeDescription
int

SPECIFIC_RESERVATION_REQUIRED_FIELD_NUMBER

public static final int SPECIFIC_RESERVATION_REQUIRED_FIELD_NUMBER
Field Value
TypeDescription
int

STATUS_FIELD_NUMBER

public static final int STATUS_FIELD_NUMBER
Field Value
TypeDescription
int

ZONE_FIELD_NUMBER

public static final int ZONE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Reservation getDefaultInstance()
Returns
TypeDescription
Reservation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Reservation.Builder newBuilder()
Returns
TypeDescription
Reservation.Builder

newBuilder(Reservation prototype)

public static Reservation.Builder newBuilder(Reservation prototype)
Parameter
NameDescription
prototypeReservation
Returns
TypeDescription
Reservation.Builder

parseDelimitedFrom(InputStream input)

public static Reservation parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Reservation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Reservation parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Reservation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Reservation parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Reservation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Reservation parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Reservation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Reservation parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Reservation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Reservation parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Reservation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Reservation
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Reservation> parser()
Returns
TypeDescription
Parser<Reservation>

Methods

containsResourcePolicies(String key)

public boolean containsResourcePolicies(String key)

map<string, string> resource_policies = 22220385;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCommitment()

public String getCommitment()

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

optional string commitment = 482134805;

Returns
TypeDescription
String

The commitment.

getCommitmentBytes()

public ByteString getCommitmentBytes()

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

optional string commitment = 482134805;

Returns
TypeDescription
ByteString

The bytes for commitment.

getCreationTimestamp()

public String getCreationTimestamp()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
TypeDescription
String

The creationTimestamp.

getCreationTimestampBytes()

public ByteString getCreationTimestampBytes()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
TypeDescription
ByteString

The bytes for creationTimestamp.

getDefaultInstanceForType()

public Reservation getDefaultInstanceForType()
Returns
TypeDescription
Reservation

getDescription()

public String getDescription()

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

optional string description = 422937596;

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

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

optional string description = 422937596;

Returns
TypeDescription
ByteString

The bytes for description.

getId()

public long getId()

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

optional uint64 id = 3355;

Returns
TypeDescription
long

The id.

getKind()

public String getKind()

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

optional string kind = 3292052;

Returns
TypeDescription
String

The kind.

getKindBytes()

public ByteString getKindBytes()

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

optional string kind = 3292052;

Returns
TypeDescription
ByteString

The bytes for kind.

getName()

public String 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? 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.

optional string name = 3373707;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

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

optional string name = 3373707;

Returns
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<Reservation> getParserForType()
Returns
TypeDescription
Parser<Reservation>
Overrides

getResourcePolicies()

public Map<String,String> getResourcePolicies()
Returns
TypeDescription
Map<String,String>

getResourcePoliciesCount()

public int getResourcePoliciesCount()

map<string, string> resource_policies = 22220385;

Returns
TypeDescription
int

getResourcePoliciesMap()

public Map<String,String> getResourcePoliciesMap()

map<string, string> resource_policies = 22220385;

Returns
TypeDescription
Map<String,String>

getResourcePoliciesOrDefault(String key, String defaultValue)

public String getResourcePoliciesOrDefault(String key, String defaultValue)

map<string, string> resource_policies = 22220385;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getResourcePoliciesOrThrow(String key)

public String getResourcePoliciesOrThrow(String key)

map<string, string> resource_policies = 22220385;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getResourceStatus()

public AllocationResourceStatus getResourceStatus()

[Output Only] Status information for Reservation resource.

optional .google.cloud.compute.v1.AllocationResourceStatus resource_status = 249429315;

Returns
TypeDescription
AllocationResourceStatus

The resourceStatus.

getResourceStatusOrBuilder()

public AllocationResourceStatusOrBuilder getResourceStatusOrBuilder()

[Output Only] Status information for Reservation resource.

optional .google.cloud.compute.v1.AllocationResourceStatus resource_status = 249429315;

Returns
TypeDescription
AllocationResourceStatusOrBuilder

getSatisfiesPzs()

public boolean getSatisfiesPzs()

[Output Only] Reserved for future use.

optional bool satisfies_pzs = 480964267;

Returns
TypeDescription
boolean

The satisfiesPzs.

public String getSelfLink()

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

optional string self_link = 456214797;

Returns
TypeDescription
String

The selfLink.

getSelfLinkBytes()

public ByteString getSelfLinkBytes()

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

optional string self_link = 456214797;

Returns
TypeDescription
ByteString

The bytes for selfLink.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getShareSettings()

public ShareSettings 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.

optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163;

Returns
TypeDescription
ShareSettings

The shareSettings.

getShareSettingsOrBuilder()

public ShareSettingsOrBuilder getShareSettingsOrBuilder()

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.

optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163;

Returns
TypeDescription
ShareSettingsOrBuilder

getSpecificReservation()

public AllocationSpecificSKUReservation getSpecificReservation()

Reservation for instances with specific machine shapes.

optional .google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 404901951;

Returns
TypeDescription
AllocationSpecificSKUReservation

The specificReservation.

getSpecificReservationOrBuilder()

public AllocationSpecificSKUReservationOrBuilder getSpecificReservationOrBuilder()

Reservation for instances with specific machine shapes.

optional .google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 404901951;

Returns
TypeDescription
AllocationSpecificSKUReservationOrBuilder

getSpecificReservationRequired()

public boolean 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.

optional bool specific_reservation_required = 226550687;

Returns
TypeDescription
boolean

The specificReservationRequired.

getStatus()

public String getStatus()

[Output Only] The status of the reservation. Check the Status enum for the list of possible values.

optional string status = 181260274;

Returns
TypeDescription
String

The status.

getStatusBytes()

public ByteString getStatusBytes()

[Output Only] The status of the reservation. Check the Status enum for the list of possible values.

optional string status = 181260274;

Returns
TypeDescription
ByteString

The bytes for status.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

getZone()

public String getZone()

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

optional string zone = 3744684;

Returns
TypeDescription
String

The zone.

getZoneBytes()

public ByteString getZoneBytes()

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

optional string zone = 3744684;

Returns
TypeDescription
ByteString

The bytes for zone.

hasCommitment()

public boolean hasCommitment()

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

optional string commitment = 482134805;

Returns
TypeDescription
boolean

Whether the commitment field is set.

hasCreationTimestamp()

public boolean hasCreationTimestamp()

[Output Only] Creation timestamp in RFC3339 text format.

optional string creation_timestamp = 30525366;

Returns
TypeDescription
boolean

Whether the creationTimestamp field is set.

hasDescription()

public boolean hasDescription()

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

optional string description = 422937596;

Returns
TypeDescription
boolean

Whether the description field is set.

hasId()

public boolean hasId()

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

optional uint64 id = 3355;

Returns
TypeDescription
boolean

Whether the id field is set.

hasKind()

public boolean hasKind()

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

optional string kind = 3292052;

Returns
TypeDescription
boolean

Whether the kind field is set.

hasName()

public boolean hasName()

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

optional string name = 3373707;

Returns
TypeDescription
boolean

Whether the name field is set.

hasResourceStatus()

public boolean hasResourceStatus()

[Output Only] Status information for Reservation resource.

optional .google.cloud.compute.v1.AllocationResourceStatus resource_status = 249429315;

Returns
TypeDescription
boolean

Whether the resourceStatus field is set.

hasSatisfiesPzs()

public boolean hasSatisfiesPzs()

[Output Only] Reserved for future use.

optional bool satisfies_pzs = 480964267;

Returns
TypeDescription
boolean

Whether the satisfiesPzs field is set.

public boolean hasSelfLink()

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

optional string self_link = 456214797;

Returns
TypeDescription
boolean

Whether the selfLink field is set.

hasShareSettings()

public boolean hasShareSettings()

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.

optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163;

Returns
TypeDescription
boolean

Whether the shareSettings field is set.

hasSpecificReservation()

public boolean hasSpecificReservation()

Reservation for instances with specific machine shapes.

optional .google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 404901951;

Returns
TypeDescription
boolean

Whether the specificReservation field is set.

hasSpecificReservationRequired()

public boolean hasSpecificReservationRequired()

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.

optional bool specific_reservation_required = 226550687;

Returns
TypeDescription
boolean

Whether the specificReservationRequired field is set.

hasStatus()

public boolean hasStatus()

[Output Only] The status of the reservation. Check the Status enum for the list of possible values.

optional string status = 181260274;

Returns
TypeDescription
boolean

Whether the status field is set.

hasZone()

public boolean hasZone()

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

optional string zone = 3744684;

Returns
TypeDescription
boolean

Whether the zone field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Reservation.Builder newBuilderForType()
Returns
TypeDescription
Reservation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Reservation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Reservation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Reservation.Builder toBuilder()
Returns
TypeDescription
Reservation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException