Class: Google::Apis::ComputeAlpha::Commitment
- Inherits:
-
Object
- Object
- Google::Apis::ComputeAlpha::Commitment
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/compute_alpha/classes.rb,
lib/google/apis/compute_alpha/representations.rb,
lib/google/apis/compute_alpha/representations.rb
Overview
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
Instance Attribute Summary collapse
-
#auto_renew ⇒ Boolean
(also: #auto_renew?)
Specifies whether to automatically renew the commitment at the end of its current term.
-
#category ⇒ String
The category of the commitment; specifies whether the commitment is for hardware or software resources.
-
#creation_timestamp ⇒ String
[Output Only] Creation timestamp in RFC3339 text format.
-
#custom_end_timestamp ⇒ String
[Input Only] Optional, specifies the requested commitment end time in RFC3339 text format.
-
#description ⇒ String
An optional description of the commitment.
-
#end_timestamp ⇒ String
[Output Only] Commitment end time in RFC3339 text format.
-
#existing_reservations ⇒ Array<String>
Corresponds to the JSON property
existingReservations. -
#id ⇒ Fixnum
[Output Only] The unique identifier for the resource.
-
#kind ⇒ String
[Output Only] Type of the resource.
-
#license_resource ⇒ Google::Apis::ComputeAlpha::LicenseResourceCommitment
Commitment for a particular license resource.
-
#merge_source_commitments ⇒ Array<String>
The list of source commitments that you are merging to create the new merged commitment.
-
#name ⇒ String
Name of the commitment.
-
#plan ⇒ String
The minimum time duration that you commit to purchasing resources.
-
#region ⇒ String
[Output Only] URL of the region where the commitment and committed resources are located.
-
#reservations ⇒ Array<Google::Apis::ComputeAlpha::Reservation>
The list of new reservations that you want to create and attach to this commitment.
-
#resource_status ⇒ Google::Apis::ComputeAlpha::CommitmentResourceStatus
[Output Only] Contains output only fields.
-
#resources ⇒ Array<Google::Apis::ComputeAlpha::ResourceCommitment>
The list of all the hardware resources, with their types and amounts, that you want to commit to.
-
#self_link ⇒ String
[Output Only] Server-defined URL for the resource.
-
#self_link_with_id ⇒ String
[Output Only] Server-defined URL for this resource with the resource id.
-
#split_source_commitment ⇒ String
The source commitment from which you are transferring resources to create the new split commitment.
-
#start_timestamp ⇒ String
[Output Only] Commitment start time in RFC3339 text format.
-
#status ⇒ String
[Output Only] Status of the commitment with regards to eventual expiration ( each commitment has an end date defined).
-
#status_message ⇒ String
[Output Only] An optional, human-readable explanation of the status.
-
#type ⇒ String
The type of commitment; specifies the machine series for which you want to commit to purchasing resources.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Commitment
constructor
A new instance of Commitment.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Commitment
Returns a new instance of Commitment.
7790 7791 7792 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7790 def initialize(**args) update!(**args) end |
Instance Attribute Details
#auto_renew ⇒ Boolean Also known as: auto_renew?
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.
Corresponds to the JSON property autoRenew
7628 7629 7630 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7628 def auto_renew @auto_renew end |
#category ⇒ String
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.
Corresponds to the JSON property category
7640 7641 7642 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7640 def category @category end |
#creation_timestamp ⇒ String
[Output Only] Creation timestamp in RFC3339 text format.
Corresponds to the JSON property creationTimestamp
7645 7646 7647 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7645 def @creation_timestamp end |
#custom_end_timestamp ⇒ String
[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.
Corresponds to the JSON property customEndTimestamp
7652 7653 7654 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7652 def @custom_end_timestamp end |
#description ⇒ String
An optional description of the commitment. You can provide this property when
you create the resource.
Corresponds to the JSON property description
7658 7659 7660 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7658 def description @description end |
#end_timestamp ⇒ String
[Output Only] Commitment end time in RFC3339 text format.
Corresponds to the JSON property endTimestamp
7663 7664 7665 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7663 def @end_timestamp end |
#existing_reservations ⇒ Array<String>
Corresponds to the JSON property existingReservations
7668 7669 7670 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7668 def existing_reservations @existing_reservations end |
#id ⇒ Fixnum
[Output Only] The unique identifier for the resource. This identifier is
defined by the server.
Corresponds to the JSON property id
7674 7675 7676 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7674 def id @id end |
#kind ⇒ String
[Output Only] Type of the resource. Always compute#commitment for commitments.
Corresponds to the JSON property kind
7679 7680 7681 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7679 def kind @kind end |
#license_resource ⇒ Google::Apis::ComputeAlpha::LicenseResourceCommitment
Commitment for a particular license resource.
Corresponds to the JSON property licenseResource
7684 7685 7686 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7684 def license_resource @license_resource end |
#merge_source_commitments ⇒ Array<String>
The list of source commitments that you are merging to create the new merged
commitment. For more information, see Merging commitments.
Corresponds to the JSON property mergeSourceCommitments
7690 7691 7692 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7690 def merge_source_commitments @merge_source_commitments end |
#name ⇒ String
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.
Corresponds to the JSON property name
7700 7701 7702 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7700 def name @name end |
#plan ⇒ String
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).
Corresponds to the JSON property plan
7710 7711 7712 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7710 def plan @plan end |
#region ⇒ String
[Output Only] URL of the region where the commitment and committed resources
are located.
Corresponds to the JSON property region
7716 7717 7718 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7716 def region @region end |
#reservations ⇒ Array<Google::Apis::ComputeAlpha::Reservation>
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.
Corresponds to the JSON property reservations
7726 7727 7728 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7726 def reservations @reservations end |
#resource_status ⇒ Google::Apis::ComputeAlpha::CommitmentResourceStatus
[Output Only] Contains output only fields.
Corresponds to the JSON property resourceStatus
7731 7732 7733 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7731 def resource_status @resource_status end |
#resources ⇒ Array<Google::Apis::ComputeAlpha::ResourceCommitment>
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.
Corresponds to the JSON property resources
7738 7739 7740 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7738 def resources @resources end |
#self_link ⇒ String
[Output Only] Server-defined URL for the resource.
Corresponds to the JSON property selfLink
7743 7744 7745 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7743 def self_link @self_link end |
#self_link_with_id ⇒ String
[Output Only] Server-defined URL for this resource with the resource id.
Corresponds to the JSON property selfLinkWithId
7748 7749 7750 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7748 def self_link_with_id @self_link_with_id end |
#split_source_commitment ⇒ String
The source commitment from which you are transferring resources to create the
new split commitment. For more information, see Split commitments.
Corresponds to the JSON property splitSourceCommitment
7754 7755 7756 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7754 def split_source_commitment @split_source_commitment end |
#start_timestamp ⇒ String
[Output Only] Commitment start time in RFC3339 text format.
Corresponds to the JSON property startTimestamp
7759 7760 7761 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7759 def @start_timestamp end |
#status ⇒ String
[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.
Corresponds to the JSON property status
7766 7767 7768 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7766 def status @status end |
#status_message ⇒ String
[Output Only] An optional, human-readable explanation of the status.
Corresponds to the JSON property statusMessage
7771 7772 7773 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7771 def @status_message end |
#type ⇒ String
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.
Corresponds to the JSON property type
7788 7789 7790 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7788 def type @type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 |
# File 'lib/google/apis/compute_alpha/classes.rb', line 7795 def update!(**args) @auto_renew = args[:auto_renew] if args.key?(:auto_renew) @category = args[:category] if args.key?(:category) @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp) @custom_end_timestamp = args[:custom_end_timestamp] if args.key?(:custom_end_timestamp) @description = args[:description] if args.key?(:description) @end_timestamp = args[:end_timestamp] if args.key?(:end_timestamp) @existing_reservations = args[:existing_reservations] if args.key?(:existing_reservations) @id = args[:id] if args.key?(:id) @kind = args[:kind] if args.key?(:kind) @license_resource = args[:license_resource] if args.key?(:license_resource) @merge_source_commitments = args[:merge_source_commitments] if args.key?(:merge_source_commitments) @name = args[:name] if args.key?(:name) @plan = args[:plan] if args.key?(:plan) @region = args[:region] if args.key?(:region) @reservations = args[:reservations] if args.key?(:reservations) @resource_status = args[:resource_status] if args.key?(:resource_status) @resources = args[:resources] if args.key?(:resources) @self_link = args[:self_link] if args.key?(:self_link) @self_link_with_id = args[:self_link_with_id] if args.key?(:self_link_with_id) @split_source_commitment = args[:split_source_commitment] if args.key?(:split_source_commitment) @start_timestamp = args[:start_timestamp] if args.key?(:start_timestamp) @status = args[:status] if args.key?(:status) @status_message = args[:status_message] if args.key?(:status_message) @type = args[:type] if args.key?(:type) end |