Skip to content

Commit

Permalink
Merge pull request #35 from oracle/release_2017-11-02
Browse files Browse the repository at this point in the history
Releasing version 1.3.9
  • Loading branch information
nathan-vu authored Nov 2, 2017
2 parents 282219d + 09b27cf commit e6d98d2
Show file tree
Hide file tree
Showing 86 changed files with 5,927 additions and 452 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.

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

====================
1.3.9 - 2017-11-02
====================

Added
-----
* Support for the Audit service
* Support for archive storage tier, object rename and namespace metadata in Object Storage service
* Support for fast clones of volumes in Block Storage service
* Support for backup and restore in Database service
* Support for sorting and filtering in list APIs in Core Services
* 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.
* Support for supplying private key contents through the 'key_content' config field

Changed
-------
* Upgraded cryptography dependency to 1.9.
* Minimum version of Mac OS supported is now 10.8

====================
1.3.8 - 2017-10-12
====================
Expand Down
29 changes: 29 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@
API Reference
~~~~~~~~~~~~~

=======
Audit
=======

--------
Client
--------

.. autoclass:: oci.audit.audit_client.AuditClient
:members:

--------
Models
--------

.. automodule:: oci.audit.models
:members:
:undoc-members:
:imported-members:

===============
Core Services
===============
Expand Down Expand Up @@ -129,6 +149,15 @@ Load Balancer
:undoc-members:
:imported-members:

================
Upload Manager
================

.. module:: oci.object_storage

.. autoclass:: UploadManager
:special-members: __init__
:members:

=============
Base Client
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ To get started, head over to the :ref:`installation instructions <install>` or s
backward-compatibility
quickstart
parallel-ops
pass-explicit-null
upload-manager
raw-requests
api/index
Expand Down
23 changes: 23 additions & 0 deletions docs/pass-explicit-null.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _pass-explicit-null:

.. raw:: html

<script type='text/javascript'>
var oldDocsHost = 'oracle-bare-metal-cloud-services-python-sdk';
if (window.location.href.indexOf(oldDocsHost) != -1) {
window.location.href = 'https://oracle-bare-metal-cloud-services-python-sdk.readthedocs.io/en/latest/deprecation-notice.html';
}
</script>

Passing explicit Null/None values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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``:

.. code-block:: python
import oci
update_bucket_details = oci.object_storage.models.UpdateBucketDetails()
update_bucket_details.metadata = oci.util.NONE_SENTINEL
object_storage.update_bucket('my_namespace', 'my_bucket', update_bucket_details)
4 changes: 2 additions & 2 deletions docs/upload-manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
Uploading Large Objects
~~~~~~~~~~~~~~~~~~~~~~~~

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

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.
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.
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
certifi
configparser==3.5.0
coverage==4.2
cryptography==1.8.2
cryptography==1.9
flake8==3.0.4
httpsig_cffi==15.0.0
mock==2.0.0
pytest==3.0.2
pytest==3.0.3
pytest-catchlog==1.2.2
python-dateutil==2.5.3
pytz==2016.7
pytz==2016.10
requests==2.11.1
sphinx-rtd-theme==0.1.9
six==1.10.0
sphinx==1.4.6
sphinx==1.6.4
tox==2.3.1
wheel==0.29.0
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ def open_relative(*path):
requires = [
"certifi",
"configparser==3.5.0",
"cryptography==1.8.2",
"cryptography==1.9",
"httpsig_cffi==15.0.0",
"python-dateutil==2.5.3",
"pytz==2016.7",
"pytz==2016.10",
"requests==2.11.1",
"six==1.10.0",
]

setup(
name="oci",
url="http://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/index.html",
url="https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/index.html",
version=version,
description="Oracle Cloud Infrastructure Python SDK",
long_description=readme,
Expand Down
4 changes: 2 additions & 2 deletions src/oci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from . import config, constants, core, database, exceptions, identity, load_balancer, object_storage, regions
from . import audit, config, constants, core, database, exceptions, identity, load_balancer, object_storage, regions
from .base_client import BaseClient
from .request import Request
from .response import Response
Expand All @@ -12,7 +12,7 @@

__all__ = [
"BaseClient", "Error", "Request", "Response", "Signer",
"config", "constants", "core", "database", "exceptions",
"audit", "config", "constants", "core", "database", "exceptions",
"identity", "load_balancer", "object_storage", "regions",
"wait_until"
]
10 changes: 10 additions & 0 deletions src/oci/audit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from __future__ import absolute_import


from .audit_client import AuditClient
from . import models

__all__ = ["AuditClient", "models"]
171 changes: 171 additions & 0 deletions src/oci/audit/audit_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from __future__ import absolute_import

import six

from ..base_client import BaseClient
from ..config import get_config_value_or_default, validate_config
from ..signer import Signer
from ..util import Sentinel
from .models import audit_type_mapping
missing = Sentinel("Missing")


class AuditClient(object):

def __init__(self, config):
validate_config(config)
signer = Signer(
tenancy=config["tenancy"],
user=config["user"],
fingerprint=config["fingerprint"],
private_key_file_location=config.get("key_file"),
pass_phrase=get_config_value_or_default(config, "pass_phrase"),
private_key_content=config.get("key_content")
)
self.base_client = BaseClient("audit", config, signer, audit_type_mapping)

def get_configuration(self, compartment_id, **kwargs):
"""
GetConfiguration
Get the configuration
:param str compartment_id: (required)
ID of the root compartment (tenancy)
:return: A :class:`~oci.response.Response` object with data of type :class:`~oci.audit.models.Configuration`
:rtype: :class:`~oci.response.Response`
"""
resource_path = "/configuration"
method = "GET"

if kwargs:
raise ValueError(
"get_configuration got unknown kwargs: {!r}".format(kwargs))

query_params = {
"compartmentId": compartment_id
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing}

header_params = {
"accept": "application/json",
"content-type": "application/json"
}

return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="Configuration")

def list_events(self, compartment_id, start_time, end_time, **kwargs):
"""
ListEvents
Returns all audit events for the specified compartment that were processed within the specified time range.
:param str compartment_id: (required)
The OCID of the compartment.
:param datetime start_time: (required)
Returns events that were processed at or after this start date and time, expressed in `RFC 3339`__ timestamp format.
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).
You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
__ https://tools.ietf.org/html/rfc3339
:param datetime end_time: (required)
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.
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.
You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
__ https://tools.ietf.org/html/rfc3339
:param str page: (optional)
The value of the `opc-next-page` response header from the previous list query.
:param str opc_request_id: (optional)
Unique Oracle-assigned identifier for the request.
If you need to contact Oracle about a particular request, please provide the request ID.
:return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.audit.models.AuditEvent`
:rtype: :class:`~oci.response.Response`
"""
resource_path = "/auditEvents"
method = "GET"

# Don't accept unknown kwargs
expected_kwargs = [
"page",
"opc_request_id"
]
extra_kwargs = [key for key in six.iterkeys(kwargs) if key not in expected_kwargs]
if extra_kwargs:
raise ValueError(
"list_events got unknown kwargs: {!r}".format(extra_kwargs))

query_params = {
"compartmentId": compartment_id,
"startTime": start_time,
"endTime": end_time,
"page": kwargs.get("page", missing)
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing}

header_params = {
"accept": "application/json",
"content-type": "application/json",
"opc-request-id": kwargs.get("opc_request_id", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing}

return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[AuditEvent]")

def update_configuration(self, compartment_id, update_configuration_details, **kwargs):
"""
UpdateConfiguration
Update the configuration
:param str compartment_id: (required)
ID of the root compartment (tenancy)
:param UpdateConfigurationDetails update_configuration_details: (required)
The configuration properties
:return: A :class:`~oci.response.Response` object with data of type None
:rtype: :class:`~oci.response.Response`
"""
resource_path = "/configuration"
method = "PUT"

if kwargs:
raise ValueError(
"update_configuration got unknown kwargs: {!r}".format(kwargs))

query_params = {
"compartmentId": compartment_id
}
query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing}

header_params = {
"accept": "application/json",
"content-type": "application/json"
}

return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
body=update_configuration_details)
15 changes: 15 additions & 0 deletions src/oci/audit/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from __future__ import absolute_import

from .audit_event import AuditEvent
from .configuration import Configuration
from .update_configuration_details import UpdateConfigurationDetails

# Maps type names to classes for audit services.
audit_type_mapping = {
"AuditEvent": AuditEvent,
"Configuration": Configuration,
"UpdateConfigurationDetails": UpdateConfigurationDetails
}
Loading

0 comments on commit e6d98d2

Please sign in to comment.