Sha256: 01db29db370e724d425cf7abfdfffd3fb4b2c135551c5968620fc41fdfb29791

Contents?: true

Size: 1.13 KB

Versions: 17

Compression:

Stored size: 1.13 KB

Contents

module Fog
  class Vcloud

    class Real


      def login
        unauthenticated_request({
          :expects  => 200,
          :headers  => {
            'Authorization' => authorization_header
          },
          :method   => 'POST',
          :parse    => true,
          :uri      => login_uri
        })
      end

    end

    class Mock

      def login
        #
        # Based off of:
        # http://support.theenterprisecloud.com/kb/default.asp?id=536&Lang=1&SID=
        # https://community.vcloudexpress.terremark.com/en-us/product_docs/w/wiki/01-get-login-token.aspx
        # vCloud API Guide v0.9 - Page 17
        #
        xml = Builder::XmlMarkup.new

        mock_it 200,
          xml.OrgList(xmlns) {
              mock_data[:organizations].each do |org|
                xml.Org( :type => "application/vnd.vmware.vcloud.org+xml", :href => org[:info][:href], :name => org[:info][:name] )
              end
            },
            { 'Set-Cookie' => 'vcloud-token=fc020a05-21d7-4f33-9b2a-25d8cd05a44e; path=/',
              'Content-Type' => 'application/vnd.vmware.vcloud.orgslist+xml' }

      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fog-0.3.16 lib/fog/vcloud/requests/login.rb
fog-0.3.15 lib/fog/vcloud/requests/login.rb
fog-0.3.14 lib/fog/vcloud/requests/login.rb
fog-0.3.13 lib/fog/vcloud/requests/login.rb
fog-0.3.12 lib/fog/vcloud/requests/login.rb
fog-0.3.11 lib/fog/vcloud/requests/login.rb
fog-0.3.10 lib/fog/vcloud/requests/login.rb
fog-0.3.9 lib/fog/vcloud/requests/login.rb
fog-0.3.8 lib/fog/vcloud/requests/login.rb
fog-0.3.7 lib/fog/vcloud/requests/login.rb
fog-0.3.6 lib/fog/vcloud/requests/login.rb
fog-0.3.5 lib/fog/vcloud/requests/login.rb
fog-0.3.4 lib/fog/vcloud/requests/login.rb
fog-0.3.3 lib/fog/vcloud/requests/login.rb
fog-0.3.2 lib/fog/vcloud/requests/login.rb
fog-0.3.1 lib/fog/vcloud/requests/login.rb
fog-0.3.0 lib/fog/vcloud/requests/login.rb