File: //lib/mysqlsh/lib/python3.8/site-packages/oci/core/virtual_network_client_composite_operations.py
# coding: utf-8
# Copyright (c) 2016, 2025, 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.
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20160918
import oci # noqa: F401
from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401
class VirtualNetworkClientCompositeOperations(object):
"""
This class provides a wrapper around :py:class:`~oci.core.VirtualNetworkClient` and offers convenience methods
for operations that would otherwise need to be chained together. For example, instead of performing an action
on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
to enter a given state, you can call a single method in this class to accomplish the same functionality
"""
def __init__(self, client, work_request_client=None, **kwargs):
"""
Creates a new VirtualNetworkClientCompositeOperations object
:param VirtualNetworkClient client:
The service client which will be wrapped by this object
:param oci.work_requests.WorkRequestClient work_request_client: (optional)
The work request service client which will be used to wait for work request states. Default is None.
"""
self.client = client
self._work_request_client = work_request_client if work_request_client else oci.work_requests.WorkRequestClient(self.client._config, **self.client._kwargs)
def add_ipv6_subnet_cidr_and_wait_for_work_request(self, subnet_id, add_subnet_ipv6_cidr_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.add_ipv6_subnet_cidr` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str subnet_id: (required)
Specify the `OCID`__ of the subnet.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.AddSubnetIpv6CidrDetails add_subnet_ipv6_cidr_details: (required)
Details object for adding an IPv6 prefix to a subnet.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.add_ipv6_subnet_cidr`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.add_ipv6_subnet_cidr(subnet_id, add_subnet_ipv6_cidr_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def add_ipv6_vcn_cidr_and_wait_for_work_request(self, vcn_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.add_ipv6_vcn_cidr` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.add_ipv6_vcn_cidr`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.add_ipv6_vcn_cidr(vcn_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def add_public_ip_pool_capacity_and_wait_for_state(self, public_ip_pool_id, add_public_ip_pool_capacity_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.add_public_ip_pool_capacity` and waits for the :py:class:`~oci.core.models.PublicIpPool` acted upon
to enter the given state(s).
:param str public_ip_pool_id: (required)
The `OCID`__ of the public IP pool.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.AddPublicIpPoolCapacityDetails add_public_ip_pool_capacity_details: (required)
Byoip Range prefix and a cidr from it
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIpPool.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.add_public_ip_pool_capacity`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.add_public_ip_pool_capacity(public_ip_pool_id, add_public_ip_pool_capacity_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
public_ip_pool_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_public_ip_pool(public_ip_pool_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def add_vcn_cidr_and_wait_for_work_request(self, vcn_id, add_vcn_cidr_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.add_vcn_cidr` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.AddVcnCidrDetails add_vcn_cidr_details: (required)
Details object for deleting a VCN CIDR.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.add_vcn_cidr`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.add_vcn_cidr(vcn_id, add_vcn_cidr_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def attach_service_id_and_wait_for_state(self, service_gateway_id, attach_service_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.attach_service_id` and waits for the :py:class:`~oci.core.models.ServiceGateway` acted upon
to enter the given state(s).
:param str service_gateway_id: (required)
The service gateway's `OCID`__.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ServiceIdRequestDetails attach_service_details: (required)
ServiceId of Service to be attached to a service gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.ServiceGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.attach_service_id`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.attach_service_id(service_gateway_id, attach_service_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
service_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_service_gateway(service_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def change_capture_filter_compartment_and_wait_for_work_request(self, capture_filter_id, change_capture_filter_compartment_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.change_capture_filter_compartment` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str capture_filter_id: (required)
The `OCID`__ of the capture filter.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ChangeCaptureFilterCompartmentDetails change_capture_filter_compartment_details: (required)
Request to change the compartment of a VTAP.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.change_capture_filter_compartment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.change_capture_filter_compartment(capture_filter_id, change_capture_filter_compartment_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def change_drg_compartment_and_wait_for_work_request(self, drg_id, change_drg_compartment_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.change_drg_compartment` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str drg_id: (required)
The `OCID`__ of the DRG.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ChangeDrgCompartmentDetails change_drg_compartment_details: (required)
Request to change the compartment of a DRG.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.change_drg_compartment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.change_drg_compartment(drg_id, change_drg_compartment_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def change_subnet_compartment_and_wait_for_work_request(self, subnet_id, change_subnet_compartment_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.change_subnet_compartment` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str subnet_id: (required)
Specify the `OCID`__ of the subnet.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ChangeSubnetCompartmentDetails change_subnet_compartment_details: (required)
Request to change the compartment of a given subnet.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.change_subnet_compartment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.change_subnet_compartment(subnet_id, change_subnet_compartment_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def change_vcn_compartment_and_wait_for_work_request(self, vcn_id, change_vcn_compartment_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.change_vcn_compartment` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ChangeVcnCompartmentDetails change_vcn_compartment_details: (required)
Request to change the compartment of a given VCN.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.change_vcn_compartment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.change_vcn_compartment(vcn_id, change_vcn_compartment_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def change_vlan_compartment_and_wait_for_work_request(self, vlan_id, change_vlan_compartment_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.change_vlan_compartment` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vlan_id: (required)
The `OCID`__ of the VLAN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ChangeVlanCompartmentDetails change_vlan_compartment_details: (required)
Request to change the compartment of a given VLAN.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.change_vlan_compartment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.change_vlan_compartment(vlan_id, change_vlan_compartment_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def change_vtap_compartment_and_wait_for_work_request(self, vtap_id, change_vtap_compartment_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.change_vtap_compartment` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vtap_id: (required)
The `OCID`__ of the VTAP.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ChangeVtapCompartmentDetails change_vtap_compartment_details: (required)
Request to change the compartment that contains a VTAP.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.change_vtap_compartment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.change_vtap_compartment(vtap_id, change_vtap_compartment_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_byoasn_and_wait_for_state(self, create_byoasn_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_byoasn` and waits for the :py:class:`~oci.core.models.Byoasn` acted upon
to enter the given state(s).
:param oci.core.models.CreateByoasnDetails create_byoasn_details: (required)
Details needed to create a BYOASN Resource.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Byoasn.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_byoasn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_byoasn(create_byoasn_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
byoasn_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_byoasn(byoasn_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_byoip_range_and_wait_for_state(self, create_byoip_range_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_byoip_range` and waits for the :py:class:`~oci.core.models.ByoipRange` acted upon
to enter the given state(s).
:param oci.core.models.CreateByoipRangeDetails create_byoip_range_details: (required)
Details needed to create a BYOIP CIDR block subrange.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.ByoipRange.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_byoip_range`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_byoip_range(create_byoip_range_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
byoip_range_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_byoip_range(byoip_range_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_capture_filter_and_wait_for_state(self, create_capture_filter_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_capture_filter` and waits for the :py:class:`~oci.core.models.CaptureFilter` acted upon
to enter the given state(s).
:param oci.core.models.CreateCaptureFilterDetails create_capture_filter_details: (required)
Details for creating a capture filter.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CaptureFilter.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_capture_filter`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_capture_filter(create_capture_filter_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
capture_filter_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_capture_filter(capture_filter_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_cross_connect_and_wait_for_state(self, create_cross_connect_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_cross_connect` and waits for the :py:class:`~oci.core.models.CrossConnect` acted upon
to enter the given state(s).
:param oci.core.models.CreateCrossConnectDetails create_cross_connect_details: (required)
Details to create a CrossConnect
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CrossConnect.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_cross_connect`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_cross_connect(create_cross_connect_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
cross_connect_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_cross_connect(cross_connect_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_cross_connect_group_and_wait_for_state(self, create_cross_connect_group_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_cross_connect_group` and waits for the :py:class:`~oci.core.models.CrossConnectGroup` acted upon
to enter the given state(s).
:param oci.core.models.CreateCrossConnectGroupDetails create_cross_connect_group_details: (required)
Details to create a CrossConnectGroup
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CrossConnectGroup.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_cross_connect_group`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_cross_connect_group(create_cross_connect_group_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
cross_connect_group_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_cross_connect_group(cross_connect_group_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_dhcp_options_and_wait_for_state(self, create_dhcp_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_dhcp_options` and waits for the :py:class:`~oci.core.models.DhcpOptions` acted upon
to enter the given state(s).
:param oci.core.models.CreateDhcpDetails create_dhcp_details: (required)
Request object for creating a new set of DHCP options.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DhcpOptions.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_dhcp_options`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_dhcp_options(create_dhcp_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
dhcp_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_dhcp_options(dhcp_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_drg_and_wait_for_state(self, create_drg_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_drg` and waits for the :py:class:`~oci.core.models.Drg` acted upon
to enter the given state(s).
:param oci.core.models.CreateDrgDetails create_drg_details: (required)
Details for creating a DRG.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Drg.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_drg`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_drg(create_drg_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg(drg_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_drg_attachment_and_wait_for_state(self, create_drg_attachment_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_drg_attachment` and waits for the :py:class:`~oci.core.models.DrgAttachment` acted upon
to enter the given state(s).
:param oci.core.models.CreateDrgAttachmentDetails create_drg_attachment_details: (required)
Details for creating a `DrgAttachment`.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgAttachment.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_drg_attachment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_drg_attachment(create_drg_attachment_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_attachment_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_attachment(drg_attachment_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_drg_route_distribution_and_wait_for_state(self, create_drg_route_distribution_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_drg_route_distribution` and waits for the :py:class:`~oci.core.models.DrgRouteDistribution` acted upon
to enter the given state(s).
:param oci.core.models.CreateDrgRouteDistributionDetails create_drg_route_distribution_details: (required)
Details for creating a route distribution.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgRouteDistribution.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_drg_route_distribution`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_drg_route_distribution(create_drg_route_distribution_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_route_distribution_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_route_distribution(drg_route_distribution_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_drg_route_table_and_wait_for_state(self, create_drg_route_table_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_drg_route_table` and waits for the :py:class:`~oci.core.models.DrgRouteTable` acted upon
to enter the given state(s).
:param oci.core.models.CreateDrgRouteTableDetails create_drg_route_table_details: (required)
Details for creating a DRG route table.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgRouteTable.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_drg_route_table`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_drg_route_table(create_drg_route_table_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_route_table_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_route_table(drg_route_table_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_internet_gateway_and_wait_for_state(self, create_internet_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_internet_gateway` and waits for the :py:class:`~oci.core.models.InternetGateway` acted upon
to enter the given state(s).
:param oci.core.models.CreateInternetGatewayDetails create_internet_gateway_details: (required)
Details for creating a new internet gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.InternetGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_internet_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_internet_gateway(create_internet_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ig_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_internet_gateway(ig_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_ip_sec_connection_and_wait_for_state(self, create_ip_sec_connection_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_ip_sec_connection` and waits for the :py:class:`~oci.core.models.IPSecConnection` acted upon
to enter the given state(s).
:param oci.core.models.CreateIPSecConnectionDetails create_ip_sec_connection_details: (required)
Details for creating an `IPSecConnection`.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.IPSecConnection.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_ip_sec_connection`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_ip_sec_connection(create_ip_sec_connection_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ipsc_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_ip_sec_connection(ipsc_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_ipv6_and_wait_for_state(self, create_ipv6_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_ipv6` and waits for the :py:class:`~oci.core.models.Ipv6` acted upon
to enter the given state(s).
:param oci.core.models.CreateIpv6Details create_ipv6_details: (required)
Create IPv6 details.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Ipv6.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_ipv6`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_ipv6(create_ipv6_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ipv6_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_ipv6(ipv6_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_local_peering_gateway_and_wait_for_state(self, create_local_peering_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_local_peering_gateway` and waits for the :py:class:`~oci.core.models.LocalPeeringGateway` acted upon
to enter the given state(s).
:param oci.core.models.CreateLocalPeeringGatewayDetails create_local_peering_gateway_details: (required)
Details for creating a new local peering gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.LocalPeeringGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_local_peering_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_local_peering_gateway(create_local_peering_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
local_peering_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_local_peering_gateway(local_peering_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_nat_gateway_and_wait_for_state(self, create_nat_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_nat_gateway` and waits for the :py:class:`~oci.core.models.NatGateway` acted upon
to enter the given state(s).
:param oci.core.models.CreateNatGatewayDetails create_nat_gateway_details: (required)
Details for creating a NAT gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.NatGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_nat_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_nat_gateway(create_nat_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
nat_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_nat_gateway(nat_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_network_security_group_and_wait_for_state(self, create_network_security_group_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_network_security_group` and waits for the :py:class:`~oci.core.models.NetworkSecurityGroup` acted upon
to enter the given state(s).
:param oci.core.models.CreateNetworkSecurityGroupDetails create_network_security_group_details: (required)
Details for creating a network security group.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.NetworkSecurityGroup.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_network_security_group`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_network_security_group(create_network_security_group_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
network_security_group_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_network_security_group(network_security_group_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_public_ip_and_wait_for_state(self, create_public_ip_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_public_ip` and waits for the :py:class:`~oci.core.models.PublicIp` acted upon
to enter the given state(s).
:param oci.core.models.CreatePublicIpDetails create_public_ip_details: (required)
Create public IP details.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIp.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_public_ip`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_public_ip(create_public_ip_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
public_ip_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_public_ip(public_ip_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_public_ip_pool_and_wait_for_state(self, create_public_ip_pool_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_public_ip_pool` and waits for the :py:class:`~oci.core.models.PublicIpPool` acted upon
to enter the given state(s).
:param oci.core.models.CreatePublicIpPoolDetails create_public_ip_pool_details: (required)
Create Public Ip Pool details
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIpPool.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_public_ip_pool`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_public_ip_pool(create_public_ip_pool_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
public_ip_pool_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_public_ip_pool(public_ip_pool_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_remote_peering_connection_and_wait_for_state(self, create_remote_peering_connection_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_remote_peering_connection` and waits for the :py:class:`~oci.core.models.RemotePeeringConnection` acted upon
to enter the given state(s).
:param oci.core.models.CreateRemotePeeringConnectionDetails create_remote_peering_connection_details: (required)
Request to create peering connection to remote region
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.RemotePeeringConnection.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_remote_peering_connection`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_remote_peering_connection(create_remote_peering_connection_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
remote_peering_connection_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_remote_peering_connection(remote_peering_connection_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_route_table_and_wait_for_state(self, create_route_table_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_route_table` and waits for the :py:class:`~oci.core.models.RouteTable` acted upon
to enter the given state(s).
:param oci.core.models.CreateRouteTableDetails create_route_table_details: (required)
Details for creating a new route table.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.RouteTable.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_route_table`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_route_table(create_route_table_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
rt_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_route_table(rt_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_security_list_and_wait_for_state(self, create_security_list_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_security_list` and waits for the :py:class:`~oci.core.models.SecurityList` acted upon
to enter the given state(s).
:param oci.core.models.CreateSecurityListDetails create_security_list_details: (required)
Details regarding the security list to create.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.SecurityList.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_security_list`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_security_list(create_security_list_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
security_list_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_security_list(security_list_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_service_gateway_and_wait_for_state(self, create_service_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_service_gateway` and waits for the :py:class:`~oci.core.models.ServiceGateway` acted upon
to enter the given state(s).
:param oci.core.models.CreateServiceGatewayDetails create_service_gateway_details: (required)
Details for creating a service gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.ServiceGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_service_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_service_gateway(create_service_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
service_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_service_gateway(service_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_subnet_and_wait_for_state(self, create_subnet_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_subnet` and waits for the :py:class:`~oci.core.models.Subnet` acted upon
to enter the given state(s).
:param oci.core.models.CreateSubnetDetails create_subnet_details: (required)
Details for creating a subnet.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Subnet.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_subnet`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_subnet(create_subnet_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
subnet_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_subnet(subnet_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_vcn_and_wait_for_state(self, create_vcn_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_vcn` and waits for the :py:class:`~oci.core.models.Vcn` acted upon
to enter the given state(s).
:param oci.core.models.CreateVcnDetails create_vcn_details: (required)
Details for creating a new VCN.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vcn.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_vcn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_vcn(create_vcn_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
vcn_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_vcn(vcn_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_virtual_circuit_and_wait_for_state(self, create_virtual_circuit_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_virtual_circuit` and waits for the :py:class:`~oci.core.models.VirtualCircuit` acted upon
to enter the given state(s).
:param oci.core.models.CreateVirtualCircuitDetails create_virtual_circuit_details: (required)
Details to create a VirtualCircuit.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.VirtualCircuit.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_virtual_circuit`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_virtual_circuit(create_virtual_circuit_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
virtual_circuit_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_virtual_circuit(virtual_circuit_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_vlan_and_wait_for_state(self, create_vlan_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_vlan` and waits for the :py:class:`~oci.core.models.Vlan` acted upon
to enter the given state(s).
:param oci.core.models.CreateVlanDetails create_vlan_details: (required)
Details for creating a VLAN
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vlan.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_vlan`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_vlan(create_vlan_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
vlan_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_vlan(vlan_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_vtap_and_wait_for_state(self, create_vtap_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.create_vtap` and waits for the :py:class:`~oci.core.models.Vtap` acted upon
to enter the given state(s).
:param oci.core.models.CreateVtapDetails create_vtap_details: (required)
Details used to create a VTAP.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vtap.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.create_vtap`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_vtap(create_vtap_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
vtap_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_vtap(vtap_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_byoasn_and_wait_for_state(self, byoasn_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_byoasn` and waits for the :py:class:`~oci.core.models.Byoasn` acted upon
to enter the given state(s).
:param str byoasn_id: (required)
The `OCID`__ of the `Byoasn` resource.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Byoasn.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_byoasn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_byoasn(byoasn_id)
operation_result = None
try:
operation_result = self.client.delete_byoasn(byoasn_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_byoasn, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_byoip_range_and_wait_for_work_request(self, byoip_range_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_byoip_range` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str byoip_range_id: (required)
The `OCID`__ of the `ByoipRange` resource containing the BYOIP CIDR block.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_byoip_range`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.delete_byoip_range(byoip_range_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_capture_filter_and_wait_for_state(self, capture_filter_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_capture_filter` and waits for the :py:class:`~oci.core.models.CaptureFilter` acted upon
to enter the given state(s).
:param str capture_filter_id: (required)
The `OCID`__ of the capture filter.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CaptureFilter.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_capture_filter`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_capture_filter(capture_filter_id)
operation_result = None
try:
operation_result = self.client.delete_capture_filter(capture_filter_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_capture_filter, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_cross_connect_and_wait_for_state(self, cross_connect_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_cross_connect` and waits for the :py:class:`~oci.core.models.CrossConnect` acted upon
to enter the given state(s).
:param str cross_connect_id: (required)
The `OCID`__ of the cross-connect.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CrossConnect.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_cross_connect`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_cross_connect(cross_connect_id)
operation_result = None
try:
operation_result = self.client.delete_cross_connect(cross_connect_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_cross_connect, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_cross_connect_group_and_wait_for_state(self, cross_connect_group_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_cross_connect_group` and waits for the :py:class:`~oci.core.models.CrossConnectGroup` acted upon
to enter the given state(s).
:param str cross_connect_group_id: (required)
The `OCID`__ of the cross-connect group.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CrossConnectGroup.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_cross_connect_group`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_cross_connect_group(cross_connect_group_id)
operation_result = None
try:
operation_result = self.client.delete_cross_connect_group(cross_connect_group_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_cross_connect_group, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_dhcp_options_and_wait_for_state(self, dhcp_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_dhcp_options` and waits for the :py:class:`~oci.core.models.DhcpOptions` acted upon
to enter the given state(s).
:param str dhcp_id: (required)
The `OCID`__ for the set of DHCP options.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DhcpOptions.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_dhcp_options`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_dhcp_options(dhcp_id)
operation_result = None
try:
operation_result = self.client.delete_dhcp_options(dhcp_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_dhcp_options, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_drg_and_wait_for_state(self, drg_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_drg` and waits for the :py:class:`~oci.core.models.Drg` acted upon
to enter the given state(s).
:param str drg_id: (required)
The `OCID`__ of the DRG.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Drg.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_drg`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_drg(drg_id)
operation_result = None
try:
operation_result = self.client.delete_drg(drg_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_drg, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_drg_attachment_and_wait_for_state(self, drg_attachment_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_drg_attachment` and waits for the :py:class:`~oci.core.models.DrgAttachment` acted upon
to enter the given state(s).
:param str drg_attachment_id: (required)
The `OCID`__ of the DRG attachment.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgAttachment.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_drg_attachment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_drg_attachment(drg_attachment_id)
operation_result = None
try:
operation_result = self.client.delete_drg_attachment(drg_attachment_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_drg_attachment, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_drg_route_distribution_and_wait_for_state(self, drg_route_distribution_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_drg_route_distribution` and waits for the :py:class:`~oci.core.models.DrgRouteDistribution` acted upon
to enter the given state(s).
:param str drg_route_distribution_id: (required)
The `OCID`__ of the route distribution.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgRouteDistribution.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_drg_route_distribution`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_drg_route_distribution(drg_route_distribution_id)
operation_result = None
try:
operation_result = self.client.delete_drg_route_distribution(drg_route_distribution_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_drg_route_distribution, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_drg_route_table_and_wait_for_state(self, drg_route_table_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_drg_route_table` and waits for the :py:class:`~oci.core.models.DrgRouteTable` acted upon
to enter the given state(s).
:param str drg_route_table_id: (required)
The `OCID`__ of the DRG route table.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgRouteTable.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_drg_route_table`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_drg_route_table(drg_route_table_id)
operation_result = None
try:
operation_result = self.client.delete_drg_route_table(drg_route_table_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_drg_route_table, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_internet_gateway_and_wait_for_state(self, ig_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_internet_gateway` and waits for the :py:class:`~oci.core.models.InternetGateway` acted upon
to enter the given state(s).
:param str ig_id: (required)
The `OCID`__ of the internet gateway.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.InternetGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_internet_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_internet_gateway(ig_id)
operation_result = None
try:
operation_result = self.client.delete_internet_gateway(ig_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_internet_gateway, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_ip_sec_connection_and_wait_for_state(self, ipsc_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_ip_sec_connection` and waits for the :py:class:`~oci.core.models.IPSecConnection` acted upon
to enter the given state(s).
:param str ipsc_id: (required)
The `OCID`__ of the IPSec connection.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.IPSecConnection.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_ip_sec_connection`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_ip_sec_connection(ipsc_id)
operation_result = None
try:
operation_result = self.client.delete_ip_sec_connection(ipsc_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_ip_sec_connection, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_ipv6_and_wait_for_state(self, ipv6_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_ipv6` and waits for the :py:class:`~oci.core.models.Ipv6` acted upon
to enter the given state(s).
:param str ipv6_id: (required)
The `OCID`__ of the IPv6.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Ipv6.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_ipv6`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_ipv6(ipv6_id)
operation_result = None
try:
operation_result = self.client.delete_ipv6(ipv6_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_ipv6, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_local_peering_gateway_and_wait_for_state(self, local_peering_gateway_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_local_peering_gateway` and waits for the :py:class:`~oci.core.models.LocalPeeringGateway` acted upon
to enter the given state(s).
:param str local_peering_gateway_id: (required)
The `OCID`__ of the local peering gateway.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.LocalPeeringGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_local_peering_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_local_peering_gateway(local_peering_gateway_id)
operation_result = None
try:
operation_result = self.client.delete_local_peering_gateway(local_peering_gateway_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_local_peering_gateway, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_nat_gateway_and_wait_for_state(self, nat_gateway_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_nat_gateway` and waits for the :py:class:`~oci.core.models.NatGateway` acted upon
to enter the given state(s).
:param str nat_gateway_id: (required)
The NAT gateway's `OCID`__.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.NatGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_nat_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_nat_gateway(nat_gateway_id)
operation_result = None
try:
operation_result = self.client.delete_nat_gateway(nat_gateway_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_nat_gateway, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_network_security_group_and_wait_for_state(self, network_security_group_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_network_security_group` and waits for the :py:class:`~oci.core.models.NetworkSecurityGroup` acted upon
to enter the given state(s).
:param str network_security_group_id: (required)
The `OCID`__ of the network security group.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.NetworkSecurityGroup.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_network_security_group`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_network_security_group(network_security_group_id)
operation_result = None
try:
operation_result = self.client.delete_network_security_group(network_security_group_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_network_security_group, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_public_ip_and_wait_for_state(self, public_ip_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_public_ip` and waits for the :py:class:`~oci.core.models.PublicIp` acted upon
to enter the given state(s).
:param str public_ip_id: (required)
The `OCID`__ of the public IP.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIp.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_public_ip`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_public_ip(public_ip_id)
operation_result = None
try:
operation_result = self.client.delete_public_ip(public_ip_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_public_ip, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_public_ip_pool_and_wait_for_state(self, public_ip_pool_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_public_ip_pool` and waits for the :py:class:`~oci.core.models.PublicIpPool` acted upon
to enter the given state(s).
:param str public_ip_pool_id: (required)
The `OCID`__ of the public IP pool.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIpPool.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_public_ip_pool`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_public_ip_pool(public_ip_pool_id)
operation_result = None
try:
operation_result = self.client.delete_public_ip_pool(public_ip_pool_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_public_ip_pool, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_remote_peering_connection_and_wait_for_state(self, remote_peering_connection_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_remote_peering_connection` and waits for the :py:class:`~oci.core.models.RemotePeeringConnection` acted upon
to enter the given state(s).
:param str remote_peering_connection_id: (required)
The `OCID`__ of the remote peering connection (RPC).
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.RemotePeeringConnection.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_remote_peering_connection`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_remote_peering_connection(remote_peering_connection_id)
operation_result = None
try:
operation_result = self.client.delete_remote_peering_connection(remote_peering_connection_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_remote_peering_connection, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_route_table_and_wait_for_state(self, rt_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_route_table` and waits for the :py:class:`~oci.core.models.RouteTable` acted upon
to enter the given state(s).
:param str rt_id: (required)
The `OCID`__ of the route table.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.RouteTable.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_route_table`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_route_table(rt_id)
operation_result = None
try:
operation_result = self.client.delete_route_table(rt_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_route_table, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_security_list_and_wait_for_state(self, security_list_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_security_list` and waits for the :py:class:`~oci.core.models.SecurityList` acted upon
to enter the given state(s).
:param str security_list_id: (required)
The `OCID`__ of the security list.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.SecurityList.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_security_list`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_security_list(security_list_id)
operation_result = None
try:
operation_result = self.client.delete_security_list(security_list_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_security_list, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_service_gateway_and_wait_for_state(self, service_gateway_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_service_gateway` and waits for the :py:class:`~oci.core.models.ServiceGateway` acted upon
to enter the given state(s).
:param str service_gateway_id: (required)
The service gateway's `OCID`__.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.ServiceGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_service_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_service_gateway(service_gateway_id)
operation_result = None
try:
operation_result = self.client.delete_service_gateway(service_gateway_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_service_gateway, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_subnet_and_wait_for_state(self, subnet_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_subnet` and waits for the :py:class:`~oci.core.models.Subnet` acted upon
to enter the given state(s).
:param str subnet_id: (required)
Specify the `OCID`__ of the subnet.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Subnet.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_subnet`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_subnet(subnet_id)
operation_result = None
try:
operation_result = self.client.delete_subnet(subnet_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_subnet, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_vcn_and_wait_for_state(self, vcn_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_vcn` and waits for the :py:class:`~oci.core.models.Vcn` acted upon
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vcn.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_vcn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_vcn(vcn_id)
operation_result = None
try:
operation_result = self.client.delete_vcn(vcn_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_vcn, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_virtual_circuit_and_wait_for_state(self, virtual_circuit_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_virtual_circuit` and waits for the :py:class:`~oci.core.models.VirtualCircuit` acted upon
to enter the given state(s).
:param str virtual_circuit_id: (required)
The `OCID`__ of the virtual circuit.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.VirtualCircuit.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_virtual_circuit`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_virtual_circuit(virtual_circuit_id)
operation_result = None
try:
operation_result = self.client.delete_virtual_circuit(virtual_circuit_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_virtual_circuit, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_vlan_and_wait_for_state(self, vlan_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_vlan` and waits for the :py:class:`~oci.core.models.Vlan` acted upon
to enter the given state(s).
:param str vlan_id: (required)
The `OCID`__ of the VLAN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vlan.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_vlan`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_vlan(vlan_id)
operation_result = None
try:
operation_result = self.client.delete_vlan(vlan_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_vlan, 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")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_vtap_and_wait_for_work_request(self, vtap_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.delete_vtap` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vtap_id: (required)
The `OCID`__ of the VTAP.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.delete_vtap`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.delete_vtap(vtap_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def detach_service_id_and_wait_for_state(self, service_gateway_id, detach_service_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.detach_service_id` and waits for the :py:class:`~oci.core.models.ServiceGateway` acted upon
to enter the given state(s).
:param str service_gateway_id: (required)
The service gateway's `OCID`__.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ServiceIdRequestDetails detach_service_details: (required)
ServiceId of Service to be detached from a service gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.ServiceGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.detach_service_id`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.detach_service_id(service_gateway_id, detach_service_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
service_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_service_gateway(service_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def get_vcn_overlap_and_wait_for_work_request(self, vcn_id, get_vcn_overlap_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.get_vcn_overlap` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.GetIpInventoryVcnOverlapDetails get_vcn_overlap_details: (required)
Lists details of the IP Inventory VCN overlap data.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.get_vcn_overlap`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.get_vcn_overlap(vcn_id, get_vcn_overlap_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def ipv6_vnic_detach_and_wait_for_state(self, ipv6_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.ipv6_vnic_detach` and waits for the :py:class:`~oci.core.models.Ipv6` acted upon
to enter the given state(s).
:param str ipv6_id: (required)
The `OCID`__ of the IPv6.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Ipv6.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.ipv6_vnic_detach`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.ipv6_vnic_detach(ipv6_id, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ipv6_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_ipv6(ipv6_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def list_ip_inventory_and_wait_for_work_request(self, list_ip_inventory_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.list_ip_inventory` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param oci.core.models.ListIpInventoryDetails list_ip_inventory_details: (required)
Details required to list the IP Inventory data.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.list_ip_inventory`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.list_ip_inventory(list_ip_inventory_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def modify_vcn_cidr_and_wait_for_work_request(self, vcn_id, modify_vcn_cidr_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.modify_vcn_cidr` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.ModifyVcnCidrDetails modify_vcn_cidr_details: (required)
Details object for updating a VCN CIDR.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.modify_vcn_cidr`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.modify_vcn_cidr(vcn_id, modify_vcn_cidr_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def remove_export_drg_route_distribution_and_wait_for_state(self, drg_attachment_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.remove_export_drg_route_distribution` and waits for the :py:class:`~oci.core.models.DrgAttachment` acted upon
to enter the given state(s).
:param str drg_attachment_id: (required)
The `OCID`__ of the DRG attachment.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgAttachment.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.remove_export_drg_route_distribution`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.remove_export_drg_route_distribution(drg_attachment_id, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_attachment_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_attachment(drg_attachment_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def remove_import_drg_route_distribution_and_wait_for_state(self, drg_route_table_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.remove_import_drg_route_distribution` and waits for the :py:class:`~oci.core.models.DrgRouteTable` acted upon
to enter the given state(s).
:param str drg_route_table_id: (required)
The `OCID`__ of the DRG route table.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgRouteTable.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.remove_import_drg_route_distribution`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.remove_import_drg_route_distribution(drg_route_table_id, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_route_table_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_route_table(drg_route_table_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def remove_ipv6_subnet_cidr_and_wait_for_work_request(self, subnet_id, remove_subnet_ipv6_cidr_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.remove_ipv6_subnet_cidr` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str subnet_id: (required)
Specify the `OCID`__ of the subnet.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.RemoveSubnetIpv6CidrDetails remove_subnet_ipv6_cidr_details: (required)
Details object for removing an IPv6 SUBNET prefix.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.remove_ipv6_subnet_cidr`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.remove_ipv6_subnet_cidr(subnet_id, remove_subnet_ipv6_cidr_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def remove_ipv6_vcn_cidr_and_wait_for_work_request(self, vcn_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.remove_ipv6_vcn_cidr` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.remove_ipv6_vcn_cidr`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.remove_ipv6_vcn_cidr(vcn_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def remove_public_ip_pool_capacity_and_wait_for_state(self, public_ip_pool_id, remove_public_ip_pool_capacity_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.remove_public_ip_pool_capacity` and waits for the :py:class:`~oci.core.models.PublicIpPool` acted upon
to enter the given state(s).
:param str public_ip_pool_id: (required)
The `OCID`__ of the public IP pool.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.RemovePublicIpPoolCapacityDetails remove_public_ip_pool_capacity_details: (required)
The CIDR block to remove from the IP pool.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIpPool.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.remove_public_ip_pool_capacity`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.remove_public_ip_pool_capacity(public_ip_pool_id, remove_public_ip_pool_capacity_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
public_ip_pool_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_public_ip_pool(public_ip_pool_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def remove_vcn_cidr_and_wait_for_work_request(self, vcn_id, remove_vcn_cidr_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.remove_vcn_cidr` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.RemoveVcnCidrDetails remove_vcn_cidr_details: (required)
Details object for removing a VCN CIDR.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.remove_vcn_cidr`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.remove_vcn_cidr(vcn_id, remove_vcn_cidr_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def set_origin_asn_and_wait_for_work_request(self, byoip_range_id, set_origin_asn_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.set_origin_asn` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str byoip_range_id: (required)
The `OCID`__ of the `ByoipRange` resource containing the BYOIP CIDR block.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.SetOriginAsnDetails set_origin_asn_details: (required)
ASN details
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.set_origin_asn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.set_origin_asn(byoip_range_id, set_origin_asn_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_byoasn_and_wait_for_state(self, byoasn_id, update_byoasn_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_byoasn` and waits for the :py:class:`~oci.core.models.Byoasn` acted upon
to enter the given state(s).
:param str byoasn_id: (required)
The `OCID`__ of the `Byoasn` resource.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateByoasnDetails update_byoasn_details: (required)
Byoasn Range details.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Byoasn.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_byoasn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_byoasn(byoasn_id, update_byoasn_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
byoasn_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_byoasn(byoasn_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_byoip_range_and_wait_for_state(self, byoip_range_id, update_byoip_range_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_byoip_range` and waits for the :py:class:`~oci.core.models.ByoipRange` acted upon
to enter the given state(s).
:param str byoip_range_id: (required)
The `OCID`__ of the `ByoipRange` resource containing the BYOIP CIDR block.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateByoipRangeDetails update_byoip_range_details: (required)
Byoip Range details.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.ByoipRange.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_byoip_range`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_byoip_range(byoip_range_id, update_byoip_range_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
byoip_range_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_byoip_range(byoip_range_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_capture_filter_and_wait_for_state(self, capture_filter_id, update_capture_filter_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_capture_filter` and waits for the :py:class:`~oci.core.models.CaptureFilter` acted upon
to enter the given state(s).
:param str capture_filter_id: (required)
The `OCID`__ of the capture filter.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateCaptureFilterDetails update_capture_filter_details: (required)
Details object for updating a VTAP.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CaptureFilter.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_capture_filter`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_capture_filter(capture_filter_id, update_capture_filter_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
capture_filter_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_capture_filter(capture_filter_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_cross_connect_and_wait_for_state(self, cross_connect_id, update_cross_connect_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_cross_connect` and waits for the :py:class:`~oci.core.models.CrossConnect` acted upon
to enter the given state(s).
:param str cross_connect_id: (required)
The `OCID`__ of the cross-connect.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateCrossConnectDetails update_cross_connect_details: (required)
Update CrossConnect fields.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CrossConnect.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_cross_connect`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_cross_connect(cross_connect_id, update_cross_connect_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
cross_connect_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_cross_connect(cross_connect_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_cross_connect_group_and_wait_for_state(self, cross_connect_group_id, update_cross_connect_group_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_cross_connect_group` and waits for the :py:class:`~oci.core.models.CrossConnectGroup` acted upon
to enter the given state(s).
:param str cross_connect_group_id: (required)
The `OCID`__ of the cross-connect group.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateCrossConnectGroupDetails update_cross_connect_group_details: (required)
Update CrossConnectGroup fields
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.CrossConnectGroup.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_cross_connect_group`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_cross_connect_group(cross_connect_group_id, update_cross_connect_group_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
cross_connect_group_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_cross_connect_group(cross_connect_group_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_dhcp_options_and_wait_for_state(self, dhcp_id, update_dhcp_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_dhcp_options` and waits for the :py:class:`~oci.core.models.DhcpOptions` acted upon
to enter the given state(s).
:param str dhcp_id: (required)
The `OCID`__ for the set of DHCP options.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateDhcpDetails update_dhcp_details: (required)
Request object for updating a set of DHCP options.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DhcpOptions.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_dhcp_options`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_dhcp_options(dhcp_id, update_dhcp_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
dhcp_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_dhcp_options(dhcp_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_drg_and_wait_for_state(self, drg_id, update_drg_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_drg` and waits for the :py:class:`~oci.core.models.Drg` acted upon
to enter the given state(s).
:param str drg_id: (required)
The `OCID`__ of the DRG.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateDrgDetails update_drg_details: (required)
Details object for updating a DRG.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Drg.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_drg`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_drg(drg_id, update_drg_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg(drg_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_drg_attachment_and_wait_for_state(self, drg_attachment_id, update_drg_attachment_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_drg_attachment` and waits for the :py:class:`~oci.core.models.DrgAttachment` acted upon
to enter the given state(s).
:param str drg_attachment_id: (required)
The `OCID`__ of the DRG attachment.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateDrgAttachmentDetails update_drg_attachment_details: (required)
Details object for updating a `DrgAttachment`.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgAttachment.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_drg_attachment`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_drg_attachment(drg_attachment_id, update_drg_attachment_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_attachment_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_attachment(drg_attachment_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_drg_route_distribution_and_wait_for_state(self, drg_route_distribution_id, update_drg_route_distribution_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_drg_route_distribution` and waits for the :py:class:`~oci.core.models.DrgRouteDistribution` acted upon
to enter the given state(s).
:param str drg_route_distribution_id: (required)
The `OCID`__ of the route distribution.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateDrgRouteDistributionDetails update_drg_route_distribution_details: (required)
Details object for updating a route distribution
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgRouteDistribution.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_drg_route_distribution`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_drg_route_distribution(drg_route_distribution_id, update_drg_route_distribution_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_route_distribution_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_route_distribution(drg_route_distribution_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_drg_route_table_and_wait_for_state(self, drg_route_table_id, update_drg_route_table_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_drg_route_table` and waits for the :py:class:`~oci.core.models.DrgRouteTable` acted upon
to enter the given state(s).
:param str drg_route_table_id: (required)
The `OCID`__ of the DRG route table.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateDrgRouteTableDetails update_drg_route_table_details: (required)
Details object used to updating a DRG route table.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.DrgRouteTable.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_drg_route_table`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_drg_route_table(drg_route_table_id, update_drg_route_table_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
drg_route_table_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_drg_route_table(drg_route_table_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_internet_gateway_and_wait_for_state(self, ig_id, update_internet_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_internet_gateway` and waits for the :py:class:`~oci.core.models.InternetGateway` acted upon
to enter the given state(s).
:param str ig_id: (required)
The `OCID`__ of the internet gateway.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateInternetGatewayDetails update_internet_gateway_details: (required)
Details for updating the internet gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.InternetGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_internet_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_internet_gateway(ig_id, update_internet_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ig_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_internet_gateway(ig_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_ip_sec_connection_and_wait_for_state(self, ipsc_id, update_ip_sec_connection_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_ip_sec_connection` and waits for the :py:class:`~oci.core.models.IPSecConnection` acted upon
to enter the given state(s).
:param str ipsc_id: (required)
The `OCID`__ of the IPSec connection.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateIPSecConnectionDetails update_ip_sec_connection_details: (required)
Details object for updating an IPSec connection.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.IPSecConnection.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_ip_sec_connection`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_ip_sec_connection(ipsc_id, update_ip_sec_connection_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ipsc_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_ip_sec_connection(ipsc_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_ip_sec_connection_tunnel_and_wait_for_state(self, ipsc_id, tunnel_id, update_ip_sec_connection_tunnel_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_ip_sec_connection_tunnel` and waits for the :py:class:`~oci.core.models.IPSecConnectionTunnel` acted upon
to enter the given state(s).
:param str ipsc_id: (required)
The `OCID`__ of the IPSec connection.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param str tunnel_id: (required)
The `OCID`__ of the tunnel.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateIPSecConnectionTunnelDetails update_ip_sec_connection_tunnel_details: (required)
Details object for updating a IPSecConnection tunnel's details.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.IPSecConnectionTunnel.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_ip_sec_connection_tunnel`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_ip_sec_connection_tunnel(ipsc_id, tunnel_id, update_ip_sec_connection_tunnel_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ipsc_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_ip_sec_connection_tunnel(ipsc_id, tunnel_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_ipv6_and_wait_for_state(self, ipv6_id, update_ipv6_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_ipv6` and waits for the :py:class:`~oci.core.models.Ipv6` acted upon
to enter the given state(s).
:param str ipv6_id: (required)
The `OCID`__ of the IPv6.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateIpv6Details update_ipv6_details: (required)
IPv6 details to be updated.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Ipv6.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_ipv6`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_ipv6(ipv6_id, update_ipv6_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
ipv6_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_ipv6(ipv6_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_local_peering_gateway_and_wait_for_state(self, local_peering_gateway_id, update_local_peering_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_local_peering_gateway` and waits for the :py:class:`~oci.core.models.LocalPeeringGateway` acted upon
to enter the given state(s).
:param str local_peering_gateway_id: (required)
The `OCID`__ of the local peering gateway.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateLocalPeeringGatewayDetails update_local_peering_gateway_details: (required)
Details object for updating a local peering gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.LocalPeeringGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_local_peering_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_local_peering_gateway(local_peering_gateway_id, update_local_peering_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
local_peering_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_local_peering_gateway(local_peering_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_nat_gateway_and_wait_for_state(self, nat_gateway_id, update_nat_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_nat_gateway` and waits for the :py:class:`~oci.core.models.NatGateway` acted upon
to enter the given state(s).
:param str nat_gateway_id: (required)
The NAT gateway's `OCID`__.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateNatGatewayDetails update_nat_gateway_details: (required)
Details object for updating a NAT gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.NatGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_nat_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_nat_gateway(nat_gateway_id, update_nat_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
nat_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_nat_gateway(nat_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_network_security_group_and_wait_for_state(self, network_security_group_id, update_network_security_group_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_network_security_group` and waits for the :py:class:`~oci.core.models.NetworkSecurityGroup` acted upon
to enter the given state(s).
:param str network_security_group_id: (required)
The `OCID`__ of the network security group.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateNetworkSecurityGroupDetails update_network_security_group_details: (required)
Details object for updating a network security group.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.NetworkSecurityGroup.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_network_security_group`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_network_security_group(network_security_group_id, update_network_security_group_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
network_security_group_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_network_security_group(network_security_group_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_public_ip_and_wait_for_state(self, public_ip_id, update_public_ip_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_public_ip` and waits for the :py:class:`~oci.core.models.PublicIp` acted upon
to enter the given state(s).
:param str public_ip_id: (required)
The `OCID`__ of the public IP.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdatePublicIpDetails update_public_ip_details: (required)
Public IP details.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIp.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_public_ip`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_public_ip(public_ip_id, update_public_ip_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
public_ip_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_public_ip(public_ip_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_public_ip_pool_and_wait_for_state(self, public_ip_pool_id, update_public_ip_pool_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_public_ip_pool` and waits for the :py:class:`~oci.core.models.PublicIpPool` acted upon
to enter the given state(s).
:param str public_ip_pool_id: (required)
The `OCID`__ of the public IP pool.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdatePublicIpPoolDetails update_public_ip_pool_details: (required)
Public IP pool details.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.PublicIpPool.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_public_ip_pool`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_public_ip_pool(public_ip_pool_id, update_public_ip_pool_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
public_ip_pool_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_public_ip_pool(public_ip_pool_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_remote_peering_connection_and_wait_for_state(self, remote_peering_connection_id, update_remote_peering_connection_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_remote_peering_connection` and waits for the :py:class:`~oci.core.models.RemotePeeringConnection` acted upon
to enter the given state(s).
:param str remote_peering_connection_id: (required)
The `OCID`__ of the remote peering connection (RPC).
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateRemotePeeringConnectionDetails update_remote_peering_connection_details: (required)
Request to the update the peering connection to remote region
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.RemotePeeringConnection.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_remote_peering_connection`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_remote_peering_connection(remote_peering_connection_id, update_remote_peering_connection_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
remote_peering_connection_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_remote_peering_connection(remote_peering_connection_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_route_table_and_wait_for_state(self, rt_id, update_route_table_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_route_table` and waits for the :py:class:`~oci.core.models.RouteTable` acted upon
to enter the given state(s).
:param str rt_id: (required)
The `OCID`__ of the route table.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateRouteTableDetails update_route_table_details: (required)
Details object for updating a route table.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.RouteTable.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_route_table`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_route_table(rt_id, update_route_table_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
rt_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_route_table(rt_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_security_list_and_wait_for_state(self, security_list_id, update_security_list_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_security_list` and waits for the :py:class:`~oci.core.models.SecurityList` acted upon
to enter the given state(s).
:param str security_list_id: (required)
The `OCID`__ of the security list.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateSecurityListDetails update_security_list_details: (required)
Updated details for the security list.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.SecurityList.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_security_list`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_security_list(security_list_id, update_security_list_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
security_list_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_security_list(security_list_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_service_gateway_and_wait_for_state(self, service_gateway_id, update_service_gateway_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_service_gateway` and waits for the :py:class:`~oci.core.models.ServiceGateway` acted upon
to enter the given state(s).
:param str service_gateway_id: (required)
The service gateway's `OCID`__.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateServiceGatewayDetails update_service_gateway_details: (required)
Details object for updating a service gateway.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.ServiceGateway.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_service_gateway`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_service_gateway(service_gateway_id, update_service_gateway_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
service_gateway_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_service_gateway(service_gateway_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_subnet_and_wait_for_state(self, subnet_id, update_subnet_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_subnet` and waits for the :py:class:`~oci.core.models.Subnet` acted upon
to enter the given state(s).
:param str subnet_id: (required)
Specify the `OCID`__ of the subnet.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateSubnetDetails update_subnet_details: (required)
Details object for updating a subnet.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Subnet.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_subnet`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_subnet(subnet_id, update_subnet_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
subnet_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_subnet(subnet_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_vcn_and_wait_for_state(self, vcn_id, update_vcn_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_vcn` and waits for the :py:class:`~oci.core.models.Vcn` acted upon
to enter the given state(s).
:param str vcn_id: (required)
Specify the `OCID`__ of the VCN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateVcnDetails update_vcn_details: (required)
Details object for updating a VCN.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vcn.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_vcn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_vcn(vcn_id, update_vcn_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
vcn_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_vcn(vcn_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_virtual_circuit_and_wait_for_state(self, virtual_circuit_id, update_virtual_circuit_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_virtual_circuit` and waits for the :py:class:`~oci.core.models.VirtualCircuit` acted upon
to enter the given state(s).
:param str virtual_circuit_id: (required)
The `OCID`__ of the virtual circuit.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateVirtualCircuitDetails update_virtual_circuit_details: (required)
Update VirtualCircuit fields.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.VirtualCircuit.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_virtual_circuit`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_virtual_circuit(virtual_circuit_id, update_virtual_circuit_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
virtual_circuit_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_virtual_circuit(virtual_circuit_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_vlan_and_wait_for_state(self, vlan_id, update_vlan_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_vlan` and waits for the :py:class:`~oci.core.models.Vlan` acted upon
to enter the given state(s).
:param str vlan_id: (required)
The `OCID`__ of the VLAN.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateVlanDetails update_vlan_details: (required)
Details object for updating a subnet.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vlan.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_vlan`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_vlan(vlan_id, update_vlan_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
vlan_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_vlan(vlan_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_vnic_and_wait_for_state(self, vnic_id, update_vnic_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_vnic` and waits for the :py:class:`~oci.core.models.Vnic` acted upon
to enter the given state(s).
:param str vnic_id: (required)
The `OCID`__ of the VNIC.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateVnicDetails update_vnic_details: (required)
Details object for updating a VNIC.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vnic.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_vnic`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_vnic(vnic_id, update_vnic_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
vnic_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_vnic(vnic_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_vtap_and_wait_for_work_request(self, vtap_id, update_vtap_details, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_vtap` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str vtap_id: (required)
The `OCID`__ of the VTAP.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateVtapDetails update_vtap_details: (required)
Details object for updating a VTAP.
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_vtap`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_vtap(vtap_id, update_vtap_details, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_vtap_and_wait_for_state(self, vtap_id, update_vtap_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.update_vtap` and waits for the :py:class:`~oci.core.models.Vtap` acted upon
to enter the given state(s).
:param str vtap_id: (required)
The `OCID`__ of the VTAP.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param oci.core.models.UpdateVtapDetails update_vtap_details: (required)
Details object for updating a VTAP.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.core.models.Vtap.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.update_vtap`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_vtap(vtap_id, update_vtap_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
vtap_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_vtap(vtap_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
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"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def upgrade_drg_and_wait_for_work_request(self, drg_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.upgrade_drg` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str drg_id: (required)
The `OCID`__ of the DRG.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.upgrade_drg`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.upgrade_drg(drg_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def validate_byoasn_and_wait_for_work_request(self, byoasn_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.validate_byoasn` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str byoasn_id: (required)
The `OCID`__ of the `Byoasn` resource.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.validate_byoasn`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.validate_byoasn(byoasn_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def validate_byoip_range_and_wait_for_work_request(self, byoip_range_id, work_request_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.core.VirtualNetworkClient.validate_byoip_range` and waits for the oci.work_requests.models.WorkRequest
to enter the given state(s).
:param str byoip_range_id: (required)
The `OCID`__ of the `ByoipRange` resource containing the BYOIP CIDR block.
__ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
:param list[str] work_request_states: (optional)
An array of work requests states to wait on. These should be valid values for :py:attr:`~oci.work_requests.models.WorkRequest.status`
Default values are termination states: [STATUS_SUCCEEDED, STATUS_FAILED, STATUS_CANCELED]
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.core.VirtualNetworkClient.validate_byoip_range`
:param dict waiter_kwargs:
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``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.validate_byoip_range(byoip_range_id, **operation_kwargs)
work_request_states = work_request_states if work_request_states else oci.waiter._WORK_REQUEST_TERMINATION_STATES
lowered_work_request_states = [w.lower() for w in work_request_states]
if 'opc-work-request-id' not in operation_result.headers:
return operation_result
work_request_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self._work_request_client,
self._work_request_client.get_work_request(work_request_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_work_request_states,
**waiter_kwargs
)
return waiter_result
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)