Sha256: 1fa75bf56b33331b143744818f188055bb75bd3e61cda5c2a3e06a7952553039
Contents?: true
Size: 1.58 KB
Versions: 28
Compression:
Stored size: 1.58 KB
Contents
module Fog module Compute class Google ## # Represents an Address resource # # @see https://developers.google.com/compute/docs/reference/latest/addresses class GlobalAddress < Fog::Model identity :name attribute :address attribute :creation_timestamp, :aliases => "creationTimestamp" attribute :description attribute :id attribute :ip_version, :aliases => "ipVersion" attribute :kind attribute :self_link, :aliases => "selfLink" attribute :status attribute :users IN_USE_STATE = "IN_USE".freeze RESERVED_STATE = "RESERVED".freeze def save requires :identity data = service.insert_global_address(identity, attributes) operation = Fog::Compute::Google::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } reload end def destroy(async = true) requires :identity data = service.delete_global_address(identity) operation = Fog::Compute::Google::Operations.new(:service => service) .get(data.name) operation.wait_for { ready? } unless async operation end def reload requires :identity data = collection.get(identity) merge_attributes(data.attributes) self end def in_use? status == IN_USE_STATE end end end end end
Version data entries
28 entries across 28 versions & 2 rubygems