Class: Google::Apis::ComputeBeta::Commitment

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/compute_beta/classes.rb,
lib/google/apis/compute_beta/representations.rb,
lib/google/apis/compute_beta/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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Commitment

Returns a new instance of Commitment.



8716
8717
8718
# File 'lib/google/apis/compute_beta/classes.rb', line 8716

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#auto_renewBoolean 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

Returns:

  • (Boolean)


8536
8537
8538
# File 'lib/google/apis/compute_beta/classes.rb', line 8536

def auto_renew
  @auto_renew
end

#categoryString

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 asVCPU 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

Returns:

  • (String)


8550
8551
8552
# File 'lib/google/apis/compute_beta/classes.rb', line 8550

def category
  @category
end

#creation_timestampString

Output only. [Output Only] Creation timestamp inRFC3339 text format. Corresponds to the JSON property creationTimestamp

Returns:

  • (String)


8556
8557
8558
# File 'lib/google/apis/compute_beta/classes.rb', line 8556

def creation_timestamp
  @creation_timestamp
end

#custom_end_timestampString

[Input Only] Optional, specifies the requested commitment end time inRFC3339 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

Returns:

  • (String)


8563
8564
8565
# File 'lib/google/apis/compute_beta/classes.rb', line 8563

def custom_end_timestamp
  @custom_end_timestamp
end

#descriptionString

An optional description of the commitment. You can provide this property when you create the resource. Corresponds to the JSON property description

Returns:

  • (String)


8569
8570
8571
# File 'lib/google/apis/compute_beta/classes.rb', line 8569

def description
  @description
end

#end_timestampString

Output only. [Output Only] Commitment end time inRFC3339 text format. Corresponds to the JSON property endTimestamp

Returns:

  • (String)


8575
8576
8577
# File 'lib/google/apis/compute_beta/classes.rb', line 8575

def end_timestamp
  @end_timestamp
end

#existing_reservationsArray<String>

Corresponds to the JSON property existingReservations

Returns:

  • (Array<String>)


8580
8581
8582
# File 'lib/google/apis/compute_beta/classes.rb', line 8580

def existing_reservations
  @existing_reservations
end

#idFixnum

Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. Corresponds to the JSON property id

Returns:

  • (Fixnum)


8587
8588
8589
# File 'lib/google/apis/compute_beta/classes.rb', line 8587

def id
  @id
end

#kindString

Output only. [Output Only] Type of the resource. Always compute#commitment for commitments. Corresponds to the JSON property kind

Returns:

  • (String)


8593
8594
8595
# File 'lib/google/apis/compute_beta/classes.rb', line 8593

def kind
  @kind
end

#license_resourceGoogle::Apis::ComputeBeta::LicenseResourceCommitment

Commitment for a particular license resource. Corresponds to the JSON property licenseResource



8598
8599
8600
# File 'lib/google/apis/compute_beta/classes.rb', line 8598

def license_resource
  @license_resource
end

#merge_source_commitmentsArray<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

Returns:

  • (Array<String>)


8605
8606
8607
# File 'lib/google/apis/compute_beta/classes.rb', line 8605

def merge_source_commitments
  @merge_source_commitments
end

#nameString

Name of the commitment. You must specify a name when you purchase the commitment. The 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. Corresponds to the JSON property name

Returns:

  • (String)


8616
8617
8618
# File 'lib/google/apis/compute_beta/classes.rb', line 8616

def name
  @name
end

#paramsGoogle::Apis::ComputeBeta::CommitmentParams

Additional commitment params. Corresponds to the JSON property params



8621
8622
8623
# File 'lib/google/apis/compute_beta/classes.rb', line 8621

def params
  @params
end

#planString

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), andTHIRTY_SIX_MONTH (3 years). Corresponds to the JSON property plan

Returns:

  • (String)


8631
8632
8633
# File 'lib/google/apis/compute_beta/classes.rb', line 8631

def plan
  @plan
end

#regionString

Output only. [Output Only] URL of the region where the commitment and committed resources are located. Corresponds to the JSON property region

Returns:

  • (String)


8638
8639
8640
# File 'lib/google/apis/compute_beta/classes.rb', line 8638

def region
  @region
end

#reservationsArray<Google::Apis::ComputeBeta::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 theexistingReservations property instead. Corresponds to the JSON property reservations



8650
8651
8652
# File 'lib/google/apis/compute_beta/classes.rb', line 8650

def reservations
  @reservations
end

#resource_statusGoogle::Apis::ComputeBeta::CommitmentResourceStatus

[Output Only] Contains output only fields. Corresponds to the JSON property resourceStatus



8655
8656
8657
# File 'lib/google/apis/compute_beta/classes.rb', line 8655

def resource_status
  @resource_status
end

#resourcesArray<Google::Apis::ComputeBeta::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



8662
8663
8664
# File 'lib/google/apis/compute_beta/classes.rb', line 8662

def resources
  @resources
end

Output only. [Output Only] Server-defined URL for the resource. Corresponds to the JSON property selfLink

Returns:

  • (String)


8667
8668
8669
# File 'lib/google/apis/compute_beta/classes.rb', line 8667

def self_link
  @self_link
end

#split_source_commitmentString

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

Returns:

  • (String)


8674
8675
8676
# File 'lib/google/apis/compute_beta/classes.rb', line 8674

def split_source_commitment
  @split_source_commitment
end

#start_timestampString

Output only. [Output Only] Commitment start time inRFC3339 text format. Corresponds to the JSON property startTimestamp

Returns:

  • (String)


8680
8681
8682
# File 'lib/google/apis/compute_beta/classes.rb', line 8680

def start_timestamp
  @start_timestamp
end

#statusString

Output only. [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, orEXPIRED. Corresponds to the JSON property status

Returns:

  • (String)


8688
8689
8690
# File 'lib/google/apis/compute_beta/classes.rb', line 8688

def status
  @status
end

#status_messageString

Output only. [Output Only] An optional, human-readable explanation of the status. Corresponds to the JSON property statusMessage

Returns:

  • (String)


8694
8695
8696
# File 'lib/google/apis/compute_beta/classes.rb', line 8694

def status_message
  @status_message
end

#typeString

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, GRAPHICS_OPTIMIZED_G4,GRAPHICS_OPTIMIZED_G4_VGPU,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

Returns:

  • (String)


8714
8715
8716
# File 'lib/google/apis/compute_beta/classes.rb', line 8714

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
# File 'lib/google/apis/compute_beta/classes.rb', line 8721

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)
  @params = args[:params] if args.key?(:params)
  @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)
  @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