Skip to content

list_job_executions_for_thing async

list_job_executions_for_thing(
    thing_name: ThingName,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    status: Optional[JobExecutionStatus] = None,
    namespace_id: Optional[NamespaceId] = None,
    max_results: Optional[LaserMaxResults] = None,
    next_token: Optional[NextToken] = None,
    job_id: Optional[JobId] = None,
) -> ListJobExecutionsForThingResponse

Lists the job executions for the specified thing.

Requires permission to access the ListJobExecutionsForThing action.

Parameters:

  • thing_name (ThingName) –

    The thing name.

  • status (Optional[JobExecutionStatus], default: None ) –

    An optional filter that lets you search for jobs that have the specified status.

  • namespace_id (Optional[NamespaceId], default: None ) –

    The namespace used to indicate that a job is a customer-managed job.

    When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.

    $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/

    The namespaceId feature is only supported by IoT Greengrass at this time. For more information, see Setting up IoT Greengrass core devices.

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

    The maximum number of results to be returned per request.

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

    The token to retrieve the next set of results.

  • job_id (Optional[JobId], default: None ) –

    The unique identifier you assigned to this job when it was created.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def list_job_executions_for_thing(
    self,
    thing_name: "capo_iot.types.thing_name.ThingName",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    status: Optional[
        "capo_iot.types.job_execution_status.JobExecutionStatus"
    ] = None,
    namespace_id: Optional["capo_iot.types.namespace_id.NamespaceId"] = None,
    max_results: Optional[
        "capo_iot.types.laser_max_results.LaserMaxResults"
    ] = None,
    next_token: Optional["capo_iot.types.next_token.NextToken"] = None,
    job_id: Optional["capo_iot.types.job_id.JobId"] = None,
) -> "capo_iot.types.list_job_executions_for_thing_response.ListJobExecutionsForThingResponse":
    """<p>Lists the job executions for the specified thing.</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">ListJobExecutionsForThing</a> action.</p>

    Args:
        thing_name: <p>The thing name.</p>
        status: <p>An optional filter that lets you search for jobs that have the specified status.</p>
        namespace_id: <p>The namespace used to indicate that a job is a customer-managed job.</p> <p>When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.</p> <p> <code>$aws/things/<i>THING_NAME</i>/jobs/<i>JOB_ID</i>/notify-namespace-<i>NAMESPACE_ID</i>/</code> </p> <note> <p>The <code>namespaceId</code> feature is only supported by IoT Greengrass at this time. For more information, see <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/setting-up.html">Setting up IoT Greengrass core devices.</a> </p> </note>
        max_results: <p>The maximum number of results to be returned per request.</p>
        next_token: <p>The token to retrieve the next set of results.</p>
        job_id: <p>The unique identifier you assigned to this job when it was created.</p>

    Raises:
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.list_job_executions_for_thing_request.ListJobExecutionsForThingRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.list_job_executions_for_thing_response.ListJobExecutionsForThingResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_job_executions_for_thing

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.list_job_executions_for_thing.async_list_job_executions_for_thing(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListJobExecutionsForThing")
    )
    input_: capo_iot.types.list_job_executions_for_thing_request.ListJobExecutionsForThingRequest = {
        "thing_name": thing_name
    }
    if status is not None:
        input_["status"] = status
    if namespace_id is not None:
        input_["namespace_id"] = namespace_id
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if job_id is not None:
        input_["job_id"] = job_id

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