Class: Google::Apis::NotebooksV2::ReservationAffinity

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/notebooks_v2/classes.rb,
lib/google/apis/notebooks_v2/representations.rb,
lib/google/apis/notebooks_v2/representations.rb

Overview

A reservation that an instance can consume from.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ReservationAffinity

Returns a new instance of ReservationAffinity.



1519
1520
1521
# File 'lib/google/apis/notebooks_v2/classes.rb', line 1519

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

Instance Attribute Details

#consume_reservation_typeString

Required. Specifies the type of reservation from which this instance can consume resources: RESERVATION_ANY (default), RESERVATION_SPECIFIC, or RESERVATION_NONE. See Consuming reserved instances for examples. Corresponds to the JSON property consumeReservationType

Returns:

  • (String)


1502
1503
1504
# File 'lib/google/apis/notebooks_v2/classes.rb', line 1502

def consume_reservation_type
  @consume_reservation_type
end

#keyString

Optional. Corresponds to the label key of a reservation resource. To target a RESERVATION_SPECIFIC by name, use compute.googleapis.com/reservation-name as the key and specify the name of your reservation as its value. Corresponds to the JSON property key

Returns:

  • (String)


1509
1510
1511
# File 'lib/google/apis/notebooks_v2/classes.rb', line 1509

def key
  @key
end

#valuesArray<String>

Optional. Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or "projects/different- project/reservations/some-reservation-name" to target a shared reservation in the same zone but in a different project. Corresponds to the JSON property values

Returns:

  • (Array<String>)


1517
1518
1519
# File 'lib/google/apis/notebooks_v2/classes.rb', line 1517

def values
  @values
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1524
1525
1526
1527
1528
# File 'lib/google/apis/notebooks_v2/classes.rb', line 1524

def update!(**args)
  @consume_reservation_type = args[:consume_reservation_type] if args.key?(:consume_reservation_type)
  @key = args[:key] if args.key?(:key)
  @values = args[:values] if args.key?(:values)
end