Class: Fog::DNS::OpenStack::V2

Inherits:
Service
  • Object
show all
Defined in:
lib/fog/dns/openstack/v2.rb,
lib/fog/dns/openstack/v2/models/zone.rb,
lib/fog/dns/openstack/v2/models/zones.rb,
lib/fog/dns/openstack/v2/models/recordset.rb,
lib/fog/dns/openstack/v2/requests/get_zone.rb,
lib/fog/dns/openstack/v2/models/recordsets.rb,
lib/fog/dns/openstack/v2/requests/get_quota.rb,
lib/fog/dns/openstack/v2/requests/list_zones.rb,
lib/fog/dns/openstack/v2/requests/create_zone.rb,
lib/fog/dns/openstack/v2/requests/delete_zone.rb,
lib/fog/dns/openstack/v2/requests/update_zone.rb,
lib/fog/dns/openstack/v2/requests/update_quota.rb,
lib/fog/dns/openstack/v2/requests/get_recordset.rb,
lib/fog/dns/openstack/v2/requests/list_recordsets.rb,
lib/fog/dns/openstack/v2/requests/create_recordset.rb,
lib/fog/dns/openstack/v2/requests/delete_recordset.rb,
lib/fog/dns/openstack/v2/requests/update_recordset.rb

Defined Under Namespace

Classes: Mock, Real, Recordset, Recordsets, Zone, Zones

Constant Summary collapse

SUPPORTED_VERSIONS =
/v2/

Class Method Summary collapse

Class Method Details

.setup_headers(options) ⇒ Object


44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fog/dns/openstack/v2.rb', line 44

def self.setup_headers(options)
  # user needs to have admin privileges to ask for all projects
  all_projects = options.delete(:all_projects) || false

  # user needs to have admin privileges to impersonate another project
  # don't ask for all and one project at the same time
  project_id = options.delete(:project_id) unless all_projects

  headers = {'X-Auth-All-Projects' => all_projects}
  headers['X-Auth-Sudo-Project-Id'] = project_id unless project_id.nil?

  [headers, options]
end