osc_lib.api package

osc_lib.api package

Submodules

osc_lib.api.api module

osc_lib.api.auth module

Authentication Library

osc_lib.api.auth.build_auth_plugins_option_parser(parser)

Auth plugins options builder

Builds dynamically the list of options expected by each available authentication plugin.

osc_lib.api.auth.check_valid_authentication_options(options, auth_plugin_name)

Validate authentication options, and provide helpful error messages

Parameters:required_scope – indicate whether a scoped token is required
osc_lib.api.auth.check_valid_authorization_options(options, auth_plugin_name)

Validate authorization options, and provide helpful error messages.

osc_lib.api.auth.get_keystone2keystone_auth(local_auth, service_provider, project_id=None, project_name=None, project_domain_id=None, project_domain_name=None)

Return Keystone 2 Keystone authentication for service provider.

Parameters:
  • local_auth – authentication to use with the local Keystone
  • service_provider – service provider id as registered in Keystone
  • project_id – project id to scope to in the service provider
  • project_name – project name to scope to in the service provider
  • project_domain_id – id of domain in the service provider
  • project_domain_name – name of domain to in the service provider
Returns:

Keystone2Keystone auth object for service provider

osc_lib.api.auth.get_options_list()

Gather plugin options so the help action has them available

osc_lib.api.auth.get_plugin_list()

Gather plugin list and cache it

osc_lib.api.utils module

API Utilities Library

osc_lib.api.utils.simple_filter(data=None, attr=None, value=None, property_field=None)

Filter a list of dicts

Parameters:
  • data (list) – The list to be filtered. The list is modified in-place and will be changed if any filtering occurs.
  • attr (string) – The name of the attribute to filter. If attr does not exist no match will succeed and no rows will be returned. If attr is None no filtering will be performed and all rows will be returned.
  • value (string) – The value to filter. None is considered to be a ‘no filter’ value. ‘’ matches against a Python empty string.
  • property_field (string) – The name of the data field containing a property dict to filter. If property_field is None, attr is a field name. If property_field is not None, attr is a property key name inside the named property field.
Returns:

Returns the filtered list

Rtype list:

This simple filter (one attribute, one exact-match value) searches a list of dicts to select items. It first searches the item dict for a matching attr then does an exact-match on the value. If property_field is given, it will look inside that field (if it exists and is a dict) for a matching value.

Module contents

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.