otcextensions.sdk.css.v1.snapshot

The CSS Snapshot Class

The Snapshot class inherits from Resource.

class otcextensions.sdk.css.v1.snapshot.Snapshot(_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.

base_path: str = '/clusters/%(uri_cluster_id)s/index_snapshot'

The base part of the URI for this resource.

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

Singular form of key for resource.

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

Plural form of key for resource.

allow_create = True

Allow create operation for this resource.

allow_delete = True

Allow delete operation for this resource.

allow_list = True

Allow list operation for this resource.

allow_fetch = True

Allow get operation for this resource.

uri_cluster_id

ID of the cluster where index data is to be backed up.

backup_keep_days

Snapshot retention period.

backup_method

Snapshot creation mode.

backup_period

Time when a snapshot is executed every day.

backup_start_time

Time when the snapshot starts to be executed.

backup_type

Snapshot Type Automatic/Manual

bucket_name

Bucket for storing snapshot data.

cluster_name

Cluster name.

cluster_id

Cluster Id.

created_at

Time when a snapshot is created.

datastore

Type of the data search engine.

description

Description of a snapshot.

end_time

Timestamp when the snapshot execution ends.

failed_shards

Number of shards that fail to be backed up.

indices

Indices that need to be backed up.

rename_pattern

Rule for defining the indices to be restored.

rename_replacement

Rule for renaming an index.

restore_status

Snapshot restoration status.

start_time

Timestamp when the snapshot starts to be executed.

status

Snapshot status.

target_cluster

ID of the cluster, to which the snapshot is to be restored.

total_shards

Total number of shards of the indices to be backed up.

updated_at

Time when a snapshot status is updated.

version

Version of the snapshot.

classmethod find(session, name_or_id: str, ignore_missing: bool = True, list_base_path: str | None = None, *, microversion: str | None = None, all_projects: bool | None = None, **params)

Find a resource by its name or id.

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

  • name_or_id – This resource’s identifier, if needed by the request. The default is None.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.

  • list_base_path (str) – base_path to be used when need listing resources.

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

  • params (dict) – Any additional parameters to be passed into underlying methods, such as to existing() in order to pass on URI parameters.

Returns:

The Resource object matching the given name or id or None if nothing matches.

Raises:

openstack.exceptions.DuplicateResource if more than one resource is found for this request.

Raises:

openstack.exceptions.ResourceNotFound if nothing is found and ignore_missing is False.

create(session, base_path=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.

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

  • resource_request_key (str) – Overrides the usage of self.resource_key when prepending a key to the request body. Ignored if prepend_key is false.

  • resource_response_key (str) – Overrides the usage of self.resource_key when processing response bodies. Ignored if prepend_key is false.

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

  • params (dict) – Additional params to pass.

Returns:

This Resource instance.

Raises:

MethodNotSupported if Resource.allow_create is not set to True.

restore(session, cluster_id, **body)

Restoring a Snapshot.