Sha256: 23af1920ac8d800436f450cb260b78a665f15a47e825584de21bf4473c1f5625

Contents?: true

Size: 972 Bytes

Versions: 1

Compression:

Stored size: 972 Bytes

Contents

define_request :list_tenants do

  endpoint_type :public
  api_version   :v2
  http_method   :get

  link_to 'documentation',
          'http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_listTenants_v2.0_tokens_tenants_.html'

  link_to 'documentation bug',
          'https://bugs.launchpad.net/keystone/+bug/1218601'


  optional_param :marker
  optional_param :limit


  def url
    service_spec = session_data[:access][:serviceCatalog].find{|s| s[:type] == 'identity' }
    str = "#{ service_spec[:endpoints][0][:publicURL] }/tenants"
    
    filters = []
    
    (optional_params + required_params).each do |param_name|
      filters << "#{ param_name }=#{ params[param_name] }" if params[param_name]
    end
    
    str += "?#{ filters.join('&') }" unless filters.empty?
    
    str
  end

  
  def headers
    h = {}
    
    unless self.anonymous?
      h['X-Auth-Token'] = session_data[:access][:token][:id]
    end

    h
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aviator-0.0.2 lib/aviator/openstack/identity/v2/public/list_tenants.rb