oci 2.129.1__py3-none-any.whl → 2.129.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oci/access_governance_cp/access_governance_cp_client.py +8 -8
- oci/adm/application_dependency_management_client.py +36 -36
- oci/ai_anomaly_detection/anomaly_detection_client.py +36 -36
- oci/ai_document/ai_service_document_client.py +22 -22
- oci/ai_language/ai_service_language_client.py +44 -44
- oci/ai_speech/ai_service_speech_client.py +10 -10
- oci/ai_vision/ai_service_vision_client.py +25 -25
- oci/analytics/analytics_client.py +23 -23
- oci/announcements_service/announcement_client.py +4 -4
- oci/announcements_service/announcement_subscription_client.py +9 -9
- oci/announcements_service/announcements_preferences_client.py +4 -4
- oci/apigateway/api_gateway_client.py +21 -21
- oci/apigateway/deployment_client.py +6 -6
- oci/apigateway/gateway_client.py +6 -6
- oci/apigateway/subscribers_client.py +6 -6
- oci/apigateway/usage_plans_client.py +6 -6
- oci/apigateway/work_requests_client.py +5 -5
- oci/apm_config/config_client.py +9 -9
- oci/apm_control_plane/apm_domain_client.py +14 -14
- oci/apm_synthetics/apm_synthetic_client.py +28 -28
- oci/apm_traces/attributes_client.py +8 -8
- oci/apm_traces/query_client.py +2 -2
- oci/apm_traces/trace_client.py +4 -4
- oci/appmgmt_control/appmgmt_control_client.py +8 -8
- oci/artifacts/artifacts_client.py +32 -32
- oci/audit/audit_client.py +3 -3
- oci/autoscaling/auto_scaling_client.py +11 -11
- oci/bastion/bastion_client.py +15 -15
- oci/bds/bds_client.py +66 -66
- oci/blockchain/blockchain_platform_client.py +27 -27
- oci/budget/budget_client.py +10 -10
- oci/capacity_management/capacity_management_client.py +22 -22
- oci/certificates/certificates_client.py +5 -5
- oci/certificates_management/certificates_management_client.py +32 -32
- oci/cims/incident_client.py +8 -8
- oci/cims/user_client.py +1 -1
- oci/cloud_bridge/common_client.py +5 -5
- oci/cloud_bridge/discovery_client.py +14 -14
- oci/cloud_bridge/inventory_client.py +16 -16
- oci/cloud_bridge/ocb_agent_svc_client.py +23 -23
- oci/cloud_guard/cloud_guard_client.py +155 -155
- oci/cloud_migrations/migration_client.py +43 -43
- oci/cluster_placement_groups/cluster_placement_groups_cp_client.py +13 -13
- oci/compute_cloud_at_customer/compute_cloud_at_customer_client.py +12 -12
- oci/compute_instance_agent/compute_instance_agent_client.py +6 -6
- oci/compute_instance_agent/plugin_client.py +2 -2
- oci/compute_instance_agent/pluginconfig_client.py +1 -1
- oci/container_engine/container_engine_client.py +44 -44
- oci/container_instances/container_instance_client.py +18 -18
- oci/core/blockstorage_client.py +60 -60
- oci/core/compute_client.py +99 -99
- oci/core/compute_management_client.py +32 -32
- oci/core/virtual_network_client.py +247 -247
- oci/dashboard_service/dashboard_client.py +6 -6
- oci/dashboard_service/dashboard_group_client.py +6 -6
- oci/data_catalog/data_catalog_client.py +149 -149
- oci/data_flow/data_flow_client.py +42 -42
- oci/data_integration/data_integration_client.py +163 -163
- oci/data_labeling_service/data_labeling_management_client.py +17 -17
- oci/data_labeling_service_dataplane/data_labeling_client.py +15 -15
- oci/data_safe/data_safe_client.py +278 -278
- oci/data_science/data_science_client.py +91 -91
- oci/database/database_client.py +466 -352
- oci/database/database_client_composite_operations.py +38 -0
- oci/database/models/create_database_details.py +37 -2
- oci/database/models/key_store.py +7 -3
- oci/database/models/key_store_summary.py +7 -3
- oci/database_management/db_management_client.py +208 -208
- oci/database_management/diagnosability_client.py +4 -4
- oci/database_management/managed_my_sql_databases_client.py +7 -7
- oci/database_management/perfhub_client.py +1 -1
- oci/database_management/sql_tuning_client.py +17 -17
- oci/database_migration/database_migration_client.py +36 -36
- oci/database_tools/database_tools_client.py +23 -23
- oci/demand_signal/occ_demand_signal_client.py +7 -7
- oci/desktops/desktop_service_client.py +21 -21
- oci/devops/devops_client.py +89 -89
- oci/disaster_recovery/disaster_recovery_client.py +29 -29
- oci/dns/dns_client.py +52 -52
- oci/dts/appliance_export_job_client.py +6 -6
- oci/dts/shipping_vendors_client.py +1 -1
- oci/dts/transfer_appliance_client.py +8 -8
- oci/dts/transfer_appliance_entitlement_client.py +3 -3
- oci/dts/transfer_device_client.py +5 -5
- oci/dts/transfer_job_client.py +6 -6
- oci/dts/transfer_package_client.py +7 -7
- oci/em_warehouse/em_data_lake_client.py +13 -13
- oci/em_warehouse/em_warehouse_client.py +13 -13
- oci/email/email_client.py +31 -31
- oci/email_data_plane/email_dp_client.py +1 -1
- oci/events/events_client.py +6 -6
- oci/exceptions.py +46 -7
- oci/file_storage/file_storage_client.py +51 -51
- oci/fleet_software_update/fleet_software_update_client.py +44 -44
- oci/functions/functions_invoke_client.py +1 -1
- oci/functions/functions_management_client.py +16 -16
- oci/fusion_apps/data_masking_activity_client.py +3 -3
- oci/fusion_apps/fusion_applications_client.py +41 -41
- oci/fusion_apps/fusion_environment_client.py +15 -15
- oci/fusion_apps/fusion_environment_family_client.py +8 -8
- oci/fusion_apps/refresh_activity_client.py +4 -4
- oci/fusion_apps/scheduled_activity_client.py +2 -2
- oci/fusion_apps/service_attachment_client.py +2 -2
- oci/generative_ai/generative_ai_client.py +22 -22
- oci/generative_ai_inference/generative_ai_inference_client.py +4 -4
- oci/generic_artifacts_content/generic_artifacts_content_client.py +3 -3
- oci/globally_distributed_database/sharded_database_service_client.py +30 -30
- oci/golden_gate/golden_gate_client.py +68 -68
- oci/governance_rules_control_plane/governance_rule_client.py +15 -15
- oci/governance_rules_control_plane/work_request_client.py +5 -5
- oci/healthchecks/health_checks_client.py +17 -17
- oci/identity/identity_client.py +145 -145
- oci/identity_data_plane/dataplane_client.py +2 -2
- oci/identity_domains/identity_domains_client.py +300 -300
- oci/integration/integration_instance_client.py +15 -15
- oci/jms/java_management_service_client.py +66 -66
- oci/jms_java_downloads/java_download_client.py +25 -25
- oci/key_management/ekm_client.py +5 -5
- oci/key_management/kms_crypto_client.py +6 -6
- oci/key_management/kms_hsm_cluster_client.py +12 -12
- oci/key_management/kms_management_client.py +21 -21
- oci/key_management/kms_vault_client.py +14 -14
- oci/license_manager/license_manager_client.py +18 -18
- oci/limits/limits_client.py +4 -4
- oci/limits/quotas_client.py +7 -7
- oci/load_balancer/load_balancer_client.py +61 -61
- oci/lockbox/lockbox_client.py +24 -24
- oci/log_analytics/log_analytics_client.py +193 -193
- oci/logging/logging_management_client.py +30 -30
- oci/loggingingestion/logging_client.py +1 -1
- oci/loggingsearch/log_search_client.py +1 -1
- oci/management_agent/management_agent_client.py +28 -28
- oci/management_dashboard/dashx_apis_client.py +14 -14
- oci/marketplace/account_client.py +2 -2
- oci/marketplace/marketplace_client.py +30 -30
- oci/marketplace_private_offer/attachment_client.py +5 -5
- oci/marketplace_private_offer/offer_client.py +6 -6
- oci/marketplace_publisher/attachment_client.py +5 -5
- oci/marketplace_publisher/marketplace_publisher_client.py +71 -71
- oci/marketplace_publisher/offer_client.py +6 -6
- oci/media_services/media_services_client.py +60 -60
- oci/media_services/media_stream_client.py +2 -2
- oci/monitoring/monitoring_client.py +18 -18
- oci/mysql/channels_client.py +7 -7
- oci/mysql/db_backups_client.py +7 -7
- oci/mysql/db_system_client.py +17 -17
- oci/mysql/mysqlaas_client.py +7 -7
- oci/mysql/replicas_client.py +5 -5
- oci/mysql/work_requests_client.py +4 -4
- oci/network_firewall/network_firewall_client.py +80 -80
- oci/network_load_balancer/network_load_balancer_client.py +34 -34
- oci/nosql/nosql_client.py +24 -24
- oci/object_storage/__init__.py +2 -1
- oci/object_storage/object_storage_client.py +50 -50
- oci/object_storage/transfer/internal/download/DownloadConfiguration.py +232 -0
- oci/object_storage/transfer/internal/download/DownloadManager.py +902 -0
- oci/object_storage/transfer/internal/download/DownloadThread.py +375 -0
- oci/object_storage/transfer/internal/download/__init__.py +5 -0
- oci/oce/oce_instance_client.py +10 -10
- oci/oci_control_center/occ_metrics_client.py +3 -3
- oci/ocvp/cluster_client.py +5 -5
- oci/ocvp/esxi_host_client.py +8 -8
- oci/ocvp/sddc_client.py +14 -14
- oci/ocvp/work_request_client.py +4 -4
- oci/oda/management_client.py +59 -59
- oci/oda/oda_client.py +17 -17
- oci/oda/odapackage_client.py +7 -7
- oci/onesubscription/billing_schedule_client.py +1 -1
- oci/onesubscription/commitment_client.py +2 -2
- oci/onesubscription/computed_usage_client.py +3 -3
- oci/onesubscription/invoice_summary_client.py +2 -2
- oci/onesubscription/organization_subscription_client.py +1 -1
- oci/onesubscription/ratecard_client.py +1 -1
- oci/onesubscription/subscribed_service_client.py +2 -2
- oci/onesubscription/subscription_client.py +1 -1
- oci/ons/notification_control_plane_client.py +6 -6
- oci/ons/notification_data_plane_client.py +10 -10
- oci/opa/opa_instance_client.py +13 -13
- oci/opensearch/opensearch_cluster_backup_client.py +4 -4
- oci/opensearch/opensearch_cluster_client.py +14 -14
- oci/operator_access_control/access_requests_client.py +10 -10
- oci/operator_access_control/operator_actions_client.py +2 -2
- oci/operator_access_control/operator_control_assignment_client.py +8 -8
- oci/operator_access_control/operator_control_client.py +6 -6
- oci/opsi/operations_insights_client.py +175 -175
- oci/optimizer/optimizer_client.py +26 -26
- oci/os_management/event_client.py +8 -8
- oci/os_management/os_management_client.py +69 -69
- oci/os_management_hub/event_client.py +8 -8
- oci/os_management_hub/lifecycle_environment_client.py +12 -12
- oci/os_management_hub/managed_instance_client.py +31 -31
- oci/os_management_hub/managed_instance_group_client.py +25 -25
- oci/os_management_hub/management_station_client.py +10 -10
- oci/os_management_hub/onboarding_client.py +6 -6
- oci/os_management_hub/reporting_managed_instance_client.py +3 -3
- oci/os_management_hub/scheduled_job_client.py +7 -7
- oci/os_management_hub/software_source_client.py +27 -27
- oci/os_management_hub/work_request_client.py +4 -4
- oci/osp_gateway/address_rule_service_client.py +1 -1
- oci/osp_gateway/address_service_client.py +2 -2
- oci/osp_gateway/invoice_service_client.py +5 -5
- oci/osp_gateway/subscription_service_client.py +5 -5
- oci/osub_billing_schedule/billing_schedule_client.py +1 -1
- oci/osub_organization_subscription/organization_subscription_client.py +1 -1
- oci/osub_subscription/commitment_client.py +2 -2
- oci/osub_subscription/ratecard_client.py +1 -1
- oci/osub_subscription/subscription_client.py +1 -1
- oci/osub_usage/computed_usage_client.py +3 -3
- oci/psql/postgresql_client.py +33 -33
- oci/queue/queue_admin_client.py +11 -11
- oci/queue/queue_client.py +8 -8
- oci/recovery/database_recovery_client.py +25 -25
- oci/redis/redis_cluster_client.py +11 -11
- oci/resource_manager/resource_manager_client.py +52 -52
- oci/resource_scheduler/schedule_client.py +13 -13
- oci/resource_search/resource_search_client.py +3 -3
- oci/rover/rover_bundle_client.py +8 -8
- oci/rover/rover_cluster_client.py +8 -8
- oci/rover/rover_entitlement_client.py +6 -6
- oci/rover/rover_node_client.py +15 -15
- oci/rover/shape_client.py +1 -1
- oci/rover/work_requests_client.py +5 -5
- oci/sch/connector_plugins_client.py +2 -2
- oci/sch/service_connector_client.py +12 -12
- oci/secrets/secrets_client.py +3 -3
- oci/service_catalog/service_catalog_client.py +26 -26
- oci/service_manager_proxy/service_manager_proxy_client.py +2 -2
- oci/service_mesh/service_mesh_client.py +48 -48
- oci/stack_monitoring/stack_monitoring_client.py +64 -64
- oci/streaming/stream_admin_client.py +18 -18
- oci/streaming/stream_client.py +8 -8
- oci/tenant_manager_control_plane/domain_client.py +5 -5
- oci/tenant_manager_control_plane/domain_governance_client.py +5 -5
- oci/tenant_manager_control_plane/governance_client.py +2 -2
- oci/tenant_manager_control_plane/link_client.py +3 -3
- oci/tenant_manager_control_plane/orders_client.py +2 -2
- oci/tenant_manager_control_plane/organization_client.py +10 -10
- oci/tenant_manager_control_plane/recipient_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/sender_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/subscription_client.py +11 -11
- oci/tenant_manager_control_plane/work_request_client.py +4 -4
- oci/threat_intelligence/threatintel_client.py +5 -5
- oci/usage/resources_client.py +2 -2
- oci/usage/rewards_client.py +6 -6
- oci/usage/usagelimits_client.py +1 -1
- oci/usage_api/models/usage_summary.py +62 -0
- oci/usage_api/usageapi_client.py +33 -33
- oci/vault/vaults_client.py +13 -13
- oci/vbs_inst/vbs_instance_client.py +10 -10
- oci/version.py +1 -1
- oci/visual_builder/vb_instance_client.py +13 -13
- oci/vn_monitoring/vn_monitoring_client.py +12 -12
- oci/vulnerability_scanning/vulnerability_scanning_client.py +58 -58
- oci/waa/waa_client.py +13 -13
- oci/waa/work_request_client.py +4 -4
- oci/waas/redirect_client.py +6 -6
- oci/waas/waas_client.py +66 -66
- oci/waf/waf_client.py +24 -24
- oci/work_requests/work_request_client.py +4 -4
- {oci-2.129.1.dist-info → oci-2.129.2.dist-info}/METADATA +1 -1
- {oci-2.129.1.dist-info → oci-2.129.2.dist-info}/RECORD +265 -261
- {oci-2.129.1.dist-info → oci-2.129.2.dist-info}/LICENSE.txt +0 -0
- {oci-2.129.1.dist-info → oci-2.129.2.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci-2.129.1.dist-info → oci-2.129.2.dist-info}/WHEEL +0 -0
- {oci-2.129.1.dist-info → oci-2.129.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,232 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2024, 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
|
+
from oci.object_storage.transfer.constants import MEBIBYTE
|
6
|
+
from oci.retry.retry import (RetryStrategyBuilder, VALID_BACKOFF_TYPES, BACKOFF_DECORRELATED_JITTER_VALUE)
|
7
|
+
|
8
|
+
|
9
|
+
DOWNLOAD_MANAGER_RETRYABLE_STATUSES_AND_CODES = {
|
10
|
+
-1: [],
|
11
|
+
409: ["ConcurrentObjectUpdate"],
|
12
|
+
429: [],
|
13
|
+
404: [],
|
14
|
+
416: []
|
15
|
+
}
|
16
|
+
|
17
|
+
|
18
|
+
class DownloadConfiguration(object):
|
19
|
+
"""
|
20
|
+
An object of this class is used to specify the download parameters to the Download Manager
|
21
|
+
|
22
|
+
:param bool allow_multipart: If True, then multipart download if feasible, will be done. If False, then
|
23
|
+
multipart download will not be done in any case. Default is True.
|
24
|
+
|
25
|
+
:param int part_size_in_bytes: The size of a part that will be downloaded. This is also the smallest amount of
|
26
|
+
bytes that will be downloaded. That is if the file size exceeds this threshold, then multipart download will
|
27
|
+
be done, respecting the do_multipart variable. Default is 5 MB
|
28
|
+
|
29
|
+
:param int num_download_threads: The number of threads that will be used to download the file. This value will
|
30
|
+
be overwritten in accordance with the do_multipart variable and the file size and part_size_in_bytes. Small
|
31
|
+
files will be downloaded in a single thread. Note that the parent thread won't be counted in this. Default
|
32
|
+
is 3
|
33
|
+
|
34
|
+
:param int pause_wait_in_seconds: The number of seconds to make a download thread sleep while being paused state
|
35
|
+
before polling for the state again. Default is 2
|
36
|
+
|
37
|
+
:param int max_retries: The maximum number of retries that will be performed on the download thread. Each thread
|
38
|
+
will attempt to download the file until it reaches the maximum number of retries in case of failures. The
|
39
|
+
first download attempt is also counted as a retry. So max_retries equals the maximum number of times
|
40
|
+
download will be tried. Default is 3
|
41
|
+
|
42
|
+
:param int initial_backoff_seconds: The initial backoff time in seconds before the first retry. Defaults to 1 second.
|
43
|
+
|
44
|
+
:param int max_backoff_seconds: The maximum backoff time in seconds between retries. Defaults to 30 seconds
|
45
|
+
|
46
|
+
:param int retry_exponential_growth_factor: For exponential backoff with jitter, the exponent which we will raise to
|
47
|
+
the power of the number of attempts. If not provided, this value defaults to 2
|
48
|
+
|
49
|
+
:param int decorrelated_jitter:
|
50
|
+
The random De-correlated jitter value in seconds (default 1) to be used when using the backoff_type
|
51
|
+
BACKOFF_DECORRELATED_JITTER_VALUE
|
52
|
+
|
53
|
+
:param str backoff_type:
|
54
|
+
The type of backoff we want to do (e.g. full jitter). The convenience constants in this retry module: ``BACKOFF_DECORRELATED_JITTER_VALUE``,
|
55
|
+
``BACKOFF_FULL_JITTER_VALUE``,`BACKOFF_EQUAL_JITTER_VALUE``, and ``BACKOFF_FULL_JITTER_EQUAL_ON_THROTTLE_VALUE`` can be used as values here.
|
56
|
+
If no value is specified then the value ``BACKOFF_DECORRELATED_JITTER_VALUE`` will be used. This will use exponential backoff and a
|
57
|
+
random de-correlated jitter.
|
58
|
+
|
59
|
+
"""
|
60
|
+
|
61
|
+
def __init__(self,
|
62
|
+
allow_multipart=True,
|
63
|
+
part_size_in_bytes=5 * MEBIBYTE,
|
64
|
+
num_download_threads=3,
|
65
|
+
pause_wait_in_seconds=2,
|
66
|
+
max_retries=3,
|
67
|
+
initial_backoff_seconds=1,
|
68
|
+
max_backoff_seconds=30,
|
69
|
+
retry_exponential_growth_factor=2,
|
70
|
+
decorrelated_jitter=1,
|
71
|
+
backoff_type=BACKOFF_DECORRELATED_JITTER_VALUE,
|
72
|
+
):
|
73
|
+
|
74
|
+
self.allow_multipart = allow_multipart
|
75
|
+
self.set_allow_multipart(allow_multipart)
|
76
|
+
self.num_download_threads = num_download_threads
|
77
|
+
self.set_num_download_threads(num_download_threads)
|
78
|
+
self.part_size_in_bytes = part_size_in_bytes
|
79
|
+
self.set_part_size_in_bytes(part_size_in_bytes)
|
80
|
+
self.pause_wait_in_seconds = pause_wait_in_seconds
|
81
|
+
self.set_pause_wait_in_seconds(pause_wait_in_seconds)
|
82
|
+
self.max_retries = max_retries
|
83
|
+
self.set_max_retries(max_retries)
|
84
|
+
self.initial_backoff_seconds = initial_backoff_seconds
|
85
|
+
self.set_initial_backoff(initial_backoff_seconds)
|
86
|
+
self.max_backoff_seconds = max_backoff_seconds
|
87
|
+
self.set_max_backoff(initial_backoff_seconds, max_backoff_seconds)
|
88
|
+
self.retry_exponential_growth_factor = retry_exponential_growth_factor
|
89
|
+
self.set_retry_exponential_growth_factor(retry_exponential_growth_factor)
|
90
|
+
self.decorrelated_jitter = decorrelated_jitter
|
91
|
+
self.set_decorrelated_jitter(decorrelated_jitter)
|
92
|
+
self.backoff_type = backoff_type
|
93
|
+
self.set_backoff_type(backoff_type)
|
94
|
+
|
95
|
+
def set_allow_multipart(self, allow_multipart):
|
96
|
+
if not isinstance(allow_multipart, bool):
|
97
|
+
raise TypeError(f"Invalid type for allow_multipart: expected bool, got {type(allow_multipart).__name__}")
|
98
|
+
|
99
|
+
self.allow_multipart = allow_multipart
|
100
|
+
|
101
|
+
def set_part_size_in_bytes(self, part_size_in_bytes):
|
102
|
+
if not isinstance(part_size_in_bytes, int):
|
103
|
+
raise TypeError(f"Invalid type for part_size_in_bytes: expected int, got {type(part_size_in_bytes).__name__}")
|
104
|
+
if part_size_in_bytes <= 0:
|
105
|
+
raise ValueError(f"Invalid value for part_size_in_bytes: expected > 0, got {part_size_in_bytes}")
|
106
|
+
self.part_size_in_bytes = part_size_in_bytes
|
107
|
+
|
108
|
+
def set_num_download_threads(self, num_download_threads):
|
109
|
+
if not isinstance(num_download_threads, int):
|
110
|
+
raise TypeError(
|
111
|
+
f"Invalid type for num_download_threads: expected int, got {type(num_download_threads).__name__}")
|
112
|
+
if num_download_threads <= 1:
|
113
|
+
raise ValueError(f"Invalid value for num_download_threads: expected > 1, got {num_download_threads}")
|
114
|
+
|
115
|
+
self.num_download_threads = num_download_threads
|
116
|
+
|
117
|
+
def set_pause_wait_in_seconds(self, pause_wait_in_seconds):
|
118
|
+
if not isinstance(pause_wait_in_seconds, int):
|
119
|
+
raise TypeError(
|
120
|
+
f"Invalid type for pause_wait_in_seconds: expected int, got {type(pause_wait_in_seconds).__name__}")
|
121
|
+
if pause_wait_in_seconds <= 0:
|
122
|
+
raise ValueError(f"Invalid value for pause_wait_in_seconds: expected > 0, got {pause_wait_in_seconds}")
|
123
|
+
|
124
|
+
self.pause_wait_in_seconds = pause_wait_in_seconds
|
125
|
+
|
126
|
+
def set_max_retries(self, max_retries):
|
127
|
+
if not isinstance(max_retries, int):
|
128
|
+
raise TypeError(
|
129
|
+
f"Invalid type for max_retries: expected int, got {type(max_retries).__name__}")
|
130
|
+
if max_retries < 1:
|
131
|
+
raise ValueError(f"Invalid value for max_retries: expected >= 1, got {max_retries}")
|
132
|
+
|
133
|
+
self.max_retries = max_retries
|
134
|
+
|
135
|
+
def set_initial_backoff(self, initial_backoff_seconds):
|
136
|
+
if not isinstance(initial_backoff_seconds, int):
|
137
|
+
raise TypeError(
|
138
|
+
f"Invalid type for initial_backoff_seconds: expected int, got {type(initial_backoff_seconds).__name__}")
|
139
|
+
if initial_backoff_seconds < 1:
|
140
|
+
raise ValueError(f"Invalid value for initial_backoff_seconds: expected >= 1, got {initial_backoff_seconds}")
|
141
|
+
|
142
|
+
self.initial_backoff_seconds = initial_backoff_seconds
|
143
|
+
|
144
|
+
def set_max_backoff(self, initial_backoff_seconds, max_backoff_seconds):
|
145
|
+
if not isinstance(max_backoff_seconds, int):
|
146
|
+
raise TypeError(
|
147
|
+
f"Invalid type for max_backoff_seconds: expected int, got {type(max_backoff_seconds).__name__}")
|
148
|
+
if max_backoff_seconds < initial_backoff_seconds:
|
149
|
+
raise ValueError(
|
150
|
+
f"Invalid value for max_backoff_seconds: expected >= initial backoff ({initial_backoff_seconds}), "
|
151
|
+
f"got {max_backoff_seconds}")
|
152
|
+
|
153
|
+
self.max_backoff_seconds = max_backoff_seconds
|
154
|
+
|
155
|
+
def set_retry_exponential_growth_factor(self, retry_exponential_growth_factor):
|
156
|
+
if not isinstance(retry_exponential_growth_factor, int):
|
157
|
+
raise TypeError(
|
158
|
+
f"Invalid type for retry_exponential_growth_factor: expected int, got {type(retry_exponential_growth_factor).__name__}")
|
159
|
+
|
160
|
+
self.retry_exponential_growth_factor = retry_exponential_growth_factor
|
161
|
+
|
162
|
+
def set_decorrelated_jitter(self, decorrelated_jitter):
|
163
|
+
if not isinstance(decorrelated_jitter, int):
|
164
|
+
raise TypeError(
|
165
|
+
f"Invalid type for decorrelated_jitter: expected int, got {type(decorrelated_jitter).__name__}"
|
166
|
+
)
|
167
|
+
|
168
|
+
self.decorrelated_jitter = decorrelated_jitter
|
169
|
+
|
170
|
+
def set_backoff_type(self, backoff_type):
|
171
|
+
if not isinstance(backoff_type, str):
|
172
|
+
raise TypeError(
|
173
|
+
f"Invalid type for backoff_type: expected str, got {type(backoff_type).__name__}"
|
174
|
+
)
|
175
|
+
if backoff_type not in VALID_BACKOFF_TYPES:
|
176
|
+
raise ValueError(
|
177
|
+
f"Invalid backoff_type: expected one of {VALID_BACKOFF_TYPES}, got {backoff_type}"
|
178
|
+
)
|
179
|
+
|
180
|
+
self.backoff_type = backoff_type
|
181
|
+
|
182
|
+
def get_allow_multipart(self):
|
183
|
+
return self.allow_multipart
|
184
|
+
|
185
|
+
def get_max_retries(self):
|
186
|
+
return self.max_retries
|
187
|
+
|
188
|
+
def get_pause_wait_in_seconds(self):
|
189
|
+
return self.pause_wait_in_seconds
|
190
|
+
|
191
|
+
def get_num_download_threads(self):
|
192
|
+
return self.num_download_threads
|
193
|
+
|
194
|
+
def get_max_backoff(self):
|
195
|
+
return self.max_backoff_seconds
|
196
|
+
|
197
|
+
def get_initial_backoff(self):
|
198
|
+
return self.initial_backoff_seconds
|
199
|
+
|
200
|
+
def get_part_size_in_bytes(self):
|
201
|
+
return self.part_size_in_bytes
|
202
|
+
|
203
|
+
def get_retry_exponential_growth_factor(self):
|
204
|
+
return self.retry_exponential_growth_factor
|
205
|
+
|
206
|
+
def get_decorrelated_jitter(self):
|
207
|
+
return self.decorrelated_jitter
|
208
|
+
|
209
|
+
def get_backoff_type(self):
|
210
|
+
return self.backoff_type
|
211
|
+
|
212
|
+
def make_retry_strategy(self):
|
213
|
+
"""
|
214
|
+
If the user doesn't provide a retry strategy (from oci.retry.retry), then a custom retry strategy is built out
|
215
|
+
of the parameters provided in the DownloadConfiguration. This function is used to make that custom retry
|
216
|
+
strategy. The retries occur if one or more of the following occur:
|
217
|
+
1) Timeout
|
218
|
+
2) Connection error
|
219
|
+
3) Unknown client exception: status == -1
|
220
|
+
4) Server exception: status >= 500
|
221
|
+
5) Potential edge case: status == 409
|
222
|
+
6) Object is changed in the object storage during a retry == 416 or 404
|
223
|
+
"""
|
224
|
+
return RetryStrategyBuilder(
|
225
|
+
max_attempts=self.get_max_retries(),
|
226
|
+
service_error_retry_config=DOWNLOAD_MANAGER_RETRYABLE_STATUSES_AND_CODES,
|
227
|
+
retry_base_sleep_time_seconds=self.get_initial_backoff(),
|
228
|
+
retry_exponential_growth_factor=self.get_retry_exponential_growth_factor(),
|
229
|
+
retry_max_wait_between_calls_seconds=self.get_max_backoff(),
|
230
|
+
decorrelated_jitter=self.get_decorrelated_jitter(),
|
231
|
+
backoff_type=self.get_backoff_type(),
|
232
|
+
).get_retry_strategy()
|