aws_sdk_ecs/client/
start_task.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 [`StartTask`](crate::operation::start_task::builders::StartTaskFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`cluster(impl Into<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::cluster) / [`set_cluster(Option<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_cluster):<br>required: **false**<br><p>The short name or full Amazon Resource Name (ARN) of the cluster where to start your task. If you do not specify a cluster, the default cluster is assumed.</p><br>
7    ///   - [`container_instances(impl Into<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::container_instances) / [`set_container_instances(Option<Vec::<String>>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_container_instances):<br>required: **true**<br><p>The container instance IDs or full ARN entries for the container instances where you would like to place your task. You can specify up to 10 container instances.</p><br>
8    ///   - [`enable_ecs_managed_tags(bool)`](crate::operation::start_task::builders::StartTaskFluentBuilder::enable_ecs_managed_tags) / [`set_enable_ecs_managed_tags(Option<bool>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_enable_ecs_managed_tags):<br>required: **false**<br><p>Specifies whether to use Amazon ECS managed tags for the task. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html">Tagging Your Amazon ECS Resources</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p><br>
9    ///   - [`enable_execute_command(bool)`](crate::operation::start_task::builders::StartTaskFluentBuilder::enable_execute_command) / [`set_enable_execute_command(Option<bool>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_enable_execute_command):<br>required: **false**<br><p>Whether or not the execute command functionality is turned on for the task. If <code>true</code>, this turns on the execute command functionality on all containers in the task.</p><br>
10    ///   - [`group(impl Into<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::group) / [`set_group(Option<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_group):<br>required: **false**<br><p>The name of the task group to associate with the task. The default value is the family name of the task definition (for example, family:my-family-name).</p><br>
11    ///   - [`network_configuration(NetworkConfiguration)`](crate::operation::start_task::builders::StartTaskFluentBuilder::network_configuration) / [`set_network_configuration(Option<NetworkConfiguration>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_network_configuration):<br>required: **false**<br><p>The VPC subnet and security group configuration for tasks that receive their own elastic network interface by using the <code>awsvpc</code> networking mode.</p><br>
12    ///   - [`overrides(TaskOverride)`](crate::operation::start_task::builders::StartTaskFluentBuilder::overrides) / [`set_overrides(Option<TaskOverride>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_overrides):<br>required: **false**<br><p>A list of container overrides in JSON format that specify the name of a container in the specified task definition and the overrides it receives. You can override the default command for a container (that's specified in the task definition or Docker image) with a <code>command</code> override. You can also override existing environment variables (that are specified in the task definition or Docker image) on a container or add new environment variables to it with an <code>environment</code> override.</p><note>  <p>A total of 8192 characters are allowed for overrides. This limit includes the JSON formatting characters of the override structure.</p> </note><br>
13    ///   - [`propagate_tags(PropagateTags)`](crate::operation::start_task::builders::StartTaskFluentBuilder::propagate_tags) / [`set_propagate_tags(Option<PropagateTags>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_propagate_tags):<br>required: **false**<br><p>Specifies whether to propagate the tags from the task definition or the service to the task. If no value is specified, the tags aren't propagated.</p><br>
14    ///   - [`reference_id(impl Into<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::reference_id) / [`set_reference_id(Option<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_reference_id):<br>required: **false**<br><p>This parameter is only used by Amazon ECS. It is not intended for use by customers.</p><br>
15    ///   - [`started_by(impl Into<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::started_by) / [`set_started_by(Option<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_started_by):<br>required: **false**<br><p>An optional tag specified when a task is started. For example, if you automatically trigger a task to run a batch process job, you could apply a unique identifier for that job to your task with the <code>startedBy</code> parameter. You can then identify which tasks belong to that job by filtering the results of a <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html">ListTasks</a> call with the <code>startedBy</code> value. Up to 36 letters (uppercase and lowercase), numbers, hyphens (-), forward slash (/), and underscores (_) are allowed.</p> <p>If a task is started by an Amazon ECS service, the <code>startedBy</code> parameter contains the deployment ID of the service that starts it.</p><br>
16    ///   - [`tags(Tag)`](crate::operation::start_task::builders::StartTaskFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_tags):<br>required: **false**<br><p>The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p> <p>The following basic restrictions apply to tags:</p> <ul>  <li>   <p>Maximum number of tags per resource - 50</p></li>  <li>   <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>  <li>   <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>  <li>   <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>  <li>   <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>  <li>   <p>Tag keys and values are case-sensitive.</p></li>  <li>   <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li> </ul><br>
17    ///   - [`task_definition(impl Into<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::task_definition) / [`set_task_definition(Option<String>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_task_definition):<br>required: **true**<br><p>The <code>family</code> and <code>revision</code> (<code>family:revision</code>) or full ARN of the task definition to start. If a <code>revision</code> isn't specified, the latest <code>ACTIVE</code> revision is used.</p><br>
18    ///   - [`volume_configurations(TaskVolumeConfiguration)`](crate::operation::start_task::builders::StartTaskFluentBuilder::volume_configurations) / [`set_volume_configurations(Option<Vec::<TaskVolumeConfiguration>>)`](crate::operation::start_task::builders::StartTaskFluentBuilder::set_volume_configurations):<br>required: **false**<br><p>The details of the volume that was <code>configuredAtLaunch</code>. You can configure the size, volumeType, IOPS, throughput, snapshot and encryption in <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskManagedEBSVolumeConfiguration.html">TaskManagedEBSVolumeConfiguration</a>. The <code>name</code> of the volume must match the <code>name</code> from the task definition.</p><br>
19    /// - On success, responds with [`StartTaskOutput`](crate::operation::start_task::StartTaskOutput) with field(s):
20    ///   - [`tasks(Option<Vec::<Task>>)`](crate::operation::start_task::StartTaskOutput::tasks): <p>A full description of the tasks that were started. Each task that was successfully placed on your container instances is described.</p>
21    ///   - [`failures(Option<Vec::<Failure>>)`](crate::operation::start_task::StartTaskOutput::failures): <p>Any failures associated with the call.</p>
22    /// - On failure, responds with [`SdkError<StartTaskError>`](crate::operation::start_task::StartTaskError)
23    pub fn start_task(&self) -> crate::operation::start_task::builders::StartTaskFluentBuilder {
24        crate::operation::start_task::builders::StartTaskFluentBuilder::new(self.handle.clone())
25    }
26}