create_job
async
¶
create_job(
job_id: JobId,
targets: JobTargets,
*,
config_overrides: Optional[AsyncIoTClientConfig] = None,
document_source: Optional[JobDocumentSource] = None,
document: Optional[JobDocument] = None,
description: Optional[JobDescription] = None,
presigned_url_config: Optional[PresignedUrlConfig] = None,
target_selection: Optional[TargetSelection] = None,
job_executions_rollout_config: Optional[JobExecutionsRolloutConfig] = None,
abort_config: Optional[AbortConfig] = None,
timeout_config: Optional[TimeoutConfig] = None,
tags: Optional[TagList] = None,
namespace_id: Optional[NamespaceId] = None,
job_template_arn: Optional[JobTemplateArn] = None,
job_executions_retry_config: Optional[JobExecutionsRetryConfig] = None,
document_parameters: Optional[ParameterMap] = None,
scheduling_config: Optional[SchedulingConfig] = None,
destination_package_versions: Optional[DestinationPackageVersions] = None,
) -> CreateJobResponse
Creates a job.
Requires permission to access the CreateJob action.
Parameters:
-
job_id(JobId) –A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.
-
targets(JobTargets) –A list of things and thing groups to which the job should be sent.
-
document_source(Optional[JobDocumentSource], default:None) –An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for
document.For example,
--document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0For more information, see Methods for accessing a bucket.
-
document(Optional[JobDocument], default:None) –The job document. Required if you don't specify a value for
documentSource. -
description(Optional[JobDescription], default:None) –A short text description of the job.
-
presigned_url_config(Optional[PresignedUrlConfig], default:None) –Configuration information for pre-signed S3 URLs.
-
target_selection(Optional[TargetSelection], default:None) –Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.
We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the job has been created.
-
job_executions_rollout_config(Optional[JobExecutionsRolloutConfig], default:None) –Allows you to create a staged rollout of the job.
-
abort_config(Optional[AbortConfig], default:None) –Allows you to create the criteria to abort a job.
-
timeout_config(Optional[TimeoutConfig], default:None) –Specifies the amount of time each device has to finish its execution of the job. The timer is started when the job execution status is set to
IN_PROGRESS. If the job execution status is not set to another terminal state before the time expires, it will be automatically set toTIMED_OUT. -
tags(Optional[TagList], default:None) –Metadata which can be used to manage the job.
-
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
namespaceIdfeature is only supported by IoT Greengrass at this time. For more information, see Setting up IoT Greengrass core devices. -
job_template_arn(Optional[JobTemplateArn], default:None) –The ARN of the job template used to create the job.
-
job_executions_retry_config(Optional[JobExecutionsRetryConfig], default:None) –Allows you to create the criteria to retry a job.
-
document_parameters(Optional[ParameterMap], default:None) –Parameters of an Amazon Web Services managed template that you can specify to create the job document.
documentParameterscan only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them. -
scheduling_config(Optional[SchedulingConfig], default:None) –The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.
-
destination_package_versions(Optional[DestinationPackageVersions], default:None) –The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see Package version lifecycle.
Note:The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.
Raises:
-
InvalidRequestException–The request is not valid.
-
LimitExceededException–A limit has been exceeded.
-
ResourceAlreadyExistsException–The resource already exists.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceUnavailableException–The service is temporarily unavailable.
-
ThrottlingException–The rate exceeds the limit.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_iot/_services/async_io_t.py
2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 | |