Skip to content

create_private_connection async

create_private_connection(
    name: PrivateConnectionName,
    mode: PrivateConnectionMode,
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    tags: Optional[Tags] = None,
) -> CreatePrivateConnectionOutput

Creates a Private Connection to a target resource.

Parameters:

Raises:

Source code in docs_src/capo_devops_agent/_services/async_dev_ops_agent.py
async def create_private_connection(
    self,
    name: "capo_devops_agent.types.private_connection_name.PrivateConnectionName",
    mode: "capo_devops_agent.types.private_connection_mode.PrivateConnectionMode",
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    tags: Optional["capo_devops_agent.types.tags.Tags"] = None,
) -> "capo_devops_agent.types.create_private_connection_output.CreatePrivateConnectionOutput":
    """<p>Creates a Private Connection to a target resource.</p>

    Args:
        name: <p>Unique name for this Private Connection within the account.</p>
        mode: <p>Private Connection mode configuration.</p>
        tags: <p>Tags to add to the Private Connection at creation time.</p>

    Raises:
        capo_devops_agent.errors.access_denied_exception.AccessDeniedException: <p>Access to the requested resource is denied due to insufficient permissions.</p>
        capo_devops_agent.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_devops_agent.errors.content_size_exceeded_exception.ContentSizeExceededException: <p>This exception is thrown when the content size exceeds the allowed limit.</p>
        capo_devops_agent.errors.internal_server_exception.InternalServerException: <p>This exception is thrown when an unexpected error occurs in the processing of a request.</p>
        capo_devops_agent.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters provided in the request are invalid.</p>
        capo_devops_agent.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_devops_agent.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed the service quota limit.</p>
        capo_devops_agent.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Please slow down and try again.</p>
        capo_devops_agent.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_devops_agent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_devops_agent.types.create_private_connection_input.CreatePrivateConnectionInput]",
    ) -> AsyncOperationResponse[
        "capo_devops_agent.types.create_private_connection_output.CreatePrivateConnectionOutput"
    ]:
        import capo_devops_agent._operations.dev_ops_agent.create_private_connection

        (
            output,
            http_response,
        ) = await capo_devops_agent._operations.dev_ops_agent.create_private_connection.async_create_private_connection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePrivateConnection")
    )
    input_: capo_devops_agent.types.create_private_connection_input.CreatePrivateConnectionInput = {
        "name": name,
        "mode": mode,
    }
    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