Skip to content

list_tunnels async

list_tunnels(
    *,
    config_overrides: Optional[AsyncIoTSecureTunnelingClientConfig] = None,
    thing_name: Optional[ThingName] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListTunnelsResponse

List all tunnels for an Amazon Web Services account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels.

Requires permission to access the ListTunnels action.

Parameters:

  • thing_name (Optional[ThingName], default: None ) –

    The name of the IoT thing associated with the destination device.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return at once.

  • next_token (Optional[NextToken], default: None ) –

    To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

Raises:

Source code in docs_src/capo_iotsecuretunneling/_services/async_io_t_secure_tunneling.py
async def list_tunnels(
    self,
    *,
    config_overrides: Optional[AsyncIoTSecureTunnelingClientConfig] = None,
    thing_name: Optional[
        "capo_iotsecuretunneling.types.thing_name.ThingName"
    ] = None,
    max_results: Optional[
        "capo_iotsecuretunneling.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_iotsecuretunneling.types.next_token.NextToken"
    ] = None,
) -> "capo_iotsecuretunneling.types.list_tunnels_response.ListTunnelsResponse":
    """<p>List all tunnels for an Amazon Web Services account. Tunnels are listed by creation time in descending order, newer tunnels will be listed before older tunnels.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ListTunnels</a> action.</p>

    Args:
        thing_name: <p>The name of the IoT thing associated with the destination device.</p>
        max_results: <p>The maximum number of results to return at once.</p>
        next_token: <p>To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.</p>

    Raises:
        capo_iotsecuretunneling.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iotsecuretunneling.types.list_tunnels_request.ListTunnelsRequest]",
    ) -> AsyncOperationResponse[
        "capo_iotsecuretunneling.types.list_tunnels_response.ListTunnelsResponse"
    ]:
        import capo_iotsecuretunneling._operations.io_t_secured_tunneling.list_tunnels

        (
            output,
            http_response,
        ) = await capo_iotsecuretunneling._operations.io_t_secured_tunneling.list_tunnels.async_list_tunnels(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTunnels")
    )
    input_: capo_iotsecuretunneling.types.list_tunnels_request.ListTunnelsRequest = {}
    if thing_name is not None:
        input_["thing_name"] = thing_name
    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