Sha256: 44ba58bb9effb95214e1168429a5dff95c184dae085b483ad6fc0b395fec02ac

Contents?: true

Size: 1.49 KB

Versions: 29

Compression:

Stored size: 1.49 KB

Contents

module Fog
  class Vcloud

    class Real
      basic_request :get_organization
    end

    class Mock

      def get_organization(organization_uri)
        #
        # Based off of:
        # http://support.theenterprisecloud.com/kb/default.asp?id=540&Lang=1&SID=
        #
        # vCloud API Guide v0.9 - Page 26
        #
        organization_uri = ensure_unparsed(organization_uri)
        if organization = mock_data.organization_from_href(organization_uri)
          xml = Builder::XmlMarkup.new

          mock_it 200,
            xml.Org(xmlns.merge(:href => organization.href, :name => organization.name)) {

              organization.vdcs.each do |vdc|
                xml.Link(:rel => "down",
                         :href => vdc.href,
                         :type => "application/vnd.vmware.vcloud.vdc+xml",
                         :name => vdc.name)
                xml.Link(:rel => "down",
                         :href => vdc.catalog.href,
                         :type => "application/vnd.vmware.vcloud.catalog+xml",
                         :name => vdc.catalog.name)
                xml.Link(:rel => "down",
                         :href => vdc.task_list.href,
                         :type => "application/vnd.vmware.vcloud.tasksList+xml",
                         :name => vdc.task_list.name)
              end
            },
            {'Content-Type' => "application/vnd.vmware.vcloud.org+xml" }
        else
          mock_error 200, "401 Unauthorized"
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

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