openstackclient.api package¶
Submodules¶
openstackclient.api.api module¶
openstackclient.api.auth module¶
Authentication Library
-
openstackclient.api.auth.
build_auth_params
(auth_plugin_name, cmd_options)¶
-
openstackclient.api.auth.
build_auth_plugins_option_parser
(parser)¶ Auth plugins options builder
Builds dynamically the list of options expected by each available authentication plugin.
-
openstackclient.api.auth.
check_valid_auth_options
(options, auth_plugin_name, required_scope=True)¶ Perform basic option checking, provide helpful error messages.
Parameters: required_scope – indicate whether a scoped token is required
-
openstackclient.api.auth.
get_options_list
()¶ Gather plugin options so the help action has them available
-
openstackclient.api.auth.
get_plugin_list
()¶ Gather plugin list and cache it
-
openstackclient.api.auth.
select_auth_plugin
(options)¶ Pick an auth plugin based on –os-auth-type or other options
openstackclient.api.auth_plugin module¶
Authentication Plugin Library
-
class
openstackclient.api.auth_plugin.
OSCGenericPassword
(*args, **kwargs)¶ Bases:
keystoneclient.auth.identity.generic.password.Password
Auth plugin hack to work around broken Keystone configurations
The default Keystone configuration uses http://localhost:xxxx in admin_endpoint and public_endpoint and are returned in the links.href attribute by the version routes. Deployments that do not set these are unusable with newer keystoneclient version discovery.
-
create_plugin
(session, version, url, raw_status=None)¶ Handle default Keystone endpoint configuration
Build the actual API endpoint from the scheme, host and port of the original auth URL and the rest from the returned version URL.
-
-
class
openstackclient.api.auth_plugin.
TokenEndpoint
(url, token, **kwargs)¶ Bases:
keystoneclient.auth.token_endpoint.Token
Auth plugin to handle traditional token/endpoint usage
Implements the methods required to handle token authentication with a user-specified token and service endpoint; no Identity calls are made for re-scoping, service catalog lookups or the like.
The purpose of this plugin is to get rid of the special-case paths in the code to handle this authentication format. Its primary use is for bootstrapping the Keystone database.
-
get_auth_ref
(session, **kwargs)¶
-
classmethod
get_options
()¶
-
openstackclient.api.image_v1 module¶
openstackclient.api.image_v2 module¶
openstackclient.api.object_store_v1 module¶
openstackclient.api.utils module¶
API Utilities Library
-
openstackclient.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 (sring) – 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 thevalue
. Ifproperty_field
is given, it will look inside that field (if it exists and is a dict) for a matchingvalue
.