Sha256: 0b60b79e9879045080d96a2a5305790f4eb983e0515b5298b5ea1aabeff86e49

Contents?: true

Size: 1.72 KB

Versions: 96

Compression:

Stored size: 1.72 KB

Contents

module Fog
  module Compute
    class VcloudDirector
      class Real
        # Retrieve a list of organizations accessible to you.
        #
        # The system administrator has access to all organizations.
        #
        # @return [Excon::Response]
        #   * body<~Hash>:
        #     * :href<~String> - The URI of the entity.
        #     * :type<~String> - The MIME type of the entity.
        #     * :Org<~Array<Hash>]:
        #       * :href<~String> - Contains the URI to the linked entity.
        #       * :name<~String> - Contains the name of the linked entity.
        #       * :type<~String> - Contains the type of the linked entity.
        #
        # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/GET-Organizations.html
        # @since vCloud API version 0.9
        def get_organizations
          response = request(
            :expects    => 200,
            :idempotent => true,
            :method     => 'GET',
            :parser     => Fog::ToHashDocument.new,
            :path       => 'org'
          )
          ensure_list! response.body, :Org
          response
        end
      end

      class Mock
        def get_organizations
          body =
            {:href=>make_href('org/'),
             :type=>"application/vnd.vmware.vcloud.orgList+xml",
             :Org=>
              [{:href=>make_href("org/#{data[:org][:uuid]}"),
                :name=>data[:org][:name],
                :type=>"application/vnd.vmware.vcloud.org+xml"}]}

          Excon::Response.new(
            :body => body,
            :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"},
            :status => 200
          )
        end
      end
    end
  end
end

Version data entries

96 entries across 94 versions & 8 rubygems

Version Path
fog-2.3.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-ifeel-2.2.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-2.2.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-2.1.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/vcloud_director/requests/compute/get_organizations.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/vcloud_director/requests/compute/get_organizations.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-1.42.1 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-vcloud-director-0.2.2 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-vcloud-director-0.2.1 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-vcloud-director-0.2.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-vcloud-director-0.1.10 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-vcloud-director-0.1.9 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-2.0.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-1.42.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-1.41.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-1.40.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-1.39.0 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-vcloud-director-0.1.8 lib/fog/vcloud_director/requests/compute/get_organizations.rb
fog-vcloud-director-0.1.7 lib/fog/vcloud_director/requests/compute/get_organizations.rb