otcextensions.sdk.obs.v1.container¶
The OBS Container (Bucket) Class¶
The Container
class inherits from
Resource
.
-
class
otcextensions.sdk.obs.v1.container.
Container
(_synchronized=False, connection=None, **attrs)¶ The base resource
- Parameters
_synchronized (bool) – This is not intended to be used directly. See
new()
andexisting()
.connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of
self._connection
in Resource code should protect itself with a check for None.
-
classmethod
list
(session, paginated=False, endpoint_override=None, headers=None, requests_auth=None, **params)¶ Override default list to incorporate endpoint overriding and custom headers
Since SDK Resource.list method is passing hardcoded headers do override the function
This resource object list generator handles pagination and takes query params for response filtering.
- Parameters
session (
Adapter
) – The session to use for making this request.paginated (bool) –
True
if a GET to this resource returns a paginated series of responses, orFalse
if a GET returns only one page of data. When paginated is False only one page of data will be returned regardless of the API’s support of pagination.params (dict) – These keyword arguments are passed through the
_transpose()
method to find if any of them match expected query parameters to be sent in the params argument toget()
. They are additionally checked against thebase_path
format string to see if any path fragments need to be filled in by the contents of this argument.
- Returns
A generator of
Resource
objects.- Raises
MethodNotSupported
ifResource.allow_list
is not set toTrue
.- Raises
InvalidResourceQuery
if query contains invalid params.
-
create
(session, prepend_key=True, endpoint_override=None, headers=None, requests_auth=None)¶ Create a remote resource based on this instance.
- Parameters
session (
Adapter
) – The session to use for making this request.prepend_key – A boolean indicating whether the resource_key should be prepended in a resource creation request. Default to True.
- Returns
This
Resource
instance.- Raises
MethodNotSupported
ifResource.allow_create
is not set toTrue
.