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

Inherits:
Service
  • Object
show all
Defined in:
lib/fog/identity/openstack/v3.rb,
lib/fog/identity/openstack/v3/models/role.rb,
lib/fog/identity/openstack/v3/models/user.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/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/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/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/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/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/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/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/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/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/v3/requests/add_user_to_group.rb,
lib/fog/identity/openstack/v3/requests/get_os_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/v3/requests/list_os_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/v3/requests/list_role_assignments.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/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/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

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



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/fog/identity/openstack/v3.rb', line 125

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, "No version available at #{uri}"
  end

  version
end