Class: Fog::Identity::OpenStack::V3

Inherits:
Service
  • Object
show all
Defined in:
lib/fog/openstack/identity_v3.rb,
lib/fog/openstack/models/identity_v3/role.rb,
lib/fog/openstack/models/identity_v3/user.rb,
lib/fog/openstack/models/identity_v3/group.rb,
lib/fog/openstack/models/identity_v3/roles.rb,
lib/fog/openstack/models/identity_v3/token.rb,
lib/fog/openstack/models/identity_v3/users.rb,
lib/fog/openstack/models/identity_v3/domain.rb,
lib/fog/openstack/models/identity_v3/groups.rb,
lib/fog/openstack/models/identity_v3/policy.rb,
lib/fog/openstack/models/identity_v3/tokens.rb,
lib/fog/openstack/models/identity_v3/domains.rb,
lib/fog/openstack/models/identity_v3/project.rb,
lib/fog/openstack/models/identity_v3/service.rb,
lib/fog/openstack/models/identity_v3/endpoint.rb,
lib/fog/openstack/models/identity_v3/policies.rb,
lib/fog/openstack/models/identity_v3/projects.rb,
lib/fog/openstack/models/identity_v3/services.rb,
lib/fog/openstack/models/identity_v3/endpoints.rb,
lib/fog/openstack/requests/identity_v3/get_role.rb,
lib/fog/openstack/requests/identity_v3/get_user.rb,
lib/fog/openstack/requests/identity_v3/get_group.rb,
lib/fog/openstack/requests/identity_v3/get_domain.rb,
lib/fog/openstack/requests/identity_v3/get_policy.rb,
lib/fog/openstack/requests/identity_v3/list_roles.rb,
lib/fog/openstack/requests/identity_v3/list_users.rb,
lib/fog/openstack/models/identity_v3/os_credential.rb,
lib/fog/openstack/requests/identity_v3/create_role.rb,
lib/fog/openstack/requests/identity_v3/create_user.rb,
lib/fog/openstack/requests/identity_v3/delete_role.rb,
lib/fog/openstack/requests/identity_v3/delete_user.rb,
lib/fog/openstack/requests/identity_v3/get_project.rb,
lib/fog/openstack/requests/identity_v3/get_service.rb,
lib/fog/openstack/requests/identity_v3/list_groups.rb,
lib/fog/openstack/requests/identity_v3/token_check.rb,
lib/fog/openstack/requests/identity_v3/update_role.rb,
lib/fog/openstack/requests/identity_v3/update_user.rb,
lib/fog/openstack/models/identity_v3/os_credentials.rb,
lib/fog/openstack/requests/identity_v3/auth_domains.rb,
lib/fog/openstack/requests/identity_v3/create_group.rb,
lib/fog/openstack/requests/identity_v3/delete_group.rb,
lib/fog/openstack/requests/identity_v3/get_endpoint.rb,
lib/fog/openstack/requests/identity_v3/list_domains.rb,
lib/fog/openstack/requests/identity_v3/token_revoke.rb,
lib/fog/openstack/requests/identity_v3/update_group.rb,
lib/fog/openstack/models/identity_v3/role_assignment.rb,
lib/fog/openstack/requests/identity_v3/auth_projects.rb,
lib/fog/openstack/requests/identity_v3/create_domain.rb,
lib/fog/openstack/requests/identity_v3/create_policy.rb,
lib/fog/openstack/requests/identity_v3/delete_domain.rb,
lib/fog/openstack/requests/identity_v3/delete_policy.rb,
lib/fog/openstack/requests/identity_v3/list_policies.rb,
lib/fog/openstack/requests/identity_v3/list_projects.rb,
lib/fog/openstack/requests/identity_v3/list_services.rb,
lib/fog/openstack/requests/identity_v3/update_domain.rb,
lib/fog/openstack/requests/identity_v3/update_policy.rb,
lib/fog/openstack/models/identity_v3/role_assignments.rb,
lib/fog/openstack/requests/identity_v3/create_project.rb,
lib/fog/openstack/requests/identity_v3/create_service.rb,
lib/fog/openstack/requests/identity_v3/delete_project.rb,
lib/fog/openstack/requests/identity_v3/delete_service.rb,
lib/fog/openstack/requests/identity_v3/list_endpoints.rb,
lib/fog/openstack/requests/identity_v3/token_validate.rb,
lib/fog/openstack/requests/identity_v3/update_project.rb,
lib/fog/openstack/requests/identity_v3/update_service.rb,
lib/fog/openstack/requests/identity_v3/create_endpoint.rb,
lib/fog/openstack/requests/identity_v3/delete_endpoint.rb,
lib/fog/openstack/requests/identity_v3/update_endpoint.rb,
lib/fog/openstack/requests/identity_v3/group_user_check.rb,
lib/fog/openstack/requests/identity_v3/list_group_users.rb,
lib/fog/openstack/requests/identity_v3/list_user_groups.rb,
lib/fog/openstack/requests/identity_v3/add_user_to_group.rb,
lib/fog/openstack/requests/identity_v3/get_os_credential.rb,
lib/fog/openstack/requests/identity_v3/list_user_projects.rb,
lib/fog/openstack/requests/identity_v3/token_authenticate.rb,
lib/fog/openstack/requests/identity_v3/list_os_credentials.rb,
lib/fog/openstack/requests/identity_v3/create_os_credential.rb,
lib/fog/openstack/requests/identity_v3/delete_os_credential.rb,
lib/fog/openstack/requests/identity_v3/update_os_credential.rb,
lib/fog/openstack/requests/identity_v3/list_role_assignments.rb,
lib/fog/openstack/requests/identity_v3/check_domain_user_role.rb,
lib/fog/openstack/requests/identity_v3/grant_domain_user_role.rb,
lib/fog/openstack/requests/identity_v3/list_domain_user_roles.rb,
lib/fog/openstack/requests/identity_v3/remove_user_from_group.rb,
lib/fog/openstack/requests/identity_v3/check_domain_group_role.rb,
lib/fog/openstack/requests/identity_v3/check_project_user_role.rb,
lib/fog/openstack/requests/identity_v3/grant_domain_group_role.rb,
lib/fog/openstack/requests/identity_v3/grant_project_user_role.rb,
lib/fog/openstack/requests/identity_v3/list_domain_group_roles.rb,
lib/fog/openstack/requests/identity_v3/list_project_user_roles.rb,
lib/fog/openstack/requests/identity_v3/revoke_domain_user_role.rb,
lib/fog/openstack/requests/identity_v3/check_project_group_role.rb,
lib/fog/openstack/requests/identity_v3/grant_project_group_role.rb,
lib/fog/openstack/requests/identity_v3/list_project_group_roles.rb,
lib/fog/openstack/requests/identity_v3/revoke_domain_group_role.rb,
lib/fog/openstack/requests/identity_v3/revoke_project_user_role.rb,
lib/fog/openstack/requests/identity_v3/revoke_project_group_role.rb

Defined Under Namespace

Classes: Domain, Domains, Endpoint, Endpoints, Group, Groups, Mock, OsCredential, OsCredentials, Policies, Policy, Project, Projects, Real, Role, RoleAssignment, RoleAssignments, Roles, Service, Services, Token, Tokens, User, Users

Class Method Summary collapse

Class Method Details

.get_api_version(uri, connection_options = {}) ⇒ Object



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/fog/openstack/identity_v3.rb', line 129

def self.get_api_version uri, connection_options={}
  connection = Fog::Core::Connection.new(uri, false, connection_options)
  response = connection.request({
                                    :expects => [200],
                                    :headers => {'Content-Type' => 'application/json',
                                                 'Accept' => 'application/json'},
                                    :method => 'GET'
                                })

  body = Fog::JSON.decode(response.body)
  version = nil
  unless body['version'].empty?
    version = body['version']['id']
  end
  if version.nil?
    raise Fog::OpenStack::Errors::ServiceUnavailable.new(
              "No version available at #{uri}")
  end

  version
end