Sha256: d322d3dc33c4f8a1aa6a40acf4d7d510217b1611a77069f56be79423dbba2a80

Contents?: true

Size: 881 Bytes

Versions: 7

Compression:

Stored size: 881 Bytes

Contents

require 'fog/core/model'

module Fog
  module Compute
    class Google
      class InstanceGroup < Fog::Model
        identity :name

        attribute :id
        attribute :kind
        attribute :creation_timestamp, :aliases => 'creationTimestamp'
        attribute :description
        attribute :fingerprint
        attribute :namedPorts
        attribute :network
        attribute :self_link, :aliases => 'selfLink'
        attribute :size
        attribute :zone, :aliases => :zone_name

        def save
          requires :name, :zone

          data = service.insert_instance_group(name, zone)
        end

        def destroy(async=true)
          requires :name, :zone
          
          data = service.delete_instance_group(name, zone_name)
        end

        def zone_name
          zone.nil? ? nil : zone.split('/')[-1]
        end

      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-google-0.1.0/lib/fog/google/models/compute/instance_group.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-google-0.1.0/lib/fog/google/models/compute/instance_group.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-google-0.1.0/lib/fog/google/models/compute/instance_group.rb
fog-google-0.1.3 lib/fog/google/models/compute/instance_group.rb
fog-google-0.1.2 lib/fog/google/models/compute/instance_group.rb
fog-google-0.1.1 lib/fog/google/models/compute/instance_group.rb
fog-google-0.1.0 lib/fog/google/models/compute/instance_group.rb