ó ¡ôXc@sÕddlZddlZddlZddlmZddlZddlmZddlm Z ddl m Z dZ i dd6d d 6d d 6d d6dd6dd6dd6dd6dd6Z de fd„ƒYZdS(iÿÿÿÿN(tArg(tdelimited_list(tCloudWatchRequest(tcloudwatch_dimensionit Dimensionstdimt MetricNametmetrictMaximumtmaxtMinimumtmint SampleCounttcounttSumtsumt TimestampttstUnittunittValuetvalt PutMetricDatacBsjeZdZedddddeddƒedd dd d d/d d deddddƒeddddd d/ddd dddƒeddddddd d/dejƒeddd d/d dddƒeddd dd d/de dd e ƒdd!ƒed"d#d d/d d$dd%ƒed&d'd d/d d(dd)ƒgZ d*„Z d+„Z d,„Zd-„Zd.„ZRS(0sJ Add data values or statistics to a CloudWatch metric A metric datum consists of a metric name, any of several attributes, and either a simple, numeric value (-v) or a set of statistical values (-s). All metric data in a given invocation of %(prog)s must belong to one namespace. %(prog)s supports the following attributes (and equivalent aliases, in parentheses) for all data. Each of these attributes has a corresponding command line option that specifies that attribute for all metric data. * MetricName (metric) * Dimensions (dim) * Timestamp (ts) * Unit (unit) Simple metric data have one additional attribute for their values: * Value (val) Statistical metric data have four additional attributes: * Maximum (max) * Minimum (min) * SampleCount (count) * Sum (sum) The -v/--value option allows you to specify the value of a simple metric datum. To specify other attributes for data given using this option, use the options that correspond to them, such as -d/--dimensions. In particular, the -m/--metric-name option is required when -v/--value is used. The -s/--metric-datum option allows for full control of each data point's attributes. This is necessary for statistical data points. To specify a metric datum using this option, join each attribute's name or alias from the lists above with its value using an '=' character, and join each of those pairs with ',' characters. If a value contains a ',' character, surround the entire attribute with '"' characters. For example, each of the following is a valid string to pass to -s/--metric-datum: MetricName=MyMetric,Value=1.5 MetricName=MyMetric,Maximum=5,Minimum=1,SampleCount=5,Sum=10 metric=MyMetric,val=9,"dim=InstanceId:i-12345678,Volume:/dev/sda" Attributes specified via -s/--metric-datum take precedence over those specified with attribute-specific command line options, such as -d/--dimensions. Timestamps must use a format specified in ISO 8601, such as "1989-11-09T19:17:45.000+01:00". Note that the CloudWatch service does not accept data with timestamps more than two weeks in the past. Dimensions' attributes are specified as a comma-separated list of dimension names and values that are themselves separated by ':' characters. This means that when more than one dimension is necessary, the entire Dimensions attribute must be enclosed in '"' characters. Most shell environments require this to be escaped. s-ns --namespacetdestt Namespacetrequiredthelps,namespace for the new metric data (required)s-vs--valuet simple_valuestroute_totmetavartFLOATttypetactiontappendsZa simple value for a metric datum. Each use specifies a new metric datum.s-ss--metric-datumt attr_valuessKEY1=VALUE1,KEY2=VALUE2,...s±names and values of the attributes for a metric datum. When values include ',' characters, enclose the entire name/value pair in '"' characters.s--statistic-valuess--statisticValuess-ms --metric-nametMETRICs(name of the metric to add metric data tos-ds --dimensionst,t item_typesLone or more dimensions to associate with the new metric datas-ts --timestampsYYYY-MM-DDThh:mm:ssZs!timestamp for the new metric datas-us--unittUNITsOunit in which to report the new metric data points (e.g. Bytes)cCs–tj|ƒg}x6|jjdƒp+dD]}|j|j|ƒƒq,Wx6|jjdƒpddD]}|j|j|ƒƒqeW||jdRtrequestbuilder.exceptionsteuca2ools.commands.argtypesRteuca2ools.commands.monitoringRt&euca2ools.commands.monitoring.argtypesRR2RPR(((sO/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/putmetricdata.pyts$