HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/customizations/__pycache__/putmetricdata.cpython-36.pyc
3

�T_�@s\dZddlZddlmZddlmZddlmZdd�Zdd	�Z	d
d�Z
Gdd
�d
e�ZdS)z�
This customization adds the following scalar parameters to the
cloudwatch put-metric-data operation:

* --metric-name
* --dimensions
* --timestamp
* --value
* --statistic-values
* --unit
* --storage-resolution

�N)�CustomArgument)�split_on_commas)�#validate_mutually_exclusive_handlerc
Cs0|jdt�|jdtdgdddddd	g��dS)
Nz2building-argument-table.cloudwatch.put-metric-dataz0operation-args-parsed.cloudwatch.put-metric-data�metric_dataZmetric_name�	timestamp�unit�value�
dimensionsZstatistic_values)�register�
_promote_argsr)Z
event_handler�r�#/usr/lib/python3.6/putmetricdata.py�register_put_metric_data!srcKs�d|d_tddd�|d<tddd�|d<tdd	d�|d<td
dd�|d
<tdd
d�|d<tddd�|d<|jjdj}|jd}td|jd�|d<dS)NFzmetric-datazmetric-namezThe name of the metric.)Z	help_textrzyThe time stamp used for the metric.  If not specified, the default value is set to the time the metric data was received.rzThe unit of metric.ra=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	a�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>.zstatistic-valuesz2A set of statistical values describing the metric.�
MetricData�StorageResolutionzstorage-resolution)Zrequired�PutMetricArgumentZinput_shape�members�memberZ
documentation)Zargument_tableZoperation_model�kwargsrZstorage_resolutionrrr
r+s$

rcs�fdd�}|S)Ncs��fdd�}|S)Ncs6|dkrdS�|krig|�<|�d}�|||�S)Nrr)�self�
parametersr�
first_element)�func�namerr
�_add_to_params^s
zIinsert_first_element.<locals>._wrap_add_to_params.<locals>._add_to_paramsr)rr)r)rr
�_wrap_add_to_params]sz1insert_first_element.<locals>._wrap_add_to_paramsr)rrr)rr
�insert_first_element\src@s�eZdZdd�Zed�dd��Zed�dd��Zed�dd	��Zed�d
d��Zed�dd
��Z	ed�dd��Z
ed�dd��ZdS)rcCs"d|jjdd�}t||�||�S)Nz
_add_param_%s�-�_)r�replace�getattr)rrrZmethod_namerrr
�
add_to_paramsoszPutMetricArgument.add_to_paramsrcCs||d<dS)NZ
MetricNamer)rrrrrr
�_add_param_metric_namessz(PutMetricArgument._add_param_metric_namecCs||d<dS)NZUnitr)rrrrrr
�_add_param_unitwsz!PutMetricArgument._add_param_unitcCs||d<dS)NZ	Timestampr)rrrrrr
�_add_param_timestamp{sz&PutMetricArgument._add_param_timestampcCstj|�|d<dS)N�Value)�decimal�Decimal)rrrrrr
�_add_param_valuesz"PutMetricArgument._add_param_valuecCs@g}x.t|�D]"}|jd�\}}|j||d��qW||d<dS)N�=)�Namer%Z
Dimensions)r�split�append)rrrr	�pair�keyrrr
�_add_param_dimensions�s
z'PutMetricArgument._add_param_dimensionscCs>i}x,t|�D] }|jd�\}}tj|�||<qW||d<dS)Nr)ZStatisticValues)rr+r&r')rrrZ
statisticsr-r.rrr
�_add_param_statistic_values�s
z-PutMetricArgument._add_param_statistic_valuescCst|�|d<dS)Nr)�int)rrrrrr
�_add_param_storage_resolution�sz/PutMetricArgument._add_param_storage_resolutionN)�__name__�
__module__�__qualname__r!rr"r#r$r(r/r0r2rrrr
rns
r)�__doc__r&Zawscli.argumentsrZawscli.utilsrZawscli.customizations.utilsrrrrrrrrr
�<module>s
1