Sha256: 5be8e63777d128837c2713065d2d1791d14a7637db4e60eb8d8372136113eeb3

Contents?: true

Size: 536 Bytes

Versions: 27

Compression:

Stored size: 536 Bytes

Contents

require 'fog/core/collection'
require 'fog/sakuracloud/models/network/switch'

module Fog
  module Network
    class SakuraCloud
      class Switches < Fog::Collection
        model Fog::Network::SakuraCloud::Switch

        def all
          load service.list_switches.body['Switches']
        end

        def get(id)
          all.find { |f| f.id == id }
        rescue Fog::Errors::NotFound
          nil
        end

        def delete(id)
          service.delete_switch(id)
          true
        end
      end
    end
  end
end

Version data entries

27 entries across 25 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-sakuracloud-1.7.5/lib/fog/sakuracloud/models/network/switches.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-sakuracloud-1.7.5/lib/fog/sakuracloud/models/network/switches.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-sakuracloud-1.7.5/lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.7.5 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.7.4 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.7.3 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.7.2 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.7.1 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.7.0 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.6.0 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.5.2 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.5.1 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.5.0 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.4.0 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.3.3 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.3.2 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.3.1 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.3.0 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.2.0 lib/fog/sakuracloud/models/network/switches.rb
fog-sakuracloud-1.1.1 lib/fog/sakuracloud/models/network/switches.rb