aws_sdk_autoscaling/types/_predefined_metric_specification.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a predefined metric for a target tracking scaling policy to use with Amazon EC2 Auto Scaling.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PredefinedMetricSpecification {
7 /// <p>The metric type. The following predefined metrics are available:</p>
8 /// <ul>
9 /// <li>
10 /// <p><code>ASGAverageCPUUtilization</code> - Average CPU utilization of the Auto Scaling group.</p></li>
11 /// <li>
12 /// <p><code>ASGAverageNetworkIn</code> - Average number of bytes received on all network interfaces by the Auto Scaling group.</p></li>
13 /// <li>
14 /// <p><code>ASGAverageNetworkOut</code> - Average number of bytes sent out on all network interfaces by the Auto Scaling group.</p></li>
15 /// <li>
16 /// <p><code>ALBRequestCountPerTarget</code> - Average Application Load Balancer request count per target for your Auto Scaling group.</p></li>
17 /// </ul>
18 pub predefined_metric_type: ::std::option::Option<crate::types::MetricType>,
19 /// <p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.</p>
20 /// <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p>
21 /// <p><code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p>
22 /// <p>Where:</p>
23 /// <ul>
24 /// <li>
25 /// <p>app/<load-balancer-name>
26 /// /
27 /// <load-balancer-id>
28 /// is the final portion of the load balancer ARN
29 /// </load-balancer-id>
30 /// </load-balancer-name></p></li>
31 /// <li>
32 /// <p>targetgroup/<target-group-name>
33 /// /
34 /// <target-group-id>
35 /// is the final portion of the target group ARN.
36 /// </target-group-id>
37 /// </target-group-name></p></li>
38 /// </ul>
39 /// <p>To find the ARN for an Application Load Balancer, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html">DescribeTargetGroups</a> API operation.</p>
40 pub resource_label: ::std::option::Option<::std::string::String>,
41}
42impl PredefinedMetricSpecification {
43 /// <p>The metric type. The following predefined metrics are available:</p>
44 /// <ul>
45 /// <li>
46 /// <p><code>ASGAverageCPUUtilization</code> - Average CPU utilization of the Auto Scaling group.</p></li>
47 /// <li>
48 /// <p><code>ASGAverageNetworkIn</code> - Average number of bytes received on all network interfaces by the Auto Scaling group.</p></li>
49 /// <li>
50 /// <p><code>ASGAverageNetworkOut</code> - Average number of bytes sent out on all network interfaces by the Auto Scaling group.</p></li>
51 /// <li>
52 /// <p><code>ALBRequestCountPerTarget</code> - Average Application Load Balancer request count per target for your Auto Scaling group.</p></li>
53 /// </ul>
54 pub fn predefined_metric_type(&self) -> ::std::option::Option<&crate::types::MetricType> {
55 self.predefined_metric_type.as_ref()
56 }
57 /// <p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.</p>
58 /// <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p>
59 /// <p><code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p>
60 /// <p>Where:</p>
61 /// <ul>
62 /// <li>
63 /// <p>app/<load-balancer-name>
64 /// /
65 /// <load-balancer-id>
66 /// is the final portion of the load balancer ARN
67 /// </load-balancer-id>
68 /// </load-balancer-name></p></li>
69 /// <li>
70 /// <p>targetgroup/<target-group-name>
71 /// /
72 /// <target-group-id>
73 /// is the final portion of the target group ARN.
74 /// </target-group-id>
75 /// </target-group-name></p></li>
76 /// </ul>
77 /// <p>To find the ARN for an Application Load Balancer, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html">DescribeTargetGroups</a> API operation.</p>
78 pub fn resource_label(&self) -> ::std::option::Option<&str> {
79 self.resource_label.as_deref()
80 }
81}
82impl PredefinedMetricSpecification {
83 /// Creates a new builder-style object to manufacture [`PredefinedMetricSpecification`](crate::types::PredefinedMetricSpecification).
84 pub fn builder() -> crate::types::builders::PredefinedMetricSpecificationBuilder {
85 crate::types::builders::PredefinedMetricSpecificationBuilder::default()
86 }
87}
88
89/// A builder for [`PredefinedMetricSpecification`](crate::types::PredefinedMetricSpecification).
90#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
91#[non_exhaustive]
92pub struct PredefinedMetricSpecificationBuilder {
93 pub(crate) predefined_metric_type: ::std::option::Option<crate::types::MetricType>,
94 pub(crate) resource_label: ::std::option::Option<::std::string::String>,
95}
96impl PredefinedMetricSpecificationBuilder {
97 /// <p>The metric type. The following predefined metrics are available:</p>
98 /// <ul>
99 /// <li>
100 /// <p><code>ASGAverageCPUUtilization</code> - Average CPU utilization of the Auto Scaling group.</p></li>
101 /// <li>
102 /// <p><code>ASGAverageNetworkIn</code> - Average number of bytes received on all network interfaces by the Auto Scaling group.</p></li>
103 /// <li>
104 /// <p><code>ASGAverageNetworkOut</code> - Average number of bytes sent out on all network interfaces by the Auto Scaling group.</p></li>
105 /// <li>
106 /// <p><code>ALBRequestCountPerTarget</code> - Average Application Load Balancer request count per target for your Auto Scaling group.</p></li>
107 /// </ul>
108 /// This field is required.
109 pub fn predefined_metric_type(mut self, input: crate::types::MetricType) -> Self {
110 self.predefined_metric_type = ::std::option::Option::Some(input);
111 self
112 }
113 /// <p>The metric type. The following predefined metrics are available:</p>
114 /// <ul>
115 /// <li>
116 /// <p><code>ASGAverageCPUUtilization</code> - Average CPU utilization of the Auto Scaling group.</p></li>
117 /// <li>
118 /// <p><code>ASGAverageNetworkIn</code> - Average number of bytes received on all network interfaces by the Auto Scaling group.</p></li>
119 /// <li>
120 /// <p><code>ASGAverageNetworkOut</code> - Average number of bytes sent out on all network interfaces by the Auto Scaling group.</p></li>
121 /// <li>
122 /// <p><code>ALBRequestCountPerTarget</code> - Average Application Load Balancer request count per target for your Auto Scaling group.</p></li>
123 /// </ul>
124 pub fn set_predefined_metric_type(mut self, input: ::std::option::Option<crate::types::MetricType>) -> Self {
125 self.predefined_metric_type = input;
126 self
127 }
128 /// <p>The metric type. The following predefined metrics are available:</p>
129 /// <ul>
130 /// <li>
131 /// <p><code>ASGAverageCPUUtilization</code> - Average CPU utilization of the Auto Scaling group.</p></li>
132 /// <li>
133 /// <p><code>ASGAverageNetworkIn</code> - Average number of bytes received on all network interfaces by the Auto Scaling group.</p></li>
134 /// <li>
135 /// <p><code>ASGAverageNetworkOut</code> - Average number of bytes sent out on all network interfaces by the Auto Scaling group.</p></li>
136 /// <li>
137 /// <p><code>ALBRequestCountPerTarget</code> - Average Application Load Balancer request count per target for your Auto Scaling group.</p></li>
138 /// </ul>
139 pub fn get_predefined_metric_type(&self) -> &::std::option::Option<crate::types::MetricType> {
140 &self.predefined_metric_type
141 }
142 /// <p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.</p>
143 /// <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p>
144 /// <p><code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p>
145 /// <p>Where:</p>
146 /// <ul>
147 /// <li>
148 /// <p>app/<load-balancer-name>
149 /// /
150 /// <load-balancer-id>
151 /// is the final portion of the load balancer ARN
152 /// </load-balancer-id>
153 /// </load-balancer-name></p></li>
154 /// <li>
155 /// <p>targetgroup/<target-group-name>
156 /// /
157 /// <target-group-id>
158 /// is the final portion of the target group ARN.
159 /// </target-group-id>
160 /// </target-group-name></p></li>
161 /// </ul>
162 /// <p>To find the ARN for an Application Load Balancer, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html">DescribeTargetGroups</a> API operation.</p>
163 pub fn resource_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164 self.resource_label = ::std::option::Option::Some(input.into());
165 self
166 }
167 /// <p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.</p>
168 /// <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p>
169 /// <p><code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p>
170 /// <p>Where:</p>
171 /// <ul>
172 /// <li>
173 /// <p>app/<load-balancer-name>
174 /// /
175 /// <load-balancer-id>
176 /// is the final portion of the load balancer ARN
177 /// </load-balancer-id>
178 /// </load-balancer-name></p></li>
179 /// <li>
180 /// <p>targetgroup/<target-group-name>
181 /// /
182 /// <target-group-id>
183 /// is the final portion of the target group ARN.
184 /// </target-group-id>
185 /// </target-group-name></p></li>
186 /// </ul>
187 /// <p>To find the ARN for an Application Load Balancer, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html">DescribeTargetGroups</a> API operation.</p>
188 pub fn set_resource_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.resource_label = input;
190 self
191 }
192 /// <p>A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group.</p>
193 /// <p>You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:</p>
194 /// <p><code>app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff</code>.</p>
195 /// <p>Where:</p>
196 /// <ul>
197 /// <li>
198 /// <p>app/<load-balancer-name>
199 /// /
200 /// <load-balancer-id>
201 /// is the final portion of the load balancer ARN
202 /// </load-balancer-id>
203 /// </load-balancer-name></p></li>
204 /// <li>
205 /// <p>targetgroup/<target-group-name>
206 /// /
207 /// <target-group-id>
208 /// is the final portion of the target group ARN.
209 /// </target-group-id>
210 /// </target-group-name></p></li>
211 /// </ul>
212 /// <p>To find the ARN for an Application Load Balancer, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html">DescribeLoadBalancers</a> API operation. To find the ARN for the target group, use the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html">DescribeTargetGroups</a> API operation.</p>
213 pub fn get_resource_label(&self) -> &::std::option::Option<::std::string::String> {
214 &self.resource_label
215 }
216 /// Consumes the builder and constructs a [`PredefinedMetricSpecification`](crate::types::PredefinedMetricSpecification).
217 pub fn build(self) -> crate::types::PredefinedMetricSpecification {
218 crate::types::PredefinedMetricSpecification {
219 predefined_metric_type: self.predefined_metric_type,
220 resource_label: self.resource_label,
221 }
222 }
223}