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

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/compute_beta/classes.rb,
generated/google/apis/compute_beta/representations.rb,
generated/google/apis/compute_beta/representations.rb

Overview

Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. Committed use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Commitment

Returns a new instance of Commitment



3030
3031
3032
# File 'generated/google/apis/compute_beta/classes.rb', line 3030

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

Instance Attribute Details

#creation_timestampString

[Output Only] Creation timestamp in RFC3339 text format. Corresponds to the JSON property creationTimestamp

Returns:

  • (String)


2956
2957
2958
# File 'generated/google/apis/compute_beta/classes.rb', line 2956

def creation_timestamp
  @creation_timestamp
end

#descriptionString

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

Returns:

  • (String)


2962
2963
2964
# File 'generated/google/apis/compute_beta/classes.rb', line 2962

def description
  @description
end

#end_timestampString

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

Returns:

  • (String)


2967
2968
2969
# File 'generated/google/apis/compute_beta/classes.rb', line 2967

def end_timestamp
  @end_timestamp
end

#idFixnum

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

Returns:

  • (Fixnum)


2973
2974
2975
# File 'generated/google/apis/compute_beta/classes.rb', line 2973

def id
  @id
end

#kindString

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

Returns:

  • (String)


2978
2979
2980
# File 'generated/google/apis/compute_beta/classes.rb', line 2978

def kind
  @kind
end

#nameString

Name of the resource. Provided by the client when the resource is created. 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? 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)


2988
2989
2990
# File 'generated/google/apis/compute_beta/classes.rb', line 2988

def name
  @name
end

#planString

The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). Corresponds to the JSON property plan

Returns:

  • (String)


2995
2996
2997
# File 'generated/google/apis/compute_beta/classes.rb', line 2995

def plan
  @plan
end

#regionString

[Output Only] URL of the region where this commitment may be used. Corresponds to the JSON property region

Returns:

  • (String)


3000
3001
3002
# File 'generated/google/apis/compute_beta/classes.rb', line 3000

def region
  @region
end

#resourcesArray<Google::Apis::ComputeBeta::ResourceCommitment>

List of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. Corresponds to the JSON property resources



3006
3007
3008
# File 'generated/google/apis/compute_beta/classes.rb', line 3006

def resources
  @resources
end

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

Returns:

  • (String)


3011
3012
3013
# File 'generated/google/apis/compute_beta/classes.rb', line 3011

def self_link
  @self_link
end

#start_timestampString

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

Returns:

  • (String)


3016
3017
3018
# File 'generated/google/apis/compute_beta/classes.rb', line 3016

def start_timestamp
  @start_timestamp
end

#statusString

[Output Only] Status of the commitment with regards to eventual expiration ( each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. Corresponds to the JSON property status

Returns:

  • (String)


3023
3024
3025
# File 'generated/google/apis/compute_beta/classes.rb', line 3023

def status
  @status
end

#status_messageString

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

Returns:

  • (String)


3028
3029
3030
# File 'generated/google/apis/compute_beta/classes.rb', line 3028

def status_message
  @status_message
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
# File 'generated/google/apis/compute_beta/classes.rb', line 3035

def update!(**args)
  @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)
  @description = args[:description] if args.key?(:description)
  @end_timestamp = args[:end_timestamp] if args.key?(:end_timestamp)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @name = args[:name] if args.key?(:name)
  @plan = args[:plan] if args.key?(:plan)
  @region = args[:region] if args.key?(:region)
  @resources = args[:resources] if args.key?(:resources)
  @self_link = args[:self_link] if args.key?(:self_link)
  @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)
end