Class: Fog::Identity::OpenStack

Inherits:
Service
  • Object
show all
Defined in:
lib/fog/identity/openstack.rb,
lib/fog/identity/openstack/v2.rb,
lib/fog/identity/openstack/v3.rb,
lib/fog/identity/openstack/v2/models/role.rb,
lib/fog/identity/openstack/v2/models/user.rb,
lib/fog/identity/openstack/v3/models/role.rb,
lib/fog/identity/openstack/v3/models/user.rb,
lib/fog/identity/openstack/v2/models/roles.rb,
lib/fog/identity/openstack/v2/models/users.rb,
lib/fog/identity/openstack/v3/models/group.rb,
lib/fog/identity/openstack/v3/models/roles.rb,
lib/fog/identity/openstack/v3/models/token.rb,
lib/fog/identity/openstack/v3/models/users.rb,
lib/fog/identity/openstack/v2/models/tenant.rb,
lib/fog/identity/openstack/v3/models/domain.rb,
lib/fog/identity/openstack/v3/models/groups.rb,
lib/fog/identity/openstack/v3/models/policy.rb,
lib/fog/identity/openstack/v3/models/tokens.rb,
lib/fog/identity/openstack/v2/models/tenants.rb,
lib/fog/identity/openstack/v3/models/domains.rb,
lib/fog/identity/openstack/v3/models/project.rb,
lib/fog/identity/openstack/v3/models/service.rb,
lib/fog/identity/openstack/v3/models/endpoint.rb,
lib/fog/identity/openstack/v3/models/policies.rb,
lib/fog/identity/openstack/v3/models/projects.rb,
lib/fog/identity/openstack/v3/models/services.rb,
lib/fog/identity/openstack/v3/models/endpoints.rb,
lib/fog/identity/openstack/v2/requests/get_role.rb,
lib/fog/identity/openstack/v3/requests/get_role.rb,
lib/fog/identity/openstack/v3/requests/get_user.rb,
lib/fog/identity/openstack/v3/requests/get_group.rb,
lib/fog/identity/openstack/v2/requests/get_tenant.rb,
lib/fog/identity/openstack/v2/requests/list_roles.rb,
lib/fog/identity/openstack/v2/requests/list_users.rb,
lib/fog/identity/openstack/v2/requests/set_tenant.rb,
lib/fog/identity/openstack/v3/requests/get_domain.rb,
lib/fog/identity/openstack/v3/requests/get_policy.rb,
lib/fog/identity/openstack/v3/requests/list_roles.rb,
lib/fog/identity/openstack/v3/requests/list_users.rb,
lib/fog/identity/openstack/v2/requests/check_token.rb,
lib/fog/identity/openstack/v2/requests/create_role.rb,
lib/fog/identity/openstack/v2/requests/create_user.rb,
lib/fog/identity/openstack/v2/requests/delete_role.rb,
lib/fog/identity/openstack/v2/requests/delete_user.rb,
lib/fog/identity/openstack/v2/requests/update_user.rb,
lib/fog/identity/openstack/v3/models/os_credential.rb,
lib/fog/identity/openstack/v3/requests/create_role.rb,
lib/fog/identity/openstack/v3/requests/create_user.rb,
lib/fog/identity/openstack/v3/requests/delete_role.rb,
lib/fog/identity/openstack/v3/requests/delete_user.rb,
lib/fog/identity/openstack/v3/requests/get_project.rb,
lib/fog/identity/openstack/v3/requests/get_service.rb,
lib/fog/identity/openstack/v3/requests/list_groups.rb,
lib/fog/identity/openstack/v3/requests/token_check.rb,
lib/fog/identity/openstack/v3/requests/update_role.rb,
lib/fog/identity/openstack/v3/requests/update_user.rb,
lib/fog/identity/openstack/v2/models/ec2_credential.rb,
lib/fog/identity/openstack/v2/requests/list_tenants.rb,
lib/fog/identity/openstack/v3/models/os_credentials.rb,
lib/fog/identity/openstack/v3/requests/auth_domains.rb,
lib/fog/identity/openstack/v3/requests/create_group.rb,
lib/fog/identity/openstack/v3/requests/delete_group.rb,
lib/fog/identity/openstack/v3/requests/get_endpoint.rb,
lib/fog/identity/openstack/v3/requests/list_domains.rb,
lib/fog/identity/openstack/v3/requests/token_revoke.rb,
lib/fog/identity/openstack/v3/requests/update_group.rb,
lib/fog/identity/openstack/v2/models/ec2_credentials.rb,
lib/fog/identity/openstack/v2/requests/create_tenant.rb,
lib/fog/identity/openstack/v2/requests/delete_tenant.rb,
lib/fog/identity/openstack/v2/requests/update_tenant.rb,
lib/fog/identity/openstack/v3/models/role_assignment.rb,
lib/fog/identity/openstack/v3/requests/auth_projects.rb,
lib/fog/identity/openstack/v3/requests/create_domain.rb,
lib/fog/identity/openstack/v3/requests/create_policy.rb,
lib/fog/identity/openstack/v3/requests/delete_domain.rb,
lib/fog/identity/openstack/v3/requests/delete_policy.rb,
lib/fog/identity/openstack/v3/requests/list_policies.rb,
lib/fog/identity/openstack/v3/requests/list_projects.rb,
lib/fog/identity/openstack/v3/requests/list_services.rb,
lib/fog/identity/openstack/v3/requests/update_domain.rb,
lib/fog/identity/openstack/v3/requests/update_policy.rb,
lib/fog/identity/openstack/v2/requests/get_user_by_id.rb,
lib/fog/identity/openstack/v2/requests/validate_token.rb,
lib/fog/identity/openstack/v3/models/role_assignments.rb,
lib/fog/identity/openstack/v3/requests/create_project.rb,
lib/fog/identity/openstack/v3/requests/create_service.rb,
lib/fog/identity/openstack/v3/requests/delete_project.rb,
lib/fog/identity/openstack/v3/requests/delete_service.rb,
lib/fog/identity/openstack/v3/requests/list_endpoints.rb,
lib/fog/identity/openstack/v3/requests/token_validate.rb,
lib/fog/identity/openstack/v3/requests/update_project.rb,
lib/fog/identity/openstack/v3/requests/update_service.rb,
lib/fog/identity/openstack/v3/requests/create_endpoint.rb,
lib/fog/identity/openstack/v3/requests/delete_endpoint.rb,
lib/fog/identity/openstack/v3/requests/update_endpoint.rb,
lib/fog/identity/openstack/v2/requests/create_user_role.rb,
lib/fog/identity/openstack/v2/requests/delete_user_role.rb,
lib/fog/identity/openstack/v2/requests/get_user_by_name.rb,
lib/fog/identity/openstack/v3/requests/group_user_check.rb,
lib/fog/identity/openstack/v3/requests/list_group_users.rb,
lib/fog/identity/openstack/v3/requests/list_user_groups.rb,
lib/fog/identity/openstack/v2/requests/get_tenants_by_id.rb,
lib/fog/identity/openstack/v3/requests/add_user_to_group.rb,
lib/fog/identity/openstack/v3/requests/get_os_credential.rb,
lib/fog/identity/openstack/v2/requests/add_user_to_tenant.rb,
lib/fog/identity/openstack/v2/requests/get_ec2_credential.rb,
lib/fog/identity/openstack/v3/requests/list_user_projects.rb,
lib/fog/identity/openstack/v3/requests/token_authenticate.rb,
lib/fog/identity/openstack/v2/requests/get_tenants_by_name.rb,
lib/fog/identity/openstack/v3/requests/list_os_credentials.rb,
lib/fog/identity/openstack/v2/requests/list_ec2_credentials.rb,
lib/fog/identity/openstack/v3/requests/create_os_credential.rb,
lib/fog/identity/openstack/v3/requests/delete_os_credential.rb,
lib/fog/identity/openstack/v3/requests/update_os_credential.rb,
lib/fog/identity/openstack/v2/requests/create_ec2_credential.rb,
lib/fog/identity/openstack/v2/requests/delete_ec2_credential.rb,
lib/fog/identity/openstack/v3/requests/list_role_assignments.rb,
lib/fog/identity/openstack/v2/requests/list_user_global_roles.rb,
lib/fog/identity/openstack/v3/requests/check_domain_user_role.rb,
lib/fog/identity/openstack/v3/requests/grant_domain_user_role.rb,
lib/fog/identity/openstack/v3/requests/list_domain_user_roles.rb,
lib/fog/identity/openstack/v3/requests/remove_user_from_group.rb,
lib/fog/identity/openstack/v2/requests/remove_user_from_tenant.rb,
lib/fog/identity/openstack/v3/requests/check_domain_group_role.rb,
lib/fog/identity/openstack/v3/requests/check_project_user_role.rb,
lib/fog/identity/openstack/v3/requests/grant_domain_group_role.rb,
lib/fog/identity/openstack/v3/requests/grant_project_user_role.rb,
lib/fog/identity/openstack/v3/requests/list_domain_group_roles.rb,
lib/fog/identity/openstack/v3/requests/list_project_user_roles.rb,
lib/fog/identity/openstack/v3/requests/revoke_domain_user_role.rb,
lib/fog/identity/openstack/v2/requests/list_endpoints_for_token.rb,
lib/fog/identity/openstack/v3/requests/check_project_group_role.rb,
lib/fog/identity/openstack/v3/requests/grant_project_group_role.rb,
lib/fog/identity/openstack/v3/requests/list_project_group_roles.rb,
lib/fog/identity/openstack/v3/requests/revoke_domain_group_role.rb,
lib/fog/identity/openstack/v3/requests/revoke_project_user_role.rb,
lib/fog/identity/openstack/v3/requests/revoke_project_group_role.rb,
lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb

Defined Under Namespace

Classes: Mock, Real, V2, V3

Class Method Summary collapse

Class Method Details

.new(args = {}) ⇒ Object

Fog::Identity::OpenStack.new() will return a Fog::Identity::OpenStack::V3 by default



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/identity/openstack.rb', line 21

def self.new(args = {})
  version = '3'
  url = Fog.credentials[:openstack_auth_url] || args[:openstack_auth_url]
  if url
    uri = URI(url)
    version = '2.0' if uri.path =~ /v2\.0/
  end

  service = case version
            when '2.0'
              Fog::Identity::OpenStack::V2.new(args)
            else
              Fog::Identity::OpenStack::V3.new(args)
            end
  service
end