Skip to content

create_odb_peering_connection async

create_odb_peering_connection(
    odb_network_id: ResourceIdOrArn,
    peer_network_id: ResourceIdOrArn,
    *,
    config_overrides: Optional[AsyncodbClientConfig] = None,
    display_name: Optional[ResourceDisplayName] = None,
    peer_network_cidrs_to_be_added: Optional[PeeredCidrList] = None,
    peer_network_route_table_ids: Optional[PeerNetworkRouteTableIdList] = None,
    client_token: Optional[GeneralInputString] = None,
    tags: Optional[RequestTagMap] = None,
) -> CreateOdbPeeringConnectionOutput

Creates a peering connection between an ODB network and a VPC.

A peering connection enables private connectivity between the networks for application-tier communication.

Parameters:

  • odb_network_id (ResourceIdOrArn) –

    The unique identifier of the ODB network that initiates the peering connection.

  • peer_network_id (ResourceIdOrArn) –

    The unique identifier of the peer network. This can be either a VPC ID or another ODB network ID.

  • display_name (Optional[ResourceDisplayName], default: None ) –

    The display name for the ODB peering connection.

  • peer_network_cidrs_to_be_added (Optional[PeeredCidrList], default: None ) –

    A list of CIDR blocks to add to the peering connection. These CIDR blocks define the IP address ranges that can communicate through the peering connection.

  • peer_network_route_table_ids (Optional[PeerNetworkRouteTableIdList], default: None ) –

    The unique identifier of the VPC route table for which a route to the ODB network is automatically created during peering connection establishment.

  • client_token (Optional[GeneralInputString], default: None ) –

    The client token for the ODB peering connection request.

    Constraints:

    • Must be unique for each request.

  • tags (Optional[RequestTagMap], default: None ) –

    The tags to assign to the ODB peering connection.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action. Make sure you have the required permissions and try again.

  • ConflictException –

    Occurs when a conflict with the current status of your resource. Fix any inconsistencies with your resource and try again.

  • InternalServerException –

    Occurs when there is an internal failure in the Oracle Database@Amazon Web Services service. Wait and try again.

  • ResourceNotFoundException –

    The operation tried to access a resource that doesn't exist. Make sure you provided the correct resource and try again.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request has failed validation because it is missing required fields or has invalid inputs.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_odb/_services/async_odb.py
async def create_odb_peering_connection(
    self,
    odb_network_id: "capo_odb.types.resource_id_or_arn.ResourceIdOrArn",
    peer_network_id: "capo_odb.types.resource_id_or_arn.ResourceIdOrArn",
    *,
    config_overrides: Optional[AsyncodbClientConfig] = None,
    display_name: Optional[
        "capo_odb.types.resource_display_name.ResourceDisplayName"
    ] = None,
    peer_network_cidrs_to_be_added: Optional[
        "capo_odb.types.peered_cidr_list.PeeredCidrList"
    ] = None,
    peer_network_route_table_ids: Optional[
        "capo_odb.types.peer_network_route_table_id_list.PeerNetworkRouteTableIdList"
    ] = None,
    client_token: Optional[
        "capo_odb.types.general_input_string.GeneralInputString"
    ] = None,
    tags: Optional["capo_odb.types.request_tag_map.RequestTagMap"] = None,
) -> "capo_odb.types.create_odb_peering_connection_output.CreateOdbPeeringConnectionOutput":
    """<p>Creates a peering connection between an ODB network and a VPC.</p> <p>A peering connection enables private connectivity between the networks for application-tier communication.</p>

    Args:
        odb_network_id: <p>The unique identifier of the ODB network that initiates the peering connection.</p>
        peer_network_id: <p>The unique identifier of the peer network. This can be either a VPC ID or another ODB network ID.</p>
        display_name: <p>The display name for the ODB peering connection.</p>
        peer_network_cidrs_to_be_added: <p>A list of CIDR blocks to add to the peering connection. These CIDR blocks define the IP address ranges that can communicate through the peering connection.</p>
        peer_network_route_table_ids: <p>The unique identifier of the VPC route table for which a route to the ODB network is automatically created during peering connection establishment.</p>
        client_token: <p>The client token for the ODB peering connection request.</p> <p>Constraints:</p> <ul> <li> <p>Must be unique for each request.</p> </li> </ul>
        tags: <p>The tags to assign to the ODB peering connection.</p>

    Raises:
        capo_odb.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action. Make sure you have the required permissions and try again.</p>
        capo_odb.errors.conflict_exception.ConflictException: <p>Occurs when a conflict with the current status of your resource. Fix any inconsistencies with your resource and try again.</p>
        capo_odb.errors.internal_server_exception.InternalServerException: <p>Occurs when there is an internal failure in the Oracle Database@Amazon Web Services service. Wait and try again.</p>
        capo_odb.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a resource that doesn't exist. Make sure you provided the correct resource and try again.</p>
        capo_odb.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_odb.errors.validation_exception.ValidationException: <p>The request has failed validation because it is missing required fields or has invalid inputs.</p>
        capo_odb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_odb.types.create_odb_peering_connection_input.CreateOdbPeeringConnectionInput]",
    ) -> AsyncOperationResponse[
        "capo_odb.types.create_odb_peering_connection_output.CreateOdbPeeringConnectionOutput"
    ]:
        import capo_odb._operations.odb.create_odb_peering_connection

        (
            output,
            http_response,
        ) = await capo_odb._operations.odb.create_odb_peering_connection.async_create_odb_peering_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateOdbPeeringConnection")
    )
    input_: capo_odb.types.create_odb_peering_connection_input.CreateOdbPeeringConnectionInput = {
        "odb_network_id": odb_network_id,
        "peer_network_id": peer_network_id,
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if peer_network_cidrs_to_be_added is not None:
        input_["peer_network_cidrs_to_be_added"] = peer_network_cidrs_to_be_added
    if peer_network_route_table_ids is not None:
        input_["peer_network_route_table_ids"] = peer_network_route_table_ids
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output