| 1 | # Generated by default/object.tt | ||
| 2 | package Paws::CloudWatch::MetricDataQuery; | ||
| 3 | use Moose; | ||
| 4 | has Expression => (is => 'ro', isa => 'Str'); | ||
| 5 | has Id => (is => 'ro', isa => 'Str', required => 1); | ||
| 6 | has Label => (is => 'ro', isa => 'Str'); | ||
| 7 | has MetricStat => (is => 'ro', isa => 'Paws::CloudWatch::MetricStat'); | ||
| 8 | has Period => (is => 'ro', isa => 'Int'); | ||
| 9 | has ReturnData => (is => 'ro', isa => 'Bool'); | ||
| 10 | |||
| 11 | 1; | ||
| 12 | |||
| 13 | ### main pod documentation begin ### | ||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | Paws::CloudWatch::MetricDataQuery | ||
| 18 | |||
| 19 | =head1 USAGE | ||
| 20 | |||
| 21 | This class represents one of two things: | ||
| 22 | |||
| 23 | =head3 Arguments in a call to a service | ||
| 24 | |||
| 25 | Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. | ||
| 26 | Each attribute should be used as a named argument in the calls that expect this type of object. | ||
| 27 | |||
| 28 | As an example, if Att1 is expected to be a Paws::CloudWatch::MetricDataQuery object: | ||
| 29 | |||
| 30 | $service_obj->Method(Att1 => { Expression => $value, ..., ReturnData => $value }); | ||
| 31 | |||
| 32 | =head3 Results returned from an API call | ||
| 33 | |||
| 34 | Use accessors for each attribute. If Att1 is expected to be an Paws::CloudWatch::MetricDataQuery object: | ||
| 35 | |||
| 36 | $result = $service_obj->Method(...); | ||
| 37 | $result->Att1->Expression | ||
| 38 | |||
| 39 | =head1 DESCRIPTION | ||
| 40 | |||
| 41 | This structure is used in both C<GetMetricData> and C<PutMetricAlarm>. | ||
| 42 | The supported use of this structure is different for those two | ||
| 43 | operations. | ||
| 44 | |||
| 45 | When used in C<GetMetricData>, it indicates the metric data to return, | ||
| 46 | and whether this call is just retrieving a batch set of data for one | ||
| 47 | metric, or is performing a math expression on metric data. A single | ||
| 48 | C<GetMetricData> call can include up to 500 C<MetricDataQuery> | ||
| 49 | structures. | ||
| 50 | |||
| 51 | When used in C<PutMetricAlarm>, it enables you to create an alarm based | ||
| 52 | on a metric math expression. Each C<MetricDataQuery> in the array | ||
| 53 | specifies either a metric to retrieve, or a math expression to be | ||
| 54 | performed on retrieved metrics. A single C<PutMetricAlarm> call can | ||
| 55 | include up to 20 C<MetricDataQuery> structures in the array. The 20 | ||
| 56 | structures can include as many as 10 structures that contain a | ||
| 57 | C<MetricStat> parameter to retrieve a metric, and as many as 10 | ||
| 58 | structures that contain the C<Expression> parameter to perform a math | ||
| 59 | expression. Of those C<Expression> structures, one must have C<True> as | ||
| 60 | the value for C<ReturnData>. The result of this expression is the value | ||
| 61 | the alarm watches. | ||
| 62 | |||
| 63 | Any expression used in a C<PutMetricAlarm> operation must return a | ||
| 64 | single time series. For more information, see Metric Math Syntax and | ||
| 65 | Functions | ||
| 66 | (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) | ||
| 67 | in the I<Amazon CloudWatch User Guide>. | ||
| 68 | |||
| 69 | Some of the parameters of this structure also have different uses | ||
| 70 | whether you are using this structure in a C<GetMetricData> operation or | ||
| 71 | a C<PutMetricAlarm> operation. These differences are explained in the | ||
| 72 | following parameter list. | ||
| 73 | |||
| 74 | =head1 ATTRIBUTES | ||
| 75 | |||
| 76 | |||
| 77 | =head2 Expression => Str | ||
| 78 | |||
| 79 | The math expression to be performed on the returned data, if this | ||
| 80 | object is performing a math expression. This expression can use the | ||
| 81 | C<Id> of the other metrics to refer to those metrics, and can also use | ||
| 82 | the C<Id> of other expressions to use the result of those expressions. | ||
| 83 | For more information about metric math expressions, see Metric Math | ||
| 84 | Syntax and Functions | ||
| 85 | (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) | ||
| 86 | in the I<Amazon CloudWatch User Guide>. | ||
| 87 | |||
| 88 | Within each MetricDataQuery object, you must specify either | ||
| 89 | C<Expression> or C<MetricStat> but not both. | ||
| 90 | |||
| 91 | |||
| 92 | =head2 B<REQUIRED> Id => Str | ||
| 93 | |||
| 94 | A short name used to tie this object to the results in the response. | ||
| 95 | This name must be unique within a single call to C<GetMetricData>. If | ||
| 96 | you are performing math expressions on this set of data, this name | ||
| 97 | represents that data and can serve as a variable in the mathematical | ||
| 98 | expression. The valid characters are letters, numbers, and underscore. | ||
| 99 | The first character must be a lowercase letter. | ||
| 100 | |||
| 101 | |||
| 102 | =head2 Label => Str | ||
| 103 | |||
| 104 | A human-readable label for this metric or expression. This is | ||
| 105 | especially useful if this is an expression, so that you know what the | ||
| 106 | value represents. If the metric or expression is shown in a CloudWatch | ||
| 107 | dashboard widget, the label is shown. If Label is omitted, CloudWatch | ||
| 108 | generates a default. | ||
| 109 | |||
| 110 | You can put dynamic expressions into a label, so that it is more | ||
| 111 | descriptive. For more information, see Using Dynamic Labels | ||
| 112 | (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html). | ||
| 113 | |||
| 114 | |||
| 115 | =head2 MetricStat => L<Paws::CloudWatch::MetricStat> | ||
| 116 | |||
| 117 | The metric to be returned, along with statistics, period, and units. | ||
| 118 | Use this parameter only if this object is retrieving a metric and not | ||
| 119 | performing a math expression on returned data. | ||
| 120 | |||
| 121 | Within one MetricDataQuery object, you must specify either | ||
| 122 | C<Expression> or C<MetricStat> but not both. | ||
| 123 | |||
| 124 | |||
| 125 | =head2 Period => Int | ||
| 126 | |||
| 127 | The granularity, in seconds, of the returned data points. For metrics | ||
| 128 | with regular resolution, a period can be as short as one minute (60 | ||
| 129 | seconds) and must be a multiple of 60. For high-resolution metrics that | ||
| 130 | are collected at intervals of less than one minute, the period can be | ||
| 131 | 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are | ||
| 132 | those metrics stored by a C<PutMetricData> operation that includes a | ||
| 133 | C<StorageResolution of 1 second>. | ||
| 134 | |||
| 135 | |||
| 136 | =head2 ReturnData => Bool | ||
| 137 | |||
| 138 | When used in C<GetMetricData>, this option indicates whether to return | ||
| 139 | the timestamps and raw data values of this metric. If you are | ||
| 140 | performing this call just to do math expressions and do not also need | ||
| 141 | the raw data returned, you can specify C<False>. If you omit this, the | ||
| 142 | default of C<True> is used. | ||
| 143 | |||
| 144 | When used in C<PutMetricAlarm>, specify C<True> for the one expression | ||
| 145 | result to use as the alarm. For all other metrics and expressions in | ||
| 146 | the same C<PutMetricAlarm> operation, specify C<ReturnData> as False. | ||
| 147 | |||
| 148 | |||
| 149 | |||
| 150 | =head1 SEE ALSO | ||
| 151 | |||
| 152 | This class forms part of L<Paws>, describing an object used in L<Paws::CloudWatch> | ||
| 153 | |||
| 154 | =head1 BUGS and CONTRIBUTIONS | ||
| 155 | |||
| 156 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 157 | |||
| 158 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 159 | |||
| 160 | =cut | ||
| 161 |