aws_sdk_iot/client/
create_job.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateJob`](crate::operation::create_job::builders::CreateJobFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`job_id(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::job_id) / [`set_job_id(Option<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_job_id):<br>required: **true**<br><p>A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.</p><br>
7    ///   - [`targets(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::targets) / [`set_targets(Option<Vec::<String>>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_targets):<br>required: **true**<br><p>A list of things and thing groups to which the job should be sent.</p><br>
8    ///   - [`document_source(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::document_source) / [`set_document_source(Option<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_document_source):<br>required: **false**<br><p>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 <code>document</code>.</p> <p>For example, <code>--document-source https://s3.<i>region-code</i>.amazonaws.com/example-firmware/device-firmware.1.0</code></p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html">Methods for accessing a bucket</a>.</p><br>
9    ///   - [`document(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::document) / [`set_document(Option<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_document):<br>required: **false**<br><p>The job document. Required if you don't specify a value for <code>documentSource</code>.</p><br>
10    ///   - [`description(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::description) / [`set_description(Option<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_description):<br>required: **false**<br><p>A short text description of the job.</p><br>
11    ///   - [`presigned_url_config(PresignedUrlConfig)`](crate::operation::create_job::builders::CreateJobFluentBuilder::presigned_url_config) / [`set_presigned_url_config(Option<PresignedUrlConfig>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_presigned_url_config):<br>required: **false**<br><p>Configuration information for pre-signed S3 URLs.</p><br>
12    ///   - [`target_selection(TargetSelection)`](crate::operation::create_job::builders::CreateJobFluentBuilder::target_selection) / [`set_target_selection(Option<TargetSelection>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_target_selection):<br>required: **false**<br><p>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.</p><note>  <p>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.</p> </note><br>
13    ///   - [`job_executions_rollout_config(JobExecutionsRolloutConfig)`](crate::operation::create_job::builders::CreateJobFluentBuilder::job_executions_rollout_config) / [`set_job_executions_rollout_config(Option<JobExecutionsRolloutConfig>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_job_executions_rollout_config):<br>required: **false**<br><p>Allows you to create a staged rollout of the job.</p><br>
14    ///   - [`abort_config(AbortConfig)`](crate::operation::create_job::builders::CreateJobFluentBuilder::abort_config) / [`set_abort_config(Option<AbortConfig>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_abort_config):<br>required: **false**<br><p>Allows you to create the criteria to abort a job.</p><br>
15    ///   - [`timeout_config(TimeoutConfig)`](crate::operation::create_job::builders::CreateJobFluentBuilder::timeout_config) / [`set_timeout_config(Option<TimeoutConfig>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_timeout_config):<br>required: **false**<br><p>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 <code>IN_PROGRESS</code>. If the job execution status is not set to another terminal state before the time expires, it will be automatically set to <code>TIMED_OUT</code>.</p><br>
16    ///   - [`tags(Tag)`](crate::operation::create_job::builders::CreateJobFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_tags):<br>required: **false**<br><p>Metadata which can be used to manage the job.</p><br>
17    ///   - [`namespace_id(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::namespace_id) / [`set_namespace_id(Option<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_namespace_id):<br>required: **false**<br><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><br>
18    ///   - [`job_template_arn(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::job_template_arn) / [`set_job_template_arn(Option<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_job_template_arn):<br>required: **false**<br><p>The ARN of the job template used to create the job.</p><br>
19    ///   - [`job_executions_retry_config(JobExecutionsRetryConfig)`](crate::operation::create_job::builders::CreateJobFluentBuilder::job_executions_retry_config) / [`set_job_executions_retry_config(Option<JobExecutionsRetryConfig>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_job_executions_retry_config):<br>required: **false**<br><p>Allows you to create the criteria to retry a job.</p><br>
20    ///   - [`document_parameters(impl Into<String>, impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::document_parameters) / [`set_document_parameters(Option<HashMap::<String, String>>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_document_parameters):<br>required: **false**<br><p>Parameters of an Amazon Web Services managed template that you can specify to create the job document.</p><note>  <p><code>documentParameters</code> can 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.</p> </note><br>
21    ///   - [`scheduling_config(SchedulingConfig)`](crate::operation::create_job::builders::CreateJobFluentBuilder::scheduling_config) / [`set_scheduling_config(Option<SchedulingConfig>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_scheduling_config):<br>required: **false**<br><p>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.</p><br>
22    ///   - [`destination_package_versions(impl Into<String>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::destination_package_versions) / [`set_destination_package_versions(Option<Vec::<String>>)`](crate::operation::create_job::builders::CreateJobFluentBuilder::set_destination_package_versions):<br>required: **false**<br><p>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 <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p> <p><b>Note:</b>The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.</p><br>
23    /// - On success, responds with [`CreateJobOutput`](crate::operation::create_job::CreateJobOutput) with field(s):
24    ///   - [`job_arn(Option<String>)`](crate::operation::create_job::CreateJobOutput::job_arn): <p>The job ARN.</p>
25    ///   - [`job_id(Option<String>)`](crate::operation::create_job::CreateJobOutput::job_id): <p>The unique identifier you assigned to this job.</p>
26    ///   - [`description(Option<String>)`](crate::operation::create_job::CreateJobOutput::description): <p>The job description.</p>
27    /// - On failure, responds with [`SdkError<CreateJobError>`](crate::operation::create_job::CreateJobError)
28    pub fn create_job(&self) -> crate::operation::create_job::builders::CreateJobFluentBuilder {
29        crate::operation::create_job::builders::CreateJobFluentBuilder::new(self.handle.clone())
30    }
31}