Skip to content

list_attachments async

list_attachments(
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    core_network_id: Optional[CoreNetworkId] = None,
    attachment_type: Optional[AttachmentType] = None,
    edge_location: Optional[ExternalRegionCode] = None,
    state: Optional[AttachmentState] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListAttachmentsResponse

Returns a list of core network attachments.

Parameters:

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def list_attachments(
    self,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    core_network_id: Optional[
        "capo_networkmanager.types.core_network_id.CoreNetworkId"
    ] = None,
    attachment_type: Optional[
        "capo_networkmanager.types.attachment_type.AttachmentType"
    ] = None,
    edge_location: Optional[
        "capo_networkmanager.types.external_region_code.ExternalRegionCode"
    ] = None,
    state: Optional[
        "capo_networkmanager.types.attachment_state.AttachmentState"
    ] = None,
    max_results: Optional[
        "capo_networkmanager.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_networkmanager.types.next_token.NextToken"] = None,
) -> "capo_networkmanager.types.list_attachments_response.ListAttachmentsResponse":
    """<p>Returns a list of core network attachments.</p>

    Args:
        core_network_id: <p>The ID of a core network.</p>
        attachment_type: <p>The type of attachment.</p>
        edge_location: <p>The Region where the edge is located.</p>
        state: <p>The state of the attachment.</p>
        max_results: <p>The maximum number of results to return.</p>
        next_token: <p>The token for the next page of results.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmanager.types.list_attachments_request.ListAttachmentsRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.list_attachments_response.ListAttachmentsResponse"
    ]:
        import capo_networkmanager._operations.network_manager.list_attachments

        (
            output,
            http_response,
        ) = await capo_networkmanager._operations.network_manager.list_attachments.async_list_attachments(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAttachments")
    )
    input_: capo_networkmanager.types.list_attachments_request.ListAttachmentsRequest = {}
    if core_network_id is not None:
        input_["core_network_id"] = core_network_id
    if attachment_type is not None:
        input_["attachment_type"] = attachment_type
    if edge_location is not None:
        input_["edge_location"] = edge_location
    if state is not None:
        input_["state"] = state
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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