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

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.

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

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