The Session overrides Session to provide end point filtering and mapping KSA exceptions to SDK exceptions.

Session Object

class openstack.session.Session(profile, user_agent=None, **kwargs)

Create a new Keystone auth session with a profile.

  • profile (Profile) – If the user has any special profiles such as the service name, region, version or interface, they may be provided in the profile object. If no profiles are provided, the services that appear first in the service catalog will be used.
  • user_agent – A User-Agent header string to use for the request. If not provided, a default of DEFAULT_USER_AGENT is used, which contains the openstacksdk version When a non-None value is passed, it will be prepended to the default.
get_endpoint(auth=None, interface=None, service_type=None, **kwargs)

Override get endpoint to automate endpoint filtering

This method uses the service catalog to find the root URI of each service and then gets all available versions directly from the service, not from the service catalog.

Endpoints are cached per service type and interface combination so that they’re only requested from the remote service once per instance of this class.