Submit
Path:
~
/
/
lib
/
python2.7
/
site-packages
/
awscli
/
customizations
/
File Content:
putmetricdata.pyc
� =��Xc @ sw d Z d d l Z d d l m Z d d l m Z d d l m Z d � Z d � Z d � Z d e f d � � YZ d S( s� This customization adds the following scalar parameters to the cloudwatch put-metric-data operation: * --metric-name * --dimensions * --timestamp * --value * --statistic-values * --unit i����N( t CustomArgument( t split_on_commas( t# validate_mutually_exclusive_handlerc C sB | j d t � | j d t d g d d d d d d g � � d S( Ns2 building-argument-table.cloudwatch.put-metric-datas0 operation-args-parsed.cloudwatch.put-metric-datat metric_datat metric_namet timestampt unitt valuet dimensionst statistic_values( t registert _promote_argsR ( t event_handler( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt register_put_metric_data s c K s� t | d _ t d d d �| d <t d d d �| d <t d d d �| d <t d d d �| d <t d d d �| d <t d d d �| d <d S( Ns metric-datas metric-namet help_texts The name of the metric.R sy The time stamp used for the metric. If not specified, the default value is set to the time the metric data was received.R s The unit of metric.R s= The value for the metric. Although the --value parameter accepts numbers of type Double, Amazon CloudWatch truncates values with very large exponents. Values with base-10 exponents greater than 126 (1 x 10^126) are truncated. Likewise, values with base-10 exponents less than -130 (1 x 10^-130) are also truncated.R s� The --dimensions argument further expands on the identity of a metric using a Name=Value pair, separated by commas, for example: <code>--dimensions InstanceID=1-23456789 InstanceType=m1.small</code>. Note that the <code>--dimensions</code> argument has a different format when used in <code>get-metric-data</code>, where for the same example you would use the format <code>--dimensions Name=InstanceID,Value=i-aaba32d4 Name=InstanceType,value=m1.small </code>.s statistic-valuess2 A set of statistical values describing the metric.( t Falset requiredt PutMetricArgument( t argument_tablet kwargs( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyR * s c s � f d � } | S( Nc s � � f d � } | S( Nc sJ | d k r d S� | k r, i g | � <n | � d } � | | | � S( Ni ( t None( t selft parametersR t first_element( t funct name( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt _add_to_paramsS s ( ( R R ( R ( R sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt _wrap_add_to_paramsR s ( ( R R ( ( R sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt insert_first_elementQ s R c B s� e Z d � Z e d � d � � Z e d � d � � Z e d � d � � Z e d � d � � Z e d � d � � Z e d � d � � Z RS( c C s/ d | j j d d � } t | | � | | � S( Ns _add_param_%st -t _( R t replacet getattr( R R R t method_name( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt add_to_paramsd s t MetricDatac C s | | d <d S( Nt MetricName( ( R R R ( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt _add_param_metric_nameh s c C s | | d <d S( Nt Unit( ( R R R ( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt _add_param_unitl s c C s | | d <d S( Nt Timestamp( ( R R R ( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt _add_param_timestampp s c C s t j | � | d <d S( Nt Value( t decimalt Decimal( R R R ( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt _add_param_valuet s c C s[ g } xD t | � D]6 } | j d � \ } } | j i | d 6| d 6� q W| | d <d S( Nt =t NameR* t Dimensions( R t splitt append( R R R R t pairt key( ( sC /tmp/pip-build-uEGWVr/awscli/awscli/customizations/putmetricdata.pyt _add_param_dimensionsy s c C sS i } x<