api.go 146 KB

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