Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pyc

ó
¡ôXc@s™ddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZd	eefd
„ƒYZdS(iÿÿÿÿN(tArg(t
ArgumentError(tTabifyingMixin(tPaginatedResponse(tdelimited_list(tCloudWatchRequest(tcloudwatch_dimensiontGetMetricStatisticscBsLeZdZedddddƒedddd	d
eddƒedd
ddd
edddedƒddƒeddddddeddeƒddƒedddddddƒedddddddƒeddd dd!ded"d#dd$ƒed%dd&dd'ƒgZd(gZ	d)„Z
d*„Zd+„Zd,„Z
d-„ZRS(.sShow a metric's statisticst
MetricNametmetavartMETRICthelps3name of the metric to get statistics for (required)s-ns--namespacetdestt	Namespacetrequireds!the metric's namespace (required)s-ss--statisticssStatistics.membersSTAT1,STAT2,...ttypet,s3the metric statistics to show (at least 1 required)s--dimensionssDimensions.membersKEY1=VALUE1,KEY2=VALUE2,...t	item_types$the dimensions of the metric to shows--start-timet	StartTimesYYYY-MM-DDThh:mm:ssZsQearliest time to
                retrieve data points for (default: one hour ago)s
--end-timetEndTimesFlatest time to retrieve
                data points for (default: now)s--periodtPeriodtSECONDStdefaulti<s`granularity of the returned data
                points (must be a multiple of 60) (default: 60)s--unittUnitsunit the metric is reported int
DatapointscCsntj|ƒ|jjdƒrj|jddkrAtdƒ‚qj|jdddkrjtdƒ‚qjndS(Ntperiodis)argument --period: value must be positivei<s1argument --period: value must be a multiple of 60(Rt	configuretargstgetR(tself((sU/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pyR@s
cCs‹tjjƒ}|tjddƒ}|jjdƒsP|jdƒ|jd<n|jjdƒs{|jdƒ|jd<nt|ddƒS(	NthoursiRs%Y-%m-%dT%H:%M:%SZRR(N(R(	tdatetimetutcnowt	timedeltaRRtstrftimetparamsRtNone(Rtnowtthen((sU/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pytmainJscCs||jd<dS(Nt	NextToken(R#(Rtpage((sU/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pytprepare_for_pageUscCs|jdƒpdS(NR((RR$(Rtresponse((sU/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pyt
get_next_pageZsc
Csòg}xÀ|jdgƒD]¬}|jddƒ}y(tjj|dƒ}|jdƒ}Wntk
rlnX|j||jdƒ|jdƒ|jdƒ|jd	ƒ|jd
ƒ|jdƒfƒqWx"t|ƒD]}|j|ƒGHqÖWdS(NRt	Timestampts%Y-%m-%dT%H:%M:%SZs%Y-%m-%d %H:%M:%StSampleCounttAveragetSumtMinimumtMaximumR(RRtstrptimeR"t
ValueErrortappendtsortedttabify(Rtresulttpointstpointt	timestamptparsed((sU/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pytprint_result^s	
(t__name__t
__module__tDESCRIPTIONRtTrueRRtinttARGSt	LIST_TAGSRR'R*R,R>(((sU/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pyR&s8		
			(RtrequestbuilderRtrequestbuilder.exceptionsRtrequestbuilder.mixinsRtrequestbuilder.responseRteuca2ools.commands.argtypesRteuca2ools.commands.monitoringRt&euca2ools.commands.monitoring.argtypesRR(((sU/usr/lib/python2.7/site-packages/euca2ools/commands/monitoring/getmetricstatistics.pyt<module>s
Back to Directory File Manager