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

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

A metadata key/value entry.

Defined Under Namespace

Classes: Item

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Metadata

Returns a new instance of Metadata.



20166
20167
20168
# File 'lib/google/apis/compute_beta/classes.rb', line 20166

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

Instance Attribute Details

#fingerprintString

Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. Corresponds to the JSON property fingerprint NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


20153
20154
20155
# File 'lib/google/apis/compute_beta/classes.rb', line 20153

def fingerprint
  @fingerprint
end

#itemsArray<Google::Apis::ComputeBeta::Metadata::Item>

Array of key/value pairs. The total size of all keys and values must be less than 512 KB. Corresponds to the JSON property items



20159
20160
20161
# File 'lib/google/apis/compute_beta/classes.rb', line 20159

def items
  @items
end

#kindString

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

Returns:

  • (String)


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

def kind
  @kind
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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