Sha256: ce03cff7b908324c8d6354af25b0c02f55ce27f491e931ac91e0123254abc1ba

Contents?: true

Size: 1.04 KB

Versions: 31

Compression:

Stored size: 1.04 KB

Contents

module Fog
  module Network
    class OpenStack
      class Real
        def get_network(network_id)
          request(
            :expects => [200],
            :method  => 'GET',
            :path    => "networks/#{network_id}"
          )
        end
      end

      class Mock
        def get_network(network_id)
          response = Excon::Response.new
          if data = self.data[:networks][network_id]
            response.status = 200
            response.body = {
              'network' => {
                'id' => 'e624a36d-762b-481f-9b50-4154ceb78bbb',
                'name' => 'network_1',
                'subnets' => [
                  '2e4ec6a4-0150-47f5-8523-e899ac03026e'
                ],
                'shared' => false,
                'status' => 'ACTIVE',
                'admin_state_up' => true,
                'tenant_id' => 'f8b26a6032bc47718a7702233ac708b9',
              }
            }
            response
          else
            raise Fog::Network::OpenStack::NotFound
          end
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 5 rubygems

Version Path
fog-openstack-0.1.1 lib/fog/openstack/requests/network/get_network.rb
fog-openstack-0.1.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.37.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.36.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.35.0 lib/fog/openstack/requests/network/get_network.rb
fog-2.0.0.pre.0 lib/fog/openstack/requests/network/get_network.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/openstack/requests/network/get_network.rb
fog-1.34.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.33.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.32.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.31.0 lib/fog/openstack/requests/network/get_network.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/openstack/requests/network/get_network.rb
fog-1.30.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.29.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.28.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.27.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.26.0 lib/fog/openstack/requests/network/get_network.rb
fog-1.25.0 lib/fog/openstack/requests/network/get_network.rb
nsidc-fog-1.24.1 lib/fog/openstack/requests/network/get_network.rb
fog-1.24.0 lib/fog/openstack/requests/network/get_network.rb