api.go 175 KB

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