Sha256: c1f4f79e8f81813c837c691f38df75c6483cb438f068d7c5ff1b3c0c04eb9fda

Contents?: true

Size: 1.69 KB

Versions: 17

Compression:

Stored size: 1.69 KB

Contents

module Fog
  module HP
    class Network
      class Real
        # List existing networks
        #
        # ==== Parameters
        # * options<~Hash>:
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * networks<~Array>:
        #       * 'id'<~String>: - UUId for the network
        #       * 'name'<~String>: - Name of the network
        #       * 'tenant_id'<~String>: - TenantId that owns the network
        #       * 'status'<~String>: - Status of the network i.e. "ACTIVE"
        #       * 'subnets'<~Array>: - Subnets for the network
        #         * 'id'<~Integer>: - UUId for the subnet
        #       * 'router:external'<~Boolean>: - true or false
        #       * 'admin_state_up'<~Boolean>: - true or false
        #       * 'shared'<~Boolean>: - true or false
        def list_networks(options = {})
          begin
            request(
              :expects => 200,
              :method  => 'GET',
              :path    => 'networks',
              :query   => options
            )
          rescue Fog::HP::Network::NotFound
            begin
              request(
                :expects => 200,
                :method  => 'GET',
                :path    => 'os-networks',
                :query   => options
              )
            rescue Exception => e
              throw e
            end
          end
        end
      end

      class Mock
        def list_networks(options = {})
          response = Excon::Response.new

          networks = self.data[:networks].values
          response.status = 200
          response.body = { 'networks' => networks }
          response
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

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