Skip to content

Commit 49a580d

Browse files
IBMericGitHub Enterprise
authored and
GitHub Enterprise
committed
Release 1.3.0
1 parent b03a4b1 commit 49a580d

File tree

5 files changed

+95
-35
lines changed

5 files changed

+95
-35
lines changed

CHANGELOG.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,52 @@
11
# CHANGELOG
22

3-
# 1.2.0
4-
## Content
5-
### Features
3+
## 1.3.0
4+
5+
### Content
6+
7+
#### Features
8+
9+
* Block Public Anonymous Access
10+
11+
#### Defect Fixes
12+
13+
* Add language support policy
14+
15+
## 1.2.0
16+
17+
### Content
18+
19+
#### Features
20+
621
* COS Usage Metrics Monitoring
722

8-
# 1.1.1
9-
## Content
23+
## 1.1.1
24+
25+
### Content
26+
1027
* No change. Refer to deprecation notice in README
1128

12-
# 1.1.0
13-
## Content
14-
### Features
29+
## 1.1.0
30+
31+
### Content
32+
33+
#### Features
34+
1535
* Activity Tracker
1636

17-
# 1.0.1
18-
## Content
19-
### Defect Fixes
37+
## 1.0.1
38+
39+
### Content
40+
41+
#### Defect Fixes
42+
2043
* This release repairs an issue with the SDK package on the PyPI repository
2144

22-
# 1.0.0
23-
## Content
24-
### Features
45+
## 1.0.0
46+
47+
### Content
48+
49+
#### Features
50+
2551
* Initial release - Deprecated due to issues with published binaries on PyPI. Please use 1.0.1
26-
* This Feature allows configuration of a firewall for a bucket to restrict access to a defined list of IP addresses
52+
* This Feature allows configuration of a firewall for a bucket to restrict access to a defined list of IP addresses

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# IBM COS Resource Configuration SDK for Python
1+
# IBM COS Resource Configuration SDK for Python
22

3-
This package allows Python developers to write software that interacts with the Resource Configuration API for [IBM
4-
Cloud Object Storage](https://cloud.ibm.com/apidocs/cos/cos-configuration).
3+
This package allows Python developers to write software that interacts with the Resource Configuration API for [IBM Cloud Object Storage](https://cloud.ibm.com/apidocs/cos/cos-configuration).
54

65
## Notice
76

8-
IBM is officially deprecating support of Python versions 2.7 & 3.4. All clients need to upgrade to version 3.5 or greater by January 31, 2020.
7+
IBM has added a [Language Support Policy](#language-support-policy). Language versions will be deprecated on the published schedule without additional notice.
98

109
## Documentation
1110

@@ -17,32 +16,34 @@ For release notes, see the [CHANGELOG](CHANGELOG.md).
1716

1817
## Quick start
1918

20-
You'll need:
21-
* An instance of COS.
22-
* An API key from [IBM Cloud Identity and Access Management](https://cloud.ibm.com/docs/iam/users_roles.html).
23-
* **Python 3.5, 3.6, or 3.7**.
19+
You will need:
2420

25-
These values can be found in the IBM Cloud Console by [generating a 'service credential'](https://cloud.ibm.com/docs/services/cloud-object-storage/iam/service-credentials.html).
21+
* An instance of COS.
22+
* An API key from [IBM Cloud Identity and Access Management](https://cloud.ibm.com/docs/iam/users_roles.html).
23+
24+
These values can be found in the IBM Cloud Console by [generating a 'service credential'](https://cloud.ibm.com/docs/services/cloud-object-storage/iam/service-credentials.html).
2625

2726
## Getting the SDK
28-
The preferred way to install the IBM COS Resource Configuration SDK for Python is to use the
29-
[pip](https://pypi.org/project/pip/) package manager. Simply type the following
30-
into a terminal window:
27+
28+
The preferred way to install the IBM COS Resource Configuration SDK for Python is to use the [pip](https://pypi.org/project/pip/) package manager. Simply type the following into a terminal window:
3129

3230
```sh
3331
pip install ibm-cos-sdk-config
3432
```
3533

3634
## Getting Help
35+
3736
Feel free to use GitHub issues for tracking bugs and feature requests, but for help please use one of the following resources:
3837

3938
* Read a quick start guide in [IBM Cloud Docs](https://cloud.ibm.com/docs/services/cloud-object-storage/).
4039
* Ask a question on [Stack Overflow](https://stackoverflow.com/) and tag it with ``ibm`` and ``object-storage``.
4140
* Open a support ticket with [IBM Cloud Support](https://cloud.ibm.com/unifiedsupport/supportcenter)
4241
* If it turns out that you may have found a bug, please [open an issue](https://github.com/ibm/ibm-cos-sdk-python-config/issues/new).
4342

43+
## Language Support Policy
44+
45+
IBM supports [current public releases](https://devguide.python.org/#status-of-python-branches). IBM will deprecate language versions 90 days after a version reaches end-of-life. All clients will need to upgrade to a supported version before the end of the grace period.
4446

4547
## License
4648

47-
This SDK is distributed under the
48-
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
49+
This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

cos_config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'IBM'
2-
__version__ = '1.2.0'
2+
__version__ = '1.3.0'

cos_config/resource_configuration_v1.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
"""
1818
REST API used to configure Cloud Object Storage buckets. This version of the API only
19-
supports reading bucket metadata and setting IP access controls.
19+
supports reading bucket metadata, setting IP access controls, and configuring logging and
20+
monitoring services.
2021
"""
2122

2223
from __future__ import absolute_import
@@ -194,7 +195,7 @@ class ActivityTracking(object):
194195
:attr bool write_data_events: (optional) If set to `true`, all object write events
195196
(i.e. uploads) will be sent to Activity Tracker.
196197
:attr str activity_tracker_crn: (optional) Required the first time `activity_tracking`
197-
is configured. The instance of Activity Tracker that will recieve object event data.
198+
is configured. The instance of Activity Tracker that will receive object event data.
198199
The format is "crn:v1:bluemix:public:logdnaat:{bucket location}:a/{storage
199200
account}:{activity tracker service instance}::".
200201
"""
@@ -209,7 +210,7 @@ def __init__(self, read_data_events=None, write_data_events=None, activity_track
209210
events (i.e. uploads) will be sent to Activity Tracker.
210211
:param str activity_tracker_crn: (optional) Required the first time
211212
`activity_tracking` is configured. The instance of Activity Tracker that will
212-
recieve object event data. The format is "crn:v1:bluemix:public:logdnaat:{bucket
213+
receive object event data. The format is "crn:v1:bluemix:public:logdnaat:{bucket
213214
location}:a/{storage account}:{activity tracker service instance}::".
214215
"""
215216
self.read_data_events = read_data_events
@@ -419,36 +420,67 @@ class Firewall(object):
419420
to be affected by firewall in CIDR notation is supported. Passing an empty array will
420421
lift the IP address filter. The `allowed_ip` array can contain a maximum of 1000
421422
items.
423+
:attr list[str] denied_ip: (optional) List of IPv4 or IPv6 addresses in CIDR notation
424+
to be affected by firewall in CIDR notation is supported. Passing an empty array will
425+
lift the IP address filter. The `denied_ip` array can contain a maximum of 1000
426+
items.
427+
:attr list[str] allowed_network_type: (optional) Indicates which network types are
428+
allowed for bucket access. May contain `public`, `private`, and/or `direct` elements.
429+
Setting `allowed_network_type` to only `private` will prevent access to object storage
430+
from outside of the IBM Cloud. The entire array will be overwritten in a `PATCH`
431+
operation. For more information on network types, [see the
432+
documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints#advanced-endpoint-types).
422433
"""
423434

424-
def __init__(self, allowed_ip=None):
435+
def __init__(self, allowed_ip=None, denied_ip=None, allowed_network_type=None):
425436
"""
426437
Initialize a Firewall object.
427438
428439
:param list[str] allowed_ip: (optional) List of IPv4 or IPv6 addresses in CIDR
429440
notation to be affected by firewall in CIDR notation is supported. Passing an
430441
empty array will lift the IP address filter. The `allowed_ip` array can contain a
431442
maximum of 1000 items.
443+
:param list[str] denied_ip: (optional) List of IPv4 or IPv6 addresses in CIDR
444+
notation to be affected by firewall in CIDR notation is supported. Passing an
445+
empty array will lift the IP address filter. The `denied_ip` array can contain a
446+
maximum of 1000 items.
447+
:param list[str] allowed_network_type: (optional) Indicates which network types
448+
are allowed for bucket access. May contain `public`, `private`, and/or `direct`
449+
elements. Setting `allowed_network_type` to only `private` will prevent access to
450+
object storage from outside of the IBM Cloud. The entire array will be
451+
overwritten in a `PATCH` operation. For more information on network types, [see
452+
the
453+
documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-endpoints#advanced-endpoint-types).
432454
"""
433455
self.allowed_ip = allowed_ip
456+
self.denied_ip = denied_ip
457+
self.allowed_network_type = allowed_network_type
434458

435459
@classmethod
436460
def _from_dict(cls, _dict):
437461
"""Initialize a Firewall object from a json dictionary."""
438462
args = {}
439-
validKeys = ['allowed_ip']
463+
validKeys = ['allowed_ip', 'denied_ip', 'allowed_network_type']
440464
badKeys = set(_dict.keys()) - set(validKeys)
441465
if badKeys:
442466
raise ValueError('Unrecognized keys detected in dictionary for class Firewall: ' + ', '.join(badKeys))
443467
if 'allowed_ip' in _dict:
444468
args['allowed_ip'] = _dict.get('allowed_ip')
469+
if 'denied_ip' in _dict:
470+
args['denied_ip'] = _dict.get('denied_ip')
471+
if 'allowed_network_type' in _dict:
472+
args['allowed_network_type'] = _dict.get('allowed_network_type')
445473
return cls(**args)
446474

447475
def _to_dict(self):
448476
"""Return a json dictionary representing this model."""
449477
_dict = {}
450478
if hasattr(self, 'allowed_ip') and self.allowed_ip is not None:
451479
_dict['allowed_ip'] = self.allowed_ip
480+
if hasattr(self, 'denied_ip') and self.denied_ip is not None:
481+
_dict['denied_ip'] = self.denied_ip
482+
if hasattr(self, 'allowed_network_type') and self.allowed_network_type is not None:
483+
_dict['allowed_network_type'] = self.allowed_network_type
452484
return _dict
453485

454486
def __str__(self):

requirements-docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
docutils>=0.10,<0.15
12
Sphinx>=1.1.3,<1.3
23
guzzle_sphinx_theme>=0.7.10,<0.8
34
-rrequirements.txt

0 commit comments

Comments
 (0)