mv-oci-sdk 2.142.0__py3-none-any.whl → 2.142.0.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {mv_oci_sdk-2.142.0.dist-info → mv_oci_sdk-2.142.0.2.dist-info}/METADATA +3 -3
- {mv_oci_sdk-2.142.0.dist-info → mv_oci_sdk-2.142.0.2.dist-info}/RECORD +248 -6
- oci/file_storage/__init__.py +14 -0
- oci/file_storage/file_storage_client.py +8601 -0
- oci/file_storage/file_storage_client_composite_operations.py +2068 -0
- oci/file_storage/models/__init__.py +130 -0
- oci/file_storage/models/change_file_system_compartment_details.py +76 -0
- oci/file_storage/models/change_filesystem_snapshot_policy_compartment_details.py +76 -0
- oci/file_storage/models/change_mount_target_compartment_details.py +76 -0
- oci/file_storage/models/change_outbound_connector_compartment_details.py +78 -0
- oci/file_storage/models/change_replication_compartment_details.py +76 -0
- oci/file_storage/models/client_options.py +389 -0
- oci/file_storage/models/create_export_details.py +303 -0
- oci/file_storage/models/create_file_system_details.py +425 -0
- oci/file_storage/models/create_filesystem_snapshot_policy_details.py +337 -0
- oci/file_storage/models/create_kerberos_details.py +200 -0
- oci/file_storage/models/create_ldap_bind_account_details.py +220 -0
- oci/file_storage/models/create_ldap_idmap_details.py +317 -0
- oci/file_storage/models/create_mount_target_details.py +581 -0
- oci/file_storage/models/create_outbound_connector_details.py +309 -0
- oci/file_storage/models/create_replication_details.py +325 -0
- oci/file_storage/models/create_snapshot_details.py +261 -0
- oci/file_storage/models/endpoint.py +103 -0
- oci/file_storage/models/export.py +456 -0
- oci/file_storage/models/export_set.py +411 -0
- oci/file_storage/models/export_set_summary.py +316 -0
- oci/file_storage/models/export_summary.py +343 -0
- oci/file_storage/models/file_system.py +818 -0
- oci/file_storage/models/file_system_summary.py +659 -0
- oci/file_storage/models/filesystem_snapshot_policy.py +473 -0
- oci/file_storage/models/filesystem_snapshot_policy_summary.py +429 -0
- oci/file_storage/models/kerberos.py +200 -0
- oci/file_storage/models/kerberos_keytab_entry.py +166 -0
- oci/file_storage/models/key_tab_secret_details.py +138 -0
- oci/file_storage/models/ldap_bind_account.py +243 -0
- oci/file_storage/models/ldap_bind_account_summary.py +176 -0
- oci/file_storage/models/ldap_idmap.py +317 -0
- oci/file_storage/models/mount_target.py +828 -0
- oci/file_storage/models/mount_target_summary.py +696 -0
- oci/file_storage/models/outbound_connector.py +453 -0
- oci/file_storage/models/outbound_connector_summary.py +438 -0
- oci/file_storage/models/replication.py +740 -0
- oci/file_storage/models/replication_estimate.py +196 -0
- oci/file_storage/models/replication_summary.py +491 -0
- oci/file_storage/models/replication_target.py +679 -0
- oci/file_storage/models/replication_target_summary.py +425 -0
- oci/file_storage/models/resource_lock.py +185 -0
- oci/file_storage/models/schedule_downgrade_shape_mount_target_details.py +78 -0
- oci/file_storage/models/snapshot.py +638 -0
- oci/file_storage/models/snapshot_schedule.py +487 -0
- oci/file_storage/models/snapshot_summary.py +601 -0
- oci/file_storage/models/source_details.py +119 -0
- oci/file_storage/models/update_export_details.py +111 -0
- oci/file_storage/models/update_export_set_details.py +172 -0
- oci/file_storage/models/update_file_system_details.py +246 -0
- oci/file_storage/models/update_filesystem_snapshot_policy_details.py +236 -0
- oci/file_storage/models/update_kerberos_details.py +200 -0
- oci/file_storage/models/update_ldap_idmap_details.py +317 -0
- oci/file_storage/models/update_mount_target_details.py +286 -0
- oci/file_storage/models/update_outbound_connector_details.py +158 -0
- oci/file_storage/models/update_replication_details.py +189 -0
- oci/file_storage/models/update_snapshot_details.py +156 -0
- oci/file_storage/models/upgrade_shape_mount_target_details.py +78 -0
- oci/file_storage/models/validate_key_tabs_details.py +103 -0
- oci/file_storage/models/validate_key_tabs_response_details.py +103 -0
- oci/functions/__init__.py +16 -0
- oci/functions/functions_invoke_client.py +267 -0
- oci/functions/functions_invoke_client_composite_operations.py +26 -0
- oci/functions/functions_management_client.py +2056 -0
- oci/functions/functions_management_client_composite_operations.py +326 -0
- oci/functions/models/__init__.py +74 -0
- oci/functions/models/application.py +628 -0
- oci/functions/models/application_summary.py +512 -0
- oci/functions/models/application_trace_config.py +103 -0
- oci/functions/models/change_application_compartment_details.py +78 -0
- oci/functions/models/config_details.py +134 -0
- oci/functions/models/constant_provisioned_concurrency_config.py +82 -0
- oci/functions/models/create_application_details.py +446 -0
- oci/functions/models/create_function_details.py +437 -0
- oci/functions/models/function.py +734 -0
- oci/functions/models/function_provisioned_concurrency_config.py +109 -0
- oci/functions/models/function_source_details.py +101 -0
- oci/functions/models/function_summary.py +657 -0
- oci/functions/models/function_trace_config.py +72 -0
- oci/functions/models/image_policy_config.py +103 -0
- oci/functions/models/key_details.py +76 -0
- oci/functions/models/none_provisioned_concurrency_config.py +51 -0
- oci/functions/models/pbf_listing.py +408 -0
- oci/functions/models/pbf_listing_summary.py +386 -0
- oci/functions/models/pbf_listing_version.py +467 -0
- oci/functions/models/pbf_listing_version_summary.py +446 -0
- oci/functions/models/pbf_listing_versions_collection.py +73 -0
- oci/functions/models/pbf_listings_collection.py +72 -0
- oci/functions/models/policy_details.py +103 -0
- oci/functions/models/pre_built_function_source_details.py +88 -0
- oci/functions/models/publisher_details.py +72 -0
- oci/functions/models/requirement_details.py +106 -0
- oci/functions/models/trigger.py +72 -0
- oci/functions/models/trigger_summary.py +72 -0
- oci/functions/models/triggers_collection.py +72 -0
- oci/functions/models/update_application_details.py +290 -0
- oci/functions/models/update_function_details.py +346 -0
- oci/load_balancer/__init__.py +14 -0
- oci/load_balancer/load_balancer_client.py +7641 -0
- oci/load_balancer/load_balancer_client_composite_operations.py +1630 -0
- oci/load_balancer/models/__init__.py +186 -0
- oci/load_balancer/models/action.py +97 -0
- oci/load_balancer/models/add_http_request_header_rule.py +134 -0
- oci/load_balancer/models/add_http_response_header_rule.py +137 -0
- oci/load_balancer/models/allow_rule.py +123 -0
- oci/load_balancer/models/backend.py +350 -0
- oci/load_balancer/models/backend_details.py +312 -0
- oci/load_balancer/models/backend_health.py +143 -0
- oci/load_balancer/models/backend_set.py +305 -0
- oci/load_balancer/models/backend_set_details.py +262 -0
- oci/load_balancer/models/backend_set_health.py +265 -0
- oci/load_balancer/models/certificate.py +188 -0
- oci/load_balancer/models/certificate_details.py +270 -0
- oci/load_balancer/models/change_load_balancer_compartment_details.py +78 -0
- oci/load_balancer/models/connection_configuration.py +168 -0
- oci/load_balancer/models/control_access_using_http_methods_rule.py +162 -0
- oci/load_balancer/models/create_backend_details.py +316 -0
- oci/load_balancer/models/create_backend_set_details.py +305 -0
- oci/load_balancer/models/create_certificate_details.py +270 -0
- oci/load_balancer/models/create_hostname_details.py +121 -0
- oci/load_balancer/models/create_listener_details.py +387 -0
- oci/load_balancer/models/create_load_balancer_details.py +895 -0
- oci/load_balancer/models/create_path_route_set_details.py +111 -0
- oci/load_balancer/models/create_routing_policy_details.py +154 -0
- oci/load_balancer/models/create_rule_set_details.py +109 -0
- oci/load_balancer/models/create_ssl_cipher_suite_details.py +606 -0
- oci/load_balancer/models/extend_http_request_header_value_rule.py +181 -0
- oci/load_balancer/models/extend_http_response_header_value_rule.py +181 -0
- oci/load_balancer/models/forward_to_backend_set.py +86 -0
- oci/load_balancer/models/health_check_result.py +219 -0
- oci/load_balancer/models/health_checker.py +381 -0
- oci/load_balancer/models/health_checker_details.py +376 -0
- oci/load_balancer/models/hostname.py +121 -0
- oci/load_balancer/models/hostname_details.py +117 -0
- oci/load_balancer/models/http_header_rule.py +127 -0
- oci/load_balancer/models/ip_address.py +142 -0
- oci/load_balancer/models/ip_based_max_connections_rule.py +118 -0
- oci/load_balancer/models/ip_max_connections.py +111 -0
- oci/load_balancer/models/lb_cookie_session_persistence_configuration_details.py +423 -0
- oci/load_balancer/models/listener.py +383 -0
- oci/load_balancer/models/listener_details.py +344 -0
- oci/load_balancer/models/listener_rule_summary.py +104 -0
- oci/load_balancer/models/load_balancer.py +1023 -0
- oci/load_balancer/models/load_balancer_health.py +281 -0
- oci/load_balancer/models/load_balancer_health_summary.py +167 -0
- oci/load_balancer/models/load_balancer_policy.py +80 -0
- oci/load_balancer/models/load_balancer_protocol.py +76 -0
- oci/load_balancer/models/load_balancer_shape.py +80 -0
- oci/load_balancer/models/path_match_condition.py +166 -0
- oci/load_balancer/models/path_match_type.py +126 -0
- oci/load_balancer/models/path_route.py +156 -0
- oci/load_balancer/models/path_route_set.py +112 -0
- oci/load_balancer/models/path_route_set_details.py +72 -0
- oci/load_balancer/models/redirect_rule.py +173 -0
- oci/load_balancer/models/redirect_uri.py +420 -0
- oci/load_balancer/models/remove_http_request_header_rule.py +90 -0
- oci/load_balancer/models/remove_http_response_header_rule.py +92 -0
- oci/load_balancer/models/reserved_ip.py +90 -0
- oci/load_balancer/models/routing_policy.py +152 -0
- oci/load_balancer/models/routing_policy_details.py +73 -0
- oci/load_balancer/models/routing_rule.py +135 -0
- oci/load_balancer/models/rule.py +177 -0
- oci/load_balancer/models/rule_condition.py +121 -0
- oci/load_balancer/models/rule_set.py +113 -0
- oci/load_balancer/models/rule_set_details.py +72 -0
- oci/load_balancer/models/session_persistence_configuration_details.py +136 -0
- oci/load_balancer/models/shape_details.py +121 -0
- oci/load_balancer/models/source_ip_address_condition.py +90 -0
- oci/load_balancer/models/source_vcn_id_condition.py +98 -0
- oci/load_balancer/models/source_vcn_ip_address_condition.py +97 -0
- oci/load_balancer/models/ssl_cipher_suite.py +606 -0
- oci/load_balancer/models/ssl_cipher_suite_details.py +606 -0
- oci/load_balancer/models/ssl_configuration.py +478 -0
- oci/load_balancer/models/ssl_configuration_details.py +476 -0
- oci/load_balancer/models/update_backend_details.py +242 -0
- oci/load_balancer/models/update_backend_set_details.py +264 -0
- oci/load_balancer/models/update_health_checker_details.py +374 -0
- oci/load_balancer/models/update_hostname_details.py +86 -0
- oci/load_balancer/models/update_listener_details.py +344 -0
- oci/load_balancer/models/update_load_balancer_details.py +356 -0
- oci/load_balancer/models/update_load_balancer_shape_details.py +127 -0
- oci/load_balancer/models/update_network_security_groups_details.py +99 -0
- oci/load_balancer/models/update_path_route_set_details.py +72 -0
- oci/load_balancer/models/update_routing_policy_details.py +115 -0
- oci/load_balancer/models/update_rule_set_details.py +72 -0
- oci/load_balancer/models/update_ssl_cipher_suite_details.py +300 -0
- oci/load_balancer/models/work_request.py +385 -0
- oci/load_balancer/models/work_request_error.py +115 -0
- oci/network_load_balancer/__init__.py +14 -0
- oci/network_load_balancer/models/__init__.py +106 -0
- oci/network_load_balancer/models/backend.py +338 -0
- oci/network_load_balancer/models/backend_collection.py +72 -0
- oci/network_load_balancer/models/backend_details.py +337 -0
- oci/network_load_balancer/models/backend_health.py +145 -0
- oci/network_load_balancer/models/backend_set.py +347 -0
- oci/network_load_balancer/models/backend_set_collection.py +72 -0
- oci/network_load_balancer/models/backend_set_details.py +306 -0
- oci/network_load_balancer/models/backend_set_health.py +265 -0
- oci/network_load_balancer/models/backend_set_summary.py +347 -0
- oci/network_load_balancer/models/backend_summary.py +338 -0
- oci/network_load_balancer/models/change_network_load_balancer_compartment_details.py +78 -0
- oci/network_load_balancer/models/create_backend_details.py +336 -0
- oci/network_load_balancer/models/create_backend_set_details.py +347 -0
- oci/network_load_balancer/models/create_listener_details.py +396 -0
- oci/network_load_balancer/models/create_network_load_balancer_details.py +694 -0
- oci/network_load_balancer/models/dns_health_checker_details.py +264 -0
- oci/network_load_balancer/models/health_check_result.py +139 -0
- oci/network_load_balancer/models/health_checker.py +449 -0
- oci/network_load_balancer/models/health_checker_details.py +449 -0
- oci/network_load_balancer/models/ip_address.py +189 -0
- oci/network_load_balancer/models/listener.py +396 -0
- oci/network_load_balancer/models/listener_collection.py +72 -0
- oci/network_load_balancer/models/listener_details.py +396 -0
- oci/network_load_balancer/models/listener_summary.py +396 -0
- oci/network_load_balancer/models/network_load_balancer.py +847 -0
- oci/network_load_balancer/models/network_load_balancer_collection.py +72 -0
- oci/network_load_balancer/models/network_load_balancer_health.py +281 -0
- oci/network_load_balancer/models/network_load_balancer_health_collection.py +72 -0
- oci/network_load_balancer/models/network_load_balancer_health_summary.py +167 -0
- oci/network_load_balancer/models/network_load_balancer_summary.py +833 -0
- oci/network_load_balancer/models/network_load_balancers_policy_collection.py +72 -0
- oci/network_load_balancer/models/network_load_balancers_protocol_collection.py +73 -0
- oci/network_load_balancer/models/reserved_ip.py +90 -0
- oci/network_load_balancer/models/update_backend_details.py +199 -0
- oci/network_load_balancer/models/update_backend_set_details.py +288 -0
- oci/network_load_balancer/models/update_health_checker_details.py +444 -0
- oci/network_load_balancer/models/update_listener_details.py +361 -0
- oci/network_load_balancer/models/update_network_load_balancer_details.py +386 -0
- oci/network_load_balancer/models/update_network_security_groups_details.py +99 -0
- oci/network_load_balancer/models/work_request.py +454 -0
- oci/network_load_balancer/models/work_request_collection.py +72 -0
- oci/network_load_balancer/models/work_request_error.py +136 -0
- oci/network_load_balancer/models/work_request_error_collection.py +72 -0
- oci/network_load_balancer/models/work_request_log_entry.py +103 -0
- oci/network_load_balancer/models/work_request_log_entry_collection.py +72 -0
- oci/network_load_balancer/models/work_request_resource.py +199 -0
- oci/network_load_balancer/models/work_request_summary.py +454 -0
- oci/network_load_balancer/network_load_balancer_client.py +4392 -0
- oci/network_load_balancer/network_load_balancer_client_composite_operations.py +757 -0
- oci/version.py +1 -1
- {mv_oci_sdk-2.142.0.dist-info → mv_oci_sdk-2.142.0.2.dist-info}/LICENSE.txt +0 -0
- {mv_oci_sdk-2.142.0.dist-info → mv_oci_sdk-2.142.0.2.dist-info}/WHEEL +0 -0
- {mv_oci_sdk-2.142.0.dist-info → mv_oci_sdk-2.142.0.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,326 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, 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
|
+
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20181201
|
6
|
+
|
7
|
+
import oci # noqa: F401
|
8
|
+
from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401
|
9
|
+
|
10
|
+
|
11
|
+
class FunctionsManagementClientCompositeOperations(object):
|
12
|
+
"""
|
13
|
+
This class provides a wrapper around :py:class:`~oci.functions.FunctionsManagementClient` and offers convenience methods
|
14
|
+
for operations that would otherwise need to be chained together. For example, instead of performing an action
|
15
|
+
on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
|
16
|
+
to enter a given state, you can call a single method in this class to accomplish the same functionality
|
17
|
+
"""
|
18
|
+
|
19
|
+
def __init__(self, client, **kwargs):
|
20
|
+
"""
|
21
|
+
Creates a new FunctionsManagementClientCompositeOperations object
|
22
|
+
|
23
|
+
:param FunctionsManagementClient client:
|
24
|
+
The service client which will be wrapped by this object
|
25
|
+
"""
|
26
|
+
self.client = client
|
27
|
+
|
28
|
+
def create_application_and_wait_for_state(self, create_application_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
|
29
|
+
"""
|
30
|
+
Calls :py:func:`~oci.functions.FunctionsManagementClient.create_application` and waits for the :py:class:`~oci.functions.models.Application` acted upon
|
31
|
+
to enter the given state(s).
|
32
|
+
|
33
|
+
:param oci.functions.models.CreateApplicationDetails create_application_details: (required)
|
34
|
+
Specification of the application to create
|
35
|
+
|
36
|
+
:param list[str] wait_for_states:
|
37
|
+
An array of states to wait on. These should be valid values for :py:attr:`~oci.functions.models.Application.lifecycle_state`
|
38
|
+
|
39
|
+
:param dict operation_kwargs:
|
40
|
+
A dictionary of keyword arguments to pass to :py:func:`~oci.functions.FunctionsManagementClient.create_application`
|
41
|
+
|
42
|
+
:param dict waiter_kwargs:
|
43
|
+
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
|
44
|
+
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
|
45
|
+
"""
|
46
|
+
operation_result = self.client.create_application(create_application_details, **operation_kwargs)
|
47
|
+
if not wait_for_states:
|
48
|
+
return operation_result
|
49
|
+
lowered_wait_for_states = [w.lower() for w in wait_for_states]
|
50
|
+
application_id = operation_result.data.id
|
51
|
+
|
52
|
+
try:
|
53
|
+
waiter_result = oci.wait_until(
|
54
|
+
self.client,
|
55
|
+
self.client.get_application(application_id), # noqa: F821
|
56
|
+
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
|
57
|
+
**waiter_kwargs
|
58
|
+
)
|
59
|
+
result_to_return = waiter_result
|
60
|
+
|
61
|
+
return result_to_return
|
62
|
+
except (NameError, TypeError) as e:
|
63
|
+
if not e.args:
|
64
|
+
e.args = ('',)
|
65
|
+
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
|
66
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
67
|
+
except Exception as e:
|
68
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
69
|
+
|
70
|
+
def create_function_and_wait_for_state(self, create_function_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
|
71
|
+
"""
|
72
|
+
Calls :py:func:`~oci.functions.FunctionsManagementClient.create_function` and waits for the :py:class:`~oci.functions.models.Function` acted upon
|
73
|
+
to enter the given state(s).
|
74
|
+
|
75
|
+
:param oci.functions.models.CreateFunctionDetails create_function_details: (required)
|
76
|
+
Specification of the function to create
|
77
|
+
|
78
|
+
:param list[str] wait_for_states:
|
79
|
+
An array of states to wait on. These should be valid values for :py:attr:`~oci.functions.models.Function.lifecycle_state`
|
80
|
+
|
81
|
+
:param dict operation_kwargs:
|
82
|
+
A dictionary of keyword arguments to pass to :py:func:`~oci.functions.FunctionsManagementClient.create_function`
|
83
|
+
|
84
|
+
:param dict waiter_kwargs:
|
85
|
+
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
|
86
|
+
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
|
87
|
+
"""
|
88
|
+
operation_result = self.client.create_function(create_function_details, **operation_kwargs)
|
89
|
+
if not wait_for_states:
|
90
|
+
return operation_result
|
91
|
+
lowered_wait_for_states = [w.lower() for w in wait_for_states]
|
92
|
+
function_id = operation_result.data.id
|
93
|
+
|
94
|
+
try:
|
95
|
+
waiter_result = oci.wait_until(
|
96
|
+
self.client,
|
97
|
+
self.client.get_function(function_id), # noqa: F821
|
98
|
+
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
|
99
|
+
**waiter_kwargs
|
100
|
+
)
|
101
|
+
result_to_return = waiter_result
|
102
|
+
|
103
|
+
return result_to_return
|
104
|
+
except (NameError, TypeError) as e:
|
105
|
+
if not e.args:
|
106
|
+
e.args = ('',)
|
107
|
+
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
|
108
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
109
|
+
except Exception as e:
|
110
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
111
|
+
|
112
|
+
def delete_application_and_wait_for_state(self, application_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
|
113
|
+
"""
|
114
|
+
Calls :py:func:`~oci.functions.FunctionsManagementClient.delete_application` and waits for the :py:class:`~oci.functions.models.Application` acted upon
|
115
|
+
to enter the given state(s).
|
116
|
+
|
117
|
+
:param str application_id: (required)
|
118
|
+
The `OCID`__ of this application.
|
119
|
+
|
120
|
+
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
|
121
|
+
|
122
|
+
:param list[str] wait_for_states:
|
123
|
+
An array of states to wait on. These should be valid values for :py:attr:`~oci.functions.models.Application.lifecycle_state`
|
124
|
+
|
125
|
+
:param dict operation_kwargs:
|
126
|
+
A dictionary of keyword arguments to pass to :py:func:`~oci.functions.FunctionsManagementClient.delete_application`
|
127
|
+
|
128
|
+
:param dict waiter_kwargs:
|
129
|
+
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
|
130
|
+
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
|
131
|
+
"""
|
132
|
+
initial_get_result = self.client.get_application(application_id)
|
133
|
+
operation_result = None
|
134
|
+
try:
|
135
|
+
operation_result = self.client.delete_application(application_id, **operation_kwargs)
|
136
|
+
except oci.exceptions.ServiceError as e:
|
137
|
+
if e.status == 404:
|
138
|
+
return WAIT_RESOURCE_NOT_FOUND
|
139
|
+
else:
|
140
|
+
raise e
|
141
|
+
|
142
|
+
if not wait_for_states:
|
143
|
+
return operation_result
|
144
|
+
lowered_wait_for_states = [w.lower() for w in wait_for_states]
|
145
|
+
|
146
|
+
try:
|
147
|
+
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
|
148
|
+
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_application, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
|
149
|
+
else:
|
150
|
+
"""
|
151
|
+
If the user does not send in this value, we set it to True by default.
|
152
|
+
We are doing this because during a delete resource scenario and waiting on its state, the service can
|
153
|
+
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
|
154
|
+
"""
|
155
|
+
waiter_kwargs["succeed_on_not_found"] = True
|
156
|
+
waiter_result = oci.wait_until(
|
157
|
+
self.client,
|
158
|
+
initial_get_result, # noqa: F821
|
159
|
+
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
|
160
|
+
**waiter_kwargs
|
161
|
+
)
|
162
|
+
result_to_return = waiter_result
|
163
|
+
|
164
|
+
return result_to_return
|
165
|
+
except (NameError, TypeError) as e:
|
166
|
+
if not e.args:
|
167
|
+
e.args = ('',)
|
168
|
+
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
|
169
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
170
|
+
except Exception as e:
|
171
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
172
|
+
|
173
|
+
def delete_function_and_wait_for_state(self, function_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
|
174
|
+
"""
|
175
|
+
Calls :py:func:`~oci.functions.FunctionsManagementClient.delete_function` and waits for the :py:class:`~oci.functions.models.Function` acted upon
|
176
|
+
to enter the given state(s).
|
177
|
+
|
178
|
+
:param str function_id: (required)
|
179
|
+
The `OCID`__ of this function.
|
180
|
+
|
181
|
+
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
|
182
|
+
|
183
|
+
:param list[str] wait_for_states:
|
184
|
+
An array of states to wait on. These should be valid values for :py:attr:`~oci.functions.models.Function.lifecycle_state`
|
185
|
+
|
186
|
+
:param dict operation_kwargs:
|
187
|
+
A dictionary of keyword arguments to pass to :py:func:`~oci.functions.FunctionsManagementClient.delete_function`
|
188
|
+
|
189
|
+
:param dict waiter_kwargs:
|
190
|
+
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
|
191
|
+
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
|
192
|
+
"""
|
193
|
+
initial_get_result = self.client.get_function(function_id)
|
194
|
+
operation_result = None
|
195
|
+
try:
|
196
|
+
operation_result = self.client.delete_function(function_id, **operation_kwargs)
|
197
|
+
except oci.exceptions.ServiceError as e:
|
198
|
+
if e.status == 404:
|
199
|
+
return WAIT_RESOURCE_NOT_FOUND
|
200
|
+
else:
|
201
|
+
raise e
|
202
|
+
|
203
|
+
if not wait_for_states:
|
204
|
+
return operation_result
|
205
|
+
lowered_wait_for_states = [w.lower() for w in wait_for_states]
|
206
|
+
|
207
|
+
try:
|
208
|
+
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
|
209
|
+
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_function, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
|
210
|
+
else:
|
211
|
+
"""
|
212
|
+
If the user does not send in this value, we set it to True by default.
|
213
|
+
We are doing this because during a delete resource scenario and waiting on its state, the service can
|
214
|
+
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
|
215
|
+
"""
|
216
|
+
waiter_kwargs["succeed_on_not_found"] = True
|
217
|
+
waiter_result = oci.wait_until(
|
218
|
+
self.client,
|
219
|
+
initial_get_result, # noqa: F821
|
220
|
+
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
|
221
|
+
**waiter_kwargs
|
222
|
+
)
|
223
|
+
result_to_return = waiter_result
|
224
|
+
|
225
|
+
return result_to_return
|
226
|
+
except (NameError, TypeError) as e:
|
227
|
+
if not e.args:
|
228
|
+
e.args = ('',)
|
229
|
+
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
|
230
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
231
|
+
except Exception as e:
|
232
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
233
|
+
|
234
|
+
def update_application_and_wait_for_state(self, application_id, update_application_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
|
235
|
+
"""
|
236
|
+
Calls :py:func:`~oci.functions.FunctionsManagementClient.update_application` and waits for the :py:class:`~oci.functions.models.Application` acted upon
|
237
|
+
to enter the given state(s).
|
238
|
+
|
239
|
+
:param str application_id: (required)
|
240
|
+
The `OCID`__ of this application.
|
241
|
+
|
242
|
+
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
|
243
|
+
|
244
|
+
:param oci.functions.models.UpdateApplicationDetails update_application_details: (required)
|
245
|
+
The new application spec to apply
|
246
|
+
|
247
|
+
:param list[str] wait_for_states:
|
248
|
+
An array of states to wait on. These should be valid values for :py:attr:`~oci.functions.models.Application.lifecycle_state`
|
249
|
+
|
250
|
+
:param dict operation_kwargs:
|
251
|
+
A dictionary of keyword arguments to pass to :py:func:`~oci.functions.FunctionsManagementClient.update_application`
|
252
|
+
|
253
|
+
:param dict waiter_kwargs:
|
254
|
+
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
|
255
|
+
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
|
256
|
+
"""
|
257
|
+
operation_result = self.client.update_application(application_id, update_application_details, **operation_kwargs)
|
258
|
+
if not wait_for_states:
|
259
|
+
return operation_result
|
260
|
+
lowered_wait_for_states = [w.lower() for w in wait_for_states]
|
261
|
+
application_id = operation_result.data.id
|
262
|
+
|
263
|
+
try:
|
264
|
+
waiter_result = oci.wait_until(
|
265
|
+
self.client,
|
266
|
+
self.client.get_application(application_id), # noqa: F821
|
267
|
+
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
|
268
|
+
**waiter_kwargs
|
269
|
+
)
|
270
|
+
result_to_return = waiter_result
|
271
|
+
|
272
|
+
return result_to_return
|
273
|
+
except (NameError, TypeError) as e:
|
274
|
+
if not e.args:
|
275
|
+
e.args = ('',)
|
276
|
+
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
|
277
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
278
|
+
except Exception as e:
|
279
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
280
|
+
|
281
|
+
def update_function_and_wait_for_state(self, function_id, update_function_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
|
282
|
+
"""
|
283
|
+
Calls :py:func:`~oci.functions.FunctionsManagementClient.update_function` and waits for the :py:class:`~oci.functions.models.Function` acted upon
|
284
|
+
to enter the given state(s).
|
285
|
+
|
286
|
+
:param str function_id: (required)
|
287
|
+
The `OCID`__ of this function.
|
288
|
+
|
289
|
+
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
|
290
|
+
|
291
|
+
:param oci.functions.models.UpdateFunctionDetails update_function_details: (required)
|
292
|
+
The new function spec to apply
|
293
|
+
|
294
|
+
:param list[str] wait_for_states:
|
295
|
+
An array of states to wait on. These should be valid values for :py:attr:`~oci.functions.models.Function.lifecycle_state`
|
296
|
+
|
297
|
+
:param dict operation_kwargs:
|
298
|
+
A dictionary of keyword arguments to pass to :py:func:`~oci.functions.FunctionsManagementClient.update_function`
|
299
|
+
|
300
|
+
:param dict waiter_kwargs:
|
301
|
+
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
|
302
|
+
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
|
303
|
+
"""
|
304
|
+
operation_result = self.client.update_function(function_id, update_function_details, **operation_kwargs)
|
305
|
+
if not wait_for_states:
|
306
|
+
return operation_result
|
307
|
+
lowered_wait_for_states = [w.lower() for w in wait_for_states]
|
308
|
+
function_id = operation_result.data.id
|
309
|
+
|
310
|
+
try:
|
311
|
+
waiter_result = oci.wait_until(
|
312
|
+
self.client,
|
313
|
+
self.client.get_function(function_id), # noqa: F821
|
314
|
+
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
|
315
|
+
**waiter_kwargs
|
316
|
+
)
|
317
|
+
result_to_return = waiter_result
|
318
|
+
|
319
|
+
return result_to_return
|
320
|
+
except (NameError, TypeError) as e:
|
321
|
+
if not e.args:
|
322
|
+
e.args = ('',)
|
323
|
+
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
|
324
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
325
|
+
except Exception as e:
|
326
|
+
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Copyright (c) 2016, 2025, 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
|
+
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20181201
|
6
|
+
|
7
|
+
from __future__ import absolute_import
|
8
|
+
|
9
|
+
from .application import Application
|
10
|
+
from .application_summary import ApplicationSummary
|
11
|
+
from .application_trace_config import ApplicationTraceConfig
|
12
|
+
from .change_application_compartment_details import ChangeApplicationCompartmentDetails
|
13
|
+
from .config_details import ConfigDetails
|
14
|
+
from .constant_provisioned_concurrency_config import ConstantProvisionedConcurrencyConfig
|
15
|
+
from .create_application_details import CreateApplicationDetails
|
16
|
+
from .create_function_details import CreateFunctionDetails
|
17
|
+
from .function import Function
|
18
|
+
from .function_provisioned_concurrency_config import FunctionProvisionedConcurrencyConfig
|
19
|
+
from .function_source_details import FunctionSourceDetails
|
20
|
+
from .function_summary import FunctionSummary
|
21
|
+
from .function_trace_config import FunctionTraceConfig
|
22
|
+
from .image_policy_config import ImagePolicyConfig
|
23
|
+
from .key_details import KeyDetails
|
24
|
+
from .none_provisioned_concurrency_config import NoneProvisionedConcurrencyConfig
|
25
|
+
from .pbf_listing import PbfListing
|
26
|
+
from .pbf_listing_summary import PbfListingSummary
|
27
|
+
from .pbf_listing_version import PbfListingVersion
|
28
|
+
from .pbf_listing_version_summary import PbfListingVersionSummary
|
29
|
+
from .pbf_listing_versions_collection import PbfListingVersionsCollection
|
30
|
+
from .pbf_listings_collection import PbfListingsCollection
|
31
|
+
from .policy_details import PolicyDetails
|
32
|
+
from .pre_built_function_source_details import PreBuiltFunctionSourceDetails
|
33
|
+
from .publisher_details import PublisherDetails
|
34
|
+
from .requirement_details import RequirementDetails
|
35
|
+
from .trigger import Trigger
|
36
|
+
from .trigger_summary import TriggerSummary
|
37
|
+
from .triggers_collection import TriggersCollection
|
38
|
+
from .update_application_details import UpdateApplicationDetails
|
39
|
+
from .update_function_details import UpdateFunctionDetails
|
40
|
+
|
41
|
+
# Maps type names to classes for functions services.
|
42
|
+
functions_type_mapping = {
|
43
|
+
"Application": Application,
|
44
|
+
"ApplicationSummary": ApplicationSummary,
|
45
|
+
"ApplicationTraceConfig": ApplicationTraceConfig,
|
46
|
+
"ChangeApplicationCompartmentDetails": ChangeApplicationCompartmentDetails,
|
47
|
+
"ConfigDetails": ConfigDetails,
|
48
|
+
"ConstantProvisionedConcurrencyConfig": ConstantProvisionedConcurrencyConfig,
|
49
|
+
"CreateApplicationDetails": CreateApplicationDetails,
|
50
|
+
"CreateFunctionDetails": CreateFunctionDetails,
|
51
|
+
"Function": Function,
|
52
|
+
"FunctionProvisionedConcurrencyConfig": FunctionProvisionedConcurrencyConfig,
|
53
|
+
"FunctionSourceDetails": FunctionSourceDetails,
|
54
|
+
"FunctionSummary": FunctionSummary,
|
55
|
+
"FunctionTraceConfig": FunctionTraceConfig,
|
56
|
+
"ImagePolicyConfig": ImagePolicyConfig,
|
57
|
+
"KeyDetails": KeyDetails,
|
58
|
+
"NoneProvisionedConcurrencyConfig": NoneProvisionedConcurrencyConfig,
|
59
|
+
"PbfListing": PbfListing,
|
60
|
+
"PbfListingSummary": PbfListingSummary,
|
61
|
+
"PbfListingVersion": PbfListingVersion,
|
62
|
+
"PbfListingVersionSummary": PbfListingVersionSummary,
|
63
|
+
"PbfListingVersionsCollection": PbfListingVersionsCollection,
|
64
|
+
"PbfListingsCollection": PbfListingsCollection,
|
65
|
+
"PolicyDetails": PolicyDetails,
|
66
|
+
"PreBuiltFunctionSourceDetails": PreBuiltFunctionSourceDetails,
|
67
|
+
"PublisherDetails": PublisherDetails,
|
68
|
+
"RequirementDetails": RequirementDetails,
|
69
|
+
"Trigger": Trigger,
|
70
|
+
"TriggerSummary": TriggerSummary,
|
71
|
+
"TriggersCollection": TriggersCollection,
|
72
|
+
"UpdateApplicationDetails": UpdateApplicationDetails,
|
73
|
+
"UpdateFunctionDetails": UpdateFunctionDetails
|
74
|
+
}
|