This Page

ibm_cos_sdk_config package

Submodules

ibm_cos_sdk_config.iam_token_manager module

ibm_cos_sdk_config.resource_configuration_v1 module

REST API used to configure Cloud Object Storage buckets.

API Version: 1.0.0

class ibm_cos_sdk_config.resource_configuration_v1.ActivityTracking(*, read_data_events: Optional[bool] = None, write_data_events: Optional[bool] = None, activity_tracker_crn: Optional[str] = None, management_events: Optional[bool] = None)[source]

Bases: object

Enables sending log data to IBM Cloud Activity Tracker Event Routing to provide visibility into bucket management, object read and write events. (Recommended) When the activity_tracker_crn is not populated, then enabled events are sent to the Activity Tracker Event Routing instance at the container’s location unless otherwise specified in the Activity Tracker Event Routing Event Routing service configuration. (Legacy) When the activity_tracker_crn is populated, then enabled events are sent to the Activity Tracker Event Routing instance specified.

Parameters
  • read_data_events (bool) – (optional) If set to true, all object read events (i.e. downloads) will be sent to Activity Tracker Event Routing.

  • write_data_events (bool) – (optional) If set to true, all object write events (i.e. uploads) will be sent to Activity Tracker Event Routing.

  • activity_tracker_crn (str) – (optional) When the activity_tracker_crn is not populated, then enabled events are sent to the Activity Tracker Event Routing instance associated to the container’s location unless otherwise specified in the Activity Tracker Event Routing Event Routing service configuration. If activity_tracker_crn is populated, then enabled events are sent to the Activity Tracker Event Routing instance specified and bucket management events are always enabled.

  • management_events (bool) – (optional) This field only applies if activity_tracker_crn is not populated. If set to true, all bucket management events will be sent to Activity Tracker Event Routing.

classmethod from_dict(_dict: Dict) ActivityTracking[source]

Initialize a ActivityTracking object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupPolicy(initial_retention: DeleteAfterDays, policy_name: str, target_backup_vault_crn: str, backup_type: str, policy_id: str, policy_status: str, *, initial_sync_progress: Optional[float] = None, error_cause: Optional[str] = None)[source]

Bases: object

The current backup coverage for a COS Bucket.

Parameters
  • initial_retention (DeleteAfterDays) – The number of days to retain data within a RecoveryRange.

  • policy_name (str) – The name granted to the policy. Validation : * chars limited to alphanumeric, underscore, hyphen and period.

  • target_backup_vault_crn (str) – The CRN for a COS BackupVault.

  • backup_type (str) – The type of backup to support. For LA+GA this is limited to “continuous”.

  • policy_id (str) – A UUID that uniquely identifies a resource.

  • policy_status (str) – The current status of the backup policy. pending : the policy has been received and has begun processing. initializing : pre-existing objects are being sync to the backup vault. active : the policy is active and healthy. action_needed : the policy is unhealthy and requires some intervention to recover degraded : the policy is unhealthy failed : the policy has failed unrecoverably.

  • initial_sync_progress (float) – (optional) Reports percent-doneness of init. Only present when policy_status=INITIALIZING/PENDING.

  • error_cause (str) – (optional) reports error cause. Only present when policy_status=ERROR/FAILED.

class BackupTypeEnum(value)[source]

Bases: str, Enum

The type of backup to support. For LA+GA this is limited to “continuous”.

CONTINUOUS = 'continuous'
class PolicyStatusEnum(value)[source]

Bases: str, Enum

The current status of the backup policy. pending : the policy has been received and has begun processing. initializing : pre-existing objects are being sync to the backup vault. active : the policy is active and healthy. action_needed : the policy is unhealthy and requires some intervention to recover degraded : the policy is unhealthy failed : the policy has failed unrecoverably.

ACTION_NEEDED = 'action_needed'
ACTIVE = 'active'
DEGRADED = 'degraded'
FAILED = 'failed'
INITIALIZING = 'initializing'
PENDING = 'pending'
classmethod from_dict(_dict: Dict) BackupPolicy[source]

Initialize a BackupPolicy object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupPolicyCollection(backup_policies: List[BackupPolicy])[source]

Bases: object

A collection of backup policies.

Parameters

backup_policies (List[BackupPolicy]) – A collection of backup policies.

classmethod from_dict(_dict: Dict) BackupPolicyCollection[source]

Initialize a BackupPolicyCollection object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupVault(backup_vault_name: str, region: str, *, activity_tracking: Optional[BackupVaultActivityTracking] = None, metrics_monitoring: Optional[BackupVaultMetricsMonitoring] = None, sse_kp_customer_root_key_crn: Optional[str] = None, crn: Optional[str] = None, service_instance_crn: Optional[str] = None, time_created: Optional[datetime] = None, time_updated: Optional[datetime] = None, bytes_used: Optional[int] = None)[source]

Bases: object

Metadata associated with a backup vault.

Parameters
  • activity_tracking (BackupVaultActivityTracking) – (optional) Activity Tracking configuration. An empty object ({}) indicates no configuration, and no events will be sent (This is the same behavior as {“management_events”:false}). Note that read/write events cannot be enabled, and events cannot be routed to a non-default Activity Tracker instance.

  • metrics_monitoring (BackupVaultMetricsMonitoring) – (optional) Metrics Monitoring configuration. An empty object ({}) indicates no configuration, and no metrics will be collected (This is the same behavior as {“usage_metrics_enabled”:false}). Note that request metrics cannot be enabled, and metrics cannot be routed to a non-default metrics router instance.

  • backup_vault_name (str) – The name given to a Bucket. Bucket names must be between 3 and 63 characters long must be made of lowercase letters, numbers, dots (periods), and dashes (hyphens). Bucket names must begin and end with a lowercase letter or number. Bucket names canâ€t contain consecutive dots or dashes. Bucket names that resemble IP addresses are not allowed. Bucket and BackupVault names exist in a global namespace and therefore must be unique.

  • region (str) – the region in which this backup-vault should be created within.

  • sse_kp_customer_root_key_crn (str) – (optional) The CRN for a KeyProtect root key.

  • crn (str) – (optional) The CRN for a COS BackupVault.

  • service_instance_crn (str) – (optional) A COS ServiceInstance CRN.

  • time_created (datetime) – (optional) creation time of the backup-vault. Returns “YYYY-MM-DDTHH:mm:ss.sssZ” timestamp format.

  • time_updated (datetime) – (optional) time of last update to the backup-vault Returns “YYYY-MM-DDTHH:mm:ss.sssZ” timestamp format.

  • bytes_used (int) – (optional) byte useage of the backup-vault. This should include all usage, including non-current versions. A maximum value is not defined.

classmethod from_dict(_dict: Dict) BackupVault[source]

Initialize a BackupVault object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupVaultActivityTracking(*, management_events: Optional[bool] = None)[source]

Bases: object

Activity Tracking configuration. An empty object ({}) indicates no configuration, and no events will be sent (This is the same behavior as {“management_events”:false}). Note that read/write events cannot be enabled, and events cannot be routed to a non-default Activity Tracker instance.

Parameters

management_events (bool) – (optional) Whether to send notifications for management events on the BackupVault.

classmethod from_dict(_dict: Dict) BackupVaultActivityTracking[source]

Initialize a BackupVaultActivityTracking object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupVaultCollection(backup_vaults: List[str], *, next: Optional[NextPagination] = None)[source]

Bases: object

A listing of backup vaults.

Parameters
  • next (NextPagination) – (optional) Pagination response body.

  • backup_vaults (List[str]) – List of Backup Vaults. If no Backup Vaults exist, this array will be empty.

classmethod from_dict(_dict: Dict) BackupVaultCollection[source]

Initialize a BackupVaultCollection object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupVaultMetricsMonitoring(*, usage_metrics_enabled: Optional[bool] = None)[source]

Bases: object

Metrics Monitoring configuration. An empty object ({}) indicates no configuration, and no metrics will be collected (This is the same behavior as {“usage_metrics_enabled”:false}). Note that request metrics cannot be enabled, and metrics cannot be routed to a non-default metrics router instance.

Parameters

usage_metrics_enabled (bool) – (optional) Whether usage metrics are collected for this BackupVault.

classmethod from_dict(_dict: Dict) BackupVaultMetricsMonitoring[source]

Initialize a BackupVaultMetricsMonitoring object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupVaultPatch(*, activity_tracking: Optional[BackupVaultActivityTracking] = None, metrics_monitoring: Optional[BackupVaultMetricsMonitoring] = None)[source]

Bases: object

Metadata elements on a backup vault that can be updated.

Parameters
  • activity_tracking (BackupVaultActivityTracking) – (optional) Activity Tracking configuration. An empty object ({}) indicates no configuration, and no events will be sent (This is the same behavior as {“management_events”:false}). Note that read/write events cannot be enabled, and events cannot be routed to a non-default Activity Tracker instance.

  • metrics_monitoring (BackupVaultMetricsMonitoring) – (optional) Metrics Monitoring configuration. An empty object ({}) indicates no configuration, and no metrics will be collected (This is the same behavior as {“usage_metrics_enabled”:false}). Note that request metrics cannot be enabled, and metrics cannot be routed to a non-default metrics router instance.

classmethod from_dict(_dict: Dict) BackupVaultPatch[source]

Initialize a BackupVaultPatch object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BackupVaultsPager(*, client: ResourceConfigurationV1, service_instance_id: str)[source]

Bases: object

BackupVaultsPager can be used to simplify the use of the “list_backup_vaults” method.

get_all() List[dict][source]

Returns all results by invoking get_next() repeatedly until all pages of results have been retrieved. :return: A List[dict], where each element is a dict that represents an instance of . :rtype: List[dict]

get_next() List[dict][source]

Returns the next page of results. :return: A List[dict], where each element is a dict that represents an instance of . :rtype: List[dict]

has_next() bool[source]

Returns true if there are potentially more results to be retrieved.

class ibm_cos_sdk_config.resource_configuration_v1.Bucket(*, name: Optional[str] = None, crn: Optional[str] = None, service_instance_id: Optional[str] = None, service_instance_crn: Optional[str] = None, time_created: Optional[datetime] = None, time_updated: Optional[datetime] = None, object_count: Optional[int] = None, bytes_used: Optional[int] = None, noncurrent_object_count: Optional[int] = None, noncurrent_bytes_used: Optional[int] = None, delete_marker_count: Optional[int] = None, firewall: Optional[Firewall] = None, activity_tracking: Optional[ActivityTracking] = None, metrics_monitoring: Optional[MetricsMonitoring] = None, hard_quota: Optional[int] = None, protection_management: Optional[ProtectionManagementResponse] = None)[source]

Bases: object

A bucket.

Parameters
  • name (str) – (optional) The name of the bucket. Non-mutable.

  • crn (str) – (optional) The service instance that holds the bucket. Non-mutable.

  • service_instance_id (str) – (optional) The service instance that holds the bucket. Non-mutable.

  • service_instance_crn (str) – (optional) The service instance that holds the bucket. Non-mutable.

  • time_created (datetime) – (optional) The creation time of the bucket in RFC 3339 format. Non-mutable.

  • time_updated (datetime) – (optional) The modification time of the bucket in RFC 3339 format. Non-mutable.

  • object_count (int) – (optional) Total number of objects in the bucket. Non-mutable.

  • bytes_used (int) – (optional) Total size of all objects in the bucket. Non-mutable.

  • noncurrent_object_count (int) – (optional) Number of non-current object versions in the bucket. Non-mutable.

  • noncurrent_bytes_used (int) – (optional) Total size of all non-current object versions in the bucket. Non-mutable.

  • delete_marker_count (int) – (optional) Total number of delete markers in the bucket. Non-mutable.

  • firewall (Firewall) – (optional) An access control mechanism based on the network (IP address) where request originated. Requests not originating from IP addresses listed in the allowed_ip field will be denied regardless of any access policies (including public access) that might otherwise permit the request. Viewing or updating the Firewall element requires the requester to have the manager role.

  • activity_tracking (ActivityTracking) – (optional) Enables sending log data to IBM Cloud Activity Tracker Event Routing to provide visibility into bucket management, object read and write events. (Recommended) When the activity_tracker_crn is not populated, then enabled events are sent to the Activity Tracker Event Routing instance at the container’s location unless otherwise specified in the Activity Tracker Event Routing Event Routing service configuration. (Legacy) When the activity_tracker_crn is populated, then enabled events are sent to the Activity Tracker Event Routing instance specified.

  • metrics_monitoring (MetricsMonitoring) – (optional) Enables sending metrics to IBM Cloud Monitoring. All metrics are opt-in. (Recommended) When the metrics_monitoring_crn is not populated, then enabled metrics are sent to the Monitoring instance at the container’s location unless otherwise specified in the Metrics Router service configuration. (Legacy) When the metrics_monitoring_crn is populated, then enabled metrics are sent to the Monitoring instance defined in the metrics_monitoring_crn field.

  • hard_quota (int) – (optional) Maximum bytes for this bucket.

  • protection_management (ProtectionManagementResponse) – (optional) Data structure holding protection management response.

classmethod from_dict(_dict: Dict) Bucket[source]

Initialize a Bucket object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.BucketPatch(*, firewall: Optional[Firewall] = None, activity_tracking: Optional[ActivityTracking] = None, metrics_monitoring: Optional[MetricsMonitoring] = None, hard_quota: Optional[int] = None, protection_management: Optional[ProtectionManagement] = None)[source]

Bases: object

An object containing new bucket metadata.

Parameters
  • firewall (Firewall) – (optional) An access control mechanism based on the network (IP address) where request originated. Requests not originating from IP addresses listed in the allowed_ip field will be denied regardless of any access policies (including public access) that might otherwise permit the request. Viewing or updating the Firewall element requires the requester to have the manager role.

  • activity_tracking (ActivityTracking) – (optional) Enables sending log data to IBM Cloud Activity Tracker Event Routing to provide visibility into bucket management, object read and write events. (Recommended) When the activity_tracker_crn is not populated, then enabled events are sent to the Activity Tracker Event Routing instance at the container’s location unless otherwise specified in the Activity Tracker Event Routing Event Routing service configuration. (Legacy) When the activity_tracker_crn is populated, then enabled events are sent to the Activity Tracker Event Routing instance specified.

  • metrics_monitoring (MetricsMonitoring) – (optional) Enables sending metrics to IBM Cloud Monitoring. All metrics are opt-in. (Recommended) When the metrics_monitoring_crn is not populated, then enabled metrics are sent to the Monitoring instance at the container’s location unless otherwise specified in the Metrics Router service configuration. (Legacy) When the metrics_monitoring_crn is populated, then enabled metrics are sent to the Monitoring instance defined in the metrics_monitoring_crn field.

  • hard_quota (int) – (optional) Maximum bytes for this bucket.

  • protection_management (ProtectionManagement) – (optional) Data structure holding protection management operations.

classmethod from_dict(_dict: Dict) BucketPatch[source]

Initialize a BucketPatch object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.DeleteAfterDays(*, delete_after_days: Optional[int] = None)[source]

Bases: object

The number of days to retain data within a RecoveryRange.

Parameters

delete_after_days (int) – (optional) The number of days to retain data within a RecoveryRange.

classmethod from_dict(_dict: Dict) DeleteAfterDays[source]

Initialize a DeleteAfterDays object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.DeleteAfterDaysWithIndefinite(*, delete_after_days: Optional[int] = None)[source]

Bases: object

The retention configuration for a RecoveryRange.

Parameters

delete_after_days (int) – (optional) The number of days to retain data within a RecoveryRange. -1 is a special value that denotes “indefinite” retention. This value can only be set implicitly via a policy created during the LA release being upgraded to the GA release.

classmethod from_dict(_dict: Dict) DeleteAfterDaysWithIndefinite[source]

Initialize a DeleteAfterDaysWithIndefinite object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.Firewall(*, allowed_ip: Optional[List[str]] = None, denied_ip: Optional[List[str]] = None, allowed_network_type: Optional[List[str]] = None)[source]

Bases: object

An access control mechanism based on the network (IP address) where request originated. Requests not originating from IP addresses listed in the allowed_ip field will be denied regardless of any access policies (including public access) that might otherwise permit the request. Viewing or updating the Firewall element requires the requester to have the manager role.

Parameters
  • allowed_ip (List[str]) – (optional) List of IPv4 or IPv6 addresses in CIDR notation to be affected by firewall in CIDR notation is supported. Passing an empty array will lift the IP address filter. The allowed_ip array can contain a maximum of 1000 items.

  • denied_ip (List[str]) – (optional) List of IPv4 or IPv6 addresses in CIDR notation to be affected by firewall in CIDR notation is supported. Passing an empty array will lift the IP address filter. The denied_ip array can contain a maximum of 1000 items.

  • allowed_network_type (List[str]) – (optional) Indicates which network types are allowed for bucket access. May contain public, private, and/or direct elements. Setting allowed_network_type to only private will prevent access to object storage from outside of the IBM Cloud. The entire array will be overwritten in a PATCH operation. For more information on network types, [see the documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints#advanced-endpoint-types).

class AllowedNetworkTypeEnum(value)[source]

Bases: str, Enum

May contain public, private, and/or direct elements. Setting allowed_network_type to only private will prevent access to object storage from outside of the IBM Cloud. The entire array will be overwritten in a PATCH operation. For more information on network types, [see the documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints#advanced-endpoint-types).

DIRECT = 'direct'
PRIVATE = 'private'
PUBLIC = 'public'
classmethod from_dict(_dict: Dict) Firewall[source]

Initialize a Firewall object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.MetricsMonitoring(*, usage_metrics_enabled: Optional[bool] = None, request_metrics_enabled: Optional[bool] = None, metrics_monitoring_crn: Optional[str] = None)[source]

Bases: object

Enables sending metrics to IBM Cloud Monitoring. All metrics are opt-in. (Recommended) When the metrics_monitoring_crn is not populated, then enabled metrics are sent to the Monitoring instance at the container’s location unless otherwise specified in the Metrics Router service configuration. (Legacy) When the metrics_monitoring_crn is populated, then enabled metrics are sent to the Monitoring instance defined in the metrics_monitoring_crn field.

Parameters
  • usage_metrics_enabled (bool) – (optional) If set to true, all usage metrics (i.e. bytes_used) will be sent to the monitoring service.

  • request_metrics_enabled (bool) – (optional) If set to true, all request metrics (i.e. rest.object.head) will be sent to the monitoring service.

  • metrics_monitoring_crn (str) – (optional) When the metrics_monitoring_crn is not populated, then enabled metrics are sent to the monitoring instance associated to the container’s location unless otherwise specified in the Metrics Router service configuration. If metrics_monitoring_crn is populated, then enabled events are sent to the Metrics Monitoring instance specified.

classmethod from_dict(_dict: Dict) MetricsMonitoring[source]

Initialize a MetricsMonitoring object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.NextPagination(href: str, token: str)[source]

Bases: object

Pagination response body.

Parameters
  • href (str) – A URL to the continuation of results.

  • token (str) – The continuation token utilized for paginated results.

classmethod from_dict(_dict: Dict) NextPagination[source]

Initialize a NextPagination object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.ProtectionManagement(*, requested_state: Optional[str] = None, protection_management_token: Optional[str] = None)[source]

Bases: object

Data structure holding protection management operations.

Parameters
  • requested_state (str) – (optional) If set to activate, protection management action on the bucket is being activated.

  • protection_management_token (str) – (optional) This field is required when using requested_state:activate and holds a JWT that is provided by the Cloud Operator. This should be the encoded JWT.

class RequestedStateEnum(value)[source]

Bases: str, Enum

If set to activate, protection management action on the bucket is being activated.

ACTIVATE = 'activate'
DEACTIVATE = 'deactivate'
classmethod from_dict(_dict: Dict) ProtectionManagement[source]

Initialize a ProtectionManagement object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.ProtectionManagementResponse(*, token_applied_counter: Optional[str] = None, token_entries: Optional[List[ProtectionManagementResponseTokenEntry]] = None)[source]

Bases: object

Data structure holding protection management response.

Parameters
  • token_applied_counter (str) – (optional) Indicates the X number of protection management tokens that have been applied to the bucket in its lifetime.

  • token_entries (List[ProtectionManagementResponseTokenEntry]) – (optional) The ‘protection management token list’ holding a recent list of applied tokens. This list may contain a subset of all tokens applied to the bucket, as indicated by the counter.

classmethod from_dict(_dict: Dict) ProtectionManagementResponse[source]

Initialize a ProtectionManagementResponse object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.ProtectionManagementResponseTokenEntry(*, token_id: Optional[str] = None, token_expiration_time: Optional[str] = None, token_reference_id: Optional[str] = None, applied_time: Optional[str] = None, invalidated_time: Optional[str] = None, expiration_time: Optional[str] = None, shorten_retention_flag: Optional[bool] = None)[source]

Bases: object

Data structure holding protection management token.

Parameters
  • token_id (str) – (optional)

  • token_expiration_time (str) – (optional)

  • token_reference_id (str) – (optional)

  • applied_time (str) – (optional)

  • invalidated_time (str) – (optional)

  • expiration_time (str) – (optional)

  • shorten_retention_flag (bool) – (optional)

classmethod from_dict(_dict: Dict) ProtectionManagementResponseTokenEntry[source]

Initialize a ProtectionManagementResponseTokenEntry object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.RecoveryRange(*, source_resource_crn: Optional[str] = None, backup_policy_name: Optional[str] = None, range_start_time: Optional[datetime] = None, range_end_time: Optional[datetime] = None, range_create_time: Optional[datetime] = None, retention: Optional[DeleteAfterDaysWithIndefinite] = None, recovery_range_id: Optional[str] = None)[source]

Bases: object

Metadata associated with a recovery range.

Parameters
  • source_resource_crn (str) – (optional) The CRN for a COS Bucket. Note that Softlayer CRNs do not contain dashes within the service_instance_id, whereas regular CRNs do. Although bucket backup is not supported for softlayer accounts, this need not be enforced at the CRN parsing level.

  • backup_policy_name (str) –

    (optional) The name granted to the policy. Validation :

    • chars limited to alphanumeric, underscore, hyphen and period.

  • range_start_time (datetime) – (optional) The point in time at which backup coverage of the sourceResource begins. Returns “YYYY-MM-DDTHH:mm:ss.sssZ” timestamp format.

  • range_end_time (datetime) – (optional) the point in time at which backup coverage of the sourceResource ends. Returns “YYYY-MM-DDTHH:mm:ss.sssZ” timestamp format.

  • range_create_time (datetime) – (optional) The time at which this recoveryRange was initially created. Returns “YYYY-MM-DDTHH:mm:ss.sssZ” timestamp format NOTE : this can be before the start-time.

  • retention (DeleteAfterDaysWithIndefinite) – (optional) The retention configuration for a RecoveryRange.

  • recovery_range_id (str) – (optional) A UUID that uniquely identifies a resource.

classmethod from_dict(_dict: Dict) RecoveryRange[source]

Initialize a RecoveryRange object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.RecoveryRangeCollection(recovery_ranges: List[RecoveryRange], *, next: Optional[NextPagination] = None)[source]

Bases: object

A collection of recovery ranges.

Parameters
classmethod from_dict(_dict: Dict) RecoveryRangeCollection[source]

Initialize a RecoveryRangeCollection object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.RecoveryRangePatch(*, retention: Optional[DeleteAfterDays] = None)[source]

Bases: object

The retention configuration for a RecoveryRange.

Parameters

retention (DeleteAfterDays) – (optional) The number of days to retain data within a RecoveryRange.

classmethod from_dict(_dict: Dict) RecoveryRangePatch[source]

Initialize a RecoveryRangePatch object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.RecoveryRangesPager(*, client: ResourceConfigurationV1, backup_vault_name: str, source_resource_crn: Optional[str] = None, latest: Optional[str] = None)[source]

Bases: object

RecoveryRangesPager can be used to simplify the use of the “list_recovery_ranges” method.

get_all() List[dict][source]

Returns all results by invoking get_next() repeatedly until all pages of results have been retrieved. :return: A List[dict], where each element is a dict that represents an instance of RecoveryRange. :rtype: List[dict]

get_next() List[dict][source]

Returns the next page of results. :return: A List[dict], where each element is a dict that represents an instance of RecoveryRange. :rtype: List[dict]

has_next() bool[source]

Returns true if there are potentially more results to be retrieved.

class ibm_cos_sdk_config.resource_configuration_v1.ResourceConfigurationV1(authenticator: Optional[Authenticator] = None)[source]

Bases: BaseService

The ResourceConfiguration V1 service.

DEFAULT_SERVICE_NAME = 'resource_configuration'
DEFAULT_SERVICE_URL = 'https://config.cloud-object-storage.cloud.ibm.com/v1'
create_backup_policy(bucket: str, initial_retention: DeleteAfterDays, policy_name: str, target_backup_vault_crn: str, backup_type: str, *, m_d5: Optional[str] = None, **kwargs) DetailedResponse[source]

Add a new backup policy to the COS Bucket.

Attach a new Backup Policy on a bucket. This request results in the creation of a single, new RecoveryRange on the destination BackupVault. Deletion and re-creation of a BackupPolicy to the same BackupVault destination will generate a new RecoveryRange. The following shall be validated. Any failure to validate shall cause a HTTP 400 to be returned.

  • the user has cloud-object-storage.bucket.post_backup_policy permissions on

the source-bucket
  • the source-bucket must have cloud-object-storage.backup_vault.sync

permissions on the Backup Vault
  • the source-bucket must have versioning-on

  • the Backup Vault must exist and be able to be contacted by the source-bucket

  • the source-bucket must not have an existing BackupPolicy targeting the Backup

Vault
  • the source-bucket must not have a BackupPolicy with the same policy_name

  • the source-bucket must have fewer than 3 total BackupPolicies.

Parameters
  • bucket (str) – Name of the COS Bucket name.

  • initial_retention (DeleteAfterDays) – The number of days to retain data within a RecoveryRange.

  • policy_name (str) – The name granted to the policy. Validation : * chars limited to alphanumeric, underscore, hyphen and period.

  • target_backup_vault_crn (str) – The CRN for a COS BackupVault.

  • backup_type (str) – The type of backup to support. For LA+GA this is limited to “continuous”.

  • m_d5 (str) – (optional) MD5 hash of content. If provided, the hash of the request must match.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a BackupPolicy object

create_backup_vault(service_instance_id: str, backup_vault_name: str, region: str, *, activity_tracking: Optional[BackupVaultActivityTracking] = None, metrics_monitoring: Optional[BackupVaultMetricsMonitoring] = None, sse_kp_customer_root_key_crn: Optional[str] = None, **kwargs) DetailedResponse[source]

create a BackupVault.

Creates a BackupVault. Requires that the user has cloud-object-storage.backup_vault.post_backup_vault permissions for the account. Certain fields will be returned only if the user has specific permissions:

  • activity_tracking requires

cloud-object-storage.backup_vault.put_activity_tracking
  • metrics_monitoring requires

cloud-object-storage.backup_vault.put_metrics_monitoring.

Parameters
  • service_instance_id (str) – Name of the service_instance to list BackupVaults for.

  • backup_vault_name (str) – The name given to a Bucket. Bucket names must be between 3 and 63 characters long must be made of lowercase letters, numbers, dots (periods), and dashes (hyphens). Bucket names must begin and end with a lowercase letter or number. Bucket names canâ€t contain consecutive dots or dashes. Bucket names that resemble IP addresses are not allowed. Bucket and BackupVault names exist in a global namespace and therefore must be unique.

  • region (str) – the region in which this backup-vault should be created within.

  • activity_tracking (BackupVaultActivityTracking) – (optional) Activity Tracking configuration. An empty object ({}) indicates no configuration, and no events will be sent (This is the same behavior as {“management_events”:false}). Note that read/write events cannot be enabled, and events cannot be routed to a non-default Activity Tracker instance.

  • metrics_monitoring (BackupVaultMetricsMonitoring) – (optional) Metrics Monitoring configuration. An empty object ({}) indicates no configuration, and no metrics will be collected (This is the same behavior as {“usage_metrics_enabled”:false}). Note that request metrics cannot be enabled, and metrics cannot be routed to a non-default metrics router instance.

  • sse_kp_customer_root_key_crn (str) – (optional) The CRN for a KeyProtect root key.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a BackupVault object

create_restore(backup_vault_name: str, recovery_range_id: str, restore_type: str, restore_point_in_time: datetime, target_resource_crn: str, **kwargs) DetailedResponse[source]

Initiate a Restore.

Initiates a restore operation against some RecoveryRange to some destination bucket. The following shall be validated. Any failure to validate shall cause a HTTP 400 to be returned.

  • The specified RecoveryRange must exist

  • The restore time must be within the RecoveryRange

  • the user has cloud-object-storage.backup-vault.post_restore permissions on

the backup-vault
  • the target-bucket must exist and be able to be contacted by the Backup Vault

  • target-bucket must have versioning-on

  • the Backup Vault must have cloud-object-storage.bucket.restore_sync

permissions on the target-bucket.

Parameters
  • backup_vault_name (str) – name of BackupVault to restore from.

  • recovery_range_id (str) – A UUID that uniquely identifies a resource.

  • restore_type (str) – The type of restore to support. More options will be available in the future.

  • restore_point_in_time (datetime) – Timestamp format used throughout the API. Accepts the following formats: YYYY-MM-DDTHH:mm:ssZ YYYY-MM-DDTHH:mm:ss YYYY-MM-DDTHH:mm:ss-hh:mm YYYY-MM-DDTHH:mm:ss+hh:mm YYYY-MM-DDTHH:mm:ss.sssZ YYYY-MM-DDTHH:mm:ss.sss YYYY-MM-DDTHH:mm:ss.sss-hh:mm YYYY-MM-DDTHH:mm:ss.sss+hh:mm.

  • target_resource_crn (str) – The CRN for a COS Bucket. Note that Softlayer CRNs do not contain dashes within the service_instance_id, whereas regular CRNs do. Although bucket backup is not supported for softlayer accounts, this need not be enforced at the CRN parsing level.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a Restore object

delete_backup_policy(bucket: str, policy_id: str, **kwargs) DetailedResponse[source]

Delete a BackupPolicy.

Delete a specific BackupPolicy. Requires that the user has cloud-object-storage.bucket.delete_backup_policy permissions on the bucket.

Parameters
  • bucket (str) – name of the bucket affected.

  • policy_id (str) – uuid of the BackupPolicy.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse

delete_backup_vault(backup_vault_name: str, **kwargs) DetailedResponse[source]

Delete an empty Backup Vault.

Delete the Backup Vault. Requires that the BackupVault not contain any RecoveryRanges. Requires that the user has cloud-object-storage.backup_vault.delete_backup_vault permissions for the account.

Parameters
  • backup_vault_name (str) – Name of the backup-vault to create or update.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse

get_backup_policy(bucket: str, policy_id: str, **kwargs) DetailedResponse[source]

Get BackupPolicy.

Read a specific backup policy on a bucket. Requires that the user has cloud-object-storage.bucket.get_backup_policy permissions on the bucket.

Parameters
  • bucket (str) – name of the bucket affected.

  • policy_id (str) – uuid of the BackupPolicy.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a BackupPolicy object

get_backup_vault(backup_vault_name: str, **kwargs) DetailedResponse[source]

get the config for a Backup Vault.

Gets configuration information for a Backup Vault. Requires that the user has cloud-object-storage.backup_vault.get_basic permissions on the backup vault. Certain fields will be returned only if the user has specific permissions:

  • activity_tracking requires

cloud-object-storage.backup_vault.get_activity_tracking
  • metrics_monitoring requires

cloud-object-storage.backup_vault.get_metrics_monitoring
  • sse_kp_customer_root_key_crn requires

cloud-object-storage.backup_vault.get_crk_id.

Parameters
  • backup_vault_name (str) – Name of the backup-vault to create or update.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a BackupVault object

get_bucket_config(bucket: str, **kwargs) DetailedResponse[source]

Returns metadata for the specified bucket.

Returns metadata for the specified bucket.

Parameters
  • bucket (str) – Name of a bucket.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a Bucket object

get_restore(backup_vault_name: str, restore_id: str, **kwargs) DetailedResponse[source]

Get Restore.

Introspect on a specific restore. Requires that the user have cloud-object-storage.backup_vault.get_restore permission on the backup vault.

Parameters
  • backup_vault_name (str) – name of BackupVault that the restore occured on.

  • restore_id (str) – id of the restore to introspect on.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a Restore object

get_source_resource_recovery_range(backup_vault_name: str, recovery_range_id: str, **kwargs) DetailedResponse[source]

get RecoveryRange info.

Get info for a specific RecoveryRange. Requires the user have cloud-object-storage.backup_vault.get_recovery_range permissions to the Backup Vault.

Parameters
  • backup_vault_name (str) – name of BackupVault to update.

  • recovery_range_id (str) – ID of the RecoveryRange to update.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a RecoveryRange object

list_backup_policies(bucket: str, **kwargs) DetailedResponse[source]

List BackupPolicies.

Get all backup policies on a bucket. Requires that the user has cloud-object-storage.bucket.list_backup_policies permissions on the source bucket. This request generates the “cloud-object-storage.bucket-backup-policy.list” ActivityTracking event.

Parameters
  • bucket (str) – Name of the COS Bucket name.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a BackupPolicyCollection object

list_backup_vaults(service_instance_id: str, *, token: Optional[str] = None, **kwargs) DetailedResponse[source]

list BackupVaults.

Returns a list of BackupVault CRNs owned by the account. Requires that the user has cloud-object-storage.backup_vault.list_account_backup_vaults permissions for the account.

Parameters
  • service_instance_id (str) – Name of the service_instance to list BackupVaults for.

  • token (str) – (optional) the continuation token for controlling pagination.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a BackupVaultCollection object

list_recovery_ranges(backup_vault_name: str, *, source_resource_crn: Optional[str] = None, latest: Optional[str] = None, token: Optional[str] = None, **kwargs) DetailedResponse[source]

List RecoveryRanges on a backup vault.

List RecoveryRanges on a backup vault. Lists all available ranges for all source resources by default. The ?source_resource_crn query parameter will limit the list to only ranges for the specified resource. Requires the user have cloud-object-storage.backup_vault.list_recovery_ranges permissions to the Backup Vault.

Parameters
  • backup_vault_name (str) – name of BackupVault.

  • source_resource_crn (str) – (optional) CRN of source resource to filter on. This limits ranges returned to only ranges where the source_resource_crn matches the parameter value.

  • latest (str) – (optional) If “true”, then return only the latest RecoveryRange for each source-resource that is backed up. If “false” or not specified, then the default behavior is produced. Value is can insensative. If any value is provided other than “true” or “false” then return 400.

  • token (str) – (optional) the continuation token for controlling pagination.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a RecoveryRangeCollection object

list_restores(backup_vault_name: str, *, token: Optional[str] = None, **kwargs) DetailedResponse[source]

List Restores.

List all current and complete restores. Requires that the user have cloud-object-storage.backup_vault.list_restores permission on the backup vault.

Parameters
  • backup_vault_name (str) – name of BackupVault to restore from.

  • token (str) – (optional) the continuation token for controlling pagination.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a RestoreCollection object

classmethod new_instance(service_name: str = 'resource_configuration') ResourceConfigurationV1[source]
Return a new client for the ResourceConfiguration service using the

specified parameters and external configuration.

patch_source_resource_recovery_range(backup_vault_name: str, recovery_range_id: str, recovery_range_patch: RecoveryRangePatch, **kwargs) DetailedResponse[source]

patch RecoveryRange info.

Update a RecoveryRange via JSON-merge-patch semantics. Requires the user have cloud-object-storage.backup_vault.put_retention permissions to the Backup Vault. The retention.delete_after_days value may only be extended.

Parameters
  • backup_vault_name (str) – name of BackupVault to update.

  • recovery_range_id (str) – ID of the RecoveryRange to update.

  • recovery_range_patch (RecoveryRangePatch) – The RecoveryRange configuration elements that are to be changed.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a RecoveryRange object

update_backup_vault(backup_vault_name: str, backup_vault_patch: BackupVaultPatch, *, if_match: Optional[str] = None, **kwargs) DetailedResponse[source]

Update the config on a Backup Vault.

Update the Backup Vault config via JSON Merge Patch update semantics. In particular, note that providing an empty object ({}) to either field in the request body will remove any existing configuration. Requires that the user have specific permissions depending on what is being changed:

  • activity_tracking requires

cloud-object-storage.backup_vault.put_activity_tracking
  • metrics_monitoring requires

cloud-object-storage.backup_vault.put_metrics_monitoring.

Parameters
  • backup_vault_name (str) – Name of the backup-vault to create or update.

  • backup_vault_patch (BackupVaultPatch) – A Backup Vault config object containing changes to apply to the existing Backup Vault config.

  • if_match (str) – (optional) Conditionally update the Backup Vault config if and only if the ETag of the existing config exactly matches the provided If-Match MD5.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse with dict result representing a BackupVault object

update_bucket_config(bucket: str, *, bucket_patch: Optional[BucketPatch] = None, if_match: Optional[str] = None, **kwargs) DetailedResponse[source]

Make changes to a bucket’s configuration.

Updates a bucket using [JSON Merge Patch](https://tools.ietf.org/html/rfc7396). This request is used to add functionality (like an IP access filter) or to update existing parameters. Primitives are overwritten and replaced in their entirety. It is not possible to append a new (or to delete a specific) value to an array. Arrays can be cleared by updating the parameter with an empty array []. A PATCH operation only updates specified mutable fields. Please don’t use PATCH trying to update the number of objects in a bucket, any timestamps, or other non-mutable fields.

Parameters
  • bucket (str) – Name of a bucket.

  • bucket_patch (BucketPatch) – (optional) An object containing new configuration metadata.

  • if_match (str) – (optional) An Etag previously returned in a header when fetching or updating a bucket’s metadata. If this value does not match the active Etag, the request will fail.

  • headers (dict) – A dict containing the request headers

Returns

A DetailedResponse containing the result, headers and HTTP status code.

Return type

DetailedResponse

class ibm_cos_sdk_config.resource_configuration_v1.Restore(recovery_range_id: str, restore_type: str, restore_point_in_time: datetime, target_resource_crn: str, *, source_resource_crn: Optional[str] = None, restore_id: Optional[str] = None, restore_status: Optional[str] = None, init_time: Optional[datetime] = None, complete_time: Optional[datetime] = None, restore_percent_progress: Optional[int] = None, error_cause: Optional[str] = None)[source]

Bases: object

Metadata associated with a requested restore operation.

Parameters
  • recovery_range_id (str) – A UUID that uniquely identifies a resource.

  • restore_type (str) – The type of restore to support. More options will be available in the future.

  • restore_point_in_time (datetime) – Timestamp format used throughout the API. Accepts the following formats: YYYY-MM-DDTHH:mm:ssZ YYYY-MM-DDTHH:mm:ss YYYY-MM-DDTHH:mm:ss-hh:mm YYYY-MM-DDTHH:mm:ss+hh:mm YYYY-MM-DDTHH:mm:ss.sssZ YYYY-MM-DDTHH:mm:ss.sss YYYY-MM-DDTHH:mm:ss.sss-hh:mm YYYY-MM-DDTHH:mm:ss.sss+hh:mm.

  • target_resource_crn (str) – The CRN for a COS Bucket. Note that Softlayer CRNs do not contain dashes within the service_instance_id, whereas regular CRNs do. Although bucket backup is not supported for softlayer accounts, this need not be enforced at the CRN parsing level.

  • source_resource_crn (str) – (optional) The CRN for a COS Bucket. Note that Softlayer CRNs do not contain dashes within the service_instance_id, whereas regular CRNs do. Although bucket backup is not supported for softlayer accounts, this need not be enforced at the CRN parsing level.

  • restore_id (str) – (optional) A UUID that uniquely identifies a resource.

  • restore_status (str) – (optional) The current status for this restore operation. initializing: The operation is initializing. Do not expect to see restored objects on the target bucket. running : The operation is ongoing. Expect to see some restored objects on the target bucket. complete: The operation has completed successfully. failed: The operation has completed unsuccessfully.

  • init_time (datetime) – (optional) The time at which this restore was initiated Returns “YYYY-MM-DDTHH:mm:ss.sssZ” timestamp format.

  • complete_time (datetime) – (optional) The time at which this restore ended (in both success and error cases) Returns “YYYY-MM-DDTHH:mm:ss.sssZ” timestamp format.

  • restore_percent_progress (int) – (optional) reports percent-doneness of init. Only present when restore_status=running.

  • error_cause (str) – (optional) Only present when restore_status=running.

class RestoreStatusEnum(value)[source]

Bases: str, Enum

The current status for this restore operation. initializing: The operation is initializing. Do not expect to see restored objects on the target bucket. running : The operation is ongoing. Expect to see some restored objects on the target bucket. complete: The operation has completed successfully. failed: The operation has completed unsuccessfully.

COMPLETE = 'complete'
FAILED = 'failed'
INITIALIZING = 'initializing'
RUNNING = 'running'
class RestoreTypeEnum(value)[source]

Bases: str, Enum

The type of restore to support. More options will be available in the future.

IN_PLACE = 'in_place'
classmethod from_dict(_dict: Dict) Restore[source]

Initialize a Restore object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.RestoreCollection(restores: List[Restore], *, next: Optional[NextPagination] = None)[source]

Bases: object

A list of restore operations.

Parameters
  • next (NextPagination) – (optional) Pagination response body.

  • restores (List[Restore]) – A collection of active and completed restore operations.

classmethod from_dict(_dict: Dict) RestoreCollection[source]

Initialize a RestoreCollection object from a json dictionary.

to_dict() Dict[source]

Return a json dictionary representing this model.

class ibm_cos_sdk_config.resource_configuration_v1.RestoresPager(*, client: ResourceConfigurationV1, backup_vault_name: str)[source]

Bases: object

RestoresPager can be used to simplify the use of the “list_restores” method.

get_all() List[dict][source]

Returns all results by invoking get_next() repeatedly until all pages of results have been retrieved. :return: A List[dict], where each element is a dict that represents an instance of Restore. :rtype: List[dict]

get_next() List[dict][source]

Returns the next page of results. :return: A List[dict], where each element is a dict that represents an instance of Restore. :rtype: List[dict]

has_next() bool[source]

Returns true if there are potentially more results to be retrieved.

ibm_cos_sdk_config.version module

Version of ibm_cos_sdk_config

ibm_cos_sdk_config.watson_service module

Module contents

IBM COS Resource Configuration SDK for Python