REST API used to configure Cloud Object Storage buckets. This version of the API only supports reading bucket metadata, setting IP access controls, and configuring logging and monitoring services.
cos_config.resource_configuration_v1.ActivityTracking(read_data_events=None, write_data_events=None, activity_tracker_crn=None)[source]¶Bases: object
Enables sending log data to Activity Tracker and LogDNA to provide visibility into object read and write events. All object events are sent to the activity tracker instance defined in the activity_tracker_crn field.
(optional) If set to true, all object read events (i.e.
downloads) will be sent to Activity Tracker. :attr bool write_data_events: (optional) If set to true, all object write events (i.e. uploads) will be sent to Activity Tracker. :attr str activity_tracker_crn: (optional) Required the first time activity_tracking is configured. The instance of Activity Tracker that will receive object event data. The format is “crn:v1:bluemix:public:logdnaat:{bucket location}:a/{storage account}:{activity tracker service instance}::”.
cos_config.resource_configuration_v1.Bucket(name=None, crn=None, service_instance_id=None, service_instance_crn=None, time_created=None, time_updated=None, object_count=None, bytes_used=None, noncurrent_object_count=None, noncurrent_bytes_used=None, delete_marker_count=None, hard_quota=None, firewall=None, activity_tracking=None, metrics_monitoring=None)[source]¶Bases: object
A bucket.
(optional) The name of the bucket. Non-mutable.
(optional) The service instance that holds the bucket. Non-mutable.
(optional) The service instance that holds the bucket.
Non-mutable. :attr str service_instance_crn: (optional) The service instance that holds the bucket. Non-mutable. :attr datetime time_created: (optional) The creation time of the bucket in RFC 3339 format. Non-mutable. :attr datetime time_updated: (optional) The modification time of the bucket in RFC 3339 format. Non-mutable. :attr int object_count: (optional) Total number of objects in the bucket. Non-mutable. :attr int bytes_used: (optional) Total size of all objects in the bucket. Non-mutable. :attr int noncurrent_object_count: (optional) Number of non-current object versions in the bucket. Non-mutable. :attr int noncurrent_bytes_used: (optional) Total size of all non-current object versions in the bucket. Non-mutable. :attr int delete_marker_count: (optional) Total number of delete markers in the bucket. Non-mutable. :attr int hard_quota: (optional) Maximum bytes for this bucket. :attr 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. :attr ActivityTracking activity_tracking: (optional) Enables sending log data to Activity Tracker and LogDNA to provide visibility into object read and write events. All object events are sent to the activity tracker instance defined in the activity_tracker_crn field. :attr MetricsMonitoring metrics_monitoring: (optional) Enables sending metrics to IBM Cloud Monitoring. All metrics are sent to the IBM Cloud Monitoring instance defined in the monitoring_crn field.
cos_config.resource_configuration_v1.Firewall(allowed_ip=None, denied_ip=None, allowed_network_type=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.
(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. :attr list[str] denied_ip: (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. :attr list[str] allowed_network_type: (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).
cos_config.resource_configuration_v1.MetricsMonitoring(usage_metrics_enabled=None, request_metrics_enabled=None, metrics_monitoring_crn=None)[source]¶Bases: object
Enables sending metrics to IBM Cloud Monitoring. All metrics are sent to the IBM Cloud Monitoring instance defined in the monitoring_crn field.
(optional) If set to true, all usage metrics (i.e.
bytes_used) will be sent to the monitoring service. :attr bool request_metrics_enabled: (optional) If set to true, all request metrics (i.e. rest.object.head) will be sent to the monitoring service. :attr str metrics_monitoring_crn: (optional) Required the first time metrics_monitoring is configured. The instance of IBM Cloud Monitoring that will receive the bucket metrics. The format is “crn:v1:bluemix:public:logdnaat:{bucket location}:a/{storage account}:{monitoring service instance}::”.
cos_config.resource_configuration_v1.ResourceConfigurationV1(url='https://config.cloud-object-storage.cloud.ibm.com/v1', iam_apikey=None, iam_access_token=None, iam_url=None, iam_client_id=None, iam_client_secret=None)[source]¶Bases: ibm_cloud_sdk_core.base_service.BaseService
The ResourceConfiguration V1 service.
default_url = 'https://config.cloud-object-storage.cloud.ibm.com/v1'¶get_bucket_config(bucket, **kwargs)[source]¶Returns metadata for the specified bucket.
Returns metadata for the specified bucket.
bucket (str) – Name of a bucket.
headers (dict) – A dict containing the request headers
A DetailedResponse containing the result, headers and HTTP status code.
DetailedResponse
update_bucket_config(bucket, firewall=None, activity_tracking=None, metrics_monitoring=None, hard_quota=None, if_match=None, **kwargs)[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 []. 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.
bucket (str) – Name of a bucket.
firewall (Firewall) – 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. :param ActivityTracking activity_tracking: Enables sending log data to Activity Tracker and LogDNA to provide visibility into object read and write events. All object events are sent to the activity tracker instance defined in the activity_tracker_crn field. :param MetricsMonitoring metrics_monitoring: Enables sending metrics to IBM Cloud Monitoring. All metrics are sent to the IBM Cloud Monitoring instance defined in the monitoring_crn field. :param int hard_quota: Maximum bytes for this bucket. :param str if_match: 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. :param dict headers: A dict containing the request headers :return: A DetailedResponse containing the result, headers and HTTP status code. :rtype: DetailedResponse