Skip to content

list_devices async

list_devices(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[ListMaxResults] = None,
    latest_heartbeat_after: Optional[Timestamp] = None,
    model_name: Optional[EntityName] = None,
    device_fleet_name: Optional[EntityName] = None,
) -> ListDevicesResponse

A list of devices.

Parameters:

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

    The response from the last list when returning a list large enough to need tokening.

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

    Maximum number of results to select.

  • latest_heartbeat_after (Optional[Timestamp], default: None ) –

    Select fleets where the job was updated after X

  • model_name (Optional[EntityName], default: None ) –

    A filter that searches devices that contains this name in any of their models.

  • device_fleet_name (Optional[EntityName], default: None ) –

    Filter for fleets containing this name in their device fleet name.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def list_devices(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    next_token: Optional["capo_sagemaker.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_sagemaker.types.list_max_results.ListMaxResults"
    ] = None,
    latest_heartbeat_after: Optional[
        "capo_sagemaker.types.timestamp.Timestamp"
    ] = None,
    model_name: Optional["capo_sagemaker.types.entity_name.EntityName"] = None,
    device_fleet_name: Optional[
        "capo_sagemaker.types.entity_name.EntityName"
    ] = None,
) -> "capo_sagemaker.types.list_devices_response.ListDevicesResponse":
    """<p>A list of devices.</p>

    Args:
        next_token: <p>The response from the last list when returning a list large enough to need tokening.</p>
        max_results: <p>Maximum number of results to select.</p>
        latest_heartbeat_after: <p>Select fleets where the job was updated after X</p>
        model_name: <p>A filter that searches devices that contains this name in any of their models.</p>
        device_fleet_name: <p>Filter for fleets containing this name in their device fleet name.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.list_devices_request.ListDevicesRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.list_devices_response.ListDevicesResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.list_devices

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.list_devices.async_list_devices(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDevices")
    )
    input_: capo_sagemaker.types.list_devices_request.ListDevicesRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if latest_heartbeat_after is not None:
        input_["latest_heartbeat_after"] = latest_heartbeat_after
    if model_name is not None:
        input_["model_name"] = model_name
    if device_fleet_name is not None:
        input_["device_fleet_name"] = device_fleet_name

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