Skip to content

Commit

Permalink
Releasing version 2.38.2
Browse files Browse the repository at this point in the history
Releasing version 2.38.2
  • Loading branch information
bhagwatvyas authored May 11, 2021
2 parents 1642736 + 10b02ba commit 72e38ef
Show file tree
Hide file tree
Showing 124 changed files with 583 additions and 137 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ Change Log
All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
====================
2.38.2 - 2021-05-11
====================

Added
-----
* Support for creating notebook sessions with larger block volumes in the Data Science service
* Support for database maintenance run patch modes in the Database service

Fixed
-----
* 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`

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

====================
2.38.1 - 2021-05-04
====================
Expand Down
12 changes: 11 additions & 1 deletion docs/known-issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,14 @@ Potential data corruption with Python SDK on binary upload (versions 2.8.0 and b

Default timeout not getting set in the clients (versions 2.17.2 and below)
==========================================================================
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.
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.

Some BlockStorage composite operations throw a 404/NotAuthorizedOrNotFound for Cross Region operations
======================================================================================================
**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.

**Impacted Versions:** All

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

**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>`_
91 changes: 91 additions & 0 deletions examples/copy_boot_volume_backup_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# 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.

# This example demonstrates how to copy boot volume backups to a different region and wait on the copy status.
#
# # USAGE:
# `python examples/copy_boot_volume_backup_example.py \
# --volume-backup-id 'foo' \
# --destination-region '<destination_region>' \
# --display_name 'bar' \
# --kms-key-id 'baz'`
#
# Example (copying from us-phoenix-1 to eu-frankfurt-1 :
# `python examples/copy_boot_volume_backup_example.py \
# --boot-volume-backup-id 'ocid1.bootvolumebackup.oc1.phx.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
# --destination-region 'us-ashburn-1'
# --display-name 'copied backup from phoenix' \
# --kms-key-id 'ocid1.key.oc1.iad.aaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'`
#
# This script accepts up to for arguments:
# - boot-volume-backup-id: is the OCID of the boot volume backup to copy.
# - destination-region: is the name of the region to copy the boot volume backup to.
# - display_name (optional): is the new display name of the copied boot volume backup.
# If omitted, the copied boot volume backup will have the same display name as the source backup.
# - kms-key-id (optional): is the OCID of the kms key to use in the destination region to encrypt
# the copied backup with. If not specified, a platform ad-master key will be used.


import oci
import argparse

# parse arguments
parser = argparse.ArgumentParser()
parser.add_argument('--boot-volume-backup-id',
help='the OCID of the boot volume backup to copy',
required=True
)
parser.add_argument('--destination-region',
help='the name of the destination region to copy the backup to',
required=True
)

parser.add_argument('--display-name',
help='the display name of the copied boot volume backup. If not specified, '
'defaults to the same as the original backup\'s display name',
required=False
)

parser.add_argument('--kms-key-id',
help='the OCID of the kms key in the destination region to encrypt the copied boot volume backup',
required=False
)
args = parser.parse_args()

source_backup_id = args.boot_volume_backup_id
destination_region = args.destination_region
kms_key_id = args.kms_key_id
display_name = args.display_name

# load config and create clients (one for the source region and one for the destination region).
source_config = oci.config.from_file()
destination_config = source_config.copy()
destination_config["region"] = destination_region
source_blockstorage_client = oci.core.BlockstorageClient(source_config)
destination_blockstorage_client = oci.core.BlockstorageClient(destination_config)

print('Copying boot volume backup with ID {} from {} to {} using new display name: {} and kms key id: {} \n'.format(
source_backup_id, source_config["region"], destination_region, display_name, kms_key_id))
result = source_blockstorage_client.copy_boot_volume_backup(
source_backup_id,
oci.core.models.CopyBootVolumeBackupDetails(
destination_region=destination_region,
display_name=display_name,
kms_key_id=kms_key_id
)
)

print('Copy boot volume backup response status: {}, copied backup: {}\n'.format(result.status, result.data))
print('Waiting for the copied backup to be in available state...')

# query the destination region for the copied' backup's status and wait for it to be available.
copied_backup = oci.wait_until(
destination_blockstorage_client,
destination_blockstorage_client.get_boot_volume_backup(result.data.id),
'lifecycle_state',
'AVAILABLE'
).data

print('Backup successfully copied: {}'.format(copied_backup))
print('Example script done')
2 changes: 1 addition & 1 deletion examples/copy_volume_backup_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# `python examples/copy_volume_backup_example.py \
# --volume-backup-id 'ocid1.volumebackup.oc1.phx.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
# --destination-region 'eu-frankfurt-1'
# --display_name 'copied backup from phoenix' \
# --display-name 'copied backup from phoenix' \
# --kms-key-id 'ocid1.key.oc1.fra.aaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'`
#
# This script accepts up to for arguments:
Expand Down
3 changes: 2 additions & 1 deletion src/oci/ai_language/ai_service_language_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20210101',
'service_endpoint_template': 'https://language.aiservice.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("ai_service_language", config, signer, ai_language_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/analytics/analytics_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20190331',
'service_endpoint_template': 'https://analytics.{region}.ocp.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("analytics", config, signer, analytics_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/announcements_service/announcement_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20180904',
'service_endpoint_template': 'https://announcements.{region}.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("announcement", config, signer, announcements_service_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20180904',
'service_endpoint_template': 'https://announcements.{region}.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("announcements_preferences", config, signer, announcements_service_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apigateway/api_gateway_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20190501',
'service_endpoint_template': 'https://apigateway.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("api_gateway", config, signer, apigateway_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apigateway/deployment_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20190501',
'service_endpoint_template': 'https://apigateway.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("deployment", config, signer, apigateway_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apigateway/gateway_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20190501',
'service_endpoint_template': 'https://apigateway.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("gateway", config, signer, apigateway_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apigateway/work_requests_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20190501',
'service_endpoint_template': 'https://apigateway.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("work_requests", config, signer, apigateway_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apm_control_plane/apm_domain_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20200630',
'service_endpoint_template': 'https://apm-cp.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("apm_domain", config, signer, apm_control_plane_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apm_synthetics/apm_synthetic_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20200630',
'service_endpoint_template': 'https://apm-synthetic.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("apm_synthetic", config, signer, apm_synthetics_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apm_traces/query_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20200630',
'service_endpoint_template': 'https://apm-trace.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("query", config, signer, apm_traces_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/apm_traces/trace_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20200630',
'service_endpoint_template': 'https://apm-trace.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("trace", config, signer, apm_traces_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20191031',
'service_endpoint_template': 'https://applicationmigration.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("application_migration", config, signer, application_migration_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/artifacts/artifacts_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20160918',
'service_endpoint_template': 'https://artifacts.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("artifacts", config, signer, artifacts_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/audit/audit_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20190901',
'service_endpoint_template': 'https://audit.{region}.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("audit", config, signer, audit_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
3 changes: 2 additions & 1 deletion src/oci/autoscaling/auto_scaling_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ def __init__(self, config, **kwargs):
base_client_init_kwargs = {
'regional_client': True,
'service_endpoint': kwargs.get('service_endpoint'),
'timeout': kwargs.get('timeout'),
'base_path': '/20181001',
'service_endpoint_template': 'https://autoscaling.{region}.oci.{secondLevelDomain}',
'skip_deserialization': kwargs.get('skip_deserialization', False)
}
if 'timeout' in kwargs:
base_client_init_kwargs['timeout'] = kwargs.get('timeout')
self.base_client = BaseClient("auto_scaling", config, signer, autoscaling_type_mapping, **base_client_init_kwargs)
self.retry_strategy = kwargs.get('retry_strategy')

Expand Down
Loading

0 comments on commit 72e38ef

Please sign in to comment.