Skip to content

Commit e6d98d2

Browse files
authored
Merge pull request #35 from oracle/release_2017-11-02
Releasing version 1.3.9
2 parents 282219d + 09b27cf commit e6d98d2

File tree

86 files changed

+5927
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+5927
-452
lines changed

CHANGELOG.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
66

7+
====================
8+
1.3.9 - 2017-11-02
9+
====================
10+
11+
Added
12+
-----
13+
* Support for the Audit service
14+
* Support for archive storage tier, object rename and namespace metadata in Object Storage service
15+
* Support for fast clones of volumes in Block Storage service
16+
* Support for backup and restore in Database service
17+
* Support for sorting and filtering in list APIs in Core Services
18+
* Support for passing explicit None values to service operations. Consult the *Passing explicit Null/None values* section of the `docs <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io>`_ for more information.
19+
* Support for supplying private key contents through the 'key_content' config field
20+
21+
Changed
22+
-------
23+
* Upgraded cryptography dependency to 1.9.
24+
* Minimum version of Mac OS supported is now 10.8
25+
726
====================
827
1.3.8 - 2017-10-12
928
====================

docs/api/index.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@
1212
API Reference
1313
~~~~~~~~~~~~~
1414

15+
=======
16+
Audit
17+
=======
18+
19+
--------
20+
Client
21+
--------
22+
23+
.. autoclass:: oci.audit.audit_client.AuditClient
24+
:members:
25+
26+
--------
27+
Models
28+
--------
29+
30+
.. automodule:: oci.audit.models
31+
:members:
32+
:undoc-members:
33+
:imported-members:
34+
1535
===============
1636
Core Services
1737
===============
@@ -129,6 +149,15 @@ Load Balancer
129149
:undoc-members:
130150
:imported-members:
131151

152+
================
153+
Upload Manager
154+
================
155+
156+
.. module:: oci.object_storage
157+
158+
.. autoclass:: UploadManager
159+
:special-members: __init__
160+
:members:
132161

133162
=============
134163
Base Client

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ To get started, head over to the :ref:`installation instructions <install>` or s
4848
backward-compatibility
4949
quickstart
5050
parallel-ops
51+
pass-explicit-null
5152
upload-manager
5253
raw-requests
5354
api/index

docs/pass-explicit-null.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. _pass-explicit-null:
2+
3+
.. raw:: html
4+
5+
<script type='text/javascript'>
6+
var oldDocsHost = 'oracle-bare-metal-cloud-services-python-sdk';
7+
if (window.location.href.indexOf(oldDocsHost) != -1) {
8+
window.location.href = 'https://oracle-bare-metal-cloud-services-python-sdk.readthedocs.io/en/latest/deprecation-notice.html';
9+
}
10+
</script>
11+
12+
Passing explicit Null/None values
13+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
The SDK does not send fields with a value of ``None`` back to the service. In order to send a ``None`` explicitly back to the service - for example if you are trying to clear metadata on a bucket - you can set a field's value to ``oci.util.NONE_SENTINEL``:
15+
16+
.. code-block:: python
17+
18+
import oci
19+
20+
update_bucket_details = oci.object_storage.models.UpdateBucketDetails()
21+
update_bucket_details.metadata = oci.util.NONE_SENTINEL
22+
23+
object_storage.update_bucket('my_namespace', 'my_bucket', update_bucket_details)

docs/upload-manager.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
Uploading Large Objects
1313
~~~~~~~~~~~~~~~~~~~~~~~~
1414

15-
The Object Storage service supports multipart uploads to make large object uploads easier by splitting the large object into parts. The Python SDK supports raw multipart upload operations for advanced use cases, as well as a higher-level upload class that uses the multipart upload APIs. `Managing Multipart Uploads <https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingmultipartuploads.htm>`_ provides links to the APIs used for raw multipart upload operations. Higher-level uploads can be performed using the UploadManager. The UploadManger will: split a large object into parts for you, upload the parts in parallel, and then recombine and commit the parts as a single object in Object Storage.
15+
The Object Storage service supports multipart uploads to make large object uploads easier by splitting the large object into parts. The Python SDK supports raw multipart upload operations for advanced use cases, as well as a higher-level upload class that uses the multipart upload APIs. `Managing Multipart Uploads <https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingmultipartuploads.htm>`_ provides links to the APIs used for raw multipart upload operations. Higher-level uploads can be performed using the :py:class:`~oci.object_storage.UploadManager`. The :py:class:`~oci.object_storage.UploadManager` will: split a large object into parts for you, upload the parts in parallel, and then recombine and commit the parts as a single object in Object Storage.
1616

17-
The `UploadObject <https://github.com/oracle/oci-python-sdk/blob/master/examples/multipart_object_upload.py>`_ example shows how UploadManager can be used to upload files to object storage.
17+
The `UploadObject <https://github.com/oracle/oci-python-sdk/blob/master/examples/multipart_object_upload.py>`_ example shows how :py:class:`~oci.object_storage.UploadManager` can be used to upload files to object storage.

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
certifi
22
configparser==3.5.0
33
coverage==4.2
4-
cryptography==1.8.2
4+
cryptography==1.9
55
flake8==3.0.4
66
httpsig_cffi==15.0.0
77
mock==2.0.0
8-
pytest==3.0.2
8+
pytest==3.0.3
99
pytest-catchlog==1.2.2
1010
python-dateutil==2.5.3
11-
pytz==2016.7
11+
pytz==2016.10
1212
requests==2.11.1
1313
sphinx-rtd-theme==0.1.9
1414
six==1.10.0
15-
sphinx==1.4.6
15+
sphinx==1.6.4
1616
tox==2.3.1
1717
wheel==0.29.0

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ def open_relative(*path):
3131
requires = [
3232
"certifi",
3333
"configparser==3.5.0",
34-
"cryptography==1.8.2",
34+
"cryptography==1.9",
3535
"httpsig_cffi==15.0.0",
3636
"python-dateutil==2.5.3",
37-
"pytz==2016.7",
37+
"pytz==2016.10",
3838
"requests==2.11.1",
3939
"six==1.10.0",
4040
]
4141

4242
setup(
4343
name="oci",
44-
url="http://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/index.html",
44+
url="https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/index.html",
4545
version=version,
4646
description="Oracle Cloud Infrastructure Python SDK",
4747
long_description=readme,

src/oci/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
33

4-
from . import config, constants, core, database, exceptions, identity, load_balancer, object_storage, regions
4+
from . import audit, config, constants, core, database, exceptions, identity, load_balancer, object_storage, regions
55
from .base_client import BaseClient
66
from .request import Request
77
from .response import Response
@@ -12,7 +12,7 @@
1212

1313
__all__ = [
1414
"BaseClient", "Error", "Request", "Response", "Signer",
15-
"config", "constants", "core", "database", "exceptions",
15+
"audit", "config", "constants", "core", "database", "exceptions",
1616
"identity", "load_balancer", "object_storage", "regions",
1717
"wait_until"
1818
]

src/oci/audit/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3+
4+
from __future__ import absolute_import
5+
6+
7+
from .audit_client import AuditClient
8+
from . import models
9+
10+
__all__ = ["AuditClient", "models"]

src/oci/audit/audit_client.py

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3+
4+
from __future__ import absolute_import
5+
6+
import six
7+
8+
from ..base_client import BaseClient
9+
from ..config import get_config_value_or_default, validate_config
10+
from ..signer import Signer
11+
from ..util import Sentinel
12+
from .models import audit_type_mapping
13+
missing = Sentinel("Missing")
14+
15+
16+
class AuditClient(object):
17+
18+
def __init__(self, config):
19+
validate_config(config)
20+
signer = Signer(
21+
tenancy=config["tenancy"],
22+
user=config["user"],
23+
fingerprint=config["fingerprint"],
24+
private_key_file_location=config.get("key_file"),
25+
pass_phrase=get_config_value_or_default(config, "pass_phrase"),
26+
private_key_content=config.get("key_content")
27+
)
28+
self.base_client = BaseClient("audit", config, signer, audit_type_mapping)
29+
30+
def get_configuration(self, compartment_id, **kwargs):
31+
"""
32+
GetConfiguration
33+
Get the configuration
34+
35+
36+
:param str compartment_id: (required)
37+
ID of the root compartment (tenancy)
38+
39+
:return: A :class:`~oci.response.Response` object with data of type :class:`~oci.audit.models.Configuration`
40+
:rtype: :class:`~oci.response.Response`
41+
"""
42+
resource_path = "/configuration"
43+
method = "GET"
44+
45+
if kwargs:
46+
raise ValueError(
47+
"get_configuration got unknown kwargs: {!r}".format(kwargs))
48+
49+
query_params = {
50+
"compartmentId": compartment_id
51+
}
52+
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing}
53+
54+
header_params = {
55+
"accept": "application/json",
56+
"content-type": "application/json"
57+
}
58+
59+
return self.base_client.call_api(
60+
resource_path=resource_path,
61+
method=method,
62+
query_params=query_params,
63+
header_params=header_params,
64+
response_type="Configuration")
65+
66+
def list_events(self, compartment_id, start_time, end_time, **kwargs):
67+
"""
68+
ListEvents
69+
Returns all audit events for the specified compartment that were processed within the specified time range.
70+
71+
72+
:param str compartment_id: (required)
73+
The OCID of the compartment.
74+
75+
:param datetime start_time: (required)
76+
Returns events that were processed at or after this start date and time, expressed in `RFC 3339`__ timestamp format.
77+
For example, a start value of `2017-01-15T11:30:00Z` will retrieve a list of all events processed since 30 minutes after the 11th hour of January 15, 2017, in Coordinated Universal Time (UTC).
78+
You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
79+
80+
__ https://tools.ietf.org/html/rfc3339
81+
82+
:param datetime end_time: (required)
83+
Returns events that were processed before this end date and time, expressed in `RFC 3339`__ timestamp format. For example, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-01-02T00:00:00Z` will retrieve a list of all events processed on January 1, 2017.
84+
Similarly, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-02-01T00:00:00Z` will result in a list of all events processed between January 1, 2017 and January 31, 2017.
85+
You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
86+
87+
__ https://tools.ietf.org/html/rfc3339
88+
89+
:param str page: (optional)
90+
The value of the `opc-next-page` response header from the previous list query.
91+
92+
:param str opc_request_id: (optional)
93+
Unique Oracle-assigned identifier for the request.
94+
If you need to contact Oracle about a particular request, please provide the request ID.
95+
96+
:return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.audit.models.AuditEvent`
97+
:rtype: :class:`~oci.response.Response`
98+
"""
99+
resource_path = "/auditEvents"
100+
method = "GET"
101+
102+
# Don't accept unknown kwargs
103+
expected_kwargs = [
104+
"page",
105+
"opc_request_id"
106+
]
107+
extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
108+
if extra_kwargs:
109+
raise ValueError(
110+
"list_events got unknown kwargs: {!r}".format(extra_kwargs))
111+
112+
query_params = {
113+
"compartmentId": compartment_id,
114+
"startTime": start_time,
115+
"endTime": end_time,
116+
"page": kwargs.get("page", missing)
117+
}
118+
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing}
119+
120+
header_params = {
121+
"accept": "application/json",
122+
"content-type": "application/json",
123+
"opc-request-id": kwargs.get("opc_request_id", missing)
124+
}
125+
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing}
126+
127+
return self.base_client.call_api(
128+
resource_path=resource_path,
129+
method=method,
130+
query_params=query_params,
131+
header_params=header_params,
132+
response_type="list[AuditEvent]")
133+
134+
def update_configuration(self, compartment_id, update_configuration_details, **kwargs):
135+
"""
136+
UpdateConfiguration
137+
Update the configuration
138+
139+
140+
:param str compartment_id: (required)
141+
ID of the root compartment (tenancy)
142+
143+
:param UpdateConfigurationDetails update_configuration_details: (required)
144+
The configuration properties
145+
146+
:return: A :class:`~oci.response.Response` object with data of type None
147+
:rtype: :class:`~oci.response.Response`
148+
"""
149+
resource_path = "/configuration"
150+
method = "PUT"
151+
152+
if kwargs:
153+
raise ValueError(
154+
"update_configuration got unknown kwargs: {!r}".format(kwargs))
155+
156+
query_params = {
157+
"compartmentId": compartment_id
158+
}
159+
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing}
160+
161+
header_params = {
162+
"accept": "application/json",
163+
"content-type": "application/json"
164+
}
165+
166+
return self.base_client.call_api(
167+
resource_path=resource_path,
168+
method=method,
169+
query_params=query_params,
170+
header_params=header_params,
171+
body=update_configuration_details)

0 commit comments

Comments
 (0)