Manage access to the clients, including authenticating when needed.
Bases: object
Descriptor class for caching created client handles.
Bases: object
Manages access to API clients, including authentication.
Dereference will trigger an auth if it hasn’t already
Return the endpoint URL for the service type.
Check if a service type is in the current Service Catalog
Set up authentication
Parameters: | required_scope – indicate whether a scoped token is required |
---|
This is deferred until authentication is actually attempted because it gets in the way of things that do not require auth.
Exception definitions.
Bases: exceptions.Exception
Bases: osc_lib.exceptions.ClientException
HTTP 400 - Bad request: you sent some malformed data.
Bases: exceptions.Exception
The base exception class for all exceptions this library raises.
Bases: exceptions.Exception
Bases: osc_lib.exceptions.ClientException
HTTP 409 - Conflict
Bases: exceptions.Exception
Could not find Service or Region in Service Catalog.
Bases: osc_lib.exceptions.ClientException
HTTP 403 - Forbidden: not authorized to access to this resource.
Bases: osc_lib.exceptions.ClientException
HTTP 501 - Not Implemented: server does not support this operation.
Bases: exceptions.Exception
This does not support looking up endpoints from an existing token.
Bases: osc_lib.exceptions.ClientException
HTTP 404 - Not found
Bases: osc_lib.exceptions.ClientException
HTTP 413 - Over limit: reached the API limits for this time period.
Bases: exceptions.Exception
A plugin threw an AttributeError while being lazily loaded.
Bases: osc_lib.exceptions.ClientException
HTTP 401 - Unauthorized: bad credentials.
Bases: exceptions.Exception
The user is trying to use an unsupported version of the API
Application logging
Subclass of keystoneauth1.session
Command-line interface to the OpenStack APIs
Bases: cliff.app.App
Configure logging for the app.
Global app init bits:
Set up auth and API versions
Prompt user for a password
Prompt for a password if stdin is a tty.
Common client utilities
Return a dictionary containing arg_name if value is set.
Search for the first defined of possibly many env vars
Returns the first environment variable defined in vars, or returns the default defined in kwargs.
Find all resources meeting the given minimum constraints
Parameters: |
|
---|---|
Return type: | A list of resources osrted by sort_attr that meet the minimums |
Helper for the _find_* methods.
Parameters: |
|
---|---|
Return type: | The found resource |
This method will attempt to find a resource in a variety of ways. Primarily .get() methods will be called with name_or_id as an integer value, and tried again as a string value.
If both fail, then a .find() is attempted, which is essentially calling a .list() function with a ‘name’ query parameter that is set to name_or_id.
Lastly, if any kwargs are passed in, they will be treated as additional query parameters. This is particularly handy in the case of finding resources in a domain.
Return a formatted string of key value pairs
Parameters: | data – a dict |
---|---|
Return type: | a string formatted to key=’value’ |
Return a formatted strings
Parameters: |
|
---|---|
Return type: | a string formatted based on separator |
Return a formatted string of key value pairs for each dict
Parameters: | data – a list of dicts |
---|---|
Return type: | a string formatted to key=’value’ with dicts separated by new line |
Returns the client class for the requested API version
Parameters: |
|
---|---|
Return type: | a client class for the requested API version |
Return a tuple containing the item properties.
Parameters: |
|
---|
Returns the lowest logging level considered by logging handlers
Retrieve and return the smallest log level set among the root logger’s handlers (in case of multiple handlers).
Return a tuple containing the item properties.
Parameters: |
|
---|
Sort items based on sort keys and sort directions given by sort_str.
Parameters: |
|
---|---|
Returns: | sorted items |
Wait for resource deletion
Parameters: |
|
---|---|
Return type: | True on success, False if the resource has gone to error state or the timeout has been reached |
Wait for status change on a resource during a long-running operation
Parameters: |
|
---|---|
Return type: | True on success |