otcextensions.sdk.smn.v2.subscription¶
The SMN Subscription Class¶
The Subscription
class inherits from
Resource
.
-
class
otcextensions.sdk.smn.v2.subscription.
Subscription
(_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.
-
id
¶ Resource identifier of a subscription, which is unique
-
endpoint
¶ Message receiving endpoint
-
protocol
¶ Subscription protocol Following protocols are supported: email, sms, http and https
-
owner
¶ Project ID of the topic creator
-
remark
¶ Remarks
-
status
¶ Subscription status 0: unconfirmed 1: confirmed 3: canceled
-
topic_urn
¶ Resource identifier of a topic, which is unique
-
delete
(session, error_message=None, **kwargs)¶ Delete the remote resource based on this instance.
- Parameters
session (
Adapter
) – The session to use for making this request.microversion (str) – API version to override the negotiated one.
kwargs (dict) – Parameters that will be passed to _prepare_request()
- Returns
This
Resource
instance.- Raises
MethodNotSupported
ifResource.allow_commit
is not set toTrue
.- Raises
ResourceNotFound
if the resource was not found.
-
classmethod
list
(session, paginated=True, base_path=None, allow_unknown_params=False, **params)¶ This method is a generator which yields resource objects.
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.base_path (str) – Base part of the URI for listing resources, if different from
base_path
.allow_unknown_params (bool) –
True
to accept, but discard unknown query parameters. This allows getting list of ‘filters’ and passing everything known to the server.False
will result in validation exception when unknown query parameters are passed.microversion (str) – API version to override the negotiated one.
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. Parameters supported as filters by the server side are passed in the API call, remaining parameters are applied as filters to the retrieved results.
- Returns
A generator of
Resource
objects.- Raises
MethodNotSupported
ifResource.allow_list
is not set toTrue
.- Raises
InvalidResourceQuery
if query contains invalid params.