api.go 180 KB

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