Skip to content

Commit 090bcd5

Browse files
authored
Merge pull request #41 from oracle/release_2018-01-11
Releasing version 1.3.12
2 parents 096a48d + 29a1cdf commit 090bcd5

File tree

331 files changed

+8387
-1005
lines changed

Some content is hidden

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

331 files changed

+8387
-1005
lines changed

CHANGELOG.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ 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.12 - 2018-01-11
9+
====================
10+
11+
Added
12+
-----
13+
* Support for tagging:
14+
15+
* Support for creating, updating, retrieving and listing tags and tag namespaces (these operations can be found in Identity Service)
16+
* Support for adding freeform and defined tags to resources in Core Services (Networking, Compute, and Block Volume) and Identity Service
17+
* An example on using tagging can be found on `GitHub <https://github.com/oracle/oci-python-sdk/blob/master/examples/tagging.py>`_.
18+
19+
* Support for bringing your own custom image for emulation mode virtual machines in Compute Service
20+
* Added the ``oci.pagination`` module, which contains convenience functions so that you don't have to manually deal with page tokens when using list operations. See the `documentation <https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/pagination.html>`_ for more information
21+
22+
Changed
23+
-------
24+
* Upgraded cryptography dependency to 2.1.3
25+
26+
* Added dependency on pyOpenSSL <= 17.4.0 as the minimum cryptography version for pyOpenSSL 17.5.0 is 2.1.4
27+
28+
* Upgraded six dependency to 1.11.0
29+
* Ugraded requests dependency to 2.18.4
30+
731
====================
832
1.3.11 - 2017-12-11
933
====================

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Contributing to the Oracle Cloud Infrastructure Python SDK
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
*Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.*
4+
*Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.*
55

66
Pull requests can be made under
77
`The Oracle Contributor Agreement <https://www.oracle.com/technetwork/community/oca-486395.html>`_ (OCA).

LICENSE.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1+
Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
22

33
This software is dual-licensed to you under the Universal Permissive License (UPL) and Apache License 2.0. See below for license terms. You may choose either license, or both.
44
____________________________
55
The Universal Permissive License (UPL), Version 1.0
6-
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
6+
Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
77

88
Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both
99

@@ -19,7 +19,7 @@ The above copyright notice and either this complete permission notice or at a mi
1919
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2020

2121
The Apache Software License, Version 2.0
22-
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
22+
Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2323

2424
Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
2525

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ __ https://github.com/oracle/oci-python-sdk
113113
License
114114
=======
115115

116-
Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
116+
Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
117117

118118
This SDK and sample is dual licensed under the Universal Permissive License 1.0 and the Apache License 2.0.
119119

docs/api/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,17 @@ Load Balancer
234234

235235
.. autofunction:: wait_until
236236

237+
===========
238+
Pagination
239+
===========
240+
241+
.. module:: oci.pagination
242+
243+
.. autofunction:: list_call_get_all_results
244+
.. autofunction:: list_call_get_up_to_limit
245+
.. autofunction:: list_call_get_all_results_generator
246+
.. autofunction:: list_call_get_up_to_limit_generator
247+
237248
=========
238249
Request
239250
=========

docs/conf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import pkg_resources
55
import sphinx_rtd_theme
66

7+
from sphinx.domains.python import PythonDomain
8+
79
# Add any Sphinx extension module names here, as strings. They can be
810
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
911
# ones.
@@ -236,3 +238,20 @@
236238
# If true, do not generate a @detailmenu in the "Top" node's menu.
237239
#
238240
# texinfo_no_detailmenu = False
241+
242+
class PatchedPythonDomain(PythonDomain):
243+
def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
244+
if 'refspecific' in node and fromdocname == 'api/index':
245+
# This for api/index.rst and defined tags. These have a data type of dict(str, dict(str, object)) but if
246+
# Sphinx auto-linking tries to link "object" to the "object" property in CreateMultipartUploadDetails (which is
247+
# incorrect).
248+
#
249+
# This prevents any non-explicit link (e.g. just plain "object") from being linked across, but if I was
250+
# explicit like "oci.object_storage.models.CreateMultipartUploadDetails.object" that **should** still produce
251+
# a link
252+
if node['reftarget'] == 'object' and not node['refexplicit']:
253+
del node['refspecific']
254+
return super(PatchedPythonDomain, self).resolve_xref(env, fromdocname, builder, typ, target, node, contnode)
255+
256+
def setup(sphinx):
257+
sphinx.override_domain(PatchedPythonDomain)

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ To get started, head over to the :ref:`installation instructions <install>` or s
5353
upload-manager
5454
raw-requests
5555
waiters
56+
pagination
5657
api/index
5758
contributions
5859
notifications

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The supported version of OpenSSL for the Python SDK is version 1.0.1 or newer.
105105

106106
If the version is lower than ``1.0.1``, run the following command to bypass the version issue::
107107

108-
pip install requests[security]==2.11.1
108+
pip install requests[security]==2.18.4
109109

110110
This command instructs the `requests <https://pypi.python.org/pypi/requests>`_
111111
library used by the Python SDK to use the version of OpenSSL that is bundled with the `cryptography <https://pypi.python.org/pypi/cryptography>`_

docs/pagination.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. raw:: html
2+
3+
<script type='text/javascript'>
4+
var oldDocsHost = 'oracle-bare-metal-cloud-services-python-sdk';
5+
if (window.location.href.indexOf(oldDocsHost) != -1) {
6+
window.location.href = 'https://oracle-bare-metal-cloud-services-python-sdk.readthedocs.io/en/latest/deprecation-notice.html';
7+
}
8+
</script>
9+
10+
Pagination
11+
~~~~~~~~~~~~
12+
When you call a list operation (for example :py:func:`~oci.core.compute_client.ComputeClient.list_instances`) will retrieve a page of results. In order
13+
to retrieve more data, you have to continue to make calls to the list operation, passing in the value of the most recent response's ``next_page`` attribute
14+
as a parameter to the next list operation call.
15+
16+
As a convenience over manually writing pagination code, you can make use of the functions in the :py:mod:`~oci.pagination` module to:
17+
18+
* Eagerly load all possible results from a list call
19+
* Eagerly load all results from a list call up to a given limit
20+
* Lazily load results (either all results, or up to a given limit) from a list call via a generator. These generators can yield either values/models or the raw response from calling the list operation
21+
22+
For an example on how to use these functions, please check `GitHub <https://github.com/oracle/oci-python-sdk/blob/master/examples/pagination.py>`_.

docs/waiters.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@ Sometimes you may need to wait until an attribute of a resource, such as an inst
3434
# - The fourth parameter is the desired value. An equality (==) comparison is done
3535
get_instance_response = oci.wait_until(client, client.get_instance(instance_ocid), 'lifecycle_state', 'RUNNING')
3636
37+
Instead of waiting for a single attribute to equal a given value, you can also provide a function reference (either a lambda or a reference to an already defined function) that
38+
can be used to evaluate the response received from the service call. This function should return a truthy value if the waiter should stop waiting, and a falsey value if the waiter
39+
should continue waiting.
40+
41+
For example, to wait until a volume backup reaches either the "AVAILABLE" or "FAULTY" state :
42+
43+
.. code-block:: python
44+
45+
oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=lambda r: r.data.lifecycle_state in ['AVAILABLE', 'FAULTY'])
46+
47+
Instead of using a lambda, an already defined function can be used:
48+
49+
.. code-block:: python
50+
51+
def should_stop_waiting_volume_backup(response):
52+
return response.data.lifecycle_state in ['AVAILABLE', 'FAULTY']
53+
54+
oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=should_stop_waiting_volume_backup)
3755
3856
In addition to the base parameters shown above, the function can accept optional attributes to control the maximum amount of time it will wait for and the time between calls to the service. For more information on the optional parameters, see the documentation on the :py:func:`~oci.wait_until` function.
3957

0 commit comments

Comments
 (0)