1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p> Information about a set of Amazon ECS tasks in an CodeDeploy deployment. An Amazon ECS task set includes details such as the desired number of tasks, how many tasks are running, and whether the task set serves production traffic. An CodeDeploy application that uses the Amazon ECS compute platform deploys a containerized application in an Amazon ECS service as a task set. </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EcsTaskSet {
/// <p> A unique ID of an <code>ECSTaskSet</code>. </p>
pub identifer: ::std::option::Option<::std::string::String>,
/// <p> The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set. </p>
pub desired_count: i64,
/// <p> The number of tasks in the task set that are in the <code>PENDING</code> status during an Amazon ECS deployment. A task in the <code>PENDING</code> state is preparing to enter the <code>RUNNING</code> state. A task set enters the <code>PENDING</code> status when it launches for the first time, or when it is restarted after being in the <code>STOPPED</code> state. </p>
pub pending_count: i64,
/// <p> The number of tasks in the task set that are in the <code>RUNNING</code> status during an Amazon ECS deployment. A task in the <code>RUNNING</code> state is running and ready for use. </p>
pub running_count: i64,
/// <p> The status of the task set. There are three valid task set statuses: </p>
/// <ul>
/// <li> <p> <code>PRIMARY</code>: Indicates the task set is serving production traffic. </p> </li>
/// <li> <p> <code>ACTIVE</code>: Indicates the task set is not serving production traffic. </p> </li>
/// <li> <p> <code>DRAINING</code>: Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group. </p> </li>
/// </ul>
pub status: ::std::option::Option<::std::string::String>,
/// <p> The percentage of traffic served by this task set. </p>
pub traffic_weight: f64,
/// <p> The target group associated with the task set. The target group is used by CodeDeploy to manage traffic to a task set. </p>
pub target_group: ::std::option::Option<crate::types::TargetGroupInfo>,
/// <p> A label that identifies whether the ECS task set is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub task_set_label: ::std::option::Option<crate::types::TargetLabel>,
}
impl EcsTaskSet {
/// <p> A unique ID of an <code>ECSTaskSet</code>. </p>
pub fn identifer(&self) -> ::std::option::Option<&str> {
self.identifer.as_deref()
}
/// <p> The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set. </p>
pub fn desired_count(&self) -> i64 {
self.desired_count
}
/// <p> The number of tasks in the task set that are in the <code>PENDING</code> status during an Amazon ECS deployment. A task in the <code>PENDING</code> state is preparing to enter the <code>RUNNING</code> state. A task set enters the <code>PENDING</code> status when it launches for the first time, or when it is restarted after being in the <code>STOPPED</code> state. </p>
pub fn pending_count(&self) -> i64 {
self.pending_count
}
/// <p> The number of tasks in the task set that are in the <code>RUNNING</code> status during an Amazon ECS deployment. A task in the <code>RUNNING</code> state is running and ready for use. </p>
pub fn running_count(&self) -> i64 {
self.running_count
}
/// <p> The status of the task set. There are three valid task set statuses: </p>
/// <ul>
/// <li> <p> <code>PRIMARY</code>: Indicates the task set is serving production traffic. </p> </li>
/// <li> <p> <code>ACTIVE</code>: Indicates the task set is not serving production traffic. </p> </li>
/// <li> <p> <code>DRAINING</code>: Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group. </p> </li>
/// </ul>
pub fn status(&self) -> ::std::option::Option<&str> {
self.status.as_deref()
}
/// <p> The percentage of traffic served by this task set. </p>
pub fn traffic_weight(&self) -> f64 {
self.traffic_weight
}
/// <p> The target group associated with the task set. The target group is used by CodeDeploy to manage traffic to a task set. </p>
pub fn target_group(&self) -> ::std::option::Option<&crate::types::TargetGroupInfo> {
self.target_group.as_ref()
}
/// <p> A label that identifies whether the ECS task set is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub fn task_set_label(&self) -> ::std::option::Option<&crate::types::TargetLabel> {
self.task_set_label.as_ref()
}
}
impl EcsTaskSet {
/// Creates a new builder-style object to manufacture [`EcsTaskSet`](crate::types::EcsTaskSet).
pub fn builder() -> crate::types::builders::EcsTaskSetBuilder {
crate::types::builders::EcsTaskSetBuilder::default()
}
}
/// A builder for [`EcsTaskSet`](crate::types::EcsTaskSet).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EcsTaskSetBuilder {
pub(crate) identifer: ::std::option::Option<::std::string::String>,
pub(crate) desired_count: ::std::option::Option<i64>,
pub(crate) pending_count: ::std::option::Option<i64>,
pub(crate) running_count: ::std::option::Option<i64>,
pub(crate) status: ::std::option::Option<::std::string::String>,
pub(crate) traffic_weight: ::std::option::Option<f64>,
pub(crate) target_group: ::std::option::Option<crate::types::TargetGroupInfo>,
pub(crate) task_set_label: ::std::option::Option<crate::types::TargetLabel>,
}
impl EcsTaskSetBuilder {
/// <p> A unique ID of an <code>ECSTaskSet</code>. </p>
pub fn identifer(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.identifer = ::std::option::Option::Some(input.into());
self
}
/// <p> A unique ID of an <code>ECSTaskSet</code>. </p>
pub fn set_identifer(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.identifer = input;
self
}
/// <p> A unique ID of an <code>ECSTaskSet</code>. </p>
pub fn get_identifer(&self) -> &::std::option::Option<::std::string::String> {
&self.identifer
}
/// <p> The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set. </p>
pub fn desired_count(mut self, input: i64) -> Self {
self.desired_count = ::std::option::Option::Some(input);
self
}
/// <p> The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set. </p>
pub fn set_desired_count(mut self, input: ::std::option::Option<i64>) -> Self {
self.desired_count = input;
self
}
/// <p> The number of tasks in a task set. During a deployment that uses the Amazon ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set and uses this value to determine how many tasks to create. After the updated task set is created, CodeDeploy shifts traffic to the new task set. </p>
pub fn get_desired_count(&self) -> &::std::option::Option<i64> {
&self.desired_count
}
/// <p> The number of tasks in the task set that are in the <code>PENDING</code> status during an Amazon ECS deployment. A task in the <code>PENDING</code> state is preparing to enter the <code>RUNNING</code> state. A task set enters the <code>PENDING</code> status when it launches for the first time, or when it is restarted after being in the <code>STOPPED</code> state. </p>
pub fn pending_count(mut self, input: i64) -> Self {
self.pending_count = ::std::option::Option::Some(input);
self
}
/// <p> The number of tasks in the task set that are in the <code>PENDING</code> status during an Amazon ECS deployment. A task in the <code>PENDING</code> state is preparing to enter the <code>RUNNING</code> state. A task set enters the <code>PENDING</code> status when it launches for the first time, or when it is restarted after being in the <code>STOPPED</code> state. </p>
pub fn set_pending_count(mut self, input: ::std::option::Option<i64>) -> Self {
self.pending_count = input;
self
}
/// <p> The number of tasks in the task set that are in the <code>PENDING</code> status during an Amazon ECS deployment. A task in the <code>PENDING</code> state is preparing to enter the <code>RUNNING</code> state. A task set enters the <code>PENDING</code> status when it launches for the first time, or when it is restarted after being in the <code>STOPPED</code> state. </p>
pub fn get_pending_count(&self) -> &::std::option::Option<i64> {
&self.pending_count
}
/// <p> The number of tasks in the task set that are in the <code>RUNNING</code> status during an Amazon ECS deployment. A task in the <code>RUNNING</code> state is running and ready for use. </p>
pub fn running_count(mut self, input: i64) -> Self {
self.running_count = ::std::option::Option::Some(input);
self
}
/// <p> The number of tasks in the task set that are in the <code>RUNNING</code> status during an Amazon ECS deployment. A task in the <code>RUNNING</code> state is running and ready for use. </p>
pub fn set_running_count(mut self, input: ::std::option::Option<i64>) -> Self {
self.running_count = input;
self
}
/// <p> The number of tasks in the task set that are in the <code>RUNNING</code> status during an Amazon ECS deployment. A task in the <code>RUNNING</code> state is running and ready for use. </p>
pub fn get_running_count(&self) -> &::std::option::Option<i64> {
&self.running_count
}
/// <p> The status of the task set. There are three valid task set statuses: </p>
/// <ul>
/// <li> <p> <code>PRIMARY</code>: Indicates the task set is serving production traffic. </p> </li>
/// <li> <p> <code>ACTIVE</code>: Indicates the task set is not serving production traffic. </p> </li>
/// <li> <p> <code>DRAINING</code>: Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group. </p> </li>
/// </ul>
pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status = ::std::option::Option::Some(input.into());
self
}
/// <p> The status of the task set. There are three valid task set statuses: </p>
/// <ul>
/// <li> <p> <code>PRIMARY</code>: Indicates the task set is serving production traffic. </p> </li>
/// <li> <p> <code>ACTIVE</code>: Indicates the task set is not serving production traffic. </p> </li>
/// <li> <p> <code>DRAINING</code>: Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group. </p> </li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status = input;
self
}
/// <p> The status of the task set. There are three valid task set statuses: </p>
/// <ul>
/// <li> <p> <code>PRIMARY</code>: Indicates the task set is serving production traffic. </p> </li>
/// <li> <p> <code>ACTIVE</code>: Indicates the task set is not serving production traffic. </p> </li>
/// <li> <p> <code>DRAINING</code>: Indicates the tasks in the task set are being stopped and their corresponding targets are being deregistered from their target group. </p> </li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
&self.status
}
/// <p> The percentage of traffic served by this task set. </p>
pub fn traffic_weight(mut self, input: f64) -> Self {
self.traffic_weight = ::std::option::Option::Some(input);
self
}
/// <p> The percentage of traffic served by this task set. </p>
pub fn set_traffic_weight(mut self, input: ::std::option::Option<f64>) -> Self {
self.traffic_weight = input;
self
}
/// <p> The percentage of traffic served by this task set. </p>
pub fn get_traffic_weight(&self) -> &::std::option::Option<f64> {
&self.traffic_weight
}
/// <p> The target group associated with the task set. The target group is used by CodeDeploy to manage traffic to a task set. </p>
pub fn target_group(mut self, input: crate::types::TargetGroupInfo) -> Self {
self.target_group = ::std::option::Option::Some(input);
self
}
/// <p> The target group associated with the task set. The target group is used by CodeDeploy to manage traffic to a task set. </p>
pub fn set_target_group(mut self, input: ::std::option::Option<crate::types::TargetGroupInfo>) -> Self {
self.target_group = input;
self
}
/// <p> The target group associated with the task set. The target group is used by CodeDeploy to manage traffic to a task set. </p>
pub fn get_target_group(&self) -> &::std::option::Option<crate::types::TargetGroupInfo> {
&self.target_group
}
/// <p> A label that identifies whether the ECS task set is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub fn task_set_label(mut self, input: crate::types::TargetLabel) -> Self {
self.task_set_label = ::std::option::Option::Some(input);
self
}
/// <p> A label that identifies whether the ECS task set is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub fn set_task_set_label(mut self, input: ::std::option::Option<crate::types::TargetLabel>) -> Self {
self.task_set_label = input;
self
}
/// <p> A label that identifies whether the ECS task set is an original target (<code>BLUE</code>) or a replacement target (<code>GREEN</code>). </p>
pub fn get_task_set_label(&self) -> &::std::option::Option<crate::types::TargetLabel> {
&self.task_set_label
}
/// Consumes the builder and constructs a [`EcsTaskSet`](crate::types::EcsTaskSet).
pub fn build(self) -> crate::types::EcsTaskSet {
crate::types::EcsTaskSet {
identifer: self.identifer,
desired_count: self.desired_count.unwrap_or_default(),
pending_count: self.pending_count.unwrap_or_default(),
running_count: self.running_count.unwrap_or_default(),
status: self.status,
traffic_weight: self.traffic_weight.unwrap_or_default(),
target_group: self.target_group,
task_set_label: self.task_set_label,
}
}
}