CBR API¶
The Cloud Backup and Recovery Service Class¶
The CBR high-level interface is available through the cbr
member of a Connection
object. The
ces
member will only be added if the
otcextensions.sdk.register_otc_extensions(conn)
method is called.
Backup Operations¶
-
class
otcextensions.sdk.cbr.v3._proxy.
Proxy
(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs) -
backups
(**query) Retrieve a generator of Backups
- Parameters
query (dict) – Optional query parameters to be sent to limit the resources being returned. * checkpoint_id: Restore point ID * dec: Dedicated Cloud * end_time: Time when the backup ends * image_type: Backup type: backup or replication * limit: Number of records displayed per page * marker: ID of the last record displayed * member_status: Backup sharing status * name: Backup name * offset: Offset value * parent_id: Parent backup ID * resource_az: AZ-based filtering * resource_id: Resource ID * resource_name: Resource name * resource_type: Resource Type * sort: sorting * start_time: Time when the backup starts * status: Status * vault_id: Vault ID
- Returns
A generator of backup
Backup
instances
-
get_backup
(backup) Get the backup by UUID.
-
find_backup
(name_or_id, ignore_missing=True) Find a single CBR backup by name or id
- Parameters
name_or_id – The name or ID of a backup
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent group.
- Returns
None
-
delete_backup
(backup, ignore_missing=True) Delete a single CBR backup.
- Parameters
backup – The value can be the ID of a backup or a
Backup
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent backup.
-
Policy Operations¶
-
class
otcextensions.sdk.cbr.v3._proxy.
Proxy
(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs) -
policies
(**query) Retrieve a generator of CBR policies
- Parameters
query (dict) – Optional query parameters to be sent to limit the resources being returned. * operation_type: Policy type: backup or replication * vault_id: Vault ID
- Returns
A generator of policies
Policy
instances
-
get_policy
(policy) Get the CBR policy by UUID.
-
find_policy
(name_or_id, ignore_missing=True) Find a single CBR policy by name or ID
- Parameters
name_or_id – The name or ID of a policy
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the policy does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent policy.
- Returns
a
Policy
instance
-
create_policy
(**attrs) Creating a CBR policy using attributes
-
update_policy
(policy, **attrs) Update CBR policy attributes
-
delete_policy
(policy, ignore_missing=True) Delete a single CBR policy.
- Parameters
policy – The value can be the ID of a policy or a
Policy
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent policy.
-
Restore Point (Checkpoint) Operations¶
-
class
otcextensions.sdk.cbr.v3._proxy.
Proxy
(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs) -
get_checkpoint
(checkpoint) Get the checkpoint by UUID.
- Parameters
checkpoint – key id or an instance of
Checkpoint
- Returns
instance of
Checkpoint
-
create_checkpoint
(**attrs) Creating a restore point / checkpoint using attributes
- Parameters
attrs (dict) – Keyword arguments which will be used to create a
Checkpoint
, comprised of the properties on the Checkpoint class.- Returns
The results of config creation
- Return type
-
Restore Operations¶
-
class
otcextensions.sdk.cbr.v3._proxy.
Proxy
(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs) -
restore_data
(backup, **attrs) Restore data using a backup
-
Vault Operations¶
-
class
otcextensions.sdk.cbr.v3._proxy.
Proxy
(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs) -
vaults
(**query) Retrieve a generator of Vaults
- Parameters
query (dict) – Optional query parameters to be sent to limit the resources being returned. * cloud_type: Cloud type * id: Vault ID * limit: Number of records displayed per page, range: 1-100 * name: Vault name * object_type: Resource type * offset: Offset value * policy_id: Policy ID * protect_type: Protection type * resource_ids: Resource IDs * status: Status
- Returns
A generator of vault
Vault
instances
-
get_vault
(vault) Get the vault by UUID.
-
find_vault
(name_or_id, ignore_missing=True) Find a single CBR vault by name or id
- Parameters
name_or_id – The name or ID of a vault
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent vault.
- Returns
None
-
create_vault
(**attrs) Creating a CBR vault using attributes
-
update_vault
(vault, **attrs) Update CBR vault attributes
-
delete_vault
(vault, ignore_missing=True) Delete a single CBR vault.
- Parameters
vault – The value can be the ID of a vault or a
Vault
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the group does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent vault.
-
unbind_policy
(vault, policy) Disassociate policy from CBR vault
-
bind_policy
(vault, policy) Associate policy to an existing CBR vault
-
associate_resources
(vault, resources) Associate resources to an existing CBR vault
- Parameters
vault – The value can be the ID of a vault or a
Vault
instance.resources – array of resources in the format: id and type
-
dissociate_resources
(vault, resources) Associate resources to an existing CBR vault
- Parameters
vault – The value can be the ID of a vault or a
Vault
instance.resources – list of resource ids to be released from vault
-
Task Operations¶
-
class
otcextensions.sdk.cbr.v3._proxy.
Proxy
(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs) -
tasks
(**query) List of tasks
-