Sha256: 85eb8a3b9180e6cc9c93bba217ff7545039e61b947306fe6ff3fc2b40647cc63

Contents?: true

Size: 1.13 KB

Versions: 29

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 |organization|
                xml.Org( :type => "application/vnd.vmware.vcloud.org+xml", :href => organization.href, :name => organization.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

29 entries across 29 versions & 3 rubygems

Version Path
fog-0.5.3 lib/fog/vcloud/requests/login.rb
fog-0.5.2 lib/fog/vcloud/requests/login.rb
fog-0.5.1 lib/fog/vcloud/requests/login.rb
fog-0.5.0 lib/fog/vcloud/requests/login.rb
phpfog-fog-0.4.1.3 lib/fog/vcloud/requests/login.rb
phpfog-fog-0.4.1.2 lib/fog/vcloud/requests/login.rb
phpfog-fog-0.4.1.1 lib/fog/vcloud/requests/login.rb
phpfog-fog-0.4.1 lib/fog/vcloud/requests/login.rb
fog-0.4.1 lib/fog/vcloud/requests/login.rb
fog-0.4.0 lib/fog/vcloud/requests/login.rb
fog-0.3.34 lib/fog/vcloud/requests/login.rb
fog-0.3.33 lib/fog/vcloud/requests/login.rb
fog-0.3.32 lib/fog/vcloud/requests/login.rb
fog-0.3.31 lib/fog/vcloud/requests/login.rb
fog-0.3.30 lib/fog/vcloud/requests/login.rb
fog-0.3.29 lib/fog/vcloud/requests/login.rb
fog-0.3.28 lib/fog/vcloud/requests/login.rb
fog-0.3.27 lib/fog/vcloud/requests/login.rb
fog-0.3.26 lib/fog/vcloud/requests/login.rb
fog-0.3.25 lib/fog/vcloud/requests/login.rb