otcextensions.sdk.kms.v1.key

The KMS CMK Class

The Key class inherits from Resource.

class otcextensions.sdk.kms.v1.key.Key(_synchronized=False, connection=None, **attrs)

The base resource

Parameters:
  • _synchronized (bool) – This is not intended to be used directly. See new() and existing().

  • 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.

resources_key: ty.Optional[str] = 'key_details'

Plural form of key for resource.

resource_key: ty.Optional[str] = 'key_info'

Singular form of key for resource.

allow_list = True

Allow list operation for this resource.

allow_create = True

Allow create operation for this resource.

allow_fetch = True

Allow get operation for this resource.

key_id

Secret key ID

domain_name

User domain name

domain_id

User domain id

key_alias

Secret key alias

realm

Secret area

key_description

Secret key description

creation_date

Secret key creation date

scheduled_deletion_date

Scheduled deletion time

key_state

Key state. (2, enabled; 3, disabled; 4: sheduled deleted)

default_key_flag

Default key flag. (default 1 else 0)

key_type

Secret key type.

error_code

Error code when create a secret key

error_msg

Error message when create a secret key

fetch(session, requires_id=None, base_path=None, error_message=None, skip_cache=False, *, resource_response_key=None, microversion=None, **params)

Get a remote resource based on this instance.

Parameters:
  • session (Adapter) – The session to use for making this request.

  • requires_id (boolean) – A boolean indicating whether resource ID should be part of the requested URI.

  • base_path (str) – Base part of the URI for fetching resources, if different from base_path.

  • error_message (str) – An Error message to be returned if requested object does not exist.

  • skip_cache (bool) – A boolean indicating whether optional API cache should be skipped for this invocation.

  • resource_response_key (str) – Overrides the usage of self.resource_key when processing the response body.

  • microversion (str) – API version to override the negotiated one.

  • params (dict) – Additional parameters that can be consumed.

Returns:

This Resource instance.

Raises:

MethodNotSupported if Resource.allow_fetch is not set to True.

Raises:

NotFoundException if the resource was not found.

classmethod list(session, paginated=True, base_path=None, **kwargs)

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, or False 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.

  • headers (dict) – Additional headers to inject into the HTTP request.

  • 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 to get(). They are additionally checked against the base_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 if Resource.allow_list is not set to True.

Raises:

InvalidResourceQuery if query contains invalid params.