api.go 145 KB

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