Sha256: 042f8125f77dc734cdfa55a2d9bb0c20aba4fe31c74306b35faa770f4904d77e

Contents?: true

Size: 653 Bytes

Versions: 11

Compression:

Stored size: 653 Bytes

Contents

require 'fog/core/collection'
require 'fog/google/models/compute/global_forwarding_rule'

module Fog
  module Compute
    class Google
      class GlobalForwardingRules < Fog::Collection
        model Fog::Compute::Google::GlobalForwardingRule

        def all
          data = service.list_global_forwarding_rules.body['items'] || []
          load(data)
        end

        def get(identity, region='global')
          if global_forwarding_rule = service.get_global_forwarding_rule(identity, region).body
            new(global_forwarding_rule)
          end
        rescue Fog::Errors::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

11 entries across 9 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-google-0.1.0/lib/fog/google/models/compute/global_forwarding_rules.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-google-0.1.0/lib/fog/google/models/compute/global_forwarding_rules.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-google-0.1.0/lib/fog/google/models/compute/global_forwarding_rules.rb
fog-google-0.1.3 lib/fog/google/models/compute/global_forwarding_rules.rb
fog-google-0.1.2 lib/fog/google/models/compute/global_forwarding_rules.rb
fog-google-0.1.1 lib/fog/google/models/compute/global_forwarding_rules.rb
fog-google-0.1.0 lib/fog/google/models/compute/global_forwarding_rules.rb
fog-google-0.0.9 lib/fog/google/models/compute/global_forwarding_rules.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-google-0.0.7/lib/fog/google/models/compute/global_forwarding_rules.rb
fog-google-0.0.7 lib/fog/google/models/compute/global_forwarding_rules.rb
fog-google-0.0.6 lib/fog/google/models/compute/global_forwarding_rules.rb