Skip to content

Commit 10b02ba

Browse files
committed
Releasing version 2.38.2
1 parent 1642736 commit 10b02ba

File tree

124 files changed

+583
-137
lines changed

Some content is hidden

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

124 files changed

+583
-137
lines changed

CHANGELOG.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ Change Log
33
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/>`_.
6+
====================
7+
2.38.2 - 2021-05-11
8+
====================
9+
10+
Added
11+
-----
12+
* Support for creating notebook sessions with larger block volumes in the Data Science service
13+
* Support for database maintenance run patch modes in the Database service
14+
15+
Fixed
16+
-----
17+
* Fixed a bug where `timeout=None` was not respected when passed to clients. The older versions of the SDK still use the default connection timeout(10s) and read timeout(60s) when initialized with `timeout=None`
18+
19+
Changed
20+
-------
21+
* Improvement in the performance of Upload Manager for parallel uploads. This is achieved by overriding the default read size of Python HTTP client from 8192 bytes to 64 kb.
22+
623
====================
724
2.38.1 - 2021-05-04
825
====================

docs/known-issues.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,14 @@ Potential data corruption with Python SDK on binary upload (versions 2.8.0 and b
6363

6464
Default timeout not getting set in the clients (versions 2.17.2 and below)
6565
==========================================================================
66-
The default timeout values (connect timeout = 10 secs and read timeout = 60 secs) we not getting set in the clients and remained None (infinite timeout). This has been fixed in v2.18.0.
66+
The default timeout values (connect timeout = 10 secs and read timeout = 60 secs) we not getting set in the clients and remained None (infinite timeout). This has been fixed in v2.18.0.
67+
68+
Some BlockStorage composite operations throw a 404/NotAuthorizedOrNotFound for Cross Region operations
69+
======================================================================================================
70+
**Details:** The copy_boot_volume_backup_and_wait_for_state() and copy_volume_backup_and_wait_for_state() from the BlockStorage Client Composite operations throw a 404/NotAuthorizedOrNotFound when copying a backup from one region to another even though the operation succeeds eventually.
71+
72+
**Impacted Versions:** All
73+
74+
**Workaround:** Instead of using the composite operations, use two different clients for this operation; one client in the Source Region to send the request for copying the backup from Region A to Region B, and a second client in Destination region to wait for the backup to become available. See `this <https://github.com/oracle/oci-python-sdk/blob/master/examples/copy_volume_backup_example.py>`_ for an example.
75+
76+
**Direct link to this issue:** `Some BlockStorage composite operations throw a 404/NotAuthorizedOrNotFound for Cross Region operations <https://github.com/oracle/oci-python-sdk/issues/344>`_
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
3+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4+
5+
# This example demonstrates how to copy boot volume backups to a different region and wait on the copy status.
6+
#
7+
# # USAGE:
8+
# `python examples/copy_boot_volume_backup_example.py \
9+
# --volume-backup-id 'foo' \
10+
# --destination-region '<destination_region>' \
11+
# --display_name 'bar' \
12+
# --kms-key-id 'baz'`
13+
#
14+
# Example (copying from us-phoenix-1 to eu-frankfurt-1 :
15+
# `python examples/copy_boot_volume_backup_example.py \
16+
# --boot-volume-backup-id 'ocid1.bootvolumebackup.oc1.phx.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
17+
# --destination-region 'us-ashburn-1'
18+
# --display-name 'copied backup from phoenix' \
19+
# --kms-key-id 'ocid1.key.oc1.iad.aaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'`
20+
#
21+
# This script accepts up to for arguments:
22+
# - boot-volume-backup-id: is the OCID of the boot volume backup to copy.
23+
# - destination-region: is the name of the region to copy the boot volume backup to.
24+
# - display_name (optional): is the new display name of the copied boot volume backup.
25+
# If omitted, the copied boot volume backup will have the same display name as the source backup.
26+
# - kms-key-id (optional): is the OCID of the kms key to use in the destination region to encrypt
27+
# the copied backup with. If not specified, a platform ad-master key will be used.
28+
29+
30+
import oci
31+
import argparse
32+
33+
# parse arguments
34+
parser = argparse.ArgumentParser()
35+
parser.add_argument('--boot-volume-backup-id',
36+
help='the OCID of the boot volume backup to copy',
37+
required=True
38+
)
39+
parser.add_argument('--destination-region',
40+
help='the name of the destination region to copy the backup to',
41+
required=True
42+
)
43+
44+
parser.add_argument('--display-name',
45+
help='the display name of the copied boot volume backup. If not specified, '
46+
'defaults to the same as the original backup\'s display name',
47+
required=False
48+
)
49+
50+
parser.add_argument('--kms-key-id',
51+
help='the OCID of the kms key in the destination region to encrypt the copied boot volume backup',
52+
required=False
53+
)
54+
args = parser.parse_args()
55+
56+
source_backup_id = args.boot_volume_backup_id
57+
destination_region = args.destination_region
58+
kms_key_id = args.kms_key_id
59+
display_name = args.display_name
60+
61+
# load config and create clients (one for the source region and one for the destination region).
62+
source_config = oci.config.from_file()
63+
destination_config = source_config.copy()
64+
destination_config["region"] = destination_region
65+
source_blockstorage_client = oci.core.BlockstorageClient(source_config)
66+
destination_blockstorage_client = oci.core.BlockstorageClient(destination_config)
67+
68+
print('Copying boot volume backup with ID {} from {} to {} using new display name: {} and kms key id: {} \n'.format(
69+
source_backup_id, source_config["region"], destination_region, display_name, kms_key_id))
70+
result = source_blockstorage_client.copy_boot_volume_backup(
71+
source_backup_id,
72+
oci.core.models.CopyBootVolumeBackupDetails(
73+
destination_region=destination_region,
74+
display_name=display_name,
75+
kms_key_id=kms_key_id
76+
)
77+
)
78+
79+
print('Copy boot volume backup response status: {}, copied backup: {}\n'.format(result.status, result.data))
80+
print('Waiting for the copied backup to be in available state...')
81+
82+
# query the destination region for the copied' backup's status and wait for it to be available.
83+
copied_backup = oci.wait_until(
84+
destination_blockstorage_client,
85+
destination_blockstorage_client.get_boot_volume_backup(result.data.id),
86+
'lifecycle_state',
87+
'AVAILABLE'
88+
).data
89+
90+
print('Backup successfully copied: {}'.format(copied_backup))
91+
print('Example script done')

examples/copy_volume_backup_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# `python examples/copy_volume_backup_example.py \
1616
# --volume-backup-id 'ocid1.volumebackup.oc1.phx.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
1717
# --destination-region 'eu-frankfurt-1'
18-
# --display_name 'copied backup from phoenix' \
18+
# --display-name 'copied backup from phoenix' \
1919
# --kms-key-id 'ocid1.key.oc1.fra.aaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'`
2020
#
2121
# This script accepts up to for arguments:

src/oci/ai_language/ai_service_language_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
7979
base_client_init_kwargs = {
8080
'regional_client': True,
8181
'service_endpoint': kwargs.get('service_endpoint'),
82-
'timeout': kwargs.get('timeout'),
8382
'base_path': '/20210101',
8483
'service_endpoint_template': 'https://language.aiservice.{region}.oci.{secondLevelDomain}',
8584
'skip_deserialization': kwargs.get('skip_deserialization', False)
8685
}
86+
if 'timeout' in kwargs:
87+
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
8788
self.base_client = BaseClient("ai_service_language", config, signer, ai_language_type_mapping, **base_client_init_kwargs)
8889
self.retry_strategy = kwargs.get('retry_strategy')
8990

src/oci/analytics/analytics_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
7777
base_client_init_kwargs = {
7878
'regional_client': True,
7979
'service_endpoint': kwargs.get('service_endpoint'),
80-
'timeout': kwargs.get('timeout'),
8180
'base_path': '/20190331',
8281
'service_endpoint_template': 'https://analytics.{region}.ocp.{secondLevelDomain}',
8382
'skip_deserialization': kwargs.get('skip_deserialization', False)
8483
}
84+
if 'timeout' in kwargs:
85+
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
8586
self.base_client = BaseClient("analytics", config, signer, analytics_type_mapping, **base_client_init_kwargs)
8687
self.retry_strategy = kwargs.get('retry_strategy')
8788

src/oci/announcements_service/announcement_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
7777
base_client_init_kwargs = {
7878
'regional_client': True,
7979
'service_endpoint': kwargs.get('service_endpoint'),
80-
'timeout': kwargs.get('timeout'),
8180
'base_path': '/20180904',
8281
'service_endpoint_template': 'https://announcements.{region}.{secondLevelDomain}',
8382
'skip_deserialization': kwargs.get('skip_deserialization', False)
8483
}
84+
if 'timeout' in kwargs:
85+
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
8586
self.base_client = BaseClient("announcement", config, signer, announcements_service_type_mapping, **base_client_init_kwargs)
8687
self.retry_strategy = kwargs.get('retry_strategy')
8788

src/oci/announcements_service/announcements_preferences_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
7777
base_client_init_kwargs = {
7878
'regional_client': True,
7979
'service_endpoint': kwargs.get('service_endpoint'),
80-
'timeout': kwargs.get('timeout'),
8180
'base_path': '/20180904',
8281
'service_endpoint_template': 'https://announcements.{region}.{secondLevelDomain}',
8382
'skip_deserialization': kwargs.get('skip_deserialization', False)
8483
}
84+
if 'timeout' in kwargs:
85+
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
8586
self.base_client = BaseClient("announcements_preferences", config, signer, announcements_service_type_mapping, **base_client_init_kwargs)
8687
self.retry_strategy = kwargs.get('retry_strategy')
8788

src/oci/apigateway/api_gateway_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
7979
base_client_init_kwargs = {
8080
'regional_client': True,
8181
'service_endpoint': kwargs.get('service_endpoint'),
82-
'timeout': kwargs.get('timeout'),
8382
'base_path': '/20190501',
8483
'service_endpoint_template': 'https://apigateway.{region}.oci.{secondLevelDomain}',
8584
'skip_deserialization': kwargs.get('skip_deserialization', False)
8685
}
86+
if 'timeout' in kwargs:
87+
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
8788
self.base_client = BaseClient("api_gateway", config, signer, apigateway_type_mapping, **base_client_init_kwargs)
8889
self.retry_strategy = kwargs.get('retry_strategy')
8990

src/oci/apigateway/deployment_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
7979
base_client_init_kwargs = {
8080
'regional_client': True,
8181
'service_endpoint': kwargs.get('service_endpoint'),
82-
'timeout': kwargs.get('timeout'),
8382
'base_path': '/20190501',
8483
'service_endpoint_template': 'https://apigateway.{region}.oci.{secondLevelDomain}',
8584
'skip_deserialization': kwargs.get('skip_deserialization', False)
8685
}
86+
if 'timeout' in kwargs:
87+
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
8788
self.base_client = BaseClient("deployment", config, signer, apigateway_type_mapping, **base_client_init_kwargs)
8889
self.retry_strategy = kwargs.get('retry_strategy')
8990

0 commit comments

Comments
 (0)