Class: Google::Apis::ComputeBeta::Metadata::Item

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

Metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Item

Returns a new instance of Item.



20173
20174
20175
# File 'lib/google/apis/compute_beta/classes.rb', line 20173

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

Instance Attribute Details

#keyString

Key for the metadata entry. Keys must conform to the following regexp: [a-zA- Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. Corresponds to the JSON property key

Returns:

  • (String)


20163
20164
20165
# File 'lib/google/apis/compute_beta/classes.rb', line 20163

def key
  @key
end

#valueString

Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). Corresponds to the JSON property value

Returns:

  • (String)


20171
20172
20173
# File 'lib/google/apis/compute_beta/classes.rb', line 20171

def value
  @value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



20178
20179
20180
20181
# File 'lib/google/apis/compute_beta/classes.rb', line 20178

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