Skip to content

get_devices async

get_devices(
    global_network_id: GlobalNetworkId,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    device_ids: Optional[DeviceIdList] = None,
    site_id: Optional[SiteId] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> GetDevicesResponse

Gets information about one or more of your devices in a global network.

Parameters:

  • global_network_id (GlobalNetworkId) –

    The ID of the global network.

  • device_ids (Optional[DeviceIdList], default: None ) –

    One or more device IDs. The maximum is 10.

  • site_id (Optional[SiteId], default: None ) –

    The ID of the site.

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

    The maximum number of results to return.

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

    The token for the next page of results.

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def get_devices(
    self,
    global_network_id: "capo_networkmanager.types.global_network_id.GlobalNetworkId",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    device_ids: Optional[
        "capo_networkmanager.types.device_id_list.DeviceIdList"
    ] = None,
    site_id: Optional["capo_networkmanager.types.site_id.SiteId"] = None,
    max_results: Optional[
        "capo_networkmanager.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_networkmanager.types.next_token.NextToken"] = None,
) -> "capo_networkmanager.types.get_devices_response.GetDevicesResponse":
    """<p>Gets information about one or more of your devices in a global network.</p>

    Args:
        global_network_id: <p>The ID of the global network.</p>
        device_ids: <p>One or more device IDs. The maximum is 10.</p>
        site_id: <p>The ID of the site.</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.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</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.get_devices_request.GetDevicesRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.get_devices_response.GetDevicesResponse"
    ]:
        import capo_networkmanager._operations.network_manager.get_devices

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

    def _redact_output(
        output: "capo_networkmanager.types.get_devices_response.GetDevicesResponse",
    ) -> dict[str, Any]:
        import capo_networkmanager.types.get_devices_response

        return capo_networkmanager.types.get_devices_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetDevices", redact_output=_redact_output),
    )
    input_: capo_networkmanager.types.get_devices_request.GetDevicesRequest = {
        "global_network_id": global_network_id
    }
    if device_ids is not None:
        input_["device_ids"] = device_ids
    if site_id is not None:
        input_["site_id"] = site_id
    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