api.go 161 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package cloudwatch
  3. import (
  4. "fmt"
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/query"
  11. )
  12. const opDeleteAlarms = "DeleteAlarms"
  13. // DeleteAlarmsRequest generates a "aws/request.Request" representing the
  14. // client's request for the DeleteAlarms operation. The "output" return
  15. // value will be populated with the request's response once the request completes
  16. // successfuly.
  17. //
  18. // Use "Send" method on the returned Request to send the API call to the service.
  19. // the "output" return value is not valid until after Send returns without error.
  20. //
  21. // See DeleteAlarms for more information on using the DeleteAlarms
  22. // API call, and error handling.
  23. //
  24. // This method is useful when you want to inject custom logic or configuration
  25. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  26. //
  27. //
  28. // // Example sending a request using the DeleteAlarmsRequest method.
  29. // req, resp := client.DeleteAlarmsRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms
  37. func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *request.Request, output *DeleteAlarmsOutput) {
  38. op := &request.Operation{
  39. Name: opDeleteAlarms,
  40. HTTPMethod: "POST",
  41. HTTPPath: "/",
  42. }
  43. if input == nil {
  44. input = &DeleteAlarmsInput{}
  45. }
  46. output = &DeleteAlarmsOutput{}
  47. req = c.newRequest(op, input, output)
  48. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  49. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  50. return
  51. }
  52. // DeleteAlarms API operation for Amazon CloudWatch.
  53. //
  54. // Deletes the specified alarms. In the event of an error, no alarms are deleted.
  55. //
  56. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  57. // with awserr.Error's Code and Message methods to get detailed information about
  58. // the error.
  59. //
  60. // See the AWS API reference guide for Amazon CloudWatch's
  61. // API operation DeleteAlarms for usage and error information.
  62. //
  63. // Returned Error Codes:
  64. // * ErrCodeResourceNotFound "ResourceNotFound"
  65. // The named resource does not exist.
  66. //
  67. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms
  68. func (c *CloudWatch) DeleteAlarms(input *DeleteAlarmsInput) (*DeleteAlarmsOutput, error) {
  69. req, out := c.DeleteAlarmsRequest(input)
  70. return out, req.Send()
  71. }
  72. // DeleteAlarmsWithContext is the same as DeleteAlarms with the addition of
  73. // the ability to pass a context and additional request options.
  74. //
  75. // See DeleteAlarms for details on how to use this API operation.
  76. //
  77. // The context must be non-nil and will be used for request cancellation. If
  78. // the context is nil a panic will occur. In the future the SDK may create
  79. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  80. // for more information on using Contexts.
  81. func (c *CloudWatch) DeleteAlarmsWithContext(ctx aws.Context, input *DeleteAlarmsInput, opts ...request.Option) (*DeleteAlarmsOutput, error) {
  82. req, out := c.DeleteAlarmsRequest(input)
  83. req.SetContext(ctx)
  84. req.ApplyOptions(opts...)
  85. return out, req.Send()
  86. }
  87. const opDeleteDashboards = "DeleteDashboards"
  88. // DeleteDashboardsRequest generates a "aws/request.Request" representing the
  89. // client's request for the DeleteDashboards operation. The "output" return
  90. // value will be populated with the request's response once the request completes
  91. // successfuly.
  92. //
  93. // Use "Send" method on the returned Request to send the API call to the service.
  94. // the "output" return value is not valid until after Send returns without error.
  95. //
  96. // See DeleteDashboards for more information on using the DeleteDashboards
  97. // API call, and error handling.
  98. //
  99. // This method is useful when you want to inject custom logic or configuration
  100. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  101. //
  102. //
  103. // // Example sending a request using the DeleteDashboardsRequest method.
  104. // req, resp := client.DeleteDashboardsRequest(params)
  105. //
  106. // err := req.Send()
  107. // if err == nil { // resp is now filled
  108. // fmt.Println(resp)
  109. // }
  110. //
  111. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboards
  112. func (c *CloudWatch) DeleteDashboardsRequest(input *DeleteDashboardsInput) (req *request.Request, output *DeleteDashboardsOutput) {
  113. op := &request.Operation{
  114. Name: opDeleteDashboards,
  115. HTTPMethod: "POST",
  116. HTTPPath: "/",
  117. }
  118. if input == nil {
  119. input = &DeleteDashboardsInput{}
  120. }
  121. output = &DeleteDashboardsOutput{}
  122. req = c.newRequest(op, input, output)
  123. return
  124. }
  125. // DeleteDashboards API operation for Amazon CloudWatch.
  126. //
  127. // Deletes all dashboards that you specify. You may specify up to 100 dashboards
  128. // to delete. If there is an error during this call, no dashboards are deleted.
  129. //
  130. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  131. // with awserr.Error's Code and Message methods to get detailed information about
  132. // the error.
  133. //
  134. // See the AWS API reference guide for Amazon CloudWatch's
  135. // API operation DeleteDashboards for usage and error information.
  136. //
  137. // Returned Error Codes:
  138. // * ErrCodeInvalidParameterValueException "InvalidParameterValue"
  139. // The value of an input parameter is bad or out-of-range.
  140. //
  141. // * ErrCodeDashboardNotFoundError "ResourceNotFound"
  142. // The specified dashboard does not exist.
  143. //
  144. // * ErrCodeInternalServiceFault "InternalServiceError"
  145. // Request processing has failed due to some unknown error, exception, or failure.
  146. //
  147. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboards
  148. func (c *CloudWatch) DeleteDashboards(input *DeleteDashboardsInput) (*DeleteDashboardsOutput, error) {
  149. req, out := c.DeleteDashboardsRequest(input)
  150. return out, req.Send()
  151. }
  152. // DeleteDashboardsWithContext is the same as DeleteDashboards with the addition of
  153. // the ability to pass a context and additional request options.
  154. //
  155. // See DeleteDashboards for details on how to use this API operation.
  156. //
  157. // The context must be non-nil and will be used for request cancellation. If
  158. // the context is nil a panic will occur. In the future the SDK may create
  159. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  160. // for more information on using Contexts.
  161. func (c *CloudWatch) DeleteDashboardsWithContext(ctx aws.Context, input *DeleteDashboardsInput, opts ...request.Option) (*DeleteDashboardsOutput, error) {
  162. req, out := c.DeleteDashboardsRequest(input)
  163. req.SetContext(ctx)
  164. req.ApplyOptions(opts...)
  165. return out, req.Send()
  166. }
  167. const opDescribeAlarmHistory = "DescribeAlarmHistory"
  168. // DescribeAlarmHistoryRequest generates a "aws/request.Request" representing the
  169. // client's request for the DescribeAlarmHistory operation. The "output" return
  170. // value will be populated with the request's response once the request completes
  171. // successfuly.
  172. //
  173. // Use "Send" method on the returned Request to send the API call to the service.
  174. // the "output" return value is not valid until after Send returns without error.
  175. //
  176. // See DescribeAlarmHistory for more information on using the DescribeAlarmHistory
  177. // API call, and error handling.
  178. //
  179. // This method is useful when you want to inject custom logic or configuration
  180. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  181. //
  182. //
  183. // // Example sending a request using the DescribeAlarmHistoryRequest method.
  184. // req, resp := client.DescribeAlarmHistoryRequest(params)
  185. //
  186. // err := req.Send()
  187. // if err == nil { // resp is now filled
  188. // fmt.Println(resp)
  189. // }
  190. //
  191. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory
  192. func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInput) (req *request.Request, output *DescribeAlarmHistoryOutput) {
  193. op := &request.Operation{
  194. Name: opDescribeAlarmHistory,
  195. HTTPMethod: "POST",
  196. HTTPPath: "/",
  197. Paginator: &request.Paginator{
  198. InputTokens: []string{"NextToken"},
  199. OutputTokens: []string{"NextToken"},
  200. LimitToken: "MaxRecords",
  201. TruncationToken: "",
  202. },
  203. }
  204. if input == nil {
  205. input = &DescribeAlarmHistoryInput{}
  206. }
  207. output = &DescribeAlarmHistoryOutput{}
  208. req = c.newRequest(op, input, output)
  209. return
  210. }
  211. // DescribeAlarmHistory API operation for Amazon CloudWatch.
  212. //
  213. // Retrieves the history for the specified alarm. You can filter the results
  214. // by date range or item type. If an alarm name is not specified, the histories
  215. // for all alarms are returned.
  216. //
  217. // CloudWatch retains the history of an alarm even if you delete the alarm.
  218. //
  219. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  220. // with awserr.Error's Code and Message methods to get detailed information about
  221. // the error.
  222. //
  223. // See the AWS API reference guide for Amazon CloudWatch's
  224. // API operation DescribeAlarmHistory for usage and error information.
  225. //
  226. // Returned Error Codes:
  227. // * ErrCodeInvalidNextToken "InvalidNextToken"
  228. // The next token specified is invalid.
  229. //
  230. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory
  231. func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*DescribeAlarmHistoryOutput, error) {
  232. req, out := c.DescribeAlarmHistoryRequest(input)
  233. return out, req.Send()
  234. }
  235. // DescribeAlarmHistoryWithContext is the same as DescribeAlarmHistory with the addition of
  236. // the ability to pass a context and additional request options.
  237. //
  238. // See DescribeAlarmHistory for details on how to use this API operation.
  239. //
  240. // The context must be non-nil and will be used for request cancellation. If
  241. // the context is nil a panic will occur. In the future the SDK may create
  242. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  243. // for more information on using Contexts.
  244. func (c *CloudWatch) DescribeAlarmHistoryWithContext(ctx aws.Context, input *DescribeAlarmHistoryInput, opts ...request.Option) (*DescribeAlarmHistoryOutput, error) {
  245. req, out := c.DescribeAlarmHistoryRequest(input)
  246. req.SetContext(ctx)
  247. req.ApplyOptions(opts...)
  248. return out, req.Send()
  249. }
  250. // DescribeAlarmHistoryPages iterates over the pages of a DescribeAlarmHistory operation,
  251. // calling the "fn" function with the response data for each page. To stop
  252. // iterating, return false from the fn function.
  253. //
  254. // See DescribeAlarmHistory method for more information on how to use this operation.
  255. //
  256. // Note: This operation can generate multiple requests to a service.
  257. //
  258. // // Example iterating over at most 3 pages of a DescribeAlarmHistory operation.
  259. // pageNum := 0
  260. // err := client.DescribeAlarmHistoryPages(params,
  261. // func(page *DescribeAlarmHistoryOutput, lastPage bool) bool {
  262. // pageNum++
  263. // fmt.Println(page)
  264. // return pageNum <= 3
  265. // })
  266. //
  267. func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(*DescribeAlarmHistoryOutput, bool) bool) error {
  268. return c.DescribeAlarmHistoryPagesWithContext(aws.BackgroundContext(), input, fn)
  269. }
  270. // DescribeAlarmHistoryPagesWithContext same as DescribeAlarmHistoryPages except
  271. // it takes a Context and allows setting request options on the pages.
  272. //
  273. // The context must be non-nil and will be used for request cancellation. If
  274. // the context is nil a panic will occur. In the future the SDK may create
  275. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  276. // for more information on using Contexts.
  277. func (c *CloudWatch) DescribeAlarmHistoryPagesWithContext(ctx aws.Context, input *DescribeAlarmHistoryInput, fn func(*DescribeAlarmHistoryOutput, bool) bool, opts ...request.Option) error {
  278. p := request.Pagination{
  279. NewRequest: func() (*request.Request, error) {
  280. var inCpy *DescribeAlarmHistoryInput
  281. if input != nil {
  282. tmp := *input
  283. inCpy = &tmp
  284. }
  285. req, _ := c.DescribeAlarmHistoryRequest(inCpy)
  286. req.SetContext(ctx)
  287. req.ApplyOptions(opts...)
  288. return req, nil
  289. },
  290. }
  291. cont := true
  292. for p.Next() && cont {
  293. cont = fn(p.Page().(*DescribeAlarmHistoryOutput), !p.HasNextPage())
  294. }
  295. return p.Err()
  296. }
  297. const opDescribeAlarms = "DescribeAlarms"
  298. // DescribeAlarmsRequest generates a "aws/request.Request" representing the
  299. // client's request for the DescribeAlarms operation. The "output" return
  300. // value will be populated with the request's response once the request completes
  301. // successfuly.
  302. //
  303. // Use "Send" method on the returned Request to send the API call to the service.
  304. // the "output" return value is not valid until after Send returns without error.
  305. //
  306. // See DescribeAlarms for more information on using the DescribeAlarms
  307. // API call, and error handling.
  308. //
  309. // This method is useful when you want to inject custom logic or configuration
  310. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  311. //
  312. //
  313. // // Example sending a request using the DescribeAlarmsRequest method.
  314. // req, resp := client.DescribeAlarmsRequest(params)
  315. //
  316. // err := req.Send()
  317. // if err == nil { // resp is now filled
  318. // fmt.Println(resp)
  319. // }
  320. //
  321. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms
  322. func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *request.Request, output *DescribeAlarmsOutput) {
  323. op := &request.Operation{
  324. Name: opDescribeAlarms,
  325. HTTPMethod: "POST",
  326. HTTPPath: "/",
  327. Paginator: &request.Paginator{
  328. InputTokens: []string{"NextToken"},
  329. OutputTokens: []string{"NextToken"},
  330. LimitToken: "MaxRecords",
  331. TruncationToken: "",
  332. },
  333. }
  334. if input == nil {
  335. input = &DescribeAlarmsInput{}
  336. }
  337. output = &DescribeAlarmsOutput{}
  338. req = c.newRequest(op, input, output)
  339. return
  340. }
  341. // DescribeAlarms API operation for Amazon CloudWatch.
  342. //
  343. // Retrieves the specified alarms. If no alarms are specified, all alarms are
  344. // returned. Alarms can be retrieved by using only a prefix for the alarm name,
  345. // the alarm state, or a prefix for any action.
  346. //
  347. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  348. // with awserr.Error's Code and Message methods to get detailed information about
  349. // the error.
  350. //
  351. // See the AWS API reference guide for Amazon CloudWatch's
  352. // API operation DescribeAlarms for usage and error information.
  353. //
  354. // Returned Error Codes:
  355. // * ErrCodeInvalidNextToken "InvalidNextToken"
  356. // The next token specified is invalid.
  357. //
  358. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms
  359. func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarmsOutput, error) {
  360. req, out := c.DescribeAlarmsRequest(input)
  361. return out, req.Send()
  362. }
  363. // DescribeAlarmsWithContext is the same as DescribeAlarms with the addition of
  364. // the ability to pass a context and additional request options.
  365. //
  366. // See DescribeAlarms for details on how to use this API operation.
  367. //
  368. // The context must be non-nil and will be used for request cancellation. If
  369. // the context is nil a panic will occur. In the future the SDK may create
  370. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  371. // for more information on using Contexts.
  372. func (c *CloudWatch) DescribeAlarmsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.Option) (*DescribeAlarmsOutput, error) {
  373. req, out := c.DescribeAlarmsRequest(input)
  374. req.SetContext(ctx)
  375. req.ApplyOptions(opts...)
  376. return out, req.Send()
  377. }
  378. // DescribeAlarmsPages iterates over the pages of a DescribeAlarms operation,
  379. // calling the "fn" function with the response data for each page. To stop
  380. // iterating, return false from the fn function.
  381. //
  382. // See DescribeAlarms method for more information on how to use this operation.
  383. //
  384. // Note: This operation can generate multiple requests to a service.
  385. //
  386. // // Example iterating over at most 3 pages of a DescribeAlarms operation.
  387. // pageNum := 0
  388. // err := client.DescribeAlarmsPages(params,
  389. // func(page *DescribeAlarmsOutput, lastPage bool) bool {
  390. // pageNum++
  391. // fmt.Println(page)
  392. // return pageNum <= 3
  393. // })
  394. //
  395. func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(*DescribeAlarmsOutput, bool) bool) error {
  396. return c.DescribeAlarmsPagesWithContext(aws.BackgroundContext(), input, fn)
  397. }
  398. // DescribeAlarmsPagesWithContext same as DescribeAlarmsPages except
  399. // it takes a Context and allows setting request options on the pages.
  400. //
  401. // The context must be non-nil and will be used for request cancellation. If
  402. // the context is nil a panic will occur. In the future the SDK may create
  403. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  404. // for more information on using Contexts.
  405. func (c *CloudWatch) DescribeAlarmsPagesWithContext(ctx aws.Context, input *DescribeAlarmsInput, fn func(*DescribeAlarmsOutput, bool) bool, opts ...request.Option) error {
  406. p := request.Pagination{
  407. NewRequest: func() (*request.Request, error) {
  408. var inCpy *DescribeAlarmsInput
  409. if input != nil {
  410. tmp := *input
  411. inCpy = &tmp
  412. }
  413. req, _ := c.DescribeAlarmsRequest(inCpy)
  414. req.SetContext(ctx)
  415. req.ApplyOptions(opts...)
  416. return req, nil
  417. },
  418. }
  419. cont := true
  420. for p.Next() && cont {
  421. cont = fn(p.Page().(*DescribeAlarmsOutput), !p.HasNextPage())
  422. }
  423. return p.Err()
  424. }
  425. const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric"
  426. // DescribeAlarmsForMetricRequest generates a "aws/request.Request" representing the
  427. // client's request for the DescribeAlarmsForMetric operation. The "output" return
  428. // value will be populated with the request's response once the request completes
  429. // successfuly.
  430. //
  431. // Use "Send" method on the returned Request to send the API call to the service.
  432. // the "output" return value is not valid until after Send returns without error.
  433. //
  434. // See DescribeAlarmsForMetric for more information on using the DescribeAlarmsForMetric
  435. // API call, and error handling.
  436. //
  437. // This method is useful when you want to inject custom logic or configuration
  438. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  439. //
  440. //
  441. // // Example sending a request using the DescribeAlarmsForMetricRequest method.
  442. // req, resp := client.DescribeAlarmsForMetricRequest(params)
  443. //
  444. // err := req.Send()
  445. // if err == nil { // resp is now filled
  446. // fmt.Println(resp)
  447. // }
  448. //
  449. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetric
  450. func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetricInput) (req *request.Request, output *DescribeAlarmsForMetricOutput) {
  451. op := &request.Operation{
  452. Name: opDescribeAlarmsForMetric,
  453. HTTPMethod: "POST",
  454. HTTPPath: "/",
  455. }
  456. if input == nil {
  457. input = &DescribeAlarmsForMetricInput{}
  458. }
  459. output = &DescribeAlarmsForMetricOutput{}
  460. req = c.newRequest(op, input, output)
  461. return
  462. }
  463. // DescribeAlarmsForMetric API operation for Amazon CloudWatch.
  464. //
  465. // Retrieves the alarms for the specified metric. To filter the results, specify
  466. // a statistic, period, or unit.
  467. //
  468. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  469. // with awserr.Error's Code and Message methods to get detailed information about
  470. // the error.
  471. //
  472. // See the AWS API reference guide for Amazon CloudWatch's
  473. // API operation DescribeAlarmsForMetric for usage and error information.
  474. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetric
  475. func (c *CloudWatch) DescribeAlarmsForMetric(input *DescribeAlarmsForMetricInput) (*DescribeAlarmsForMetricOutput, error) {
  476. req, out := c.DescribeAlarmsForMetricRequest(input)
  477. return out, req.Send()
  478. }
  479. // DescribeAlarmsForMetricWithContext is the same as DescribeAlarmsForMetric with the addition of
  480. // the ability to pass a context and additional request options.
  481. //
  482. // See DescribeAlarmsForMetric for details on how to use this API operation.
  483. //
  484. // The context must be non-nil and will be used for request cancellation. If
  485. // the context is nil a panic will occur. In the future the SDK may create
  486. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  487. // for more information on using Contexts.
  488. func (c *CloudWatch) DescribeAlarmsForMetricWithContext(ctx aws.Context, input *DescribeAlarmsForMetricInput, opts ...request.Option) (*DescribeAlarmsForMetricOutput, error) {
  489. req, out := c.DescribeAlarmsForMetricRequest(input)
  490. req.SetContext(ctx)
  491. req.ApplyOptions(opts...)
  492. return out, req.Send()
  493. }
  494. const opDisableAlarmActions = "DisableAlarmActions"
  495. // DisableAlarmActionsRequest generates a "aws/request.Request" representing the
  496. // client's request for the DisableAlarmActions operation. The "output" return
  497. // value will be populated with the request's response once the request completes
  498. // successfuly.
  499. //
  500. // Use "Send" method on the returned Request to send the API call to the service.
  501. // the "output" return value is not valid until after Send returns without error.
  502. //
  503. // See DisableAlarmActions for more information on using the DisableAlarmActions
  504. // API call, and error handling.
  505. //
  506. // This method is useful when you want to inject custom logic or configuration
  507. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  508. //
  509. //
  510. // // Example sending a request using the DisableAlarmActionsRequest method.
  511. // req, resp := client.DisableAlarmActionsRequest(params)
  512. //
  513. // err := req.Send()
  514. // if err == nil { // resp is now filled
  515. // fmt.Println(resp)
  516. // }
  517. //
  518. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions
  519. func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) (req *request.Request, output *DisableAlarmActionsOutput) {
  520. op := &request.Operation{
  521. Name: opDisableAlarmActions,
  522. HTTPMethod: "POST",
  523. HTTPPath: "/",
  524. }
  525. if input == nil {
  526. input = &DisableAlarmActionsInput{}
  527. }
  528. output = &DisableAlarmActionsOutput{}
  529. req = c.newRequest(op, input, output)
  530. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  531. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  532. return
  533. }
  534. // DisableAlarmActions API operation for Amazon CloudWatch.
  535. //
  536. // Disables the actions for the specified alarms. When an alarm's actions are
  537. // disabled, the alarm actions do not execute when the alarm state changes.
  538. //
  539. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  540. // with awserr.Error's Code and Message methods to get detailed information about
  541. // the error.
  542. //
  543. // See the AWS API reference guide for Amazon CloudWatch's
  544. // API operation DisableAlarmActions for usage and error information.
  545. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions
  546. func (c *CloudWatch) DisableAlarmActions(input *DisableAlarmActionsInput) (*DisableAlarmActionsOutput, error) {
  547. req, out := c.DisableAlarmActionsRequest(input)
  548. return out, req.Send()
  549. }
  550. // DisableAlarmActionsWithContext is the same as DisableAlarmActions with the addition of
  551. // the ability to pass a context and additional request options.
  552. //
  553. // See DisableAlarmActions for details on how to use this API operation.
  554. //
  555. // The context must be non-nil and will be used for request cancellation. If
  556. // the context is nil a panic will occur. In the future the SDK may create
  557. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  558. // for more information on using Contexts.
  559. func (c *CloudWatch) DisableAlarmActionsWithContext(ctx aws.Context, input *DisableAlarmActionsInput, opts ...request.Option) (*DisableAlarmActionsOutput, error) {
  560. req, out := c.DisableAlarmActionsRequest(input)
  561. req.SetContext(ctx)
  562. req.ApplyOptions(opts...)
  563. return out, req.Send()
  564. }
  565. const opEnableAlarmActions = "EnableAlarmActions"
  566. // EnableAlarmActionsRequest generates a "aws/request.Request" representing the
  567. // client's request for the EnableAlarmActions operation. The "output" return
  568. // value will be populated with the request's response once the request completes
  569. // successfuly.
  570. //
  571. // Use "Send" method on the returned Request to send the API call to the service.
  572. // the "output" return value is not valid until after Send returns without error.
  573. //
  574. // See EnableAlarmActions for more information on using the EnableAlarmActions
  575. // API call, and error handling.
  576. //
  577. // This method is useful when you want to inject custom logic or configuration
  578. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  579. //
  580. //
  581. // // Example sending a request using the EnableAlarmActionsRequest method.
  582. // req, resp := client.EnableAlarmActionsRequest(params)
  583. //
  584. // err := req.Send()
  585. // if err == nil { // resp is now filled
  586. // fmt.Println(resp)
  587. // }
  588. //
  589. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions
  590. func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (req *request.Request, output *EnableAlarmActionsOutput) {
  591. op := &request.Operation{
  592. Name: opEnableAlarmActions,
  593. HTTPMethod: "POST",
  594. HTTPPath: "/",
  595. }
  596. if input == nil {
  597. input = &EnableAlarmActionsInput{}
  598. }
  599. output = &EnableAlarmActionsOutput{}
  600. req = c.newRequest(op, input, output)
  601. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  602. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  603. return
  604. }
  605. // EnableAlarmActions API operation for Amazon CloudWatch.
  606. //
  607. // Enables the actions for the specified alarms.
  608. //
  609. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  610. // with awserr.Error's Code and Message methods to get detailed information about
  611. // the error.
  612. //
  613. // See the AWS API reference guide for Amazon CloudWatch's
  614. // API operation EnableAlarmActions for usage and error information.
  615. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions
  616. func (c *CloudWatch) EnableAlarmActions(input *EnableAlarmActionsInput) (*EnableAlarmActionsOutput, error) {
  617. req, out := c.EnableAlarmActionsRequest(input)
  618. return out, req.Send()
  619. }
  620. // EnableAlarmActionsWithContext is the same as EnableAlarmActions with the addition of
  621. // the ability to pass a context and additional request options.
  622. //
  623. // See EnableAlarmActions for details on how to use this API operation.
  624. //
  625. // The context must be non-nil and will be used for request cancellation. If
  626. // the context is nil a panic will occur. In the future the SDK may create
  627. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  628. // for more information on using Contexts.
  629. func (c *CloudWatch) EnableAlarmActionsWithContext(ctx aws.Context, input *EnableAlarmActionsInput, opts ...request.Option) (*EnableAlarmActionsOutput, error) {
  630. req, out := c.EnableAlarmActionsRequest(input)
  631. req.SetContext(ctx)
  632. req.ApplyOptions(opts...)
  633. return out, req.Send()
  634. }
  635. const opGetDashboard = "GetDashboard"
  636. // GetDashboardRequest generates a "aws/request.Request" representing the
  637. // client's request for the GetDashboard operation. The "output" return
  638. // value will be populated with the request's response once the request completes
  639. // successfuly.
  640. //
  641. // Use "Send" method on the returned Request to send the API call to the service.
  642. // the "output" return value is not valid until after Send returns without error.
  643. //
  644. // See GetDashboard for more information on using the GetDashboard
  645. // API call, and error handling.
  646. //
  647. // This method is useful when you want to inject custom logic or configuration
  648. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  649. //
  650. //
  651. // // Example sending a request using the GetDashboardRequest method.
  652. // req, resp := client.GetDashboardRequest(params)
  653. //
  654. // err := req.Send()
  655. // if err == nil { // resp is now filled
  656. // fmt.Println(resp)
  657. // }
  658. //
  659. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard
  660. func (c *CloudWatch) GetDashboardRequest(input *GetDashboardInput) (req *request.Request, output *GetDashboardOutput) {
  661. op := &request.Operation{
  662. Name: opGetDashboard,
  663. HTTPMethod: "POST",
  664. HTTPPath: "/",
  665. }
  666. if input == nil {
  667. input = &GetDashboardInput{}
  668. }
  669. output = &GetDashboardOutput{}
  670. req = c.newRequest(op, input, output)
  671. return
  672. }
  673. // GetDashboard API operation for Amazon CloudWatch.
  674. //
  675. // Displays the details of the dashboard that you specify.
  676. //
  677. // To copy an existing dashboard, use GetDashboard, and then use the data returned
  678. // within DashboardBody as the template for the new dashboard when you call
  679. // PutDashboard to create the copy.
  680. //
  681. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  682. // with awserr.Error's Code and Message methods to get detailed information about
  683. // the error.
  684. //
  685. // See the AWS API reference guide for Amazon CloudWatch's
  686. // API operation GetDashboard for usage and error information.
  687. //
  688. // Returned Error Codes:
  689. // * ErrCodeInvalidParameterValueException "InvalidParameterValue"
  690. // The value of an input parameter is bad or out-of-range.
  691. //
  692. // * ErrCodeDashboardNotFoundError "ResourceNotFound"
  693. // The specified dashboard does not exist.
  694. //
  695. // * ErrCodeInternalServiceFault "InternalServiceError"
  696. // Request processing has failed due to some unknown error, exception, or failure.
  697. //
  698. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard
  699. func (c *CloudWatch) GetDashboard(input *GetDashboardInput) (*GetDashboardOutput, error) {
  700. req, out := c.GetDashboardRequest(input)
  701. return out, req.Send()
  702. }
  703. // GetDashboardWithContext is the same as GetDashboard with the addition of
  704. // the ability to pass a context and additional request options.
  705. //
  706. // See GetDashboard for details on how to use this API operation.
  707. //
  708. // The context must be non-nil and will be used for request cancellation. If
  709. // the context is nil a panic will occur. In the future the SDK may create
  710. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  711. // for more information on using Contexts.
  712. func (c *CloudWatch) GetDashboardWithContext(ctx aws.Context, input *GetDashboardInput, opts ...request.Option) (*GetDashboardOutput, error) {
  713. req, out := c.GetDashboardRequest(input)
  714. req.SetContext(ctx)
  715. req.ApplyOptions(opts...)
  716. return out, req.Send()
  717. }
  718. const opGetMetricData = "GetMetricData"
  719. // GetMetricDataRequest generates a "aws/request.Request" representing the
  720. // client's request for the GetMetricData operation. The "output" return
  721. // value will be populated with the request's response once the request completes
  722. // successfuly.
  723. //
  724. // Use "Send" method on the returned Request to send the API call to the service.
  725. // the "output" return value is not valid until after Send returns without error.
  726. //
  727. // See GetMetricData for more information on using the GetMetricData
  728. // API call, and error handling.
  729. //
  730. // This method is useful when you want to inject custom logic or configuration
  731. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  732. //
  733. //
  734. // // Example sending a request using the GetMetricDataRequest method.
  735. // req, resp := client.GetMetricDataRequest(params)
  736. //
  737. // err := req.Send()
  738. // if err == nil { // resp is now filled
  739. // fmt.Println(resp)
  740. // }
  741. //
  742. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricData
  743. func (c *CloudWatch) GetMetricDataRequest(input *GetMetricDataInput) (req *request.Request, output *GetMetricDataOutput) {
  744. op := &request.Operation{
  745. Name: opGetMetricData,
  746. HTTPMethod: "POST",
  747. HTTPPath: "/",
  748. }
  749. if input == nil {
  750. input = &GetMetricDataInput{}
  751. }
  752. output = &GetMetricDataOutput{}
  753. req = c.newRequest(op, input, output)
  754. return
  755. }
  756. // GetMetricData API operation for Amazon CloudWatch.
  757. //
  758. // You can use the GetMetricData API to retrieve as many as 100 different metrics
  759. // in a single request, with a total of as many as 100,800 datapoints. You can
  760. // also optionally perform math expressions on the values of the returned statistics,
  761. // to create new time series that represent new insights into your data. For
  762. // example, using Lambda metrics, you could divide the Errors metric by the
  763. // Invocations metric to get an error rate time series. For more information
  764. // about metric math expressions, see Metric Math Syntax and Functions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax)
  765. // in the Amazon CloudWatch User Guide.
  766. //
  767. // Calls to the GetMetricData API have a different pricing structure than calls
  768. // to GetMetricStatistics. For more information about pricing, see Amazon CloudWatch
  769. // Pricing (https://aws.amazon.com/cloudwatch/pricing/).
  770. //
  771. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  772. // with awserr.Error's Code and Message methods to get detailed information about
  773. // the error.
  774. //
  775. // See the AWS API reference guide for Amazon CloudWatch's
  776. // API operation GetMetricData for usage and error information.
  777. //
  778. // Returned Error Codes:
  779. // * ErrCodeInvalidNextToken "InvalidNextToken"
  780. // The next token specified is invalid.
  781. //
  782. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricData
  783. func (c *CloudWatch) GetMetricData(input *GetMetricDataInput) (*GetMetricDataOutput, error) {
  784. req, out := c.GetMetricDataRequest(input)
  785. return out, req.Send()
  786. }
  787. // GetMetricDataWithContext is the same as GetMetricData with the addition of
  788. // the ability to pass a context and additional request options.
  789. //
  790. // See GetMetricData for details on how to use this API operation.
  791. //
  792. // The context must be non-nil and will be used for request cancellation. If
  793. // the context is nil a panic will occur. In the future the SDK may create
  794. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  795. // for more information on using Contexts.
  796. func (c *CloudWatch) GetMetricDataWithContext(ctx aws.Context, input *GetMetricDataInput, opts ...request.Option) (*GetMetricDataOutput, error) {
  797. req, out := c.GetMetricDataRequest(input)
  798. req.SetContext(ctx)
  799. req.ApplyOptions(opts...)
  800. return out, req.Send()
  801. }
  802. const opGetMetricStatistics = "GetMetricStatistics"
  803. // GetMetricStatisticsRequest generates a "aws/request.Request" representing the
  804. // client's request for the GetMetricStatistics operation. The "output" return
  805. // value will be populated with the request's response once the request completes
  806. // successfuly.
  807. //
  808. // Use "Send" method on the returned Request to send the API call to the service.
  809. // the "output" return value is not valid until after Send returns without error.
  810. //
  811. // See GetMetricStatistics for more information on using the GetMetricStatistics
  812. // API call, and error handling.
  813. //
  814. // This method is useful when you want to inject custom logic or configuration
  815. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  816. //
  817. //
  818. // // Example sending a request using the GetMetricStatisticsRequest method.
  819. // req, resp := client.GetMetricStatisticsRequest(params)
  820. //
  821. // err := req.Send()
  822. // if err == nil { // resp is now filled
  823. // fmt.Println(resp)
  824. // }
  825. //
  826. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics
  827. func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) (req *request.Request, output *GetMetricStatisticsOutput) {
  828. op := &request.Operation{
  829. Name: opGetMetricStatistics,
  830. HTTPMethod: "POST",
  831. HTTPPath: "/",
  832. }
  833. if input == nil {
  834. input = &GetMetricStatisticsInput{}
  835. }
  836. output = &GetMetricStatisticsOutput{}
  837. req = c.newRequest(op, input, output)
  838. return
  839. }
  840. // GetMetricStatistics API operation for Amazon CloudWatch.
  841. //
  842. // Gets statistics for the specified metric.
  843. //
  844. // The maximum number of data points returned from a single call is 1,440. If
  845. // you request more than 1,440 data points, CloudWatch returns an error. To
  846. // reduce the number of data points, you can narrow the specified time range
  847. // and make multiple requests across adjacent time ranges, or you can increase
  848. // the specified period. Data points are not returned in chronological order.
  849. //
  850. // CloudWatch aggregates data points based on the length of the period that
  851. // you specify. For example, if you request statistics with a one-hour period,
  852. // CloudWatch aggregates all data points with time stamps that fall within each
  853. // one-hour period. Therefore, the number of values aggregated by CloudWatch
  854. // is larger than the number of data points returned.
  855. //
  856. // CloudWatch needs raw data points to calculate percentile statistics. If you
  857. // publish data using a statistic set instead, you can only retrieve percentile
  858. // statistics for this data if one of the following conditions is true:
  859. //
  860. // * The SampleCount value of the statistic set is 1.
  861. //
  862. // * The Min and the Max values of the statistic set are equal.
  863. //
  864. // Amazon CloudWatch retains metric data as follows:
  865. //
  866. // * Data points with a period of less than 60 seconds are available for
  867. // 3 hours. These data points are high-resolution metrics and are available
  868. // only for custom metrics that have been defined with a StorageResolution
  869. // of 1.
  870. //
  871. // * Data points with a period of 60 seconds (1-minute) are available for
  872. // 15 days.
  873. //
  874. // * Data points with a period of 300 seconds (5-minute) are available for
  875. // 63 days.
  876. //
  877. // * Data points with a period of 3600 seconds (1 hour) are available for
  878. // 455 days (15 months).
  879. //
  880. // Data points that are initially published with a shorter period are aggregated
  881. // together for long-term storage. For example, if you collect data using a
  882. // period of 1 minute, the data remains available for 15 days with 1-minute
  883. // resolution. After 15 days, this data is still available, but is aggregated
  884. // and retrievable only with a resolution of 5 minutes. After 63 days, the data
  885. // is further aggregated and is available with a resolution of 1 hour.
  886. //
  887. // CloudWatch started retaining 5-minute and 1-hour metric data as of July 9,
  888. // 2016.
  889. //
  890. // For information about metrics and dimensions supported by AWS services, see
  891. // the Amazon CloudWatch Metrics and Dimensions Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html)
  892. // in the Amazon CloudWatch User Guide.
  893. //
  894. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  895. // with awserr.Error's Code and Message methods to get detailed information about
  896. // the error.
  897. //
  898. // See the AWS API reference guide for Amazon CloudWatch's
  899. // API operation GetMetricStatistics for usage and error information.
  900. //
  901. // Returned Error Codes:
  902. // * ErrCodeInvalidParameterValueException "InvalidParameterValue"
  903. // The value of an input parameter is bad or out-of-range.
  904. //
  905. // * ErrCodeMissingRequiredParameterException "MissingParameter"
  906. // An input parameter that is required is missing.
  907. //
  908. // * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination"
  909. // Parameters were used together that cannot be used together.
  910. //
  911. // * ErrCodeInternalServiceFault "InternalServiceError"
  912. // Request processing has failed due to some unknown error, exception, or failure.
  913. //
  914. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatistics
  915. func (c *CloudWatch) GetMetricStatistics(input *GetMetricStatisticsInput) (*GetMetricStatisticsOutput, error) {
  916. req, out := c.GetMetricStatisticsRequest(input)
  917. return out, req.Send()
  918. }
  919. // GetMetricStatisticsWithContext is the same as GetMetricStatistics with the addition of
  920. // the ability to pass a context and additional request options.
  921. //
  922. // See GetMetricStatistics for details on how to use this API operation.
  923. //
  924. // The context must be non-nil and will be used for request cancellation. If
  925. // the context is nil a panic will occur. In the future the SDK may create
  926. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  927. // for more information on using Contexts.
  928. func (c *CloudWatch) GetMetricStatisticsWithContext(ctx aws.Context, input *GetMetricStatisticsInput, opts ...request.Option) (*GetMetricStatisticsOutput, error) {
  929. req, out := c.GetMetricStatisticsRequest(input)
  930. req.SetContext(ctx)
  931. req.ApplyOptions(opts...)
  932. return out, req.Send()
  933. }
  934. const opListDashboards = "ListDashboards"
  935. // ListDashboardsRequest generates a "aws/request.Request" representing the
  936. // client's request for the ListDashboards operation. The "output" return
  937. // value will be populated with the request's response once the request completes
  938. // successfuly.
  939. //
  940. // Use "Send" method on the returned Request to send the API call to the service.
  941. // the "output" return value is not valid until after Send returns without error.
  942. //
  943. // See ListDashboards for more information on using the ListDashboards
  944. // API call, and error handling.
  945. //
  946. // This method is useful when you want to inject custom logic or configuration
  947. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  948. //
  949. //
  950. // // Example sending a request using the ListDashboardsRequest method.
  951. // req, resp := client.ListDashboardsRequest(params)
  952. //
  953. // err := req.Send()
  954. // if err == nil { // resp is now filled
  955. // fmt.Println(resp)
  956. // }
  957. //
  958. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboards
  959. func (c *CloudWatch) ListDashboardsRequest(input *ListDashboardsInput) (req *request.Request, output *ListDashboardsOutput) {
  960. op := &request.Operation{
  961. Name: opListDashboards,
  962. HTTPMethod: "POST",
  963. HTTPPath: "/",
  964. }
  965. if input == nil {
  966. input = &ListDashboardsInput{}
  967. }
  968. output = &ListDashboardsOutput{}
  969. req = c.newRequest(op, input, output)
  970. return
  971. }
  972. // ListDashboards API operation for Amazon CloudWatch.
  973. //
  974. // Returns a list of the dashboards for your account. If you include DashboardNamePrefix,
  975. // only those dashboards with names starting with the prefix are listed. Otherwise,
  976. // all dashboards in your account are listed.
  977. //
  978. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  979. // with awserr.Error's Code and Message methods to get detailed information about
  980. // the error.
  981. //
  982. // See the AWS API reference guide for Amazon CloudWatch's
  983. // API operation ListDashboards for usage and error information.
  984. //
  985. // Returned Error Codes:
  986. // * ErrCodeInvalidParameterValueException "InvalidParameterValue"
  987. // The value of an input parameter is bad or out-of-range.
  988. //
  989. // * ErrCodeInternalServiceFault "InternalServiceError"
  990. // Request processing has failed due to some unknown error, exception, or failure.
  991. //
  992. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboards
  993. func (c *CloudWatch) ListDashboards(input *ListDashboardsInput) (*ListDashboardsOutput, error) {
  994. req, out := c.ListDashboardsRequest(input)
  995. return out, req.Send()
  996. }
  997. // ListDashboardsWithContext is the same as ListDashboards with the addition of
  998. // the ability to pass a context and additional request options.
  999. //
  1000. // See ListDashboards for details on how to use this API operation.
  1001. //
  1002. // The context must be non-nil and will be used for request cancellation. If
  1003. // the context is nil a panic will occur. In the future the SDK may create
  1004. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1005. // for more information on using Contexts.
  1006. func (c *CloudWatch) ListDashboardsWithContext(ctx aws.Context, input *ListDashboardsInput, opts ...request.Option) (*ListDashboardsOutput, error) {
  1007. req, out := c.ListDashboardsRequest(input)
  1008. req.SetContext(ctx)
  1009. req.ApplyOptions(opts...)
  1010. return out, req.Send()
  1011. }
  1012. const opListMetrics = "ListMetrics"
  1013. // ListMetricsRequest generates a "aws/request.Request" representing the
  1014. // client's request for the ListMetrics operation. The "output" return
  1015. // value will be populated with the request's response once the request completes
  1016. // successfuly.
  1017. //
  1018. // Use "Send" method on the returned Request to send the API call to the service.
  1019. // the "output" return value is not valid until after Send returns without error.
  1020. //
  1021. // See ListMetrics for more information on using the ListMetrics
  1022. // API call, and error handling.
  1023. //
  1024. // This method is useful when you want to inject custom logic or configuration
  1025. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1026. //
  1027. //
  1028. // // Example sending a request using the ListMetricsRequest method.
  1029. // req, resp := client.ListMetricsRequest(params)
  1030. //
  1031. // err := req.Send()
  1032. // if err == nil { // resp is now filled
  1033. // fmt.Println(resp)
  1034. // }
  1035. //
  1036. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetrics
  1037. func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *request.Request, output *ListMetricsOutput) {
  1038. op := &request.Operation{
  1039. Name: opListMetrics,
  1040. HTTPMethod: "POST",
  1041. HTTPPath: "/",
  1042. Paginator: &request.Paginator{
  1043. InputTokens: []string{"NextToken"},
  1044. OutputTokens: []string{"NextToken"},
  1045. LimitToken: "",
  1046. TruncationToken: "",
  1047. },
  1048. }
  1049. if input == nil {
  1050. input = &ListMetricsInput{}
  1051. }
  1052. output = &ListMetricsOutput{}
  1053. req = c.newRequest(op, input, output)
  1054. return
  1055. }
  1056. // ListMetrics API operation for Amazon CloudWatch.
  1057. //
  1058. // List the specified metrics. You can use the returned metrics with GetMetricStatistics
  1059. // to obtain statistical data.
  1060. //
  1061. // Up to 500 results are returned for any one call. To retrieve additional results,
  1062. // use the returned token with subsequent calls.
  1063. //
  1064. // After you create a metric, allow up to fifteen minutes before the metric
  1065. // appears. Statistics about the metric, however, are available sooner using
  1066. // GetMetricStatistics.
  1067. //
  1068. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1069. // with awserr.Error's Code and Message methods to get detailed information about
  1070. // the error.
  1071. //
  1072. // See the AWS API reference guide for Amazon CloudWatch's
  1073. // API operation ListMetrics for usage and error information.
  1074. //
  1075. // Returned Error Codes:
  1076. // * ErrCodeInternalServiceFault "InternalServiceError"
  1077. // Request processing has failed due to some unknown error, exception, or failure.
  1078. //
  1079. // * ErrCodeInvalidParameterValueException "InvalidParameterValue"
  1080. // The value of an input parameter is bad or out-of-range.
  1081. //
  1082. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetrics
  1083. func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, error) {
  1084. req, out := c.ListMetricsRequest(input)
  1085. return out, req.Send()
  1086. }
  1087. // ListMetricsWithContext is the same as ListMetrics with the addition of
  1088. // the ability to pass a context and additional request options.
  1089. //
  1090. // See ListMetrics for details on how to use this API operation.
  1091. //
  1092. // The context must be non-nil and will be used for request cancellation. If
  1093. // the context is nil a panic will occur. In the future the SDK may create
  1094. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1095. // for more information on using Contexts.
  1096. func (c *CloudWatch) ListMetricsWithContext(ctx aws.Context, input *ListMetricsInput, opts ...request.Option) (*ListMetricsOutput, error) {
  1097. req, out := c.ListMetricsRequest(input)
  1098. req.SetContext(ctx)
  1099. req.ApplyOptions(opts...)
  1100. return out, req.Send()
  1101. }
  1102. // ListMetricsPages iterates over the pages of a ListMetrics operation,
  1103. // calling the "fn" function with the response data for each page. To stop
  1104. // iterating, return false from the fn function.
  1105. //
  1106. // See ListMetrics method for more information on how to use this operation.
  1107. //
  1108. // Note: This operation can generate multiple requests to a service.
  1109. //
  1110. // // Example iterating over at most 3 pages of a ListMetrics operation.
  1111. // pageNum := 0
  1112. // err := client.ListMetricsPages(params,
  1113. // func(page *ListMetricsOutput, lastPage bool) bool {
  1114. // pageNum++
  1115. // fmt.Println(page)
  1116. // return pageNum <= 3
  1117. // })
  1118. //
  1119. func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(*ListMetricsOutput, bool) bool) error {
  1120. return c.ListMetricsPagesWithContext(aws.BackgroundContext(), input, fn)
  1121. }
  1122. // ListMetricsPagesWithContext same as ListMetricsPages except
  1123. // it takes a Context and allows setting request options on the pages.
  1124. //
  1125. // The context must be non-nil and will be used for request cancellation. If
  1126. // the context is nil a panic will occur. In the future the SDK may create
  1127. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1128. // for more information on using Contexts.
  1129. func (c *CloudWatch) ListMetricsPagesWithContext(ctx aws.Context, input *ListMetricsInput, fn func(*ListMetricsOutput, bool) bool, opts ...request.Option) error {
  1130. p := request.Pagination{
  1131. NewRequest: func() (*request.Request, error) {
  1132. var inCpy *ListMetricsInput
  1133. if input != nil {
  1134. tmp := *input
  1135. inCpy = &tmp
  1136. }
  1137. req, _ := c.ListMetricsRequest(inCpy)
  1138. req.SetContext(ctx)
  1139. req.ApplyOptions(opts...)
  1140. return req, nil
  1141. },
  1142. }
  1143. cont := true
  1144. for p.Next() && cont {
  1145. cont = fn(p.Page().(*ListMetricsOutput), !p.HasNextPage())
  1146. }
  1147. return p.Err()
  1148. }
  1149. const opPutDashboard = "PutDashboard"
  1150. // PutDashboardRequest generates a "aws/request.Request" representing the
  1151. // client's request for the PutDashboard operation. The "output" return
  1152. // value will be populated with the request's response once the request completes
  1153. // successfuly.
  1154. //
  1155. // Use "Send" method on the returned Request to send the API call to the service.
  1156. // the "output" return value is not valid until after Send returns without error.
  1157. //
  1158. // See PutDashboard for more information on using the PutDashboard
  1159. // API call, and error handling.
  1160. //
  1161. // This method is useful when you want to inject custom logic or configuration
  1162. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1163. //
  1164. //
  1165. // // Example sending a request using the PutDashboardRequest method.
  1166. // req, resp := client.PutDashboardRequest(params)
  1167. //
  1168. // err := req.Send()
  1169. // if err == nil { // resp is now filled
  1170. // fmt.Println(resp)
  1171. // }
  1172. //
  1173. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard
  1174. func (c *CloudWatch) PutDashboardRequest(input *PutDashboardInput) (req *request.Request, output *PutDashboardOutput) {
  1175. op := &request.Operation{
  1176. Name: opPutDashboard,
  1177. HTTPMethod: "POST",
  1178. HTTPPath: "/",
  1179. }
  1180. if input == nil {
  1181. input = &PutDashboardInput{}
  1182. }
  1183. output = &PutDashboardOutput{}
  1184. req = c.newRequest(op, input, output)
  1185. return
  1186. }
  1187. // PutDashboard API operation for Amazon CloudWatch.
  1188. //
  1189. // Creates a dashboard if it does not already exist, or updates an existing
  1190. // dashboard. If you update a dashboard, the entire contents are replaced with
  1191. // what you specify here.
  1192. //
  1193. // You can have up to 500 dashboards per account. All dashboards in your account
  1194. // are global, not region-specific.
  1195. //
  1196. // A simple way to create a dashboard using PutDashboard is to copy an existing
  1197. // dashboard. To copy an existing dashboard using the console, you can load
  1198. // the dashboard and then use the View/edit source command in the Actions menu
  1199. // to display the JSON block for that dashboard. Another way to copy a dashboard
  1200. // is to use GetDashboard, and then use the data returned within DashboardBody
  1201. // as the template for the new dashboard when you call PutDashboard.
  1202. //
  1203. // When you create a dashboard with PutDashboard, a good practice is to add
  1204. // a text widget at the top of the dashboard with a message that the dashboard
  1205. // was created by script and should not be changed in the console. This message
  1206. // could also point console users to the location of the DashboardBody script
  1207. // or the CloudFormation template used to create the dashboard.
  1208. //
  1209. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1210. // with awserr.Error's Code and Message methods to get detailed information about
  1211. // the error.
  1212. //
  1213. // See the AWS API reference guide for Amazon CloudWatch's
  1214. // API operation PutDashboard for usage and error information.
  1215. //
  1216. // Returned Error Codes:
  1217. // * ErrCodeDashboardInvalidInputError "InvalidParameterInput"
  1218. // Some part of the dashboard data is invalid.
  1219. //
  1220. // * ErrCodeInternalServiceFault "InternalServiceError"
  1221. // Request processing has failed due to some unknown error, exception, or failure.
  1222. //
  1223. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard
  1224. func (c *CloudWatch) PutDashboard(input *PutDashboardInput) (*PutDashboardOutput, error) {
  1225. req, out := c.PutDashboardRequest(input)
  1226. return out, req.Send()
  1227. }
  1228. // PutDashboardWithContext is the same as PutDashboard with the addition of
  1229. // the ability to pass a context and additional request options.
  1230. //
  1231. // See PutDashboard for details on how to use this API operation.
  1232. //
  1233. // The context must be non-nil and will be used for request cancellation. If
  1234. // the context is nil a panic will occur. In the future the SDK may create
  1235. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1236. // for more information on using Contexts.
  1237. func (c *CloudWatch) PutDashboardWithContext(ctx aws.Context, input *PutDashboardInput, opts ...request.Option) (*PutDashboardOutput, error) {
  1238. req, out := c.PutDashboardRequest(input)
  1239. req.SetContext(ctx)
  1240. req.ApplyOptions(opts...)
  1241. return out, req.Send()
  1242. }
  1243. const opPutMetricAlarm = "PutMetricAlarm"
  1244. // PutMetricAlarmRequest generates a "aws/request.Request" representing the
  1245. // client's request for the PutMetricAlarm operation. The "output" return
  1246. // value will be populated with the request's response once the request completes
  1247. // successfuly.
  1248. //
  1249. // Use "Send" method on the returned Request to send the API call to the service.
  1250. // the "output" return value is not valid until after Send returns without error.
  1251. //
  1252. // See PutMetricAlarm for more information on using the PutMetricAlarm
  1253. // API call, and error handling.
  1254. //
  1255. // This method is useful when you want to inject custom logic or configuration
  1256. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1257. //
  1258. //
  1259. // // Example sending a request using the PutMetricAlarmRequest method.
  1260. // req, resp := client.PutMetricAlarmRequest(params)
  1261. //
  1262. // err := req.Send()
  1263. // if err == nil { // resp is now filled
  1264. // fmt.Println(resp)
  1265. // }
  1266. //
  1267. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm
  1268. func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *request.Request, output *PutMetricAlarmOutput) {
  1269. op := &request.Operation{
  1270. Name: opPutMetricAlarm,
  1271. HTTPMethod: "POST",
  1272. HTTPPath: "/",
  1273. }
  1274. if input == nil {
  1275. input = &PutMetricAlarmInput{}
  1276. }
  1277. output = &PutMetricAlarmOutput{}
  1278. req = c.newRequest(op, input, output)
  1279. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1280. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1281. return
  1282. }
  1283. // PutMetricAlarm API operation for Amazon CloudWatch.
  1284. //
  1285. // Creates or updates an alarm and associates it with the specified metric.
  1286. // Optionally, this operation can associate one or more Amazon SNS resources
  1287. // with the alarm.
  1288. //
  1289. // When this operation creates an alarm, the alarm state is immediately set
  1290. // to INSUFFICIENT_DATA. The alarm is evaluated and its state is set appropriately.
  1291. // Any actions associated with the state are then executed.
  1292. //
  1293. // When you update an existing alarm, its state is left unchanged, but the update
  1294. // completely overwrites the previous configuration of the alarm.
  1295. //
  1296. // If you are an IAM user, you must have Amazon EC2 permissions for some operations:
  1297. //
  1298. // * iam:CreateServiceLinkedRole for all alarms with EC2 actions
  1299. //
  1300. // * ec2:DescribeInstanceStatus and ec2:DescribeInstances for all alarms
  1301. // on EC2 instance status metrics
  1302. //
  1303. // * ec2:StopInstances for alarms with stop actions
  1304. //
  1305. // * ec2:TerminateInstances for alarms with terminate actions
  1306. //
  1307. // * ec2:DescribeInstanceRecoveryAttribute and ec2:RecoverInstances for alarms
  1308. // with recover actions
  1309. //
  1310. // If you have read/write permissions for Amazon CloudWatch but not for Amazon
  1311. // EC2, you can still create an alarm, but the stop or terminate actions are
  1312. // not performed. However, if you are later granted the required permissions,
  1313. // the alarm actions that you created earlier are performed.
  1314. //
  1315. // If you are using an IAM role (for example, an EC2 instance profile), you
  1316. // cannot stop or terminate the instance using alarm actions. However, you can
  1317. // still see the alarm state and perform any other actions such as Amazon SNS
  1318. // notifications or Auto Scaling policies.
  1319. //
  1320. // If you are using temporary security credentials granted using AWS STS, you
  1321. // cannot stop or terminate an EC2 instance using alarm actions.
  1322. //
  1323. // You must create at least one stop, terminate, or reboot alarm using either
  1324. // the Amazon EC2 or CloudWatch consoles to create the EC2ActionsAccess IAM
  1325. // role. After this IAM role is created, you can create stop, terminate, or
  1326. // reboot alarms using a command-line interface or API.
  1327. //
  1328. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1329. // with awserr.Error's Code and Message methods to get detailed information about
  1330. // the error.
  1331. //
  1332. // See the AWS API reference guide for Amazon CloudWatch's
  1333. // API operation PutMetricAlarm for usage and error information.
  1334. //
  1335. // Returned Error Codes:
  1336. // * ErrCodeLimitExceededFault "LimitExceeded"
  1337. // The quota for alarms for this customer has already been reached.
  1338. //
  1339. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm
  1340. func (c *CloudWatch) PutMetricAlarm(input *PutMetricAlarmInput) (*PutMetricAlarmOutput, error) {
  1341. req, out := c.PutMetricAlarmRequest(input)
  1342. return out, req.Send()
  1343. }
  1344. // PutMetricAlarmWithContext is the same as PutMetricAlarm with the addition of
  1345. // the ability to pass a context and additional request options.
  1346. //
  1347. // See PutMetricAlarm for details on how to use this API operation.
  1348. //
  1349. // The context must be non-nil and will be used for request cancellation. If
  1350. // the context is nil a panic will occur. In the future the SDK may create
  1351. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1352. // for more information on using Contexts.
  1353. func (c *CloudWatch) PutMetricAlarmWithContext(ctx aws.Context, input *PutMetricAlarmInput, opts ...request.Option) (*PutMetricAlarmOutput, error) {
  1354. req, out := c.PutMetricAlarmRequest(input)
  1355. req.SetContext(ctx)
  1356. req.ApplyOptions(opts...)
  1357. return out, req.Send()
  1358. }
  1359. const opPutMetricData = "PutMetricData"
  1360. // PutMetricDataRequest generates a "aws/request.Request" representing the
  1361. // client's request for the PutMetricData operation. The "output" return
  1362. // value will be populated with the request's response once the request completes
  1363. // successfuly.
  1364. //
  1365. // Use "Send" method on the returned Request to send the API call to the service.
  1366. // the "output" return value is not valid until after Send returns without error.
  1367. //
  1368. // See PutMetricData for more information on using the PutMetricData
  1369. // API call, and error handling.
  1370. //
  1371. // This method is useful when you want to inject custom logic or configuration
  1372. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1373. //
  1374. //
  1375. // // Example sending a request using the PutMetricDataRequest method.
  1376. // req, resp := client.PutMetricDataRequest(params)
  1377. //
  1378. // err := req.Send()
  1379. // if err == nil { // resp is now filled
  1380. // fmt.Println(resp)
  1381. // }
  1382. //
  1383. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricData
  1384. func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *request.Request, output *PutMetricDataOutput) {
  1385. op := &request.Operation{
  1386. Name: opPutMetricData,
  1387. HTTPMethod: "POST",
  1388. HTTPPath: "/",
  1389. }
  1390. if input == nil {
  1391. input = &PutMetricDataInput{}
  1392. }
  1393. output = &PutMetricDataOutput{}
  1394. req = c.newRequest(op, input, output)
  1395. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1396. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1397. return
  1398. }
  1399. // PutMetricData API operation for Amazon CloudWatch.
  1400. //
  1401. // Publishes metric data points to Amazon CloudWatch. CloudWatch associates
  1402. // the data points with the specified metric. If the specified metric does not
  1403. // exist, CloudWatch creates the metric. When CloudWatch creates a metric, it
  1404. // can take up to fifteen minutes for the metric to appear in calls to ListMetrics.
  1405. //
  1406. // Each PutMetricData request is limited to 40 KB in size for HTTP POST requests.
  1407. //
  1408. // Although the Value parameter accepts numbers of type Double, CloudWatch rejects
  1409. // values that are either too small or too large. Values must be in the range
  1410. // of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).
  1411. // In addition, special values (for example, NaN, +Infinity, -Infinity) are
  1412. // not supported.
  1413. //
  1414. // You can use up to 10 dimensions per metric to further clarify what data the
  1415. // metric collects. For more information about specifying dimensions, see Publishing
  1416. // Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html)
  1417. // in the Amazon CloudWatch User Guide.
  1418. //
  1419. // Data points with time stamps from 24 hours ago or longer can take at least
  1420. // 48 hours to become available for GetMetricStatistics from the time they are
  1421. // submitted.
  1422. //
  1423. // CloudWatch needs raw data points to calculate percentile statistics. If you
  1424. // publish data using a statistic set instead, you can only retrieve percentile
  1425. // statistics for this data if one of the following conditions is true:
  1426. //
  1427. // * The SampleCount value of the statistic set is 1
  1428. //
  1429. // * The Min and the Max values of the statistic set are equal
  1430. //
  1431. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1432. // with awserr.Error's Code and Message methods to get detailed information about
  1433. // the error.
  1434. //
  1435. // See the AWS API reference guide for Amazon CloudWatch's
  1436. // API operation PutMetricData for usage and error information.
  1437. //
  1438. // Returned Error Codes:
  1439. // * ErrCodeInvalidParameterValueException "InvalidParameterValue"
  1440. // The value of an input parameter is bad or out-of-range.
  1441. //
  1442. // * ErrCodeMissingRequiredParameterException "MissingParameter"
  1443. // An input parameter that is required is missing.
  1444. //
  1445. // * ErrCodeInvalidParameterCombinationException "InvalidParameterCombination"
  1446. // Parameters were used together that cannot be used together.
  1447. //
  1448. // * ErrCodeInternalServiceFault "InternalServiceError"
  1449. // Request processing has failed due to some unknown error, exception, or failure.
  1450. //
  1451. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricData
  1452. func (c *CloudWatch) PutMetricData(input *PutMetricDataInput) (*PutMetricDataOutput, error) {
  1453. req, out := c.PutMetricDataRequest(input)
  1454. return out, req.Send()
  1455. }
  1456. // PutMetricDataWithContext is the same as PutMetricData with the addition of
  1457. // the ability to pass a context and additional request options.
  1458. //
  1459. // See PutMetricData for details on how to use this API operation.
  1460. //
  1461. // The context must be non-nil and will be used for request cancellation. If
  1462. // the context is nil a panic will occur. In the future the SDK may create
  1463. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1464. // for more information on using Contexts.
  1465. func (c *CloudWatch) PutMetricDataWithContext(ctx aws.Context, input *PutMetricDataInput, opts ...request.Option) (*PutMetricDataOutput, error) {
  1466. req, out := c.PutMetricDataRequest(input)
  1467. req.SetContext(ctx)
  1468. req.ApplyOptions(opts...)
  1469. return out, req.Send()
  1470. }
  1471. const opSetAlarmState = "SetAlarmState"
  1472. // SetAlarmStateRequest generates a "aws/request.Request" representing the
  1473. // client's request for the SetAlarmState operation. The "output" return
  1474. // value will be populated with the request's response once the request completes
  1475. // successfuly.
  1476. //
  1477. // Use "Send" method on the returned Request to send the API call to the service.
  1478. // the "output" return value is not valid until after Send returns without error.
  1479. //
  1480. // See SetAlarmState for more information on using the SetAlarmState
  1481. // API call, and error handling.
  1482. //
  1483. // This method is useful when you want to inject custom logic or configuration
  1484. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1485. //
  1486. //
  1487. // // Example sending a request using the SetAlarmStateRequest method.
  1488. // req, resp := client.SetAlarmStateRequest(params)
  1489. //
  1490. // err := req.Send()
  1491. // if err == nil { // resp is now filled
  1492. // fmt.Println(resp)
  1493. // }
  1494. //
  1495. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState
  1496. func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *request.Request, output *SetAlarmStateOutput) {
  1497. op := &request.Operation{
  1498. Name: opSetAlarmState,
  1499. HTTPMethod: "POST",
  1500. HTTPPath: "/",
  1501. }
  1502. if input == nil {
  1503. input = &SetAlarmStateInput{}
  1504. }
  1505. output = &SetAlarmStateOutput{}
  1506. req = c.newRequest(op, input, output)
  1507. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  1508. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1509. return
  1510. }
  1511. // SetAlarmState API operation for Amazon CloudWatch.
  1512. //
  1513. // Temporarily sets the state of an alarm for testing purposes. When the updated
  1514. // state differs from the previous value, the action configured for the appropriate
  1515. // state is invoked. For example, if your alarm is configured to send an Amazon
  1516. // SNS message when an alarm is triggered, temporarily changing the alarm state
  1517. // to ALARM sends an SNS message. The alarm returns to its actual state (often
  1518. // within seconds). Because the alarm state change happens quickly, it is typically
  1519. // only visible in the alarm's History tab in the Amazon CloudWatch console
  1520. // or through DescribeAlarmHistory.
  1521. //
  1522. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1523. // with awserr.Error's Code and Message methods to get detailed information about
  1524. // the error.
  1525. //
  1526. // See the AWS API reference guide for Amazon CloudWatch's
  1527. // API operation SetAlarmState for usage and error information.
  1528. //
  1529. // Returned Error Codes:
  1530. // * ErrCodeResourceNotFound "ResourceNotFound"
  1531. // The named resource does not exist.
  1532. //
  1533. // * ErrCodeInvalidFormatFault "InvalidFormat"
  1534. // Data was not syntactically valid JSON.
  1535. //
  1536. // See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState
  1537. func (c *CloudWatch) SetAlarmState(input *SetAlarmStateInput) (*SetAlarmStateOutput, error) {
  1538. req, out := c.SetAlarmStateRequest(input)
  1539. return out, req.Send()
  1540. }
  1541. // SetAlarmStateWithContext is the same as SetAlarmState with the addition of
  1542. // the ability to pass a context and additional request options.
  1543. //
  1544. // See SetAlarmState for details on how to use this API operation.
  1545. //
  1546. // The context must be non-nil and will be used for request cancellation. If
  1547. // the context is nil a panic will occur. In the future the SDK may create
  1548. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1549. // for more information on using Contexts.
  1550. func (c *CloudWatch) SetAlarmStateWithContext(ctx aws.Context, input *SetAlarmStateInput, opts ...request.Option) (*SetAlarmStateOutput, error) {
  1551. req, out := c.SetAlarmStateRequest(input)
  1552. req.SetContext(ctx)
  1553. req.ApplyOptions(opts...)
  1554. return out, req.Send()
  1555. }
  1556. // Represents the history of a specific alarm.
  1557. type AlarmHistoryItem struct {
  1558. _ struct{} `type:"structure"`
  1559. // The descriptive name for the alarm.
  1560. AlarmName *string `min:"1" type:"string"`
  1561. // Data about the alarm, in JSON format.
  1562. HistoryData *string `min:"1" type:"string"`
  1563. // The type of alarm history item.
  1564. HistoryItemType *string `type:"string" enum:"HistoryItemType"`
  1565. // A summary of the alarm history, in text format.
  1566. HistorySummary *string `min:"1" type:"string"`
  1567. // The time stamp for the alarm history item.
  1568. Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1569. }
  1570. // String returns the string representation
  1571. func (s AlarmHistoryItem) String() string {
  1572. return awsutil.Prettify(s)
  1573. }
  1574. // GoString returns the string representation
  1575. func (s AlarmHistoryItem) GoString() string {
  1576. return s.String()
  1577. }
  1578. // SetAlarmName sets the AlarmName field's value.
  1579. func (s *AlarmHistoryItem) SetAlarmName(v string) *AlarmHistoryItem {
  1580. s.AlarmName = &v
  1581. return s
  1582. }
  1583. // SetHistoryData sets the HistoryData field's value.
  1584. func (s *AlarmHistoryItem) SetHistoryData(v string) *AlarmHistoryItem {
  1585. s.HistoryData = &v
  1586. return s
  1587. }
  1588. // SetHistoryItemType sets the HistoryItemType field's value.
  1589. func (s *AlarmHistoryItem) SetHistoryItemType(v string) *AlarmHistoryItem {
  1590. s.HistoryItemType = &v
  1591. return s
  1592. }
  1593. // SetHistorySummary sets the HistorySummary field's value.
  1594. func (s *AlarmHistoryItem) SetHistorySummary(v string) *AlarmHistoryItem {
  1595. s.HistorySummary = &v
  1596. return s
  1597. }
  1598. // SetTimestamp sets the Timestamp field's value.
  1599. func (s *AlarmHistoryItem) SetTimestamp(v time.Time) *AlarmHistoryItem {
  1600. s.Timestamp = &v
  1601. return s
  1602. }
  1603. // Represents a specific dashboard.
  1604. type DashboardEntry struct {
  1605. _ struct{} `type:"structure"`
  1606. // The Amazon Resource Name (ARN) of the dashboard.
  1607. DashboardArn *string `type:"string"`
  1608. // The name of the dashboard.
  1609. DashboardName *string `type:"string"`
  1610. // The time stamp of when the dashboard was last modified, either by an API
  1611. // call or through the console. This number is expressed as the number of milliseconds
  1612. // since Jan 1, 1970 00:00:00 UTC.
  1613. LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1614. // The size of the dashboard, in bytes.
  1615. Size *int64 `type:"long"`
  1616. }
  1617. // String returns the string representation
  1618. func (s DashboardEntry) String() string {
  1619. return awsutil.Prettify(s)
  1620. }
  1621. // GoString returns the string representation
  1622. func (s DashboardEntry) GoString() string {
  1623. return s.String()
  1624. }
  1625. // SetDashboardArn sets the DashboardArn field's value.
  1626. func (s *DashboardEntry) SetDashboardArn(v string) *DashboardEntry {
  1627. s.DashboardArn = &v
  1628. return s
  1629. }
  1630. // SetDashboardName sets the DashboardName field's value.
  1631. func (s *DashboardEntry) SetDashboardName(v string) *DashboardEntry {
  1632. s.DashboardName = &v
  1633. return s
  1634. }
  1635. // SetLastModified sets the LastModified field's value.
  1636. func (s *DashboardEntry) SetLastModified(v time.Time) *DashboardEntry {
  1637. s.LastModified = &v
  1638. return s
  1639. }
  1640. // SetSize sets the Size field's value.
  1641. func (s *DashboardEntry) SetSize(v int64) *DashboardEntry {
  1642. s.Size = &v
  1643. return s
  1644. }
  1645. // An error or warning for the operation.
  1646. type DashboardValidationMessage struct {
  1647. _ struct{} `type:"structure"`
  1648. // The data path related to the message.
  1649. DataPath *string `type:"string"`
  1650. // A message describing the error or warning.
  1651. Message *string `type:"string"`
  1652. }
  1653. // String returns the string representation
  1654. func (s DashboardValidationMessage) String() string {
  1655. return awsutil.Prettify(s)
  1656. }
  1657. // GoString returns the string representation
  1658. func (s DashboardValidationMessage) GoString() string {
  1659. return s.String()
  1660. }
  1661. // SetDataPath sets the DataPath field's value.
  1662. func (s *DashboardValidationMessage) SetDataPath(v string) *DashboardValidationMessage {
  1663. s.DataPath = &v
  1664. return s
  1665. }
  1666. // SetMessage sets the Message field's value.
  1667. func (s *DashboardValidationMessage) SetMessage(v string) *DashboardValidationMessage {
  1668. s.Message = &v
  1669. return s
  1670. }
  1671. // Encapsulates the statistical data that CloudWatch computes from metric data.
  1672. type Datapoint struct {
  1673. _ struct{} `type:"structure"`
  1674. // The average of the metric values that correspond to the data point.
  1675. Average *float64 `type:"double"`
  1676. // The percentile statistic for the data point.
  1677. ExtendedStatistics map[string]*float64 `type:"map"`
  1678. // The maximum metric value for the data point.
  1679. Maximum *float64 `type:"double"`
  1680. // The minimum metric value for the data point.
  1681. Minimum *float64 `type:"double"`
  1682. // The number of metric values that contributed to the aggregate value of this
  1683. // data point.
  1684. SampleCount *float64 `type:"double"`
  1685. // The sum of the metric values for the data point.
  1686. Sum *float64 `type:"double"`
  1687. // The time stamp used for the data point.
  1688. Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1689. // The standard unit for the data point.
  1690. Unit *string `type:"string" enum:"StandardUnit"`
  1691. }
  1692. // String returns the string representation
  1693. func (s Datapoint) String() string {
  1694. return awsutil.Prettify(s)
  1695. }
  1696. // GoString returns the string representation
  1697. func (s Datapoint) GoString() string {
  1698. return s.String()
  1699. }
  1700. // SetAverage sets the Average field's value.
  1701. func (s *Datapoint) SetAverage(v float64) *Datapoint {
  1702. s.Average = &v
  1703. return s
  1704. }
  1705. // SetExtendedStatistics sets the ExtendedStatistics field's value.
  1706. func (s *Datapoint) SetExtendedStatistics(v map[string]*float64) *Datapoint {
  1707. s.ExtendedStatistics = v
  1708. return s
  1709. }
  1710. // SetMaximum sets the Maximum field's value.
  1711. func (s *Datapoint) SetMaximum(v float64) *Datapoint {
  1712. s.Maximum = &v
  1713. return s
  1714. }
  1715. // SetMinimum sets the Minimum field's value.
  1716. func (s *Datapoint) SetMinimum(v float64) *Datapoint {
  1717. s.Minimum = &v
  1718. return s
  1719. }
  1720. // SetSampleCount sets the SampleCount field's value.
  1721. func (s *Datapoint) SetSampleCount(v float64) *Datapoint {
  1722. s.SampleCount = &v
  1723. return s
  1724. }
  1725. // SetSum sets the Sum field's value.
  1726. func (s *Datapoint) SetSum(v float64) *Datapoint {
  1727. s.Sum = &v
  1728. return s
  1729. }
  1730. // SetTimestamp sets the Timestamp field's value.
  1731. func (s *Datapoint) SetTimestamp(v time.Time) *Datapoint {
  1732. s.Timestamp = &v
  1733. return s
  1734. }
  1735. // SetUnit sets the Unit field's value.
  1736. func (s *Datapoint) SetUnit(v string) *Datapoint {
  1737. s.Unit = &v
  1738. return s
  1739. }
  1740. type DeleteAlarmsInput struct {
  1741. _ struct{} `type:"structure"`
  1742. // The alarms to be deleted.
  1743. //
  1744. // AlarmNames is a required field
  1745. AlarmNames []*string `type:"list" required:"true"`
  1746. }
  1747. // String returns the string representation
  1748. func (s DeleteAlarmsInput) String() string {
  1749. return awsutil.Prettify(s)
  1750. }
  1751. // GoString returns the string representation
  1752. func (s DeleteAlarmsInput) GoString() string {
  1753. return s.String()
  1754. }
  1755. // Validate inspects the fields of the type to determine if they are valid.
  1756. func (s *DeleteAlarmsInput) Validate() error {
  1757. invalidParams := request.ErrInvalidParams{Context: "DeleteAlarmsInput"}
  1758. if s.AlarmNames == nil {
  1759. invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
  1760. }
  1761. if invalidParams.Len() > 0 {
  1762. return invalidParams
  1763. }
  1764. return nil
  1765. }
  1766. // SetAlarmNames sets the AlarmNames field's value.
  1767. func (s *DeleteAlarmsInput) SetAlarmNames(v []*string) *DeleteAlarmsInput {
  1768. s.AlarmNames = v
  1769. return s
  1770. }
  1771. type DeleteAlarmsOutput struct {
  1772. _ struct{} `type:"structure"`
  1773. }
  1774. // String returns the string representation
  1775. func (s DeleteAlarmsOutput) String() string {
  1776. return awsutil.Prettify(s)
  1777. }
  1778. // GoString returns the string representation
  1779. func (s DeleteAlarmsOutput) GoString() string {
  1780. return s.String()
  1781. }
  1782. type DeleteDashboardsInput struct {
  1783. _ struct{} `type:"structure"`
  1784. // The dashboards to be deleted. This parameter is required.
  1785. //
  1786. // DashboardNames is a required field
  1787. DashboardNames []*string `type:"list" required:"true"`
  1788. }
  1789. // String returns the string representation
  1790. func (s DeleteDashboardsInput) String() string {
  1791. return awsutil.Prettify(s)
  1792. }
  1793. // GoString returns the string representation
  1794. func (s DeleteDashboardsInput) GoString() string {
  1795. return s.String()
  1796. }
  1797. // Validate inspects the fields of the type to determine if they are valid.
  1798. func (s *DeleteDashboardsInput) Validate() error {
  1799. invalidParams := request.ErrInvalidParams{Context: "DeleteDashboardsInput"}
  1800. if s.DashboardNames == nil {
  1801. invalidParams.Add(request.NewErrParamRequired("DashboardNames"))
  1802. }
  1803. if invalidParams.Len() > 0 {
  1804. return invalidParams
  1805. }
  1806. return nil
  1807. }
  1808. // SetDashboardNames sets the DashboardNames field's value.
  1809. func (s *DeleteDashboardsInput) SetDashboardNames(v []*string) *DeleteDashboardsInput {
  1810. s.DashboardNames = v
  1811. return s
  1812. }
  1813. type DeleteDashboardsOutput struct {
  1814. _ struct{} `type:"structure"`
  1815. }
  1816. // String returns the string representation
  1817. func (s DeleteDashboardsOutput) String() string {
  1818. return awsutil.Prettify(s)
  1819. }
  1820. // GoString returns the string representation
  1821. func (s DeleteDashboardsOutput) GoString() string {
  1822. return s.String()
  1823. }
  1824. type DescribeAlarmHistoryInput struct {
  1825. _ struct{} `type:"structure"`
  1826. // The name of the alarm.
  1827. AlarmName *string `min:"1" type:"string"`
  1828. // The ending date to retrieve alarm history.
  1829. EndDate *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1830. // The type of alarm histories to retrieve.
  1831. HistoryItemType *string `type:"string" enum:"HistoryItemType"`
  1832. // The maximum number of alarm history records to retrieve.
  1833. MaxRecords *int64 `min:"1" type:"integer"`
  1834. // The token returned by a previous call to indicate that there is more data
  1835. // available.
  1836. NextToken *string `type:"string"`
  1837. // The starting date to retrieve alarm history.
  1838. StartDate *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1839. }
  1840. // String returns the string representation
  1841. func (s DescribeAlarmHistoryInput) String() string {
  1842. return awsutil.Prettify(s)
  1843. }
  1844. // GoString returns the string representation
  1845. func (s DescribeAlarmHistoryInput) GoString() string {
  1846. return s.String()
  1847. }
  1848. // Validate inspects the fields of the type to determine if they are valid.
  1849. func (s *DescribeAlarmHistoryInput) Validate() error {
  1850. invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmHistoryInput"}
  1851. if s.AlarmName != nil && len(*s.AlarmName) < 1 {
  1852. invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
  1853. }
  1854. if s.MaxRecords != nil && *s.MaxRecords < 1 {
  1855. invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1))
  1856. }
  1857. if invalidParams.Len() > 0 {
  1858. return invalidParams
  1859. }
  1860. return nil
  1861. }
  1862. // SetAlarmName sets the AlarmName field's value.
  1863. func (s *DescribeAlarmHistoryInput) SetAlarmName(v string) *DescribeAlarmHistoryInput {
  1864. s.AlarmName = &v
  1865. return s
  1866. }
  1867. // SetEndDate sets the EndDate field's value.
  1868. func (s *DescribeAlarmHistoryInput) SetEndDate(v time.Time) *DescribeAlarmHistoryInput {
  1869. s.EndDate = &v
  1870. return s
  1871. }
  1872. // SetHistoryItemType sets the HistoryItemType field's value.
  1873. func (s *DescribeAlarmHistoryInput) SetHistoryItemType(v string) *DescribeAlarmHistoryInput {
  1874. s.HistoryItemType = &v
  1875. return s
  1876. }
  1877. // SetMaxRecords sets the MaxRecords field's value.
  1878. func (s *DescribeAlarmHistoryInput) SetMaxRecords(v int64) *DescribeAlarmHistoryInput {
  1879. s.MaxRecords = &v
  1880. return s
  1881. }
  1882. // SetNextToken sets the NextToken field's value.
  1883. func (s *DescribeAlarmHistoryInput) SetNextToken(v string) *DescribeAlarmHistoryInput {
  1884. s.NextToken = &v
  1885. return s
  1886. }
  1887. // SetStartDate sets the StartDate field's value.
  1888. func (s *DescribeAlarmHistoryInput) SetStartDate(v time.Time) *DescribeAlarmHistoryInput {
  1889. s.StartDate = &v
  1890. return s
  1891. }
  1892. type DescribeAlarmHistoryOutput struct {
  1893. _ struct{} `type:"structure"`
  1894. // The alarm histories, in JSON format.
  1895. AlarmHistoryItems []*AlarmHistoryItem `type:"list"`
  1896. // The token that marks the start of the next batch of returned results.
  1897. NextToken *string `type:"string"`
  1898. }
  1899. // String returns the string representation
  1900. func (s DescribeAlarmHistoryOutput) String() string {
  1901. return awsutil.Prettify(s)
  1902. }
  1903. // GoString returns the string representation
  1904. func (s DescribeAlarmHistoryOutput) GoString() string {
  1905. return s.String()
  1906. }
  1907. // SetAlarmHistoryItems sets the AlarmHistoryItems field's value.
  1908. func (s *DescribeAlarmHistoryOutput) SetAlarmHistoryItems(v []*AlarmHistoryItem) *DescribeAlarmHistoryOutput {
  1909. s.AlarmHistoryItems = v
  1910. return s
  1911. }
  1912. // SetNextToken sets the NextToken field's value.
  1913. func (s *DescribeAlarmHistoryOutput) SetNextToken(v string) *DescribeAlarmHistoryOutput {
  1914. s.NextToken = &v
  1915. return s
  1916. }
  1917. type DescribeAlarmsForMetricInput struct {
  1918. _ struct{} `type:"structure"`
  1919. // The dimensions associated with the metric. If the metric has any associated
  1920. // dimensions, you must specify them in order for the call to succeed.
  1921. Dimensions []*Dimension `type:"list"`
  1922. // The percentile statistic for the metric. Specify a value between p0.0 and
  1923. // p100.
  1924. ExtendedStatistic *string `type:"string"`
  1925. // The name of the metric.
  1926. //
  1927. // MetricName is a required field
  1928. MetricName *string `min:"1" type:"string" required:"true"`
  1929. // The namespace of the metric.
  1930. //
  1931. // Namespace is a required field
  1932. Namespace *string `min:"1" type:"string" required:"true"`
  1933. // The period, in seconds, over which the statistic is applied.
  1934. Period *int64 `min:"1" type:"integer"`
  1935. // The statistic for the metric, other than percentiles. For percentile statistics,
  1936. // use ExtendedStatistics.
  1937. Statistic *string `type:"string" enum:"Statistic"`
  1938. // The unit for the metric.
  1939. Unit *string `type:"string" enum:"StandardUnit"`
  1940. }
  1941. // String returns the string representation
  1942. func (s DescribeAlarmsForMetricInput) String() string {
  1943. return awsutil.Prettify(s)
  1944. }
  1945. // GoString returns the string representation
  1946. func (s DescribeAlarmsForMetricInput) GoString() string {
  1947. return s.String()
  1948. }
  1949. // Validate inspects the fields of the type to determine if they are valid.
  1950. func (s *DescribeAlarmsForMetricInput) Validate() error {
  1951. invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsForMetricInput"}
  1952. if s.MetricName == nil {
  1953. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  1954. }
  1955. if s.MetricName != nil && len(*s.MetricName) < 1 {
  1956. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  1957. }
  1958. if s.Namespace == nil {
  1959. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  1960. }
  1961. if s.Namespace != nil && len(*s.Namespace) < 1 {
  1962. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  1963. }
  1964. if s.Period != nil && *s.Period < 1 {
  1965. invalidParams.Add(request.NewErrParamMinValue("Period", 1))
  1966. }
  1967. if s.Dimensions != nil {
  1968. for i, v := range s.Dimensions {
  1969. if v == nil {
  1970. continue
  1971. }
  1972. if err := v.Validate(); err != nil {
  1973. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  1974. }
  1975. }
  1976. }
  1977. if invalidParams.Len() > 0 {
  1978. return invalidParams
  1979. }
  1980. return nil
  1981. }
  1982. // SetDimensions sets the Dimensions field's value.
  1983. func (s *DescribeAlarmsForMetricInput) SetDimensions(v []*Dimension) *DescribeAlarmsForMetricInput {
  1984. s.Dimensions = v
  1985. return s
  1986. }
  1987. // SetExtendedStatistic sets the ExtendedStatistic field's value.
  1988. func (s *DescribeAlarmsForMetricInput) SetExtendedStatistic(v string) *DescribeAlarmsForMetricInput {
  1989. s.ExtendedStatistic = &v
  1990. return s
  1991. }
  1992. // SetMetricName sets the MetricName field's value.
  1993. func (s *DescribeAlarmsForMetricInput) SetMetricName(v string) *DescribeAlarmsForMetricInput {
  1994. s.MetricName = &v
  1995. return s
  1996. }
  1997. // SetNamespace sets the Namespace field's value.
  1998. func (s *DescribeAlarmsForMetricInput) SetNamespace(v string) *DescribeAlarmsForMetricInput {
  1999. s.Namespace = &v
  2000. return s
  2001. }
  2002. // SetPeriod sets the Period field's value.
  2003. func (s *DescribeAlarmsForMetricInput) SetPeriod(v int64) *DescribeAlarmsForMetricInput {
  2004. s.Period = &v
  2005. return s
  2006. }
  2007. // SetStatistic sets the Statistic field's value.
  2008. func (s *DescribeAlarmsForMetricInput) SetStatistic(v string) *DescribeAlarmsForMetricInput {
  2009. s.Statistic = &v
  2010. return s
  2011. }
  2012. // SetUnit sets the Unit field's value.
  2013. func (s *DescribeAlarmsForMetricInput) SetUnit(v string) *DescribeAlarmsForMetricInput {
  2014. s.Unit = &v
  2015. return s
  2016. }
  2017. type DescribeAlarmsForMetricOutput struct {
  2018. _ struct{} `type:"structure"`
  2019. // The information for each alarm with the specified metric.
  2020. MetricAlarms []*MetricAlarm `type:"list"`
  2021. }
  2022. // String returns the string representation
  2023. func (s DescribeAlarmsForMetricOutput) String() string {
  2024. return awsutil.Prettify(s)
  2025. }
  2026. // GoString returns the string representation
  2027. func (s DescribeAlarmsForMetricOutput) GoString() string {
  2028. return s.String()
  2029. }
  2030. // SetMetricAlarms sets the MetricAlarms field's value.
  2031. func (s *DescribeAlarmsForMetricOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsForMetricOutput {
  2032. s.MetricAlarms = v
  2033. return s
  2034. }
  2035. type DescribeAlarmsInput struct {
  2036. _ struct{} `type:"structure"`
  2037. // The action name prefix.
  2038. ActionPrefix *string `min:"1" type:"string"`
  2039. // The alarm name prefix. If this parameter is specified, you cannot specify
  2040. // AlarmNames.
  2041. AlarmNamePrefix *string `min:"1" type:"string"`
  2042. // The names of the alarms.
  2043. AlarmNames []*string `type:"list"`
  2044. // The maximum number of alarm descriptions to retrieve.
  2045. MaxRecords *int64 `min:"1" type:"integer"`
  2046. // The token returned by a previous call to indicate that there is more data
  2047. // available.
  2048. NextToken *string `type:"string"`
  2049. // The state value to be used in matching alarms.
  2050. StateValue *string `type:"string" enum:"StateValue"`
  2051. }
  2052. // String returns the string representation
  2053. func (s DescribeAlarmsInput) String() string {
  2054. return awsutil.Prettify(s)
  2055. }
  2056. // GoString returns the string representation
  2057. func (s DescribeAlarmsInput) GoString() string {
  2058. return s.String()
  2059. }
  2060. // Validate inspects the fields of the type to determine if they are valid.
  2061. func (s *DescribeAlarmsInput) Validate() error {
  2062. invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsInput"}
  2063. if s.ActionPrefix != nil && len(*s.ActionPrefix) < 1 {
  2064. invalidParams.Add(request.NewErrParamMinLen("ActionPrefix", 1))
  2065. }
  2066. if s.AlarmNamePrefix != nil && len(*s.AlarmNamePrefix) < 1 {
  2067. invalidParams.Add(request.NewErrParamMinLen("AlarmNamePrefix", 1))
  2068. }
  2069. if s.MaxRecords != nil && *s.MaxRecords < 1 {
  2070. invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1))
  2071. }
  2072. if invalidParams.Len() > 0 {
  2073. return invalidParams
  2074. }
  2075. return nil
  2076. }
  2077. // SetActionPrefix sets the ActionPrefix field's value.
  2078. func (s *DescribeAlarmsInput) SetActionPrefix(v string) *DescribeAlarmsInput {
  2079. s.ActionPrefix = &v
  2080. return s
  2081. }
  2082. // SetAlarmNamePrefix sets the AlarmNamePrefix field's value.
  2083. func (s *DescribeAlarmsInput) SetAlarmNamePrefix(v string) *DescribeAlarmsInput {
  2084. s.AlarmNamePrefix = &v
  2085. return s
  2086. }
  2087. // SetAlarmNames sets the AlarmNames field's value.
  2088. func (s *DescribeAlarmsInput) SetAlarmNames(v []*string) *DescribeAlarmsInput {
  2089. s.AlarmNames = v
  2090. return s
  2091. }
  2092. // SetMaxRecords sets the MaxRecords field's value.
  2093. func (s *DescribeAlarmsInput) SetMaxRecords(v int64) *DescribeAlarmsInput {
  2094. s.MaxRecords = &v
  2095. return s
  2096. }
  2097. // SetNextToken sets the NextToken field's value.
  2098. func (s *DescribeAlarmsInput) SetNextToken(v string) *DescribeAlarmsInput {
  2099. s.NextToken = &v
  2100. return s
  2101. }
  2102. // SetStateValue sets the StateValue field's value.
  2103. func (s *DescribeAlarmsInput) SetStateValue(v string) *DescribeAlarmsInput {
  2104. s.StateValue = &v
  2105. return s
  2106. }
  2107. type DescribeAlarmsOutput struct {
  2108. _ struct{} `type:"structure"`
  2109. // The information for the specified alarms.
  2110. MetricAlarms []*MetricAlarm `type:"list"`
  2111. // The token that marks the start of the next batch of returned results.
  2112. NextToken *string `type:"string"`
  2113. }
  2114. // String returns the string representation
  2115. func (s DescribeAlarmsOutput) String() string {
  2116. return awsutil.Prettify(s)
  2117. }
  2118. // GoString returns the string representation
  2119. func (s DescribeAlarmsOutput) GoString() string {
  2120. return s.String()
  2121. }
  2122. // SetMetricAlarms sets the MetricAlarms field's value.
  2123. func (s *DescribeAlarmsOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsOutput {
  2124. s.MetricAlarms = v
  2125. return s
  2126. }
  2127. // SetNextToken sets the NextToken field's value.
  2128. func (s *DescribeAlarmsOutput) SetNextToken(v string) *DescribeAlarmsOutput {
  2129. s.NextToken = &v
  2130. return s
  2131. }
  2132. // Expands the identity of a metric.
  2133. type Dimension struct {
  2134. _ struct{} `type:"structure"`
  2135. // The name of the dimension.
  2136. //
  2137. // Name is a required field
  2138. Name *string `min:"1" type:"string" required:"true"`
  2139. // The value representing the dimension measurement.
  2140. //
  2141. // Value is a required field
  2142. Value *string `min:"1" type:"string" required:"true"`
  2143. }
  2144. // String returns the string representation
  2145. func (s Dimension) String() string {
  2146. return awsutil.Prettify(s)
  2147. }
  2148. // GoString returns the string representation
  2149. func (s Dimension) GoString() string {
  2150. return s.String()
  2151. }
  2152. // Validate inspects the fields of the type to determine if they are valid.
  2153. func (s *Dimension) Validate() error {
  2154. invalidParams := request.ErrInvalidParams{Context: "Dimension"}
  2155. if s.Name == nil {
  2156. invalidParams.Add(request.NewErrParamRequired("Name"))
  2157. }
  2158. if s.Name != nil && len(*s.Name) < 1 {
  2159. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  2160. }
  2161. if s.Value == nil {
  2162. invalidParams.Add(request.NewErrParamRequired("Value"))
  2163. }
  2164. if s.Value != nil && len(*s.Value) < 1 {
  2165. invalidParams.Add(request.NewErrParamMinLen("Value", 1))
  2166. }
  2167. if invalidParams.Len() > 0 {
  2168. return invalidParams
  2169. }
  2170. return nil
  2171. }
  2172. // SetName sets the Name field's value.
  2173. func (s *Dimension) SetName(v string) *Dimension {
  2174. s.Name = &v
  2175. return s
  2176. }
  2177. // SetValue sets the Value field's value.
  2178. func (s *Dimension) SetValue(v string) *Dimension {
  2179. s.Value = &v
  2180. return s
  2181. }
  2182. // Represents filters for a dimension.
  2183. type DimensionFilter struct {
  2184. _ struct{} `type:"structure"`
  2185. // The dimension name to be matched.
  2186. //
  2187. // Name is a required field
  2188. Name *string `min:"1" type:"string" required:"true"`
  2189. // The value of the dimension to be matched.
  2190. Value *string `min:"1" type:"string"`
  2191. }
  2192. // String returns the string representation
  2193. func (s DimensionFilter) String() string {
  2194. return awsutil.Prettify(s)
  2195. }
  2196. // GoString returns the string representation
  2197. func (s DimensionFilter) GoString() string {
  2198. return s.String()
  2199. }
  2200. // Validate inspects the fields of the type to determine if they are valid.
  2201. func (s *DimensionFilter) Validate() error {
  2202. invalidParams := request.ErrInvalidParams{Context: "DimensionFilter"}
  2203. if s.Name == nil {
  2204. invalidParams.Add(request.NewErrParamRequired("Name"))
  2205. }
  2206. if s.Name != nil && len(*s.Name) < 1 {
  2207. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  2208. }
  2209. if s.Value != nil && len(*s.Value) < 1 {
  2210. invalidParams.Add(request.NewErrParamMinLen("Value", 1))
  2211. }
  2212. if invalidParams.Len() > 0 {
  2213. return invalidParams
  2214. }
  2215. return nil
  2216. }
  2217. // SetName sets the Name field's value.
  2218. func (s *DimensionFilter) SetName(v string) *DimensionFilter {
  2219. s.Name = &v
  2220. return s
  2221. }
  2222. // SetValue sets the Value field's value.
  2223. func (s *DimensionFilter) SetValue(v string) *DimensionFilter {
  2224. s.Value = &v
  2225. return s
  2226. }
  2227. type DisableAlarmActionsInput struct {
  2228. _ struct{} `type:"structure"`
  2229. // The names of the alarms.
  2230. //
  2231. // AlarmNames is a required field
  2232. AlarmNames []*string `type:"list" required:"true"`
  2233. }
  2234. // String returns the string representation
  2235. func (s DisableAlarmActionsInput) String() string {
  2236. return awsutil.Prettify(s)
  2237. }
  2238. // GoString returns the string representation
  2239. func (s DisableAlarmActionsInput) GoString() string {
  2240. return s.String()
  2241. }
  2242. // Validate inspects the fields of the type to determine if they are valid.
  2243. func (s *DisableAlarmActionsInput) Validate() error {
  2244. invalidParams := request.ErrInvalidParams{Context: "DisableAlarmActionsInput"}
  2245. if s.AlarmNames == nil {
  2246. invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
  2247. }
  2248. if invalidParams.Len() > 0 {
  2249. return invalidParams
  2250. }
  2251. return nil
  2252. }
  2253. // SetAlarmNames sets the AlarmNames field's value.
  2254. func (s *DisableAlarmActionsInput) SetAlarmNames(v []*string) *DisableAlarmActionsInput {
  2255. s.AlarmNames = v
  2256. return s
  2257. }
  2258. type DisableAlarmActionsOutput struct {
  2259. _ struct{} `type:"structure"`
  2260. }
  2261. // String returns the string representation
  2262. func (s DisableAlarmActionsOutput) String() string {
  2263. return awsutil.Prettify(s)
  2264. }
  2265. // GoString returns the string representation
  2266. func (s DisableAlarmActionsOutput) GoString() string {
  2267. return s.String()
  2268. }
  2269. type EnableAlarmActionsInput struct {
  2270. _ struct{} `type:"structure"`
  2271. // The names of the alarms.
  2272. //
  2273. // AlarmNames is a required field
  2274. AlarmNames []*string `type:"list" required:"true"`
  2275. }
  2276. // String returns the string representation
  2277. func (s EnableAlarmActionsInput) String() string {
  2278. return awsutil.Prettify(s)
  2279. }
  2280. // GoString returns the string representation
  2281. func (s EnableAlarmActionsInput) GoString() string {
  2282. return s.String()
  2283. }
  2284. // Validate inspects the fields of the type to determine if they are valid.
  2285. func (s *EnableAlarmActionsInput) Validate() error {
  2286. invalidParams := request.ErrInvalidParams{Context: "EnableAlarmActionsInput"}
  2287. if s.AlarmNames == nil {
  2288. invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
  2289. }
  2290. if invalidParams.Len() > 0 {
  2291. return invalidParams
  2292. }
  2293. return nil
  2294. }
  2295. // SetAlarmNames sets the AlarmNames field's value.
  2296. func (s *EnableAlarmActionsInput) SetAlarmNames(v []*string) *EnableAlarmActionsInput {
  2297. s.AlarmNames = v
  2298. return s
  2299. }
  2300. type EnableAlarmActionsOutput struct {
  2301. _ struct{} `type:"structure"`
  2302. }
  2303. // String returns the string representation
  2304. func (s EnableAlarmActionsOutput) String() string {
  2305. return awsutil.Prettify(s)
  2306. }
  2307. // GoString returns the string representation
  2308. func (s EnableAlarmActionsOutput) GoString() string {
  2309. return s.String()
  2310. }
  2311. type GetDashboardInput struct {
  2312. _ struct{} `type:"structure"`
  2313. // The name of the dashboard to be described.
  2314. //
  2315. // DashboardName is a required field
  2316. DashboardName *string `type:"string" required:"true"`
  2317. }
  2318. // String returns the string representation
  2319. func (s GetDashboardInput) String() string {
  2320. return awsutil.Prettify(s)
  2321. }
  2322. // GoString returns the string representation
  2323. func (s GetDashboardInput) GoString() string {
  2324. return s.String()
  2325. }
  2326. // Validate inspects the fields of the type to determine if they are valid.
  2327. func (s *GetDashboardInput) Validate() error {
  2328. invalidParams := request.ErrInvalidParams{Context: "GetDashboardInput"}
  2329. if s.DashboardName == nil {
  2330. invalidParams.Add(request.NewErrParamRequired("DashboardName"))
  2331. }
  2332. if invalidParams.Len() > 0 {
  2333. return invalidParams
  2334. }
  2335. return nil
  2336. }
  2337. // SetDashboardName sets the DashboardName field's value.
  2338. func (s *GetDashboardInput) SetDashboardName(v string) *GetDashboardInput {
  2339. s.DashboardName = &v
  2340. return s
  2341. }
  2342. type GetDashboardOutput struct {
  2343. _ struct{} `type:"structure"`
  2344. // The Amazon Resource Name (ARN) of the dashboard.
  2345. DashboardArn *string `type:"string"`
  2346. // The detailed information about the dashboard, including what widgets are
  2347. // included and their location on the dashboard. For more information about
  2348. // the DashboardBody syntax, see CloudWatch-Dashboard-Body-Structure.
  2349. DashboardBody *string `type:"string"`
  2350. // The name of the dashboard.
  2351. DashboardName *string `type:"string"`
  2352. }
  2353. // String returns the string representation
  2354. func (s GetDashboardOutput) String() string {
  2355. return awsutil.Prettify(s)
  2356. }
  2357. // GoString returns the string representation
  2358. func (s GetDashboardOutput) GoString() string {
  2359. return s.String()
  2360. }
  2361. // SetDashboardArn sets the DashboardArn field's value.
  2362. func (s *GetDashboardOutput) SetDashboardArn(v string) *GetDashboardOutput {
  2363. s.DashboardArn = &v
  2364. return s
  2365. }
  2366. // SetDashboardBody sets the DashboardBody field's value.
  2367. func (s *GetDashboardOutput) SetDashboardBody(v string) *GetDashboardOutput {
  2368. s.DashboardBody = &v
  2369. return s
  2370. }
  2371. // SetDashboardName sets the DashboardName field's value.
  2372. func (s *GetDashboardOutput) SetDashboardName(v string) *GetDashboardOutput {
  2373. s.DashboardName = &v
  2374. return s
  2375. }
  2376. type GetMetricDataInput struct {
  2377. _ struct{} `type:"structure"`
  2378. // The time stamp indicating the latest data to be returned.
  2379. //
  2380. // EndTime is a required field
  2381. EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
  2382. // The maximum number of data points the request should return before paginating.
  2383. // If you omit this, the default of 100,800 is used.
  2384. MaxDatapoints *int64 `type:"integer"`
  2385. // The metric queries to be returned. A single GetMetricData call can include
  2386. // as many as 100 MetricDataQuery structures. Each of these structures can specify
  2387. // either a metric to retrieve, or a math expression to perform on retrieved
  2388. // data.
  2389. //
  2390. // MetricDataQueries is a required field
  2391. MetricDataQueries []*MetricDataQuery `type:"list" required:"true"`
  2392. // Include this value, if it was returned by the previous call, to get the next
  2393. // set of data points.
  2394. NextToken *string `type:"string"`
  2395. // The order in which data points should be returned. TimestampDescending returns
  2396. // the newest data first and paginates when the MaxDatapoints limit is reached.
  2397. // TimestampAscending returns the oldest data first and paginates when the MaxDatapoints
  2398. // limit is reached.
  2399. ScanBy *string `type:"string" enum:"ScanBy"`
  2400. // The time stamp indicating the earliest data to be returned.
  2401. //
  2402. // StartTime is a required field
  2403. StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
  2404. }
  2405. // String returns the string representation
  2406. func (s GetMetricDataInput) String() string {
  2407. return awsutil.Prettify(s)
  2408. }
  2409. // GoString returns the string representation
  2410. func (s GetMetricDataInput) GoString() string {
  2411. return s.String()
  2412. }
  2413. // Validate inspects the fields of the type to determine if they are valid.
  2414. func (s *GetMetricDataInput) Validate() error {
  2415. invalidParams := request.ErrInvalidParams{Context: "GetMetricDataInput"}
  2416. if s.EndTime == nil {
  2417. invalidParams.Add(request.NewErrParamRequired("EndTime"))
  2418. }
  2419. if s.MetricDataQueries == nil {
  2420. invalidParams.Add(request.NewErrParamRequired("MetricDataQueries"))
  2421. }
  2422. if s.StartTime == nil {
  2423. invalidParams.Add(request.NewErrParamRequired("StartTime"))
  2424. }
  2425. if s.MetricDataQueries != nil {
  2426. for i, v := range s.MetricDataQueries {
  2427. if v == nil {
  2428. continue
  2429. }
  2430. if err := v.Validate(); err != nil {
  2431. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricDataQueries", i), err.(request.ErrInvalidParams))
  2432. }
  2433. }
  2434. }
  2435. if invalidParams.Len() > 0 {
  2436. return invalidParams
  2437. }
  2438. return nil
  2439. }
  2440. // SetEndTime sets the EndTime field's value.
  2441. func (s *GetMetricDataInput) SetEndTime(v time.Time) *GetMetricDataInput {
  2442. s.EndTime = &v
  2443. return s
  2444. }
  2445. // SetMaxDatapoints sets the MaxDatapoints field's value.
  2446. func (s *GetMetricDataInput) SetMaxDatapoints(v int64) *GetMetricDataInput {
  2447. s.MaxDatapoints = &v
  2448. return s
  2449. }
  2450. // SetMetricDataQueries sets the MetricDataQueries field's value.
  2451. func (s *GetMetricDataInput) SetMetricDataQueries(v []*MetricDataQuery) *GetMetricDataInput {
  2452. s.MetricDataQueries = v
  2453. return s
  2454. }
  2455. // SetNextToken sets the NextToken field's value.
  2456. func (s *GetMetricDataInput) SetNextToken(v string) *GetMetricDataInput {
  2457. s.NextToken = &v
  2458. return s
  2459. }
  2460. // SetScanBy sets the ScanBy field's value.
  2461. func (s *GetMetricDataInput) SetScanBy(v string) *GetMetricDataInput {
  2462. s.ScanBy = &v
  2463. return s
  2464. }
  2465. // SetStartTime sets the StartTime field's value.
  2466. func (s *GetMetricDataInput) SetStartTime(v time.Time) *GetMetricDataInput {
  2467. s.StartTime = &v
  2468. return s
  2469. }
  2470. type GetMetricDataOutput struct {
  2471. _ struct{} `type:"structure"`
  2472. // The metrics that are returned, including the metric name, namespace, and
  2473. // dimensions.
  2474. MetricDataResults []*MetricDataResult `type:"list"`
  2475. // A token that marks the next batch of returned results.
  2476. NextToken *string `type:"string"`
  2477. }
  2478. // String returns the string representation
  2479. func (s GetMetricDataOutput) String() string {
  2480. return awsutil.Prettify(s)
  2481. }
  2482. // GoString returns the string representation
  2483. func (s GetMetricDataOutput) GoString() string {
  2484. return s.String()
  2485. }
  2486. // SetMetricDataResults sets the MetricDataResults field's value.
  2487. func (s *GetMetricDataOutput) SetMetricDataResults(v []*MetricDataResult) *GetMetricDataOutput {
  2488. s.MetricDataResults = v
  2489. return s
  2490. }
  2491. // SetNextToken sets the NextToken field's value.
  2492. func (s *GetMetricDataOutput) SetNextToken(v string) *GetMetricDataOutput {
  2493. s.NextToken = &v
  2494. return s
  2495. }
  2496. type GetMetricStatisticsInput struct {
  2497. _ struct{} `type:"structure"`
  2498. // The dimensions. If the metric contains multiple dimensions, you must include
  2499. // a value for each dimension. CloudWatch treats each unique combination of
  2500. // dimensions as a separate metric. If a specific combination of dimensions
  2501. // was not published, you can't retrieve statistics for it. You must specify
  2502. // the same dimensions that were used when the metrics were created. For an
  2503. // example, see Dimension Combinations (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations)
  2504. // in the Amazon CloudWatch User Guide. For more information about specifying
  2505. // dimensions, see Publishing Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html)
  2506. // in the Amazon CloudWatch User Guide.
  2507. Dimensions []*Dimension `type:"list"`
  2508. // The time stamp that determines the last data point to return.
  2509. //
  2510. // The value specified is exclusive; results include data points up to the specified
  2511. // time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).
  2512. //
  2513. // EndTime is a required field
  2514. EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
  2515. // The percentile statistics. Specify values between p0.0 and p100. When calling
  2516. // GetMetricStatistics, you must specify either Statistics or ExtendedStatistics,
  2517. // but not both.
  2518. ExtendedStatistics []*string `min:"1" type:"list"`
  2519. // The name of the metric, with or without spaces.
  2520. //
  2521. // MetricName is a required field
  2522. MetricName *string `min:"1" type:"string" required:"true"`
  2523. // The namespace of the metric, with or without spaces.
  2524. //
  2525. // Namespace is a required field
  2526. Namespace *string `min:"1" type:"string" required:"true"`
  2527. // The granularity, in seconds, of the returned data points. For metrics with
  2528. // regular resolution, a period can be as short as one minute (60 seconds) and
  2529. // must be a multiple of 60. For high-resolution metrics that are collected
  2530. // at intervals of less than one minute, the period can be 1, 5, 10, 30, 60,
  2531. // or any multiple of 60. High-resolution metrics are those metrics stored by
  2532. // a PutMetricData call that includes a StorageResolution of 1 second.
  2533. //
  2534. // If the StartTime parameter specifies a time stamp that is greater than 3
  2535. // hours ago, you must specify the period as follows or no data points in that
  2536. // time range is returned:
  2537. //
  2538. // * Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds
  2539. // (1 minute).
  2540. //
  2541. // * Start time between 15 and 63 days ago - Use a multiple of 300 seconds
  2542. // (5 minutes).
  2543. //
  2544. // * Start time greater than 63 days ago - Use a multiple of 3600 seconds
  2545. // (1 hour).
  2546. //
  2547. // Period is a required field
  2548. Period *int64 `min:"1" type:"integer" required:"true"`
  2549. // The time stamp that determines the first data point to return. Start times
  2550. // are evaluated relative to the time that CloudWatch receives the request.
  2551. //
  2552. // The value specified is inclusive; results include data points with the specified
  2553. // time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
  2554. //
  2555. // CloudWatch rounds the specified time stamp as follows:
  2556. //
  2557. // * Start time less than 15 days ago - Round down to the nearest whole minute.
  2558. // For example, 12:32:34 is rounded down to 12:32:00.
  2559. //
  2560. // * Start time between 15 and 63 days ago - Round down to the nearest 5-minute
  2561. // clock interval. For example, 12:32:34 is rounded down to 12:30:00.
  2562. //
  2563. // * Start time greater than 63 days ago - Round down to the nearest 1-hour
  2564. // clock interval. For example, 12:32:34 is rounded down to 12:00:00.
  2565. //
  2566. // If you set Period to 5, 10, or 30, the start time of your request is rounded
  2567. // down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions
  2568. // of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for
  2569. // the previous 10-second period, the start time of your request is rounded
  2570. // down and you receive data from 01:05:10 to 01:05:20. If you make a query
  2571. // at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds,
  2572. // you receive data timestamped between 15:02:15 and 15:07:15.
  2573. //
  2574. // StartTime is a required field
  2575. StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
  2576. // The metric statistics, other than percentile. For percentile statistics,
  2577. // use ExtendedStatistics. When calling GetMetricStatistics, you must specify
  2578. // either Statistics or ExtendedStatistics, but not both.
  2579. Statistics []*string `min:"1" type:"list"`
  2580. // The unit for a given metric. Metrics may be reported in multiple units. Not
  2581. // supplying a unit results in all units being returned. If you specify only
  2582. // a unit that the metric does not report, the results of the call are null.
  2583. Unit *string `type:"string" enum:"StandardUnit"`
  2584. }
  2585. // String returns the string representation
  2586. func (s GetMetricStatisticsInput) String() string {
  2587. return awsutil.Prettify(s)
  2588. }
  2589. // GoString returns the string representation
  2590. func (s GetMetricStatisticsInput) GoString() string {
  2591. return s.String()
  2592. }
  2593. // Validate inspects the fields of the type to determine if they are valid.
  2594. func (s *GetMetricStatisticsInput) Validate() error {
  2595. invalidParams := request.ErrInvalidParams{Context: "GetMetricStatisticsInput"}
  2596. if s.EndTime == nil {
  2597. invalidParams.Add(request.NewErrParamRequired("EndTime"))
  2598. }
  2599. if s.ExtendedStatistics != nil && len(s.ExtendedStatistics) < 1 {
  2600. invalidParams.Add(request.NewErrParamMinLen("ExtendedStatistics", 1))
  2601. }
  2602. if s.MetricName == nil {
  2603. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  2604. }
  2605. if s.MetricName != nil && len(*s.MetricName) < 1 {
  2606. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  2607. }
  2608. if s.Namespace == nil {
  2609. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  2610. }
  2611. if s.Namespace != nil && len(*s.Namespace) < 1 {
  2612. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  2613. }
  2614. if s.Period == nil {
  2615. invalidParams.Add(request.NewErrParamRequired("Period"))
  2616. }
  2617. if s.Period != nil && *s.Period < 1 {
  2618. invalidParams.Add(request.NewErrParamMinValue("Period", 1))
  2619. }
  2620. if s.StartTime == nil {
  2621. invalidParams.Add(request.NewErrParamRequired("StartTime"))
  2622. }
  2623. if s.Statistics != nil && len(s.Statistics) < 1 {
  2624. invalidParams.Add(request.NewErrParamMinLen("Statistics", 1))
  2625. }
  2626. if s.Dimensions != nil {
  2627. for i, v := range s.Dimensions {
  2628. if v == nil {
  2629. continue
  2630. }
  2631. if err := v.Validate(); err != nil {
  2632. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  2633. }
  2634. }
  2635. }
  2636. if invalidParams.Len() > 0 {
  2637. return invalidParams
  2638. }
  2639. return nil
  2640. }
  2641. // SetDimensions sets the Dimensions field's value.
  2642. func (s *GetMetricStatisticsInput) SetDimensions(v []*Dimension) *GetMetricStatisticsInput {
  2643. s.Dimensions = v
  2644. return s
  2645. }
  2646. // SetEndTime sets the EndTime field's value.
  2647. func (s *GetMetricStatisticsInput) SetEndTime(v time.Time) *GetMetricStatisticsInput {
  2648. s.EndTime = &v
  2649. return s
  2650. }
  2651. // SetExtendedStatistics sets the ExtendedStatistics field's value.
  2652. func (s *GetMetricStatisticsInput) SetExtendedStatistics(v []*string) *GetMetricStatisticsInput {
  2653. s.ExtendedStatistics = v
  2654. return s
  2655. }
  2656. // SetMetricName sets the MetricName field's value.
  2657. func (s *GetMetricStatisticsInput) SetMetricName(v string) *GetMetricStatisticsInput {
  2658. s.MetricName = &v
  2659. return s
  2660. }
  2661. // SetNamespace sets the Namespace field's value.
  2662. func (s *GetMetricStatisticsInput) SetNamespace(v string) *GetMetricStatisticsInput {
  2663. s.Namespace = &v
  2664. return s
  2665. }
  2666. // SetPeriod sets the Period field's value.
  2667. func (s *GetMetricStatisticsInput) SetPeriod(v int64) *GetMetricStatisticsInput {
  2668. s.Period = &v
  2669. return s
  2670. }
  2671. // SetStartTime sets the StartTime field's value.
  2672. func (s *GetMetricStatisticsInput) SetStartTime(v time.Time) *GetMetricStatisticsInput {
  2673. s.StartTime = &v
  2674. return s
  2675. }
  2676. // SetStatistics sets the Statistics field's value.
  2677. func (s *GetMetricStatisticsInput) SetStatistics(v []*string) *GetMetricStatisticsInput {
  2678. s.Statistics = v
  2679. return s
  2680. }
  2681. // SetUnit sets the Unit field's value.
  2682. func (s *GetMetricStatisticsInput) SetUnit(v string) *GetMetricStatisticsInput {
  2683. s.Unit = &v
  2684. return s
  2685. }
  2686. type GetMetricStatisticsOutput struct {
  2687. _ struct{} `type:"structure"`
  2688. // The data points for the specified metric.
  2689. Datapoints []*Datapoint `type:"list"`
  2690. // A label for the specified metric.
  2691. Label *string `type:"string"`
  2692. }
  2693. // String returns the string representation
  2694. func (s GetMetricStatisticsOutput) String() string {
  2695. return awsutil.Prettify(s)
  2696. }
  2697. // GoString returns the string representation
  2698. func (s GetMetricStatisticsOutput) GoString() string {
  2699. return s.String()
  2700. }
  2701. // SetDatapoints sets the Datapoints field's value.
  2702. func (s *GetMetricStatisticsOutput) SetDatapoints(v []*Datapoint) *GetMetricStatisticsOutput {
  2703. s.Datapoints = v
  2704. return s
  2705. }
  2706. // SetLabel sets the Label field's value.
  2707. func (s *GetMetricStatisticsOutput) SetLabel(v string) *GetMetricStatisticsOutput {
  2708. s.Label = &v
  2709. return s
  2710. }
  2711. type ListDashboardsInput struct {
  2712. _ struct{} `type:"structure"`
  2713. // If you specify this parameter, only the dashboards with names starting with
  2714. // the specified string are listed. The maximum length is 255, and valid characters
  2715. // are A-Z, a-z, 0-9, ".", "-", and "_".
  2716. DashboardNamePrefix *string `type:"string"`
  2717. // The token returned by a previous call to indicate that there is more data
  2718. // available.
  2719. NextToken *string `type:"string"`
  2720. }
  2721. // String returns the string representation
  2722. func (s ListDashboardsInput) String() string {
  2723. return awsutil.Prettify(s)
  2724. }
  2725. // GoString returns the string representation
  2726. func (s ListDashboardsInput) GoString() string {
  2727. return s.String()
  2728. }
  2729. // SetDashboardNamePrefix sets the DashboardNamePrefix field's value.
  2730. func (s *ListDashboardsInput) SetDashboardNamePrefix(v string) *ListDashboardsInput {
  2731. s.DashboardNamePrefix = &v
  2732. return s
  2733. }
  2734. // SetNextToken sets the NextToken field's value.
  2735. func (s *ListDashboardsInput) SetNextToken(v string) *ListDashboardsInput {
  2736. s.NextToken = &v
  2737. return s
  2738. }
  2739. type ListDashboardsOutput struct {
  2740. _ struct{} `type:"structure"`
  2741. // The list of matching dashboards.
  2742. DashboardEntries []*DashboardEntry `type:"list"`
  2743. // The token that marks the start of the next batch of returned results.
  2744. NextToken *string `type:"string"`
  2745. }
  2746. // String returns the string representation
  2747. func (s ListDashboardsOutput) String() string {
  2748. return awsutil.Prettify(s)
  2749. }
  2750. // GoString returns the string representation
  2751. func (s ListDashboardsOutput) GoString() string {
  2752. return s.String()
  2753. }
  2754. // SetDashboardEntries sets the DashboardEntries field's value.
  2755. func (s *ListDashboardsOutput) SetDashboardEntries(v []*DashboardEntry) *ListDashboardsOutput {
  2756. s.DashboardEntries = v
  2757. return s
  2758. }
  2759. // SetNextToken sets the NextToken field's value.
  2760. func (s *ListDashboardsOutput) SetNextToken(v string) *ListDashboardsOutput {
  2761. s.NextToken = &v
  2762. return s
  2763. }
  2764. type ListMetricsInput struct {
  2765. _ struct{} `type:"structure"`
  2766. // The dimensions to filter against.
  2767. Dimensions []*DimensionFilter `type:"list"`
  2768. // The name of the metric to filter against.
  2769. MetricName *string `min:"1" type:"string"`
  2770. // The namespace to filter against.
  2771. Namespace *string `min:"1" type:"string"`
  2772. // The token returned by a previous call to indicate that there is more data
  2773. // available.
  2774. NextToken *string `type:"string"`
  2775. }
  2776. // String returns the string representation
  2777. func (s ListMetricsInput) String() string {
  2778. return awsutil.Prettify(s)
  2779. }
  2780. // GoString returns the string representation
  2781. func (s ListMetricsInput) GoString() string {
  2782. return s.String()
  2783. }
  2784. // Validate inspects the fields of the type to determine if they are valid.
  2785. func (s *ListMetricsInput) Validate() error {
  2786. invalidParams := request.ErrInvalidParams{Context: "ListMetricsInput"}
  2787. if s.MetricName != nil && len(*s.MetricName) < 1 {
  2788. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  2789. }
  2790. if s.Namespace != nil && len(*s.Namespace) < 1 {
  2791. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  2792. }
  2793. if s.Dimensions != nil {
  2794. for i, v := range s.Dimensions {
  2795. if v == nil {
  2796. continue
  2797. }
  2798. if err := v.Validate(); err != nil {
  2799. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  2800. }
  2801. }
  2802. }
  2803. if invalidParams.Len() > 0 {
  2804. return invalidParams
  2805. }
  2806. return nil
  2807. }
  2808. // SetDimensions sets the Dimensions field's value.
  2809. func (s *ListMetricsInput) SetDimensions(v []*DimensionFilter) *ListMetricsInput {
  2810. s.Dimensions = v
  2811. return s
  2812. }
  2813. // SetMetricName sets the MetricName field's value.
  2814. func (s *ListMetricsInput) SetMetricName(v string) *ListMetricsInput {
  2815. s.MetricName = &v
  2816. return s
  2817. }
  2818. // SetNamespace sets the Namespace field's value.
  2819. func (s *ListMetricsInput) SetNamespace(v string) *ListMetricsInput {
  2820. s.Namespace = &v
  2821. return s
  2822. }
  2823. // SetNextToken sets the NextToken field's value.
  2824. func (s *ListMetricsInput) SetNextToken(v string) *ListMetricsInput {
  2825. s.NextToken = &v
  2826. return s
  2827. }
  2828. type ListMetricsOutput struct {
  2829. _ struct{} `type:"structure"`
  2830. // The metrics.
  2831. Metrics []*Metric `type:"list"`
  2832. // The token that marks the start of the next batch of returned results.
  2833. NextToken *string `type:"string"`
  2834. }
  2835. // String returns the string representation
  2836. func (s ListMetricsOutput) String() string {
  2837. return awsutil.Prettify(s)
  2838. }
  2839. // GoString returns the string representation
  2840. func (s ListMetricsOutput) GoString() string {
  2841. return s.String()
  2842. }
  2843. // SetMetrics sets the Metrics field's value.
  2844. func (s *ListMetricsOutput) SetMetrics(v []*Metric) *ListMetricsOutput {
  2845. s.Metrics = v
  2846. return s
  2847. }
  2848. // SetNextToken sets the NextToken field's value.
  2849. func (s *ListMetricsOutput) SetNextToken(v string) *ListMetricsOutput {
  2850. s.NextToken = &v
  2851. return s
  2852. }
  2853. // A message returned by the GetMetricDataAPI, including a code and a description.
  2854. type MessageData struct {
  2855. _ struct{} `type:"structure"`
  2856. // The error code or status code associated with the message.
  2857. Code *string `type:"string"`
  2858. // The message text.
  2859. Value *string `type:"string"`
  2860. }
  2861. // String returns the string representation
  2862. func (s MessageData) String() string {
  2863. return awsutil.Prettify(s)
  2864. }
  2865. // GoString returns the string representation
  2866. func (s MessageData) GoString() string {
  2867. return s.String()
  2868. }
  2869. // SetCode sets the Code field's value.
  2870. func (s *MessageData) SetCode(v string) *MessageData {
  2871. s.Code = &v
  2872. return s
  2873. }
  2874. // SetValue sets the Value field's value.
  2875. func (s *MessageData) SetValue(v string) *MessageData {
  2876. s.Value = &v
  2877. return s
  2878. }
  2879. // Represents a specific metric.
  2880. type Metric struct {
  2881. _ struct{} `type:"structure"`
  2882. // The dimensions for the metric.
  2883. Dimensions []*Dimension `type:"list"`
  2884. // The name of the metric.
  2885. MetricName *string `min:"1" type:"string"`
  2886. // The namespace of the metric.
  2887. Namespace *string `min:"1" type:"string"`
  2888. }
  2889. // String returns the string representation
  2890. func (s Metric) String() string {
  2891. return awsutil.Prettify(s)
  2892. }
  2893. // GoString returns the string representation
  2894. func (s Metric) GoString() string {
  2895. return s.String()
  2896. }
  2897. // Validate inspects the fields of the type to determine if they are valid.
  2898. func (s *Metric) Validate() error {
  2899. invalidParams := request.ErrInvalidParams{Context: "Metric"}
  2900. if s.MetricName != nil && len(*s.MetricName) < 1 {
  2901. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  2902. }
  2903. if s.Namespace != nil && len(*s.Namespace) < 1 {
  2904. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  2905. }
  2906. if s.Dimensions != nil {
  2907. for i, v := range s.Dimensions {
  2908. if v == nil {
  2909. continue
  2910. }
  2911. if err := v.Validate(); err != nil {
  2912. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  2913. }
  2914. }
  2915. }
  2916. if invalidParams.Len() > 0 {
  2917. return invalidParams
  2918. }
  2919. return nil
  2920. }
  2921. // SetDimensions sets the Dimensions field's value.
  2922. func (s *Metric) SetDimensions(v []*Dimension) *Metric {
  2923. s.Dimensions = v
  2924. return s
  2925. }
  2926. // SetMetricName sets the MetricName field's value.
  2927. func (s *Metric) SetMetricName(v string) *Metric {
  2928. s.MetricName = &v
  2929. return s
  2930. }
  2931. // SetNamespace sets the Namespace field's value.
  2932. func (s *Metric) SetNamespace(v string) *Metric {
  2933. s.Namespace = &v
  2934. return s
  2935. }
  2936. // Represents an alarm.
  2937. type MetricAlarm struct {
  2938. _ struct{} `type:"structure"`
  2939. // Indicates whether actions should be executed during any changes to the alarm
  2940. // state.
  2941. ActionsEnabled *bool `type:"boolean"`
  2942. // The actions to execute when this alarm transitions to the ALARM state from
  2943. // any other state. Each action is specified as an Amazon Resource Name (ARN).
  2944. AlarmActions []*string `type:"list"`
  2945. // The Amazon Resource Name (ARN) of the alarm.
  2946. AlarmArn *string `min:"1" type:"string"`
  2947. // The time stamp of the last update to the alarm configuration.
  2948. AlarmConfigurationUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  2949. // The description of the alarm.
  2950. AlarmDescription *string `type:"string"`
  2951. // The name of the alarm.
  2952. AlarmName *string `min:"1" type:"string"`
  2953. // The arithmetic operation to use when comparing the specified statistic and
  2954. // threshold. The specified statistic value is used as the first operand.
  2955. ComparisonOperator *string `type:"string" enum:"ComparisonOperator"`
  2956. // The number of datapoints that must be breaching to trigger the alarm.
  2957. DatapointsToAlarm *int64 `min:"1" type:"integer"`
  2958. // The dimensions for the metric associated with the alarm.
  2959. Dimensions []*Dimension `type:"list"`
  2960. // Used only for alarms based on percentiles. If ignore, the alarm state does
  2961. // not change during periods with too few data points to be statistically significant.
  2962. // If evaluate or this parameter is not used, the alarm is always evaluated
  2963. // and possibly changes state no matter how many data points are available.
  2964. EvaluateLowSampleCountPercentile *string `min:"1" type:"string"`
  2965. // The number of periods over which data is compared to the specified threshold.
  2966. EvaluationPeriods *int64 `min:"1" type:"integer"`
  2967. // The percentile statistic for the metric associated with the alarm. Specify
  2968. // a value between p0.0 and p100.
  2969. ExtendedStatistic *string `type:"string"`
  2970. // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
  2971. // state from any other state. Each action is specified as an Amazon Resource
  2972. // Name (ARN).
  2973. InsufficientDataActions []*string `type:"list"`
  2974. // The name of the metric associated with the alarm.
  2975. MetricName *string `min:"1" type:"string"`
  2976. // The namespace of the metric associated with the alarm.
  2977. Namespace *string `min:"1" type:"string"`
  2978. // The actions to execute when this alarm transitions to the OK state from any
  2979. // other state. Each action is specified as an Amazon Resource Name (ARN).
  2980. OKActions []*string `type:"list"`
  2981. // The period, in seconds, over which the statistic is applied.
  2982. Period *int64 `min:"1" type:"integer"`
  2983. // An explanation for the alarm state, in text format.
  2984. StateReason *string `type:"string"`
  2985. // An explanation for the alarm state, in JSON format.
  2986. StateReasonData *string `type:"string"`
  2987. // The time stamp of the last update to the alarm state.
  2988. StateUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  2989. // The state value for the alarm.
  2990. StateValue *string `type:"string" enum:"StateValue"`
  2991. // The statistic for the metric associated with the alarm, other than percentile.
  2992. // For percentile statistics, use ExtendedStatistic.
  2993. Statistic *string `type:"string" enum:"Statistic"`
  2994. // The value to compare with the specified statistic.
  2995. Threshold *float64 `type:"double"`
  2996. // Sets how this alarm is to handle missing data points. If this parameter is
  2997. // omitted, the default behavior of missing is used.
  2998. TreatMissingData *string `min:"1" type:"string"`
  2999. // The unit of the metric associated with the alarm.
  3000. Unit *string `type:"string" enum:"StandardUnit"`
  3001. }
  3002. // String returns the string representation
  3003. func (s MetricAlarm) String() string {
  3004. return awsutil.Prettify(s)
  3005. }
  3006. // GoString returns the string representation
  3007. func (s MetricAlarm) GoString() string {
  3008. return s.String()
  3009. }
  3010. // SetActionsEnabled sets the ActionsEnabled field's value.
  3011. func (s *MetricAlarm) SetActionsEnabled(v bool) *MetricAlarm {
  3012. s.ActionsEnabled = &v
  3013. return s
  3014. }
  3015. // SetAlarmActions sets the AlarmActions field's value.
  3016. func (s *MetricAlarm) SetAlarmActions(v []*string) *MetricAlarm {
  3017. s.AlarmActions = v
  3018. return s
  3019. }
  3020. // SetAlarmArn sets the AlarmArn field's value.
  3021. func (s *MetricAlarm) SetAlarmArn(v string) *MetricAlarm {
  3022. s.AlarmArn = &v
  3023. return s
  3024. }
  3025. // SetAlarmConfigurationUpdatedTimestamp sets the AlarmConfigurationUpdatedTimestamp field's value.
  3026. func (s *MetricAlarm) SetAlarmConfigurationUpdatedTimestamp(v time.Time) *MetricAlarm {
  3027. s.AlarmConfigurationUpdatedTimestamp = &v
  3028. return s
  3029. }
  3030. // SetAlarmDescription sets the AlarmDescription field's value.
  3031. func (s *MetricAlarm) SetAlarmDescription(v string) *MetricAlarm {
  3032. s.AlarmDescription = &v
  3033. return s
  3034. }
  3035. // SetAlarmName sets the AlarmName field's value.
  3036. func (s *MetricAlarm) SetAlarmName(v string) *MetricAlarm {
  3037. s.AlarmName = &v
  3038. return s
  3039. }
  3040. // SetComparisonOperator sets the ComparisonOperator field's value.
  3041. func (s *MetricAlarm) SetComparisonOperator(v string) *MetricAlarm {
  3042. s.ComparisonOperator = &v
  3043. return s
  3044. }
  3045. // SetDatapointsToAlarm sets the DatapointsToAlarm field's value.
  3046. func (s *MetricAlarm) SetDatapointsToAlarm(v int64) *MetricAlarm {
  3047. s.DatapointsToAlarm = &v
  3048. return s
  3049. }
  3050. // SetDimensions sets the Dimensions field's value.
  3051. func (s *MetricAlarm) SetDimensions(v []*Dimension) *MetricAlarm {
  3052. s.Dimensions = v
  3053. return s
  3054. }
  3055. // SetEvaluateLowSampleCountPercentile sets the EvaluateLowSampleCountPercentile field's value.
  3056. func (s *MetricAlarm) SetEvaluateLowSampleCountPercentile(v string) *MetricAlarm {
  3057. s.EvaluateLowSampleCountPercentile = &v
  3058. return s
  3059. }
  3060. // SetEvaluationPeriods sets the EvaluationPeriods field's value.
  3061. func (s *MetricAlarm) SetEvaluationPeriods(v int64) *MetricAlarm {
  3062. s.EvaluationPeriods = &v
  3063. return s
  3064. }
  3065. // SetExtendedStatistic sets the ExtendedStatistic field's value.
  3066. func (s *MetricAlarm) SetExtendedStatistic(v string) *MetricAlarm {
  3067. s.ExtendedStatistic = &v
  3068. return s
  3069. }
  3070. // SetInsufficientDataActions sets the InsufficientDataActions field's value.
  3071. func (s *MetricAlarm) SetInsufficientDataActions(v []*string) *MetricAlarm {
  3072. s.InsufficientDataActions = v
  3073. return s
  3074. }
  3075. // SetMetricName sets the MetricName field's value.
  3076. func (s *MetricAlarm) SetMetricName(v string) *MetricAlarm {
  3077. s.MetricName = &v
  3078. return s
  3079. }
  3080. // SetNamespace sets the Namespace field's value.
  3081. func (s *MetricAlarm) SetNamespace(v string) *MetricAlarm {
  3082. s.Namespace = &v
  3083. return s
  3084. }
  3085. // SetOKActions sets the OKActions field's value.
  3086. func (s *MetricAlarm) SetOKActions(v []*string) *MetricAlarm {
  3087. s.OKActions = v
  3088. return s
  3089. }
  3090. // SetPeriod sets the Period field's value.
  3091. func (s *MetricAlarm) SetPeriod(v int64) *MetricAlarm {
  3092. s.Period = &v
  3093. return s
  3094. }
  3095. // SetStateReason sets the StateReason field's value.
  3096. func (s *MetricAlarm) SetStateReason(v string) *MetricAlarm {
  3097. s.StateReason = &v
  3098. return s
  3099. }
  3100. // SetStateReasonData sets the StateReasonData field's value.
  3101. func (s *MetricAlarm) SetStateReasonData(v string) *MetricAlarm {
  3102. s.StateReasonData = &v
  3103. return s
  3104. }
  3105. // SetStateUpdatedTimestamp sets the StateUpdatedTimestamp field's value.
  3106. func (s *MetricAlarm) SetStateUpdatedTimestamp(v time.Time) *MetricAlarm {
  3107. s.StateUpdatedTimestamp = &v
  3108. return s
  3109. }
  3110. // SetStateValue sets the StateValue field's value.
  3111. func (s *MetricAlarm) SetStateValue(v string) *MetricAlarm {
  3112. s.StateValue = &v
  3113. return s
  3114. }
  3115. // SetStatistic sets the Statistic field's value.
  3116. func (s *MetricAlarm) SetStatistic(v string) *MetricAlarm {
  3117. s.Statistic = &v
  3118. return s
  3119. }
  3120. // SetThreshold sets the Threshold field's value.
  3121. func (s *MetricAlarm) SetThreshold(v float64) *MetricAlarm {
  3122. s.Threshold = &v
  3123. return s
  3124. }
  3125. // SetTreatMissingData sets the TreatMissingData field's value.
  3126. func (s *MetricAlarm) SetTreatMissingData(v string) *MetricAlarm {
  3127. s.TreatMissingData = &v
  3128. return s
  3129. }
  3130. // SetUnit sets the Unit field's value.
  3131. func (s *MetricAlarm) SetUnit(v string) *MetricAlarm {
  3132. s.Unit = &v
  3133. return s
  3134. }
  3135. // This structure indicates the metric data to return, and whether this call
  3136. // is just retrieving a batch set of data for one metric, or is performing a
  3137. // math expression on metric data. A single GetMetricData call can include up
  3138. // to 100 MetricDataQuery structures.
  3139. type MetricDataQuery struct {
  3140. _ struct{} `type:"structure"`
  3141. // The math expression to be performed on the returned data, if this structure
  3142. // is performing a math expression. For more information about metric math expressions,
  3143. // see Metric Math Syntax and Functions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax)
  3144. // in the Amazon CloudWatch User Guide.
  3145. //
  3146. // Within one MetricDataQuery structure, you must specify either Expression
  3147. // or MetricStat but not both.
  3148. Expression *string `min:"1" type:"string"`
  3149. // A short name used to tie this structure to the results in the response. This
  3150. // name must be unique within a single call to GetMetricData. If you are performing
  3151. // math expressions on this set of data, this name represents that data and
  3152. // can serve as a variable in the mathematical expression. The valid characters
  3153. // are letters, numbers, and underscore. The first character must be a lowercase
  3154. // letter.
  3155. //
  3156. // Id is a required field
  3157. Id *string `min:"1" type:"string" required:"true"`
  3158. // A human-readable label for this metric or expression. This is especially
  3159. // useful if this is an expression, so that you know what the value represents.
  3160. // If the metric or expression is shown in a CloudWatch dashboard widget, the
  3161. // label is shown. If Label is omitted, CloudWatch generates a default.
  3162. Label *string `type:"string"`
  3163. // The metric to be returned, along with statistics, period, and units. Use
  3164. // this parameter only if this structure is performing a data retrieval and
  3165. // not performing a math expression on the returned data.
  3166. //
  3167. // Within one MetricDataQuery structure, you must specify either Expression
  3168. // or MetricStat but not both.
  3169. MetricStat *MetricStat `type:"structure"`
  3170. // Indicates whether to return the time stamps and raw data values of this metric.
  3171. // If you are performing this call just to do math expressions and do not also
  3172. // need the raw data returned, you can specify False. If you omit this, the
  3173. // default of True is used.
  3174. ReturnData *bool `type:"boolean"`
  3175. }
  3176. // String returns the string representation
  3177. func (s MetricDataQuery) String() string {
  3178. return awsutil.Prettify(s)
  3179. }
  3180. // GoString returns the string representation
  3181. func (s MetricDataQuery) GoString() string {
  3182. return s.String()
  3183. }
  3184. // Validate inspects the fields of the type to determine if they are valid.
  3185. func (s *MetricDataQuery) Validate() error {
  3186. invalidParams := request.ErrInvalidParams{Context: "MetricDataQuery"}
  3187. if s.Expression != nil && len(*s.Expression) < 1 {
  3188. invalidParams.Add(request.NewErrParamMinLen("Expression", 1))
  3189. }
  3190. if s.Id == nil {
  3191. invalidParams.Add(request.NewErrParamRequired("Id"))
  3192. }
  3193. if s.Id != nil && len(*s.Id) < 1 {
  3194. invalidParams.Add(request.NewErrParamMinLen("Id", 1))
  3195. }
  3196. if s.MetricStat != nil {
  3197. if err := s.MetricStat.Validate(); err != nil {
  3198. invalidParams.AddNested("MetricStat", err.(request.ErrInvalidParams))
  3199. }
  3200. }
  3201. if invalidParams.Len() > 0 {
  3202. return invalidParams
  3203. }
  3204. return nil
  3205. }
  3206. // SetExpression sets the Expression field's value.
  3207. func (s *MetricDataQuery) SetExpression(v string) *MetricDataQuery {
  3208. s.Expression = &v
  3209. return s
  3210. }
  3211. // SetId sets the Id field's value.
  3212. func (s *MetricDataQuery) SetId(v string) *MetricDataQuery {
  3213. s.Id = &v
  3214. return s
  3215. }
  3216. // SetLabel sets the Label field's value.
  3217. func (s *MetricDataQuery) SetLabel(v string) *MetricDataQuery {
  3218. s.Label = &v
  3219. return s
  3220. }
  3221. // SetMetricStat sets the MetricStat field's value.
  3222. func (s *MetricDataQuery) SetMetricStat(v *MetricStat) *MetricDataQuery {
  3223. s.MetricStat = v
  3224. return s
  3225. }
  3226. // SetReturnData sets the ReturnData field's value.
  3227. func (s *MetricDataQuery) SetReturnData(v bool) *MetricDataQuery {
  3228. s.ReturnData = &v
  3229. return s
  3230. }
  3231. // A GetMetricData call returns an array of MetricDataResult structures. Each
  3232. // of these structures includes the data points for that metric, along with
  3233. // the time stamps of those data points and other identifying information.
  3234. type MetricDataResult struct {
  3235. _ struct{} `type:"structure"`
  3236. // The short name you specified to represent this metric.
  3237. Id *string `min:"1" type:"string"`
  3238. // The human-readable label associated with the data.
  3239. Label *string `type:"string"`
  3240. // A list of messages with additional information about the data returned.
  3241. Messages []*MessageData `type:"list"`
  3242. // The status of the returned data. Complete indicates that all data points
  3243. // in the requested time range were returned. PartialData means that an incomplete
  3244. // set of data points were returned. You can use the NextToken value that was
  3245. // returned and repeat your request to get more data points. NextToken is not
  3246. // returned if you are performing a math expression. InternalError indicates
  3247. // that an error occurred. Retry your request using NextToken, if present.
  3248. StatusCode *string `type:"string" enum:"StatusCode"`
  3249. // The time stamps for the data points, formatted in Unix timestamp format.
  3250. // The number of time stamps always matches the number of values and the value
  3251. // for Timestamps[x] is Values[x].
  3252. Timestamps []*time.Time `type:"list"`
  3253. // The data points for the metric corresponding to Timestamps. The number of
  3254. // values always matches the number of time stamps and the time stamp for Values[x]
  3255. // is Timestamps[x].
  3256. Values []*float64 `type:"list"`
  3257. }
  3258. // String returns the string representation
  3259. func (s MetricDataResult) String() string {
  3260. return awsutil.Prettify(s)
  3261. }
  3262. // GoString returns the string representation
  3263. func (s MetricDataResult) GoString() string {
  3264. return s.String()
  3265. }
  3266. // SetId sets the Id field's value.
  3267. func (s *MetricDataResult) SetId(v string) *MetricDataResult {
  3268. s.Id = &v
  3269. return s
  3270. }
  3271. // SetLabel sets the Label field's value.
  3272. func (s *MetricDataResult) SetLabel(v string) *MetricDataResult {
  3273. s.Label = &v
  3274. return s
  3275. }
  3276. // SetMessages sets the Messages field's value.
  3277. func (s *MetricDataResult) SetMessages(v []*MessageData) *MetricDataResult {
  3278. s.Messages = v
  3279. return s
  3280. }
  3281. // SetStatusCode sets the StatusCode field's value.
  3282. func (s *MetricDataResult) SetStatusCode(v string) *MetricDataResult {
  3283. s.StatusCode = &v
  3284. return s
  3285. }
  3286. // SetTimestamps sets the Timestamps field's value.
  3287. func (s *MetricDataResult) SetTimestamps(v []*time.Time) *MetricDataResult {
  3288. s.Timestamps = v
  3289. return s
  3290. }
  3291. // SetValues sets the Values field's value.
  3292. func (s *MetricDataResult) SetValues(v []*float64) *MetricDataResult {
  3293. s.Values = v
  3294. return s
  3295. }
  3296. // Encapsulates the information sent to either create a metric or add new values
  3297. // to be aggregated into an existing metric.
  3298. type MetricDatum struct {
  3299. _ struct{} `type:"structure"`
  3300. // The dimensions associated with the metric.
  3301. Dimensions []*Dimension `type:"list"`
  3302. // The name of the metric.
  3303. //
  3304. // MetricName is a required field
  3305. MetricName *string `min:"1" type:"string" required:"true"`
  3306. // The statistical values for the metric.
  3307. StatisticValues *StatisticSet `type:"structure"`
  3308. // Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution
  3309. // metric, so that CloudWatch stores the metric with sub-minute resolution down
  3310. // to one second. Setting this to 60 specifies this metric as a regular-resolution
  3311. // metric, which CloudWatch stores at 1-minute resolution. Currently, high resolution
  3312. // is available only for custom metrics. For more information about high-resolution
  3313. // metrics, see High-Resolution Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics)
  3314. // in the Amazon CloudWatch User Guide.
  3315. //
  3316. // This field is optional, if you do not specify it the default of 60 is used.
  3317. StorageResolution *int64 `min:"1" type:"integer"`
  3318. // The time the metric data was received, expressed as the number of milliseconds
  3319. // since Jan 1, 1970 00:00:00 UTC.
  3320. Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  3321. // The unit of the metric.
  3322. Unit *string `type:"string" enum:"StandardUnit"`
  3323. // The value for the metric.
  3324. //
  3325. // Although the parameter accepts numbers of type Double, CloudWatch rejects
  3326. // values that are either too small or too large. Values must be in the range
  3327. // of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).
  3328. // In addition, special values (for example, NaN, +Infinity, -Infinity) are
  3329. // not supported.
  3330. Value *float64 `type:"double"`
  3331. }
  3332. // String returns the string representation
  3333. func (s MetricDatum) String() string {
  3334. return awsutil.Prettify(s)
  3335. }
  3336. // GoString returns the string representation
  3337. func (s MetricDatum) GoString() string {
  3338. return s.String()
  3339. }
  3340. // Validate inspects the fields of the type to determine if they are valid.
  3341. func (s *MetricDatum) Validate() error {
  3342. invalidParams := request.ErrInvalidParams{Context: "MetricDatum"}
  3343. if s.MetricName == nil {
  3344. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  3345. }
  3346. if s.MetricName != nil && len(*s.MetricName) < 1 {
  3347. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  3348. }
  3349. if s.StorageResolution != nil && *s.StorageResolution < 1 {
  3350. invalidParams.Add(request.NewErrParamMinValue("StorageResolution", 1))
  3351. }
  3352. if s.Dimensions != nil {
  3353. for i, v := range s.Dimensions {
  3354. if v == nil {
  3355. continue
  3356. }
  3357. if err := v.Validate(); err != nil {
  3358. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  3359. }
  3360. }
  3361. }
  3362. if s.StatisticValues != nil {
  3363. if err := s.StatisticValues.Validate(); err != nil {
  3364. invalidParams.AddNested("StatisticValues", err.(request.ErrInvalidParams))
  3365. }
  3366. }
  3367. if invalidParams.Len() > 0 {
  3368. return invalidParams
  3369. }
  3370. return nil
  3371. }
  3372. // SetDimensions sets the Dimensions field's value.
  3373. func (s *MetricDatum) SetDimensions(v []*Dimension) *MetricDatum {
  3374. s.Dimensions = v
  3375. return s
  3376. }
  3377. // SetMetricName sets the MetricName field's value.
  3378. func (s *MetricDatum) SetMetricName(v string) *MetricDatum {
  3379. s.MetricName = &v
  3380. return s
  3381. }
  3382. // SetStatisticValues sets the StatisticValues field's value.
  3383. func (s *MetricDatum) SetStatisticValues(v *StatisticSet) *MetricDatum {
  3384. s.StatisticValues = v
  3385. return s
  3386. }
  3387. // SetStorageResolution sets the StorageResolution field's value.
  3388. func (s *MetricDatum) SetStorageResolution(v int64) *MetricDatum {
  3389. s.StorageResolution = &v
  3390. return s
  3391. }
  3392. // SetTimestamp sets the Timestamp field's value.
  3393. func (s *MetricDatum) SetTimestamp(v time.Time) *MetricDatum {
  3394. s.Timestamp = &v
  3395. return s
  3396. }
  3397. // SetUnit sets the Unit field's value.
  3398. func (s *MetricDatum) SetUnit(v string) *MetricDatum {
  3399. s.Unit = &v
  3400. return s
  3401. }
  3402. // SetValue sets the Value field's value.
  3403. func (s *MetricDatum) SetValue(v float64) *MetricDatum {
  3404. s.Value = &v
  3405. return s
  3406. }
  3407. // This structure defines the metric to be returned, along with the statistics,
  3408. // period, and units.
  3409. type MetricStat struct {
  3410. _ struct{} `type:"structure"`
  3411. // The metric to return, including the metric name, namespace, and dimensions.
  3412. //
  3413. // Metric is a required field
  3414. Metric *Metric `type:"structure" required:"true"`
  3415. // The period to use when retrieving the metric.
  3416. //
  3417. // Period is a required field
  3418. Period *int64 `min:"1" type:"integer" required:"true"`
  3419. // The statistic to return. It can include any CloudWatch statistic or extended
  3420. // statistic.
  3421. //
  3422. // Stat is a required field
  3423. Stat *string `type:"string" required:"true"`
  3424. // The unit to use for the returned data points.
  3425. Unit *string `type:"string" enum:"StandardUnit"`
  3426. }
  3427. // String returns the string representation
  3428. func (s MetricStat) String() string {
  3429. return awsutil.Prettify(s)
  3430. }
  3431. // GoString returns the string representation
  3432. func (s MetricStat) GoString() string {
  3433. return s.String()
  3434. }
  3435. // Validate inspects the fields of the type to determine if they are valid.
  3436. func (s *MetricStat) Validate() error {
  3437. invalidParams := request.ErrInvalidParams{Context: "MetricStat"}
  3438. if s.Metric == nil {
  3439. invalidParams.Add(request.NewErrParamRequired("Metric"))
  3440. }
  3441. if s.Period == nil {
  3442. invalidParams.Add(request.NewErrParamRequired("Period"))
  3443. }
  3444. if s.Period != nil && *s.Period < 1 {
  3445. invalidParams.Add(request.NewErrParamMinValue("Period", 1))
  3446. }
  3447. if s.Stat == nil {
  3448. invalidParams.Add(request.NewErrParamRequired("Stat"))
  3449. }
  3450. if s.Metric != nil {
  3451. if err := s.Metric.Validate(); err != nil {
  3452. invalidParams.AddNested("Metric", err.(request.ErrInvalidParams))
  3453. }
  3454. }
  3455. if invalidParams.Len() > 0 {
  3456. return invalidParams
  3457. }
  3458. return nil
  3459. }
  3460. // SetMetric sets the Metric field's value.
  3461. func (s *MetricStat) SetMetric(v *Metric) *MetricStat {
  3462. s.Metric = v
  3463. return s
  3464. }
  3465. // SetPeriod sets the Period field's value.
  3466. func (s *MetricStat) SetPeriod(v int64) *MetricStat {
  3467. s.Period = &v
  3468. return s
  3469. }
  3470. // SetStat sets the Stat field's value.
  3471. func (s *MetricStat) SetStat(v string) *MetricStat {
  3472. s.Stat = &v
  3473. return s
  3474. }
  3475. // SetUnit sets the Unit field's value.
  3476. func (s *MetricStat) SetUnit(v string) *MetricStat {
  3477. s.Unit = &v
  3478. return s
  3479. }
  3480. type PutDashboardInput struct {
  3481. _ struct{} `type:"structure"`
  3482. // The detailed information about the dashboard in JSON format, including the
  3483. // widgets to include and their location on the dashboard. This parameter is
  3484. // required.
  3485. //
  3486. // For more information about the syntax, see CloudWatch-Dashboard-Body-Structure.
  3487. //
  3488. // DashboardBody is a required field
  3489. DashboardBody *string `type:"string" required:"true"`
  3490. // The name of the dashboard. If a dashboard with this name already exists,
  3491. // this call modifies that dashboard, replacing its current contents. Otherwise,
  3492. // a new dashboard is created. The maximum length is 255, and valid characters
  3493. // are A-Z, a-z, 0-9, "-", and "_". This parameter is required.
  3494. //
  3495. // DashboardName is a required field
  3496. DashboardName *string `type:"string" required:"true"`
  3497. }
  3498. // String returns the string representation
  3499. func (s PutDashboardInput) String() string {
  3500. return awsutil.Prettify(s)
  3501. }
  3502. // GoString returns the string representation
  3503. func (s PutDashboardInput) GoString() string {
  3504. return s.String()
  3505. }
  3506. // Validate inspects the fields of the type to determine if they are valid.
  3507. func (s *PutDashboardInput) Validate() error {
  3508. invalidParams := request.ErrInvalidParams{Context: "PutDashboardInput"}
  3509. if s.DashboardBody == nil {
  3510. invalidParams.Add(request.NewErrParamRequired("DashboardBody"))
  3511. }
  3512. if s.DashboardName == nil {
  3513. invalidParams.Add(request.NewErrParamRequired("DashboardName"))
  3514. }
  3515. if invalidParams.Len() > 0 {
  3516. return invalidParams
  3517. }
  3518. return nil
  3519. }
  3520. // SetDashboardBody sets the DashboardBody field's value.
  3521. func (s *PutDashboardInput) SetDashboardBody(v string) *PutDashboardInput {
  3522. s.DashboardBody = &v
  3523. return s
  3524. }
  3525. // SetDashboardName sets the DashboardName field's value.
  3526. func (s *PutDashboardInput) SetDashboardName(v string) *PutDashboardInput {
  3527. s.DashboardName = &v
  3528. return s
  3529. }
  3530. type PutDashboardOutput struct {
  3531. _ struct{} `type:"structure"`
  3532. // If the input for PutDashboard was correct and the dashboard was successfully
  3533. // created or modified, this result is empty.
  3534. //
  3535. // If this result includes only warning messages, then the input was valid enough
  3536. // for the dashboard to be created or modified, but some elements of the dashboard
  3537. // may not render.
  3538. //
  3539. // If this result includes error messages, the input was not valid and the operation
  3540. // failed.
  3541. DashboardValidationMessages []*DashboardValidationMessage `type:"list"`
  3542. }
  3543. // String returns the string representation
  3544. func (s PutDashboardOutput) String() string {
  3545. return awsutil.Prettify(s)
  3546. }
  3547. // GoString returns the string representation
  3548. func (s PutDashboardOutput) GoString() string {
  3549. return s.String()
  3550. }
  3551. // SetDashboardValidationMessages sets the DashboardValidationMessages field's value.
  3552. func (s *PutDashboardOutput) SetDashboardValidationMessages(v []*DashboardValidationMessage) *PutDashboardOutput {
  3553. s.DashboardValidationMessages = v
  3554. return s
  3555. }
  3556. type PutMetricAlarmInput struct {
  3557. _ struct{} `type:"structure"`
  3558. // Indicates whether actions should be executed during any changes to the alarm
  3559. // state.
  3560. ActionsEnabled *bool `type:"boolean"`
  3561. // The actions to execute when this alarm transitions to the ALARM state from
  3562. // any other state. Each action is specified as an Amazon Resource Name (ARN).
  3563. //
  3564. // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate
  3565. // | arn:aws:automate:region:ec2:recover | arn:aws:sns:region:account-id:sns-topic-name
  3566. // | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
  3567. //
  3568. // Valid Values (for use with IAM roles): arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Stop/1.0
  3569. // | arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Terminate/1.0
  3570. // | arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Reboot/1.0
  3571. AlarmActions []*string `type:"list"`
  3572. // The description for the alarm.
  3573. AlarmDescription *string `type:"string"`
  3574. // The name for the alarm. This name must be unique within the AWS account.
  3575. //
  3576. // AlarmName is a required field
  3577. AlarmName *string `min:"1" type:"string" required:"true"`
  3578. // The arithmetic operation to use when comparing the specified statistic and
  3579. // threshold. The specified statistic value is used as the first operand.
  3580. //
  3581. // ComparisonOperator is a required field
  3582. ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"`
  3583. // The number of datapoints that must be breaching to trigger the alarm. This
  3584. // is used only if you are setting an "M out of N" alarm. In that case, this
  3585. // value is the M. For more information, see Evaluating an Alarm (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation)
  3586. // in the Amazon CloudWatch User Guide.
  3587. DatapointsToAlarm *int64 `min:"1" type:"integer"`
  3588. // The dimensions for the metric associated with the alarm.
  3589. Dimensions []*Dimension `type:"list"`
  3590. // Used only for alarms based on percentiles. If you specify ignore, the alarm
  3591. // state does not change during periods with too few data points to be statistically
  3592. // significant. If you specify evaluate or omit this parameter, the alarm is
  3593. // always evaluated and possibly changes state no matter how many data points
  3594. // are available. For more information, see Percentile-Based CloudWatch Alarms
  3595. // and Low Data Samples (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples).
  3596. //
  3597. // Valid Values: evaluate | ignore
  3598. EvaluateLowSampleCountPercentile *string `min:"1" type:"string"`
  3599. // The number of periods over which data is compared to the specified threshold.
  3600. // If you are setting an alarm which requires that a number of consecutive data
  3601. // points be breaching to trigger the alarm, this value specifies that number.
  3602. // If you are setting an "M out of N" alarm, this value is the N.
  3603. //
  3604. // An alarm's total current evaluation period can be no longer than one day,
  3605. // so this number multiplied by Period cannot be more than 86,400 seconds.
  3606. //
  3607. // EvaluationPeriods is a required field
  3608. EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"`
  3609. // The percentile statistic for the metric associated with the alarm. Specify
  3610. // a value between p0.0 and p100. When you call PutMetricAlarm, you must specify
  3611. // either Statistic or ExtendedStatistic, but not both.
  3612. ExtendedStatistic *string `type:"string"`
  3613. // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
  3614. // state from any other state. Each action is specified as an Amazon Resource
  3615. // Name (ARN).
  3616. //
  3617. // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate
  3618. // | arn:aws:automate:region:ec2:recover | arn:aws:sns:region:account-id:sns-topic-name
  3619. // | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
  3620. //
  3621. // Valid Values (for use with IAM roles): arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Stop/1.0
  3622. // | arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Terminate/1.0
  3623. // | arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Reboot/1.0
  3624. InsufficientDataActions []*string `type:"list"`
  3625. // The name for the metric associated with the alarm.
  3626. //
  3627. // MetricName is a required field
  3628. MetricName *string `min:"1" type:"string" required:"true"`
  3629. // The namespace for the metric associated with the alarm.
  3630. //
  3631. // Namespace is a required field
  3632. Namespace *string `min:"1" type:"string" required:"true"`
  3633. // The actions to execute when this alarm transitions to an OK state from any
  3634. // other state. Each action is specified as an Amazon Resource Name (ARN).
  3635. //
  3636. // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate
  3637. // | arn:aws:automate:region:ec2:recover | arn:aws:sns:region:account-id:sns-topic-name
  3638. // | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
  3639. //
  3640. // Valid Values (for use with IAM roles): arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Stop/1.0
  3641. // | arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Terminate/1.0
  3642. // | arn:aws:swf:region:{account-id}:action/actions/AWS_EC2.InstanceId.Reboot/1.0
  3643. OKActions []*string `type:"list"`
  3644. // The period, in seconds, over which the specified statistic is applied. Valid
  3645. // values are 10, 30, and any multiple of 60.
  3646. //
  3647. // Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
  3648. // call with a StorageResolution of 1. If you specify a period of 10 or 30 for
  3649. // a metric that does not have sub-minute resolution, the alarm still attempts
  3650. // to gather data at the period rate that you specify. In this case, it does
  3651. // not receive data for the attempts that do not correspond to a one-minute
  3652. // data resolution, and the alarm may often lapse into INSUFFICENT_DATA status.
  3653. // Specifying 10 or 30 also sets this alarm as a high-resolution alarm, which
  3654. // has a higher charge than other alarms. For more information about pricing,
  3655. // see Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/).
  3656. //
  3657. // An alarm's total current evaluation period can be no longer than one day,
  3658. // so Period multiplied by EvaluationPeriods cannot be more than 86,400 seconds.
  3659. //
  3660. // Period is a required field
  3661. Period *int64 `min:"1" type:"integer" required:"true"`
  3662. // The statistic for the metric associated with the alarm, other than percentile.
  3663. // For percentile statistics, use ExtendedStatistic. When you call PutMetricAlarm,
  3664. // you must specify either Statistic or ExtendedStatistic, but not both.
  3665. Statistic *string `type:"string" enum:"Statistic"`
  3666. // The value against which the specified statistic is compared.
  3667. //
  3668. // Threshold is a required field
  3669. Threshold *float64 `type:"double" required:"true"`
  3670. // Sets how this alarm is to handle missing data points. If TreatMissingData
  3671. // is omitted, the default behavior of missing is used. For more information,
  3672. // see Configuring How CloudWatch Alarms Treats Missing Data (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data).
  3673. //
  3674. // Valid Values: breaching | notBreaching | ignore | missing
  3675. TreatMissingData *string `min:"1" type:"string"`
  3676. // The unit of measure for the statistic. For example, the units for the Amazon
  3677. // EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes
  3678. // that an instance receives on all network interfaces. You can also specify
  3679. // a unit when you create a custom metric. Units help provide conceptual meaning
  3680. // to your data. Metric data points that specify a unit of measure, such as
  3681. // Percent, are aggregated separately.
  3682. //
  3683. // If you specify a unit, you must use a unit that is appropriate for the metric.
  3684. // Otherwise, the CloudWatch alarm can get stuck in the INSUFFICIENT DATA state.
  3685. Unit *string `type:"string" enum:"StandardUnit"`
  3686. }
  3687. // String returns the string representation
  3688. func (s PutMetricAlarmInput) String() string {
  3689. return awsutil.Prettify(s)
  3690. }
  3691. // GoString returns the string representation
  3692. func (s PutMetricAlarmInput) GoString() string {
  3693. return s.String()
  3694. }
  3695. // Validate inspects the fields of the type to determine if they are valid.
  3696. func (s *PutMetricAlarmInput) Validate() error {
  3697. invalidParams := request.ErrInvalidParams{Context: "PutMetricAlarmInput"}
  3698. if s.AlarmName == nil {
  3699. invalidParams.Add(request.NewErrParamRequired("AlarmName"))
  3700. }
  3701. if s.AlarmName != nil && len(*s.AlarmName) < 1 {
  3702. invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
  3703. }
  3704. if s.ComparisonOperator == nil {
  3705. invalidParams.Add(request.NewErrParamRequired("ComparisonOperator"))
  3706. }
  3707. if s.DatapointsToAlarm != nil && *s.DatapointsToAlarm < 1 {
  3708. invalidParams.Add(request.NewErrParamMinValue("DatapointsToAlarm", 1))
  3709. }
  3710. if s.EvaluateLowSampleCountPercentile != nil && len(*s.EvaluateLowSampleCountPercentile) < 1 {
  3711. invalidParams.Add(request.NewErrParamMinLen("EvaluateLowSampleCountPercentile", 1))
  3712. }
  3713. if s.EvaluationPeriods == nil {
  3714. invalidParams.Add(request.NewErrParamRequired("EvaluationPeriods"))
  3715. }
  3716. if s.EvaluationPeriods != nil && *s.EvaluationPeriods < 1 {
  3717. invalidParams.Add(request.NewErrParamMinValue("EvaluationPeriods", 1))
  3718. }
  3719. if s.MetricName == nil {
  3720. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  3721. }
  3722. if s.MetricName != nil && len(*s.MetricName) < 1 {
  3723. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  3724. }
  3725. if s.Namespace == nil {
  3726. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  3727. }
  3728. if s.Namespace != nil && len(*s.Namespace) < 1 {
  3729. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  3730. }
  3731. if s.Period == nil {
  3732. invalidParams.Add(request.NewErrParamRequired("Period"))
  3733. }
  3734. if s.Period != nil && *s.Period < 1 {
  3735. invalidParams.Add(request.NewErrParamMinValue("Period", 1))
  3736. }
  3737. if s.Threshold == nil {
  3738. invalidParams.Add(request.NewErrParamRequired("Threshold"))
  3739. }
  3740. if s.TreatMissingData != nil && len(*s.TreatMissingData) < 1 {
  3741. invalidParams.Add(request.NewErrParamMinLen("TreatMissingData", 1))
  3742. }
  3743. if s.Dimensions != nil {
  3744. for i, v := range s.Dimensions {
  3745. if v == nil {
  3746. continue
  3747. }
  3748. if err := v.Validate(); err != nil {
  3749. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  3750. }
  3751. }
  3752. }
  3753. if invalidParams.Len() > 0 {
  3754. return invalidParams
  3755. }
  3756. return nil
  3757. }
  3758. // SetActionsEnabled sets the ActionsEnabled field's value.
  3759. func (s *PutMetricAlarmInput) SetActionsEnabled(v bool) *PutMetricAlarmInput {
  3760. s.ActionsEnabled = &v
  3761. return s
  3762. }
  3763. // SetAlarmActions sets the AlarmActions field's value.
  3764. func (s *PutMetricAlarmInput) SetAlarmActions(v []*string) *PutMetricAlarmInput {
  3765. s.AlarmActions = v
  3766. return s
  3767. }
  3768. // SetAlarmDescription sets the AlarmDescription field's value.
  3769. func (s *PutMetricAlarmInput) SetAlarmDescription(v string) *PutMetricAlarmInput {
  3770. s.AlarmDescription = &v
  3771. return s
  3772. }
  3773. // SetAlarmName sets the AlarmName field's value.
  3774. func (s *PutMetricAlarmInput) SetAlarmName(v string) *PutMetricAlarmInput {
  3775. s.AlarmName = &v
  3776. return s
  3777. }
  3778. // SetComparisonOperator sets the ComparisonOperator field's value.
  3779. func (s *PutMetricAlarmInput) SetComparisonOperator(v string) *PutMetricAlarmInput {
  3780. s.ComparisonOperator = &v
  3781. return s
  3782. }
  3783. // SetDatapointsToAlarm sets the DatapointsToAlarm field's value.
  3784. func (s *PutMetricAlarmInput) SetDatapointsToAlarm(v int64) *PutMetricAlarmInput {
  3785. s.DatapointsToAlarm = &v
  3786. return s
  3787. }
  3788. // SetDimensions sets the Dimensions field's value.
  3789. func (s *PutMetricAlarmInput) SetDimensions(v []*Dimension) *PutMetricAlarmInput {
  3790. s.Dimensions = v
  3791. return s
  3792. }
  3793. // SetEvaluateLowSampleCountPercentile sets the EvaluateLowSampleCountPercentile field's value.
  3794. func (s *PutMetricAlarmInput) SetEvaluateLowSampleCountPercentile(v string) *PutMetricAlarmInput {
  3795. s.EvaluateLowSampleCountPercentile = &v
  3796. return s
  3797. }
  3798. // SetEvaluationPeriods sets the EvaluationPeriods field's value.
  3799. func (s *PutMetricAlarmInput) SetEvaluationPeriods(v int64) *PutMetricAlarmInput {
  3800. s.EvaluationPeriods = &v
  3801. return s
  3802. }
  3803. // SetExtendedStatistic sets the ExtendedStatistic field's value.
  3804. func (s *PutMetricAlarmInput) SetExtendedStatistic(v string) *PutMetricAlarmInput {
  3805. s.ExtendedStatistic = &v
  3806. return s
  3807. }
  3808. // SetInsufficientDataActions sets the InsufficientDataActions field's value.
  3809. func (s *PutMetricAlarmInput) SetInsufficientDataActions(v []*string) *PutMetricAlarmInput {
  3810. s.InsufficientDataActions = v
  3811. return s
  3812. }
  3813. // SetMetricName sets the MetricName field's value.
  3814. func (s *PutMetricAlarmInput) SetMetricName(v string) *PutMetricAlarmInput {
  3815. s.MetricName = &v
  3816. return s
  3817. }
  3818. // SetNamespace sets the Namespace field's value.
  3819. func (s *PutMetricAlarmInput) SetNamespace(v string) *PutMetricAlarmInput {
  3820. s.Namespace = &v
  3821. return s
  3822. }
  3823. // SetOKActions sets the OKActions field's value.
  3824. func (s *PutMetricAlarmInput) SetOKActions(v []*string) *PutMetricAlarmInput {
  3825. s.OKActions = v
  3826. return s
  3827. }
  3828. // SetPeriod sets the Period field's value.
  3829. func (s *PutMetricAlarmInput) SetPeriod(v int64) *PutMetricAlarmInput {
  3830. s.Period = &v
  3831. return s
  3832. }
  3833. // SetStatistic sets the Statistic field's value.
  3834. func (s *PutMetricAlarmInput) SetStatistic(v string) *PutMetricAlarmInput {
  3835. s.Statistic = &v
  3836. return s
  3837. }
  3838. // SetThreshold sets the Threshold field's value.
  3839. func (s *PutMetricAlarmInput) SetThreshold(v float64) *PutMetricAlarmInput {
  3840. s.Threshold = &v
  3841. return s
  3842. }
  3843. // SetTreatMissingData sets the TreatMissingData field's value.
  3844. func (s *PutMetricAlarmInput) SetTreatMissingData(v string) *PutMetricAlarmInput {
  3845. s.TreatMissingData = &v
  3846. return s
  3847. }
  3848. // SetUnit sets the Unit field's value.
  3849. func (s *PutMetricAlarmInput) SetUnit(v string) *PutMetricAlarmInput {
  3850. s.Unit = &v
  3851. return s
  3852. }
  3853. type PutMetricAlarmOutput struct {
  3854. _ struct{} `type:"structure"`
  3855. }
  3856. // String returns the string representation
  3857. func (s PutMetricAlarmOutput) String() string {
  3858. return awsutil.Prettify(s)
  3859. }
  3860. // GoString returns the string representation
  3861. func (s PutMetricAlarmOutput) GoString() string {
  3862. return s.String()
  3863. }
  3864. type PutMetricDataInput struct {
  3865. _ struct{} `type:"structure"`
  3866. // The data for the metric.
  3867. //
  3868. // MetricData is a required field
  3869. MetricData []*MetricDatum `type:"list" required:"true"`
  3870. // The namespace for the metric data.
  3871. //
  3872. // You cannot specify a namespace that begins with "AWS/". Namespaces that begin
  3873. // with "AWS/" are reserved for use by Amazon Web Services products.
  3874. //
  3875. // Namespace is a required field
  3876. Namespace *string `min:"1" type:"string" required:"true"`
  3877. }
  3878. // String returns the string representation
  3879. func (s PutMetricDataInput) String() string {
  3880. return awsutil.Prettify(s)
  3881. }
  3882. // GoString returns the string representation
  3883. func (s PutMetricDataInput) GoString() string {
  3884. return s.String()
  3885. }
  3886. // Validate inspects the fields of the type to determine if they are valid.
  3887. func (s *PutMetricDataInput) Validate() error {
  3888. invalidParams := request.ErrInvalidParams{Context: "PutMetricDataInput"}
  3889. if s.MetricData == nil {
  3890. invalidParams.Add(request.NewErrParamRequired("MetricData"))
  3891. }
  3892. if s.Namespace == nil {
  3893. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  3894. }
  3895. if s.Namespace != nil && len(*s.Namespace) < 1 {
  3896. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  3897. }
  3898. if s.MetricData != nil {
  3899. for i, v := range s.MetricData {
  3900. if v == nil {
  3901. continue
  3902. }
  3903. if err := v.Validate(); err != nil {
  3904. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricData", i), err.(request.ErrInvalidParams))
  3905. }
  3906. }
  3907. }
  3908. if invalidParams.Len() > 0 {
  3909. return invalidParams
  3910. }
  3911. return nil
  3912. }
  3913. // SetMetricData sets the MetricData field's value.
  3914. func (s *PutMetricDataInput) SetMetricData(v []*MetricDatum) *PutMetricDataInput {
  3915. s.MetricData = v
  3916. return s
  3917. }
  3918. // SetNamespace sets the Namespace field's value.
  3919. func (s *PutMetricDataInput) SetNamespace(v string) *PutMetricDataInput {
  3920. s.Namespace = &v
  3921. return s
  3922. }
  3923. type PutMetricDataOutput struct {
  3924. _ struct{} `type:"structure"`
  3925. }
  3926. // String returns the string representation
  3927. func (s PutMetricDataOutput) String() string {
  3928. return awsutil.Prettify(s)
  3929. }
  3930. // GoString returns the string representation
  3931. func (s PutMetricDataOutput) GoString() string {
  3932. return s.String()
  3933. }
  3934. type SetAlarmStateInput struct {
  3935. _ struct{} `type:"structure"`
  3936. // The name for the alarm. This name must be unique within the AWS account.
  3937. // The maximum length is 255 characters.
  3938. //
  3939. // AlarmName is a required field
  3940. AlarmName *string `min:"1" type:"string" required:"true"`
  3941. // The reason that this alarm is set to this specific state, in text format.
  3942. //
  3943. // StateReason is a required field
  3944. StateReason *string `type:"string" required:"true"`
  3945. // The reason that this alarm is set to this specific state, in JSON format.
  3946. StateReasonData *string `type:"string"`
  3947. // The value of the state.
  3948. //
  3949. // StateValue is a required field
  3950. StateValue *string `type:"string" required:"true" enum:"StateValue"`
  3951. }
  3952. // String returns the string representation
  3953. func (s SetAlarmStateInput) String() string {
  3954. return awsutil.Prettify(s)
  3955. }
  3956. // GoString returns the string representation
  3957. func (s SetAlarmStateInput) GoString() string {
  3958. return s.String()
  3959. }
  3960. // Validate inspects the fields of the type to determine if they are valid.
  3961. func (s *SetAlarmStateInput) Validate() error {
  3962. invalidParams := request.ErrInvalidParams{Context: "SetAlarmStateInput"}
  3963. if s.AlarmName == nil {
  3964. invalidParams.Add(request.NewErrParamRequired("AlarmName"))
  3965. }
  3966. if s.AlarmName != nil && len(*s.AlarmName) < 1 {
  3967. invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
  3968. }
  3969. if s.StateReason == nil {
  3970. invalidParams.Add(request.NewErrParamRequired("StateReason"))
  3971. }
  3972. if s.StateValue == nil {
  3973. invalidParams.Add(request.NewErrParamRequired("StateValue"))
  3974. }
  3975. if invalidParams.Len() > 0 {
  3976. return invalidParams
  3977. }
  3978. return nil
  3979. }
  3980. // SetAlarmName sets the AlarmName field's value.
  3981. func (s *SetAlarmStateInput) SetAlarmName(v string) *SetAlarmStateInput {
  3982. s.AlarmName = &v
  3983. return s
  3984. }
  3985. // SetStateReason sets the StateReason field's value.
  3986. func (s *SetAlarmStateInput) SetStateReason(v string) *SetAlarmStateInput {
  3987. s.StateReason = &v
  3988. return s
  3989. }
  3990. // SetStateReasonData sets the StateReasonData field's value.
  3991. func (s *SetAlarmStateInput) SetStateReasonData(v string) *SetAlarmStateInput {
  3992. s.StateReasonData = &v
  3993. return s
  3994. }
  3995. // SetStateValue sets the StateValue field's value.
  3996. func (s *SetAlarmStateInput) SetStateValue(v string) *SetAlarmStateInput {
  3997. s.StateValue = &v
  3998. return s
  3999. }
  4000. type SetAlarmStateOutput struct {
  4001. _ struct{} `type:"structure"`
  4002. }
  4003. // String returns the string representation
  4004. func (s SetAlarmStateOutput) String() string {
  4005. return awsutil.Prettify(s)
  4006. }
  4007. // GoString returns the string representation
  4008. func (s SetAlarmStateOutput) GoString() string {
  4009. return s.String()
  4010. }
  4011. // Represents a set of statistics that describes a specific metric.
  4012. type StatisticSet struct {
  4013. _ struct{} `type:"structure"`
  4014. // The maximum value of the sample set.
  4015. //
  4016. // Maximum is a required field
  4017. Maximum *float64 `type:"double" required:"true"`
  4018. // The minimum value of the sample set.
  4019. //
  4020. // Minimum is a required field
  4021. Minimum *float64 `type:"double" required:"true"`
  4022. // The number of samples used for the statistic set.
  4023. //
  4024. // SampleCount is a required field
  4025. SampleCount *float64 `type:"double" required:"true"`
  4026. // The sum of values for the sample set.
  4027. //
  4028. // Sum is a required field
  4029. Sum *float64 `type:"double" required:"true"`
  4030. }
  4031. // String returns the string representation
  4032. func (s StatisticSet) String() string {
  4033. return awsutil.Prettify(s)
  4034. }
  4035. // GoString returns the string representation
  4036. func (s StatisticSet) GoString() string {
  4037. return s.String()
  4038. }
  4039. // Validate inspects the fields of the type to determine if they are valid.
  4040. func (s *StatisticSet) Validate() error {
  4041. invalidParams := request.ErrInvalidParams{Context: "StatisticSet"}
  4042. if s.Maximum == nil {
  4043. invalidParams.Add(request.NewErrParamRequired("Maximum"))
  4044. }
  4045. if s.Minimum == nil {
  4046. invalidParams.Add(request.NewErrParamRequired("Minimum"))
  4047. }
  4048. if s.SampleCount == nil {
  4049. invalidParams.Add(request.NewErrParamRequired("SampleCount"))
  4050. }
  4051. if s.Sum == nil {
  4052. invalidParams.Add(request.NewErrParamRequired("Sum"))
  4053. }
  4054. if invalidParams.Len() > 0 {
  4055. return invalidParams
  4056. }
  4057. return nil
  4058. }
  4059. // SetMaximum sets the Maximum field's value.
  4060. func (s *StatisticSet) SetMaximum(v float64) *StatisticSet {
  4061. s.Maximum = &v
  4062. return s
  4063. }
  4064. // SetMinimum sets the Minimum field's value.
  4065. func (s *StatisticSet) SetMinimum(v float64) *StatisticSet {
  4066. s.Minimum = &v
  4067. return s
  4068. }
  4069. // SetSampleCount sets the SampleCount field's value.
  4070. func (s *StatisticSet) SetSampleCount(v float64) *StatisticSet {
  4071. s.SampleCount = &v
  4072. return s
  4073. }
  4074. // SetSum sets the Sum field's value.
  4075. func (s *StatisticSet) SetSum(v float64) *StatisticSet {
  4076. s.Sum = &v
  4077. return s
  4078. }
  4079. const (
  4080. // ComparisonOperatorGreaterThanOrEqualToThreshold is a ComparisonOperator enum value
  4081. ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold"
  4082. // ComparisonOperatorGreaterThanThreshold is a ComparisonOperator enum value
  4083. ComparisonOperatorGreaterThanThreshold = "GreaterThanThreshold"
  4084. // ComparisonOperatorLessThanThreshold is a ComparisonOperator enum value
  4085. ComparisonOperatorLessThanThreshold = "LessThanThreshold"
  4086. // ComparisonOperatorLessThanOrEqualToThreshold is a ComparisonOperator enum value
  4087. ComparisonOperatorLessThanOrEqualToThreshold = "LessThanOrEqualToThreshold"
  4088. )
  4089. const (
  4090. // HistoryItemTypeConfigurationUpdate is a HistoryItemType enum value
  4091. HistoryItemTypeConfigurationUpdate = "ConfigurationUpdate"
  4092. // HistoryItemTypeStateUpdate is a HistoryItemType enum value
  4093. HistoryItemTypeStateUpdate = "StateUpdate"
  4094. // HistoryItemTypeAction is a HistoryItemType enum value
  4095. HistoryItemTypeAction = "Action"
  4096. )
  4097. const (
  4098. // ScanByTimestampDescending is a ScanBy enum value
  4099. ScanByTimestampDescending = "TimestampDescending"
  4100. // ScanByTimestampAscending is a ScanBy enum value
  4101. ScanByTimestampAscending = "TimestampAscending"
  4102. )
  4103. const (
  4104. // StandardUnitSeconds is a StandardUnit enum value
  4105. StandardUnitSeconds = "Seconds"
  4106. // StandardUnitMicroseconds is a StandardUnit enum value
  4107. StandardUnitMicroseconds = "Microseconds"
  4108. // StandardUnitMilliseconds is a StandardUnit enum value
  4109. StandardUnitMilliseconds = "Milliseconds"
  4110. // StandardUnitBytes is a StandardUnit enum value
  4111. StandardUnitBytes = "Bytes"
  4112. // StandardUnitKilobytes is a StandardUnit enum value
  4113. StandardUnitKilobytes = "Kilobytes"
  4114. // StandardUnitMegabytes is a StandardUnit enum value
  4115. StandardUnitMegabytes = "Megabytes"
  4116. // StandardUnitGigabytes is a StandardUnit enum value
  4117. StandardUnitGigabytes = "Gigabytes"
  4118. // StandardUnitTerabytes is a StandardUnit enum value
  4119. StandardUnitTerabytes = "Terabytes"
  4120. // StandardUnitBits is a StandardUnit enum value
  4121. StandardUnitBits = "Bits"
  4122. // StandardUnitKilobits is a StandardUnit enum value
  4123. StandardUnitKilobits = "Kilobits"
  4124. // StandardUnitMegabits is a StandardUnit enum value
  4125. StandardUnitMegabits = "Megabits"
  4126. // StandardUnitGigabits is a StandardUnit enum value
  4127. StandardUnitGigabits = "Gigabits"
  4128. // StandardUnitTerabits is a StandardUnit enum value
  4129. StandardUnitTerabits = "Terabits"
  4130. // StandardUnitPercent is a StandardUnit enum value
  4131. StandardUnitPercent = "Percent"
  4132. // StandardUnitCount is a StandardUnit enum value
  4133. StandardUnitCount = "Count"
  4134. // StandardUnitBytesSecond is a StandardUnit enum value
  4135. StandardUnitBytesSecond = "Bytes/Second"
  4136. // StandardUnitKilobytesSecond is a StandardUnit enum value
  4137. StandardUnitKilobytesSecond = "Kilobytes/Second"
  4138. // StandardUnitMegabytesSecond is a StandardUnit enum value
  4139. StandardUnitMegabytesSecond = "Megabytes/Second"
  4140. // StandardUnitGigabytesSecond is a StandardUnit enum value
  4141. StandardUnitGigabytesSecond = "Gigabytes/Second"
  4142. // StandardUnitTerabytesSecond is a StandardUnit enum value
  4143. StandardUnitTerabytesSecond = "Terabytes/Second"
  4144. // StandardUnitBitsSecond is a StandardUnit enum value
  4145. StandardUnitBitsSecond = "Bits/Second"
  4146. // StandardUnitKilobitsSecond is a StandardUnit enum value
  4147. StandardUnitKilobitsSecond = "Kilobits/Second"
  4148. // StandardUnitMegabitsSecond is a StandardUnit enum value
  4149. StandardUnitMegabitsSecond = "Megabits/Second"
  4150. // StandardUnitGigabitsSecond is a StandardUnit enum value
  4151. StandardUnitGigabitsSecond = "Gigabits/Second"
  4152. // StandardUnitTerabitsSecond is a StandardUnit enum value
  4153. StandardUnitTerabitsSecond = "Terabits/Second"
  4154. // StandardUnitCountSecond is a StandardUnit enum value
  4155. StandardUnitCountSecond = "Count/Second"
  4156. // StandardUnitNone is a StandardUnit enum value
  4157. StandardUnitNone = "None"
  4158. )
  4159. const (
  4160. // StateValueOk is a StateValue enum value
  4161. StateValueOk = "OK"
  4162. // StateValueAlarm is a StateValue enum value
  4163. StateValueAlarm = "ALARM"
  4164. // StateValueInsufficientData is a StateValue enum value
  4165. StateValueInsufficientData = "INSUFFICIENT_DATA"
  4166. )
  4167. const (
  4168. // StatisticSampleCount is a Statistic enum value
  4169. StatisticSampleCount = "SampleCount"
  4170. // StatisticAverage is a Statistic enum value
  4171. StatisticAverage = "Average"
  4172. // StatisticSum is a Statistic enum value
  4173. StatisticSum = "Sum"
  4174. // StatisticMinimum is a Statistic enum value
  4175. StatisticMinimum = "Minimum"
  4176. // StatisticMaximum is a Statistic enum value
  4177. StatisticMaximum = "Maximum"
  4178. )
  4179. const (
  4180. // StatusCodeComplete is a StatusCode enum value
  4181. StatusCodeComplete = "Complete"
  4182. // StatusCodeInternalError is a StatusCode enum value
  4183. StatusCodeInternalError = "InternalError"
  4184. // StatusCodePartialData is a StatusCode enum value
  4185. StatusCodePartialData = "PartialData"
  4186. )