target.apidocs.com.google.api.services.compute.model.Commitment.html Maven / Gradle / Ivy
The newest version!
Commitment (Compute Engine API v1-rev20250320-2.0.0)
com.google.api.services.compute.model
Class Commitment
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.compute.model.Commitment
-
public final class Commitment
extends com.google.api.client.json.GenericJson
Represents a regional resource-based commitment resource. Creating this commitment resource means
that you are purchasing a resource-based committed use contract, with an explicit start and end
time. You can purchase resource-based commitments for both hardware and software resources. For
more information, read Resource-based committed use discounts
This is the Java data model class that specifies how to parse/serialize into the JSON that is
transmitted over HTTP when working with the Compute Engine API. For a detailed explanation see:
https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
-
Constructor Summary
Constructors
Constructor and Description
Commitment()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
Commitment
clone()
Boolean
getAutoRenew()
Specifies whether to automatically renew the commitment at the end of its current term.
String
getCategory()
The category of the commitment; specifies whether the commitment is for hardware or software
resources.
String
getCreationTimestamp()
[Output Only] Creation timestamp in RFC3339 text format.
String
getCustomEndTimestamp()
[Input Only] Optional, specifies the requested commitment end time in RFC3339 text format.
String
getDescription()
An optional description of the commitment.
String
getEndTimestamp()
[Output Only] Commitment end time in RFC3339 text format.
List<String>
getExistingReservations()
BigInteger
getId()
[Output Only] The unique identifier for the resource.
String
getKind()
[Output Only] Type of the resource.
LicenseResourceCommitment
getLicenseResource()
The license specification required as part of a license commitment.
List<String>
getMergeSourceCommitments()
The list of source commitments that you are merging to create the new merged commitment.
String
getName()
Name of the commitment.
String
getPlan()
The minimum time duration that you commit to purchasing resources.
String
getRegion()
[Output Only] URL of the region where the commitment and committed resources are located.
List<Reservation>
getReservations()
The list of new reservations that you want to create and attach to this commitment.
List<ResourceCommitment>
getResources()
The list of all the hardware resources, with their types and amounts, that you want to commit
to.
CommitmentResourceStatus
getResourceStatus()
[Output Only] Status information for Commitment resource.
String
getSelfLink()
[Output Only] Server-defined URL for the resource.
String
getSplitSourceCommitment()
The source commitment from which you are transferring resources to create the new split
commitment.
String
getStartTimestamp()
[Output Only] Commitment start time in RFC3339 text format.
String
getStatus()
[Output Only] Status of the commitment with regards to eventual expiration (each commitment has
an end date defined).
String
getStatusMessage()
[Output Only] An optional, human-readable explanation of the status.
String
getType()
The type of commitment; specifies the machine series for which you want to commit to purchasing
resources.
Commitment
set(String fieldName,
Object value)
Commitment
setAutoRenew(Boolean autoRenew)
Specifies whether to automatically renew the commitment at the end of its current term.
Commitment
setCategory(String category)
The category of the commitment; specifies whether the commitment is for hardware or software
resources.
Commitment
setCreationTimestamp(String creationTimestamp)
[Output Only] Creation timestamp in RFC3339 text format.
Commitment
setCustomEndTimestamp(String customEndTimestamp)
[Input Only] Optional, specifies the requested commitment end time in RFC3339 text format.
Commitment
setDescription(String description)
An optional description of the commitment.
Commitment
setEndTimestamp(String endTimestamp)
[Output Only] Commitment end time in RFC3339 text format.
Commitment
setExistingReservations(List<String> existingReservations)
Commitment
setId(BigInteger id)
[Output Only] The unique identifier for the resource.
Commitment
setKind(String kind)
[Output Only] Type of the resource.
Commitment
setLicenseResource(LicenseResourceCommitment licenseResource)
The license specification required as part of a license commitment.
Commitment
setMergeSourceCommitments(List<String> mergeSourceCommitments)
The list of source commitments that you are merging to create the new merged commitment.
Commitment
setName(String name)
Name of the commitment.
Commitment
setPlan(String plan)
The minimum time duration that you commit to purchasing resources.
Commitment
setRegion(String region)
[Output Only] URL of the region where the commitment and committed resources are located.
Commitment
setReservations(List<Reservation> reservations)
The list of new reservations that you want to create and attach to this commitment.
Commitment
setResources(List<ResourceCommitment> resources)
The list of all the hardware resources, with their types and amounts, that you want to commit
to.
Commitment
setResourceStatus(CommitmentResourceStatus resourceStatus)
[Output Only] Status information for Commitment resource.
Commitment
setSelfLink(String selfLink)
[Output Only] Server-defined URL for the resource.
Commitment
setSplitSourceCommitment(String splitSourceCommitment)
The source commitment from which you are transferring resources to create the new split
commitment.
Commitment
setStartTimestamp(String startTimestamp)
[Output Only] Commitment start time in RFC3339 text format.
Commitment
setStatus(String status)
[Output Only] Status of the commitment with regards to eventual expiration (each commitment has
an end date defined).
Commitment
setStatusMessage(String statusMessage)
[Output Only] An optional, human-readable explanation of the status.
Commitment
setType(String type)
The type of commitment; specifies the machine series for which you want to commit to purchasing
resources.
-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
Method Detail
-
getAutoRenew
public Boolean getAutoRenew()
Specifies whether to automatically renew the commitment at the end of its current term. The
default value is false. If you set the field to true, each time your commitment reaches the end
of its term, Compute Engine automatically renews it for another term. You can update this field
anytime before the commitment expires. For example, if the commitment is set to expire at 12 AM
UTC-8 on January 3, 2027, you can update this field until 11:59 PM UTC-8 on January 2, 2027.
- Returns:
- value or
null for none
-
setAutoRenew
public Commitment setAutoRenew(Boolean autoRenew)
Specifies whether to automatically renew the commitment at the end of its current term. The
default value is false. If you set the field to true, each time your commitment reaches the end
of its term, Compute Engine automatically renews it for another term. You can update this field
anytime before the commitment expires. For example, if the commitment is set to expire at 12 AM
UTC-8 on January 3, 2027, you can update this field until 11:59 PM UTC-8 on January 2, 2027.
- Parameters:
autoRenew - autoRenew or null for none
-
getCategory
public String getCategory()
The category of the commitment; specifies whether the commitment is for hardware or software
resources. Category MACHINE specifies that you are committing to hardware machine resources
such as VCPU or MEMORY, listed in resources. Category LICENSE specifies that you are committing
to software licenses, listed in licenseResources. Note that if you specify MACHINE commitments,
then you must also specify a type to indicate the machine series of the hardware resource that
you are committing to.
- Returns:
- value or
null for none
-
setCategory
public Commitment setCategory(String category)
The category of the commitment; specifies whether the commitment is for hardware or software
resources. Category MACHINE specifies that you are committing to hardware machine resources
such as VCPU or MEMORY, listed in resources. Category LICENSE specifies that you are committing
to software licenses, listed in licenseResources. Note that if you specify MACHINE commitments,
then you must also specify a type to indicate the machine series of the hardware resource that
you are committing to.
- Parameters:
category - category or null for none
-
getCreationTimestamp
public String getCreationTimestamp()
[Output Only] Creation timestamp in RFC3339 text format.
- Returns:
- value or
null for none
-
setCreationTimestamp
public Commitment setCreationTimestamp(String creationTimestamp)
[Output Only] Creation timestamp in RFC3339 text format.
- Parameters:
creationTimestamp - creationTimestamp or null for none
-
getCustomEndTimestamp
public String getCustomEndTimestamp()
[Input Only] Optional, specifies the requested commitment end time in RFC3339 text format. Use
this option when the desired commitment's end date is later than the start date + term
duration.
- Returns:
- value or
null for none
-
setCustomEndTimestamp
public Commitment setCustomEndTimestamp(String customEndTimestamp)
[Input Only] Optional, specifies the requested commitment end time in RFC3339 text format. Use
this option when the desired commitment's end date is later than the start date + term
duration.
- Parameters:
customEndTimestamp - customEndTimestamp or null for none
-
getDescription
public String getDescription()
An optional description of the commitment. You can provide this property when you create the
resource.
- Returns:
- value or
null for none
-
setDescription
public Commitment setDescription(String description)
An optional description of the commitment. You can provide this property when you create the
resource.
- Parameters:
description - description or null for none
-
getEndTimestamp
public String getEndTimestamp()
[Output Only] Commitment end time in RFC3339 text format.
- Returns:
- value or
null for none
-
setEndTimestamp
public Commitment setEndTimestamp(String endTimestamp)
[Output Only] Commitment end time in RFC3339 text format.
- Parameters:
endTimestamp - endTimestamp or null for none
-
getExistingReservations
public List<String> getExistingReservations()
- Returns:
- value or
null for none
-
setExistingReservations
public Commitment setExistingReservations(List<String> existingReservations)
- Parameters:
existingReservations - existingReservations or null for none
-
getId
public BigInteger getId()
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- Returns:
- value or
null for none
-
setId
public Commitment setId(BigInteger id)
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- Parameters:
id - id or null for none
-
getKind
public String getKind()
[Output Only] Type of the resource. Always compute#commitment for commitments.
- Returns:
- value or
null for none
-
setKind
public Commitment setKind(String kind)
[Output Only] Type of the resource. Always compute#commitment for commitments.
- Parameters:
kind - kind or null for none
-
getLicenseResource
public LicenseResourceCommitment getLicenseResource()
The license specification required as part of a license commitment.
- Returns:
- value or
null for none
-
setLicenseResource
public Commitment setLicenseResource(LicenseResourceCommitment licenseResource)
The license specification required as part of a license commitment.
- Parameters:
licenseResource - licenseResource or null for none
-
getMergeSourceCommitments
public List<String> getMergeSourceCommitments()
The list of source commitments that you are merging to create the new merged commitment. For
more information, see Merging commitments.
- Returns:
- value or
null for none
-
setMergeSourceCommitments
public Commitment setMergeSourceCommitments(List<String> mergeSourceCommitments)
The list of source commitments that you are merging to create the new merged commitment. For
more information, see Merging commitments.
- Parameters:
mergeSourceCommitments - mergeSourceCommitments or null for none
-
getName
public String getName()
Name of the commitment. You must specify a name when you purchase the commitment. The 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:
- value or
null for none
-
setName
public Commitment setName(String name)
Name of the commitment. You must specify a name when you purchase the commitment. The 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.
- Parameters:
name - name or null for none
-
getPlan
public String getPlan()
The minimum time duration that you commit to purchasing resources. The plan that you choose
determines the preset term length of the commitment (which is 1 year or 3 years) and affects
the discount rate that you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this field are
TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
- Returns:
- value or
null for none
-
setPlan
public Commitment setPlan(String plan)
The minimum time duration that you commit to purchasing resources. The plan that you choose
determines the preset term length of the commitment (which is 1 year or 3 years) and affects
the discount rate that you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this field are
TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
- Parameters:
plan - plan or null for none
-
getRegion
public String getRegion()
[Output Only] URL of the region where the commitment and committed resources are located.
- Returns:
- value or
null for none
-
setRegion
public Commitment setRegion(String region)
[Output Only] URL of the region where the commitment and committed resources are located.
- Parameters:
region - region or null for none
-
getReservations
public List<Reservation> getReservations()
The list of new reservations that you want to create and attach to this commitment. You must
attach reservations to your commitment if your commitment specifies any GPUs or Local SSD
disks. For more information, see Attach reservations to resource-based commitments. Specify
this property only if you want to create new reservations to attach. To attach existing
reservations, specify the existingReservations property instead.
- Returns:
- value or
null for none
-
setReservations
public Commitment setReservations(List<Reservation> reservations)
The list of new reservations that you want to create and attach to this commitment. You must
attach reservations to your commitment if your commitment specifies any GPUs or Local SSD
disks. For more information, see Attach reservations to resource-based commitments. Specify
this property only if you want to create new reservations to attach. To attach existing
reservations, specify the existingReservations property instead.
- Parameters:
reservations - reservations or null for none
-
getResourceStatus
public CommitmentResourceStatus getResourceStatus()
[Output Only] Status information for Commitment resource.
- Returns:
- value or
null for none
-
setResourceStatus
public Commitment setResourceStatus(CommitmentResourceStatus resourceStatus)
[Output Only] Status information for Commitment resource.
- Parameters:
resourceStatus - resourceStatus or null for none
-
getResources
public List<ResourceCommitment> getResources()
The list of all the hardware resources, with their types and amounts, that you want to commit
to. Specify as a separate entry in the list for each individual resource type.
- Returns:
- value or
null for none
-
setResources
public Commitment setResources(List<ResourceCommitment> resources)
The list of all the hardware resources, with their types and amounts, that you want to commit
to. Specify as a separate entry in the list for each individual resource type.
- Parameters:
resources - resources or null for none
-
getSelfLink
public String getSelfLink()
[Output Only] Server-defined URL for the resource.
- Returns:
- value or
null for none
-
setSelfLink
public Commitment setSelfLink(String selfLink)
[Output Only] Server-defined URL for the resource.
- Parameters:
selfLink - selfLink or null for none
-
getSplitSourceCommitment
public String getSplitSourceCommitment()
The source commitment from which you are transferring resources to create the new split
commitment. For more information, see Split commitments.
- Returns:
- value or
null for none
-
setSplitSourceCommitment
public Commitment setSplitSourceCommitment(String splitSourceCommitment)
The source commitment from which you are transferring resources to create the new split
commitment. For more information, see Split commitments.
- Parameters:
splitSourceCommitment - splitSourceCommitment or null for none
-
getStartTimestamp
public String getStartTimestamp()
[Output Only] Commitment start time in RFC3339 text format.
- Returns:
- value or
null for none
-
setStartTimestamp
public Commitment setStartTimestamp(String startTimestamp)
[Output Only] Commitment start time in RFC3339 text format.
- Parameters:
startTimestamp - startTimestamp or null for none
-
getStatus
public String getStatus()
[Output Only] Status of the commitment with regards to eventual expiration (each commitment has
an end date defined). Status can be one of the following values: NOT_YET_ACTIVE, ACTIVE, or
EXPIRED.
- Returns:
- value or
null for none
-
setStatus
public Commitment setStatus(String status)
[Output Only] Status of the commitment with regards to eventual expiration (each commitment has
an end date defined). Status can be one of the following values: NOT_YET_ACTIVE, ACTIVE, or
EXPIRED.
- Parameters:
status - status or null for none
-
getStatusMessage
public String getStatusMessage()
[Output Only] An optional, human-readable explanation of the status.
- Returns:
- value or
null for none
-
setStatusMessage
public Commitment setStatusMessage(String statusMessage)
[Output Only] An optional, human-readable explanation of the status.
- Parameters:
statusMessage - statusMessage or null for none
-
getType
public String getType()
The type of commitment; specifies the machine series for which you want to commit to purchasing
resources. The choice of machine series affects the discount rate and the eligible resource
types. The type must be one of the following: ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,
ACCELERATOR_OPTIMIZED_A3_MEGA, COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D, COMPUTE_OPTIMIZED_C3,
COMPUTE_OPTIMIZED_C3D, COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE, GENERAL_PURPOSE_C4,
GENERAL_PURPOSE_E2, GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D, GENERAL_PURPOSE_N4,
GENERAL_PURPOSE_T2D, GRAPHICS_OPTIMIZED, MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,
MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For example, type MEMORY_OPTIMIZED specifies a
commitment that applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that applies only to eligible resources of
general purpose N1 machine series.
- Returns:
- value or
null for none
-
setType
public Commitment setType(String type)
The type of commitment; specifies the machine series for which you want to commit to purchasing
resources. The choice of machine series affects the discount rate and the eligible resource
types. The type must be one of the following: ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,
ACCELERATOR_OPTIMIZED_A3_MEGA, COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D, COMPUTE_OPTIMIZED_C3,
COMPUTE_OPTIMIZED_C3D, COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE, GENERAL_PURPOSE_C4,
GENERAL_PURPOSE_E2, GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D, GENERAL_PURPOSE_N4,
GENERAL_PURPOSE_T2D, GRAPHICS_OPTIMIZED, MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,
MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For example, type MEMORY_OPTIMIZED specifies a
commitment that applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that applies only to eligible resources of
general purpose N1 machine series.
- Parameters:
type - type or null for none
-
set
public Commitment set(String fieldName,
Object value)
- Overrides:
set in class com.google.api.client.json.GenericJson
-
clone
public Commitment clone()
- Overrides:
clone in class com.google.api.client.json.GenericJson
Copyright © 2011–2025 Google. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy