You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.rst
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,31 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
6
6
7
7
====================
8
-
2.0.3 -2018-09-06
8
+
2.0.4 - 2018-09-27
9
+
====================
10
+
11
+
Added
12
+
-----
13
+
* Support for paravirtualized launch mode when importing images in the Compute service
14
+
* Support for Key Management service
15
+
* Support for encrypting the contents of an Object Storage bucket using a Key Management service key
16
+
* Support for specifying a Key Management service key when launching a compute instance in the Compute service
17
+
* Support for specifying a Key Management service key when backing up or restoring a block storage volume in the Block Volume service
18
+
19
+
Fixed
20
+
-----
21
+
* ObjectStorageClient requires int value for content_length keyword agruement to put_object and upload_part, but the SDK was not converting the type for the Requests library.
22
+
23
+
====================
24
+
2.0.3 - 2018-09-06
9
25
====================
10
26
11
27
Added
12
28
-----
13
29
* Added support for updating metadata fields on an instance in the Compute service
14
30
15
31
Fixed
16
-
-------
32
+
-----
17
33
* Fixed example wait_for_resource_in_state.py to use existing response objects. The updated example can be found on `GitHub <https://github.com/oracle/oci-python-sdk/blob/master/examples/wait_for_resource_in_state.py>`__.
Copy file name to clipboardExpand all lines: docs/upload-manager.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,6 @@
12
12
Uploading Large Objects
13
13
~~~~~~~~~~~~~~~~~~~~~~~~
14
14
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.
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. `Using Multipart Uploads <https://docs.cloud.oracle.com/iaas/Content/Object/Tasks/usingmultipartuploads.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.
16
16
17
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.
Copy file name to clipboardExpand all lines: docs/waiters.rst
+34-21Lines changed: 34 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,22 @@
7
7
}
8
8
</script>
9
9
10
+
Composite Operations and Waiters
11
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12
+
13
+
To wait until an attribute of a resource reaches a certain state, you can use composite operations or waiters.
14
+
15
+
Composite Operations
16
+
---------------------
17
+
You can use the ``CompositeOperation`` classes in the SDK (e.g. :py:class:`~oci.core.ComputeClientCompositeOperations`)
18
+
to perform an action on a resource and wait for it to enter a particular state (or states). The ``CompositeOperation`` classes provide
19
+
convenience methods so that you do not have to invoke an operation and then separately invoke a waiter.
20
+
21
+
An example of using ``CompositeOperation`` classes can be found on `GitHub <https://github.com/oracle/oci-python-sdk/blob/master/examples/composite_operations_example.py>`__.
22
+
10
23
Waiters
11
-
~~~~~~~
12
-
Sometimes you may need to wait until an attribute of a resource, such as an instance or a VCN, reaches a certain state. An example of this would be launching an instance and then waiting for the instance to become available, or waiting until a subnet in a VCN has been terminated. This waiting can be accomplished by using the :py:func:`~oci.wait_until` function. As an example:
24
+
-------
25
+
You can also use the :py:func:`~oci.wait_until` function to wait for a resource to enter a particular state. As an example:
13
26
14
27
.. code-block:: python
15
28
@@ -34,33 +47,33 @@ Sometimes you may need to wait until an attribute of a resource, such as an inst
34
47
# - The fourth parameter is the desired value. An equality (==) comparison is done
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.
50
+
Passing a Function Reference
51
+
``````````````````````````````
40
52
41
-
For example, to wait until a volume backup reaches either the "AVAILABLE" or "FAULTY" state :
53
+
Instead of waiting for a single attribute to reach a given value, you can use a function reference, such as a Lambda expression or a reference to a defined function, to evaluate the response received from the service call. If this function returns a truthy value, the waiter stops waiting.
42
54
43
-
.. code-block:: python
55
+
For example, to wait until a volume backup reaches either the AVAILABLE or FAULTY state :
44
56
45
-
oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=lambdar: r.data.lifecycle_state in ['AVAILABLE', 'FAULTY'])
57
+
* Using a Lambda expression:
46
58
47
-
Instead of using a lambda, an already defined function can be used:
59
+
.. code-block:: python
48
60
49
-
.. code-block:: python
61
+
oci.wait_until(client, client.get_volume_backup(vol_backup_id), evaluate_response=lambdar: r.data.lifecycle_state in ['AVAILABLE', 'FAULTY'])
50
62
51
-
defshould_stop_waiting_volume_backup(response):
52
-
return response.data.lifecycle_state in ['AVAILABLE', 'FAULTY']
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.
67
+
defshould_stop_waiting_volume_backup(response):
68
+
return response.data.lifecycle_state in ['AVAILABLE', 'FAULTY']
57
69
58
-
For a more comprehensive sample, please see our `examples <https://github.com/oracle/oci-python-sdk/blob/master/examples/wait_for_resource_in_state.py>`_ on GitHub.
In addition to using waiters, you can use the ``CompositeOperation`` classes in the SDK (e.g. :py:class:`~oci.core.ComputeClientCompositeOperations`)
63
-
to perform an action on a resource and wait for it to enter a particular state (or states). The ``CompositeOperation`` classes provide
64
-
convenience methods so that you yourself do not have to invoke an operation and then separately invoke a waiter.
72
+
Be aware that if the inner function raises an exception, ``oci.wait_until()`` will not be called. In the preceding example, if ``client.get_volume_backup(volume_backup_id)`` raises an exception, ``oci.wait_until()`` will not be called. This happens even if the inner function raises a Not Found exception and ``succeed_on_not_found=True`` is passed to ``oci.wait_until()``.
73
+
74
+
Optional Attributes
75
+
``````````````````````
65
76
66
-
An example of using ``CompositeOperation`` classes can be found on `GitHub <https://github.com/oracle/oci-python-sdk/blob/master/examples/composite_operations_example.py>`__.
77
+
In addition to these base parameters, ``wait_until()`` can accept optional attributes to control the maximum amount of time it will wait 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.
78
+
79
+
For a more comprehensive sample, please see our `examples <https://github.com/oracle/oci-python-sdk/blob/master/examples/wait_for_resource_in_state.py>`_ on GitHub.
0 commit comments