api.go 97 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package cloudwatch provides a client for Amazon CloudWatch.
  3. package cloudwatch
  4. import (
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/query"
  11. )
  12. const opDeleteAlarms = "DeleteAlarms"
  13. // DeleteAlarmsRequest generates a "aws/request.Request" representing the
  14. // client's request for the DeleteAlarms operation. The "output" return
  15. // value can be used to capture response data after the request's "Send" method
  16. // is called.
  17. //
  18. // See DeleteAlarms for usage and error information.
  19. //
  20. // Creating a request object using this method should be used when you want to inject
  21. // custom logic into the request's lifecycle using a custom handler, or if you want to
  22. // access properties on the request object before or after sending the request. If
  23. // you just want the service response, call the DeleteAlarms method directly
  24. // instead.
  25. //
  26. // Note: You must call the "Send" method on the returned request object in order
  27. // to execute the request.
  28. //
  29. // // Example sending a request using the DeleteAlarmsRequest method.
  30. // req, resp := client.DeleteAlarmsRequest(params)
  31. //
  32. // err := req.Send()
  33. // if err == nil { // resp is now filled
  34. // fmt.Println(resp)
  35. // }
  36. //
  37. 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. req = c.newRequest(op, input, output)
  47. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  48. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  49. output = &DeleteAlarmsOutput{}
  50. req.Data = output
  51. return
  52. }
  53. // DeleteAlarms API operation for Amazon CloudWatch.
  54. //
  55. // Deletes the specified alarms. In the event of an error, no alarms are deleted.
  56. //
  57. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  58. // with awserr.Error's Code and Message methods to get detailed information about
  59. // the error.
  60. //
  61. // See the AWS API reference guide for Amazon CloudWatch's
  62. // API operation DeleteAlarms for usage and error information.
  63. //
  64. // Returned Error Codes:
  65. // * ResourceNotFound
  66. // The named resource does not exist.
  67. //
  68. func (c *CloudWatch) DeleteAlarms(input *DeleteAlarmsInput) (*DeleteAlarmsOutput, error) {
  69. req, out := c.DeleteAlarmsRequest(input)
  70. err := req.Send()
  71. return out, err
  72. }
  73. const opDescribeAlarmHistory = "DescribeAlarmHistory"
  74. // DescribeAlarmHistoryRequest generates a "aws/request.Request" representing the
  75. // client's request for the DescribeAlarmHistory operation. The "output" return
  76. // value can be used to capture response data after the request's "Send" method
  77. // is called.
  78. //
  79. // See DescribeAlarmHistory for usage and error information.
  80. //
  81. // Creating a request object using this method should be used when you want to inject
  82. // custom logic into the request's lifecycle using a custom handler, or if you want to
  83. // access properties on the request object before or after sending the request. If
  84. // you just want the service response, call the DescribeAlarmHistory method directly
  85. // instead.
  86. //
  87. // Note: You must call the "Send" method on the returned request object in order
  88. // to execute the request.
  89. //
  90. // // Example sending a request using the DescribeAlarmHistoryRequest method.
  91. // req, resp := client.DescribeAlarmHistoryRequest(params)
  92. //
  93. // err := req.Send()
  94. // if err == nil { // resp is now filled
  95. // fmt.Println(resp)
  96. // }
  97. //
  98. func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInput) (req *request.Request, output *DescribeAlarmHistoryOutput) {
  99. op := &request.Operation{
  100. Name: opDescribeAlarmHistory,
  101. HTTPMethod: "POST",
  102. HTTPPath: "/",
  103. Paginator: &request.Paginator{
  104. InputTokens: []string{"NextToken"},
  105. OutputTokens: []string{"NextToken"},
  106. LimitToken: "MaxRecords",
  107. TruncationToken: "",
  108. },
  109. }
  110. if input == nil {
  111. input = &DescribeAlarmHistoryInput{}
  112. }
  113. req = c.newRequest(op, input, output)
  114. output = &DescribeAlarmHistoryOutput{}
  115. req.Data = output
  116. return
  117. }
  118. // DescribeAlarmHistory API operation for Amazon CloudWatch.
  119. //
  120. // Retrieves the history for the specified alarm. You can filter the results
  121. // by date range or item type. If an alarm name is not specified, the histories
  122. // for all alarms are returned.
  123. //
  124. // Note that Amazon CloudWatch retains the history of an alarm even if you delete
  125. // the alarm.
  126. //
  127. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  128. // with awserr.Error's Code and Message methods to get detailed information about
  129. // the error.
  130. //
  131. // See the AWS API reference guide for Amazon CloudWatch's
  132. // API operation DescribeAlarmHistory for usage and error information.
  133. //
  134. // Returned Error Codes:
  135. // * InvalidNextToken
  136. // The next token specified is invalid.
  137. //
  138. func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*DescribeAlarmHistoryOutput, error) {
  139. req, out := c.DescribeAlarmHistoryRequest(input)
  140. err := req.Send()
  141. return out, err
  142. }
  143. // DescribeAlarmHistoryPages iterates over the pages of a DescribeAlarmHistory operation,
  144. // calling the "fn" function with the response data for each page. To stop
  145. // iterating, return false from the fn function.
  146. //
  147. // See DescribeAlarmHistory method for more information on how to use this operation.
  148. //
  149. // Note: This operation can generate multiple requests to a service.
  150. //
  151. // // Example iterating over at most 3 pages of a DescribeAlarmHistory operation.
  152. // pageNum := 0
  153. // err := client.DescribeAlarmHistoryPages(params,
  154. // func(page *DescribeAlarmHistoryOutput, lastPage bool) bool {
  155. // pageNum++
  156. // fmt.Println(page)
  157. // return pageNum <= 3
  158. // })
  159. //
  160. func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(p *DescribeAlarmHistoryOutput, lastPage bool) (shouldContinue bool)) error {
  161. page, _ := c.DescribeAlarmHistoryRequest(input)
  162. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  163. return page.EachPage(func(p interface{}, lastPage bool) bool {
  164. return fn(p.(*DescribeAlarmHistoryOutput), lastPage)
  165. })
  166. }
  167. const opDescribeAlarms = "DescribeAlarms"
  168. // DescribeAlarmsRequest generates a "aws/request.Request" representing the
  169. // client's request for the DescribeAlarms operation. The "output" return
  170. // value can be used to capture response data after the request's "Send" method
  171. // is called.
  172. //
  173. // See DescribeAlarms for usage and error information.
  174. //
  175. // Creating a request object using this method should be used when you want to inject
  176. // custom logic into the request's lifecycle using a custom handler, or if you want to
  177. // access properties on the request object before or after sending the request. If
  178. // you just want the service response, call the DescribeAlarms method directly
  179. // instead.
  180. //
  181. // Note: You must call the "Send" method on the returned request object in order
  182. // to execute the request.
  183. //
  184. // // Example sending a request using the DescribeAlarmsRequest method.
  185. // req, resp := client.DescribeAlarmsRequest(params)
  186. //
  187. // err := req.Send()
  188. // if err == nil { // resp is now filled
  189. // fmt.Println(resp)
  190. // }
  191. //
  192. func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *request.Request, output *DescribeAlarmsOutput) {
  193. op := &request.Operation{
  194. Name: opDescribeAlarms,
  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 = &DescribeAlarmsInput{}
  206. }
  207. req = c.newRequest(op, input, output)
  208. output = &DescribeAlarmsOutput{}
  209. req.Data = output
  210. return
  211. }
  212. // DescribeAlarms API operation for Amazon CloudWatch.
  213. //
  214. // Retrieves the specified alarms. If no alarms are specified, all alarms are
  215. // returned. Alarms can be retrieved by using only a prefix for the alarm name,
  216. // the alarm state, or a prefix for any action.
  217. //
  218. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  219. // with awserr.Error's Code and Message methods to get detailed information about
  220. // the error.
  221. //
  222. // See the AWS API reference guide for Amazon CloudWatch's
  223. // API operation DescribeAlarms for usage and error information.
  224. //
  225. // Returned Error Codes:
  226. // * InvalidNextToken
  227. // The next token specified is invalid.
  228. //
  229. func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarmsOutput, error) {
  230. req, out := c.DescribeAlarmsRequest(input)
  231. err := req.Send()
  232. return out, err
  233. }
  234. // DescribeAlarmsPages iterates over the pages of a DescribeAlarms operation,
  235. // calling the "fn" function with the response data for each page. To stop
  236. // iterating, return false from the fn function.
  237. //
  238. // See DescribeAlarms method for more information on how to use this operation.
  239. //
  240. // Note: This operation can generate multiple requests to a service.
  241. //
  242. // // Example iterating over at most 3 pages of a DescribeAlarms operation.
  243. // pageNum := 0
  244. // err := client.DescribeAlarmsPages(params,
  245. // func(page *DescribeAlarmsOutput, lastPage bool) bool {
  246. // pageNum++
  247. // fmt.Println(page)
  248. // return pageNum <= 3
  249. // })
  250. //
  251. func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(p *DescribeAlarmsOutput, lastPage bool) (shouldContinue bool)) error {
  252. page, _ := c.DescribeAlarmsRequest(input)
  253. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  254. return page.EachPage(func(p interface{}, lastPage bool) bool {
  255. return fn(p.(*DescribeAlarmsOutput), lastPage)
  256. })
  257. }
  258. const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric"
  259. // DescribeAlarmsForMetricRequest generates a "aws/request.Request" representing the
  260. // client's request for the DescribeAlarmsForMetric operation. The "output" return
  261. // value can be used to capture response data after the request's "Send" method
  262. // is called.
  263. //
  264. // See DescribeAlarmsForMetric for usage and error information.
  265. //
  266. // Creating a request object using this method should be used when you want to inject
  267. // custom logic into the request's lifecycle using a custom handler, or if you want to
  268. // access properties on the request object before or after sending the request. If
  269. // you just want the service response, call the DescribeAlarmsForMetric method directly
  270. // instead.
  271. //
  272. // Note: You must call the "Send" method on the returned request object in order
  273. // to execute the request.
  274. //
  275. // // Example sending a request using the DescribeAlarmsForMetricRequest method.
  276. // req, resp := client.DescribeAlarmsForMetricRequest(params)
  277. //
  278. // err := req.Send()
  279. // if err == nil { // resp is now filled
  280. // fmt.Println(resp)
  281. // }
  282. //
  283. func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetricInput) (req *request.Request, output *DescribeAlarmsForMetricOutput) {
  284. op := &request.Operation{
  285. Name: opDescribeAlarmsForMetric,
  286. HTTPMethod: "POST",
  287. HTTPPath: "/",
  288. }
  289. if input == nil {
  290. input = &DescribeAlarmsForMetricInput{}
  291. }
  292. req = c.newRequest(op, input, output)
  293. output = &DescribeAlarmsForMetricOutput{}
  294. req.Data = output
  295. return
  296. }
  297. // DescribeAlarmsForMetric API operation for Amazon CloudWatch.
  298. //
  299. // Retrieves the alarms for the specified metric. Specify a statistic, period,
  300. // or unit to filter the results.
  301. //
  302. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  303. // with awserr.Error's Code and Message methods to get detailed information about
  304. // the error.
  305. //
  306. // See the AWS API reference guide for Amazon CloudWatch's
  307. // API operation DescribeAlarmsForMetric for usage and error information.
  308. func (c *CloudWatch) DescribeAlarmsForMetric(input *DescribeAlarmsForMetricInput) (*DescribeAlarmsForMetricOutput, error) {
  309. req, out := c.DescribeAlarmsForMetricRequest(input)
  310. err := req.Send()
  311. return out, err
  312. }
  313. const opDisableAlarmActions = "DisableAlarmActions"
  314. // DisableAlarmActionsRequest generates a "aws/request.Request" representing the
  315. // client's request for the DisableAlarmActions operation. The "output" return
  316. // value can be used to capture response data after the request's "Send" method
  317. // is called.
  318. //
  319. // See DisableAlarmActions for usage and error information.
  320. //
  321. // Creating a request object using this method should be used when you want to inject
  322. // custom logic into the request's lifecycle using a custom handler, or if you want to
  323. // access properties on the request object before or after sending the request. If
  324. // you just want the service response, call the DisableAlarmActions method directly
  325. // instead.
  326. //
  327. // Note: You must call the "Send" method on the returned request object in order
  328. // to execute the request.
  329. //
  330. // // Example sending a request using the DisableAlarmActionsRequest method.
  331. // req, resp := client.DisableAlarmActionsRequest(params)
  332. //
  333. // err := req.Send()
  334. // if err == nil { // resp is now filled
  335. // fmt.Println(resp)
  336. // }
  337. //
  338. func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) (req *request.Request, output *DisableAlarmActionsOutput) {
  339. op := &request.Operation{
  340. Name: opDisableAlarmActions,
  341. HTTPMethod: "POST",
  342. HTTPPath: "/",
  343. }
  344. if input == nil {
  345. input = &DisableAlarmActionsInput{}
  346. }
  347. req = c.newRequest(op, input, output)
  348. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  349. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  350. output = &DisableAlarmActionsOutput{}
  351. req.Data = output
  352. return
  353. }
  354. // DisableAlarmActions API operation for Amazon CloudWatch.
  355. //
  356. // Disables the actions for the specified alarms. When an alarm's actions are
  357. // disabled, the alarm actions do not execute when the alarm state changes.
  358. //
  359. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  360. // with awserr.Error's Code and Message methods to get detailed information about
  361. // the error.
  362. //
  363. // See the AWS API reference guide for Amazon CloudWatch's
  364. // API operation DisableAlarmActions for usage and error information.
  365. func (c *CloudWatch) DisableAlarmActions(input *DisableAlarmActionsInput) (*DisableAlarmActionsOutput, error) {
  366. req, out := c.DisableAlarmActionsRequest(input)
  367. err := req.Send()
  368. return out, err
  369. }
  370. const opEnableAlarmActions = "EnableAlarmActions"
  371. // EnableAlarmActionsRequest generates a "aws/request.Request" representing the
  372. // client's request for the EnableAlarmActions operation. The "output" return
  373. // value can be used to capture response data after the request's "Send" method
  374. // is called.
  375. //
  376. // See EnableAlarmActions for usage and error information.
  377. //
  378. // Creating a request object using this method should be used when you want to inject
  379. // custom logic into the request's lifecycle using a custom handler, or if you want to
  380. // access properties on the request object before or after sending the request. If
  381. // you just want the service response, call the EnableAlarmActions method directly
  382. // instead.
  383. //
  384. // Note: You must call the "Send" method on the returned request object in order
  385. // to execute the request.
  386. //
  387. // // Example sending a request using the EnableAlarmActionsRequest method.
  388. // req, resp := client.EnableAlarmActionsRequest(params)
  389. //
  390. // err := req.Send()
  391. // if err == nil { // resp is now filled
  392. // fmt.Println(resp)
  393. // }
  394. //
  395. func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (req *request.Request, output *EnableAlarmActionsOutput) {
  396. op := &request.Operation{
  397. Name: opEnableAlarmActions,
  398. HTTPMethod: "POST",
  399. HTTPPath: "/",
  400. }
  401. if input == nil {
  402. input = &EnableAlarmActionsInput{}
  403. }
  404. req = c.newRequest(op, input, output)
  405. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  406. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  407. output = &EnableAlarmActionsOutput{}
  408. req.Data = output
  409. return
  410. }
  411. // EnableAlarmActions API operation for Amazon CloudWatch.
  412. //
  413. // Enables the actions for the specified alarms.
  414. //
  415. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  416. // with awserr.Error's Code and Message methods to get detailed information about
  417. // the error.
  418. //
  419. // See the AWS API reference guide for Amazon CloudWatch's
  420. // API operation EnableAlarmActions for usage and error information.
  421. func (c *CloudWatch) EnableAlarmActions(input *EnableAlarmActionsInput) (*EnableAlarmActionsOutput, error) {
  422. req, out := c.EnableAlarmActionsRequest(input)
  423. err := req.Send()
  424. return out, err
  425. }
  426. const opGetMetricStatistics = "GetMetricStatistics"
  427. // GetMetricStatisticsRequest generates a "aws/request.Request" representing the
  428. // client's request for the GetMetricStatistics operation. The "output" return
  429. // value can be used to capture response data after the request's "Send" method
  430. // is called.
  431. //
  432. // See GetMetricStatistics for usage and error information.
  433. //
  434. // Creating a request object using this method should be used when you want to inject
  435. // custom logic into the request's lifecycle using a custom handler, or if you want to
  436. // access properties on the request object before or after sending the request. If
  437. // you just want the service response, call the GetMetricStatistics method directly
  438. // instead.
  439. //
  440. // Note: You must call the "Send" method on the returned request object in order
  441. // to execute the request.
  442. //
  443. // // Example sending a request using the GetMetricStatisticsRequest method.
  444. // req, resp := client.GetMetricStatisticsRequest(params)
  445. //
  446. // err := req.Send()
  447. // if err == nil { // resp is now filled
  448. // fmt.Println(resp)
  449. // }
  450. //
  451. func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) (req *request.Request, output *GetMetricStatisticsOutput) {
  452. op := &request.Operation{
  453. Name: opGetMetricStatistics,
  454. HTTPMethod: "POST",
  455. HTTPPath: "/",
  456. }
  457. if input == nil {
  458. input = &GetMetricStatisticsInput{}
  459. }
  460. req = c.newRequest(op, input, output)
  461. output = &GetMetricStatisticsOutput{}
  462. req.Data = output
  463. return
  464. }
  465. // GetMetricStatistics API operation for Amazon CloudWatch.
  466. //
  467. // Gets statistics for the specified metric.
  468. //
  469. // Amazon CloudWatch retains metric data as follows:
  470. //
  471. // * Data points with a period of 60 seconds (1 minute) are available for
  472. // 15 days
  473. //
  474. // * Data points with a period of 300 seconds (5 minute) are available for
  475. // 63 days
  476. //
  477. // * Data points with a period of 3600 seconds (1 hour) are available for
  478. // 455 days (15 months)
  479. //
  480. // Note that CloudWatch started retaining 5-minute and 1-hour metric data as
  481. // of 9 July 2016.
  482. //
  483. // The maximum number of data points returned from a single call is 1,440. If
  484. // you request more than 1,440 data points, Amazon CloudWatch returns an error.
  485. // To reduce the number of data points, you can narrow the specified time range
  486. // and make multiple requests across adjacent time ranges, or you can increase
  487. // the specified period. A period can be as short as one minute (60 seconds).
  488. // Note that data points are not returned in chronological order.
  489. //
  490. // Amazon CloudWatch aggregates data points based on the length of the period
  491. // that you specify. For example, if you request statistics with a one-hour
  492. // period, Amazon CloudWatch aggregates all data points with time stamps that
  493. // fall within each one-hour period. Therefore, the number of values aggregated
  494. // by CloudWatch is larger than the number of data points returned.
  495. //
  496. // For a list of metrics and dimensions supported by AWS services, see the Amazon
  497. // CloudWatch Metrics and Dimensions Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html)
  498. // in the Amazon CloudWatch User Guide.
  499. //
  500. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  501. // with awserr.Error's Code and Message methods to get detailed information about
  502. // the error.
  503. //
  504. // See the AWS API reference guide for Amazon CloudWatch's
  505. // API operation GetMetricStatistics for usage and error information.
  506. //
  507. // Returned Error Codes:
  508. // * InvalidParameterValue
  509. // The value of an input parameter is bad or out-of-range.
  510. //
  511. // * MissingParameter
  512. // An input parameter that is required is missing.
  513. //
  514. // * InvalidParameterCombination
  515. // Parameters that cannot be used together were used together.
  516. //
  517. // * InternalServiceError
  518. // Request processing has failed due to some unknown error, exception, or failure.
  519. //
  520. func (c *CloudWatch) GetMetricStatistics(input *GetMetricStatisticsInput) (*GetMetricStatisticsOutput, error) {
  521. req, out := c.GetMetricStatisticsRequest(input)
  522. err := req.Send()
  523. return out, err
  524. }
  525. const opListMetrics = "ListMetrics"
  526. // ListMetricsRequest generates a "aws/request.Request" representing the
  527. // client's request for the ListMetrics operation. The "output" return
  528. // value can be used to capture response data after the request's "Send" method
  529. // is called.
  530. //
  531. // See ListMetrics for usage and error information.
  532. //
  533. // Creating a request object using this method should be used when you want to inject
  534. // custom logic into the request's lifecycle using a custom handler, or if you want to
  535. // access properties on the request object before or after sending the request. If
  536. // you just want the service response, call the ListMetrics method directly
  537. // instead.
  538. //
  539. // Note: You must call the "Send" method on the returned request object in order
  540. // to execute the request.
  541. //
  542. // // Example sending a request using the ListMetricsRequest method.
  543. // req, resp := client.ListMetricsRequest(params)
  544. //
  545. // err := req.Send()
  546. // if err == nil { // resp is now filled
  547. // fmt.Println(resp)
  548. // }
  549. //
  550. func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *request.Request, output *ListMetricsOutput) {
  551. op := &request.Operation{
  552. Name: opListMetrics,
  553. HTTPMethod: "POST",
  554. HTTPPath: "/",
  555. Paginator: &request.Paginator{
  556. InputTokens: []string{"NextToken"},
  557. OutputTokens: []string{"NextToken"},
  558. LimitToken: "",
  559. TruncationToken: "",
  560. },
  561. }
  562. if input == nil {
  563. input = &ListMetricsInput{}
  564. }
  565. req = c.newRequest(op, input, output)
  566. output = &ListMetricsOutput{}
  567. req.Data = output
  568. return
  569. }
  570. // ListMetrics API operation for Amazon CloudWatch.
  571. //
  572. // List the specified metrics. You can use the returned metrics with GetMetricStatistics
  573. // to obtain statistical data.
  574. //
  575. // Up to 500 results are returned for any one call. To retrieve additional results,
  576. // use the returned token with subsequent calls.
  577. //
  578. // After you create a metric, allow up to fifteen minutes before the metric
  579. // appears. Statistics about the metric, however, are available sooner using
  580. // GetMetricStatistics.
  581. //
  582. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  583. // with awserr.Error's Code and Message methods to get detailed information about
  584. // the error.
  585. //
  586. // See the AWS API reference guide for Amazon CloudWatch's
  587. // API operation ListMetrics for usage and error information.
  588. //
  589. // Returned Error Codes:
  590. // * InternalServiceError
  591. // Request processing has failed due to some unknown error, exception, or failure.
  592. //
  593. // * InvalidParameterValue
  594. // The value of an input parameter is bad or out-of-range.
  595. //
  596. func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, error) {
  597. req, out := c.ListMetricsRequest(input)
  598. err := req.Send()
  599. return out, err
  600. }
  601. // ListMetricsPages iterates over the pages of a ListMetrics operation,
  602. // calling the "fn" function with the response data for each page. To stop
  603. // iterating, return false from the fn function.
  604. //
  605. // See ListMetrics method for more information on how to use this operation.
  606. //
  607. // Note: This operation can generate multiple requests to a service.
  608. //
  609. // // Example iterating over at most 3 pages of a ListMetrics operation.
  610. // pageNum := 0
  611. // err := client.ListMetricsPages(params,
  612. // func(page *ListMetricsOutput, lastPage bool) bool {
  613. // pageNum++
  614. // fmt.Println(page)
  615. // return pageNum <= 3
  616. // })
  617. //
  618. func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(p *ListMetricsOutput, lastPage bool) (shouldContinue bool)) error {
  619. page, _ := c.ListMetricsRequest(input)
  620. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  621. return page.EachPage(func(p interface{}, lastPage bool) bool {
  622. return fn(p.(*ListMetricsOutput), lastPage)
  623. })
  624. }
  625. const opPutMetricAlarm = "PutMetricAlarm"
  626. // PutMetricAlarmRequest generates a "aws/request.Request" representing the
  627. // client's request for the PutMetricAlarm operation. The "output" return
  628. // value can be used to capture response data after the request's "Send" method
  629. // is called.
  630. //
  631. // See PutMetricAlarm for usage and error information.
  632. //
  633. // Creating a request object using this method should be used when you want to inject
  634. // custom logic into the request's lifecycle using a custom handler, or if you want to
  635. // access properties on the request object before or after sending the request. If
  636. // you just want the service response, call the PutMetricAlarm method directly
  637. // instead.
  638. //
  639. // Note: You must call the "Send" method on the returned request object in order
  640. // to execute the request.
  641. //
  642. // // Example sending a request using the PutMetricAlarmRequest method.
  643. // req, resp := client.PutMetricAlarmRequest(params)
  644. //
  645. // err := req.Send()
  646. // if err == nil { // resp is now filled
  647. // fmt.Println(resp)
  648. // }
  649. //
  650. func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *request.Request, output *PutMetricAlarmOutput) {
  651. op := &request.Operation{
  652. Name: opPutMetricAlarm,
  653. HTTPMethod: "POST",
  654. HTTPPath: "/",
  655. }
  656. if input == nil {
  657. input = &PutMetricAlarmInput{}
  658. }
  659. req = c.newRequest(op, input, output)
  660. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  661. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  662. output = &PutMetricAlarmOutput{}
  663. req.Data = output
  664. return
  665. }
  666. // PutMetricAlarm API operation for Amazon CloudWatch.
  667. //
  668. // Creates or updates an alarm and associates it with the specified metric.
  669. // Optionally, this operation can associate one or more Amazon SNS resources
  670. // with the alarm.
  671. //
  672. // When this operation creates an alarm, the alarm state is immediately set
  673. // to INSUFFICIENT_DATA. The alarm is evaluated and its state is set appropriately.
  674. // Any actions associated with the state are then executed.
  675. //
  676. // When you update an existing alarm, its state is left unchanged, but the update
  677. // completely overwrites the previous configuration of the alarm.
  678. //
  679. // If you are an AWS Identity and Access Management (IAM) user, you must have
  680. // Amazon EC2 permissions for some operations:
  681. //
  682. // * ec2:DescribeInstanceStatus and ec2:DescribeInstances for all alarms
  683. // on EC2 instance status metrics
  684. //
  685. // * ec2:StopInstances for alarms with stop actions
  686. //
  687. // * ec2:TerminateInstances for alarms with terminate actions
  688. //
  689. // * ec2:DescribeInstanceRecoveryAttribute and ec2:RecoverInstances for alarms
  690. // with recover actions
  691. //
  692. // If you have read/write permissions for Amazon CloudWatch but not for Amazon
  693. // EC2, you can still create an alarm, but the stop or terminate actions won't
  694. // be performed. However, if you are later granted the required permissions,
  695. // the alarm actions that you created earlier will be performed.
  696. //
  697. // If you are using an IAM role (for example, an Amazon EC2 instance profile),
  698. // you cannot stop or terminate the instance using alarm actions. However, you
  699. // can still see the alarm state and perform any other actions such as Amazon
  700. // SNS notifications or Auto Scaling policies.
  701. //
  702. // If you are using temporary security credentials granted using the AWS Security
  703. // Token Service (AWS STS), you cannot stop or terminate an Amazon EC2 instance
  704. // using alarm actions.
  705. //
  706. // Note that you must create at least one stop, terminate, or reboot alarm using
  707. // the Amazon EC2 or CloudWatch console to create the EC2ActionsAccess IAM role.
  708. // After this IAM role is created, you can create stop, terminate, or reboot
  709. // alarms using a command-line interface or an API.
  710. //
  711. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  712. // with awserr.Error's Code and Message methods to get detailed information about
  713. // the error.
  714. //
  715. // See the AWS API reference guide for Amazon CloudWatch's
  716. // API operation PutMetricAlarm for usage and error information.
  717. //
  718. // Returned Error Codes:
  719. // * LimitExceeded
  720. // The quota for alarms for this customer has already been reached.
  721. //
  722. func (c *CloudWatch) PutMetricAlarm(input *PutMetricAlarmInput) (*PutMetricAlarmOutput, error) {
  723. req, out := c.PutMetricAlarmRequest(input)
  724. err := req.Send()
  725. return out, err
  726. }
  727. const opPutMetricData = "PutMetricData"
  728. // PutMetricDataRequest generates a "aws/request.Request" representing the
  729. // client's request for the PutMetricData operation. The "output" return
  730. // value can be used to capture response data after the request's "Send" method
  731. // is called.
  732. //
  733. // See PutMetricData for usage and error information.
  734. //
  735. // Creating a request object using this method should be used when you want to inject
  736. // custom logic into the request's lifecycle using a custom handler, or if you want to
  737. // access properties on the request object before or after sending the request. If
  738. // you just want the service response, call the PutMetricData method directly
  739. // instead.
  740. //
  741. // Note: You must call the "Send" method on the returned request object in order
  742. // to execute the request.
  743. //
  744. // // Example sending a request using the PutMetricDataRequest method.
  745. // req, resp := client.PutMetricDataRequest(params)
  746. //
  747. // err := req.Send()
  748. // if err == nil { // resp is now filled
  749. // fmt.Println(resp)
  750. // }
  751. //
  752. func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *request.Request, output *PutMetricDataOutput) {
  753. op := &request.Operation{
  754. Name: opPutMetricData,
  755. HTTPMethod: "POST",
  756. HTTPPath: "/",
  757. }
  758. if input == nil {
  759. input = &PutMetricDataInput{}
  760. }
  761. req = c.newRequest(op, input, output)
  762. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  763. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  764. output = &PutMetricDataOutput{}
  765. req.Data = output
  766. return
  767. }
  768. // PutMetricData API operation for Amazon CloudWatch.
  769. //
  770. // Publishes metric data points to Amazon CloudWatch. Amazon CloudWatch associates
  771. // the data points with the specified metric. If the specified metric does not
  772. // exist, Amazon CloudWatch creates the metric. When Amazon CloudWatch creates
  773. // a metric, it can take up to fifteen minutes for the metric to appear in calls
  774. // to ListMetrics.
  775. //
  776. // Each PutMetricData request is limited to 8 KB in size for HTTP GET requests
  777. // and is limited to 40 KB in size for HTTP POST requests.
  778. //
  779. // Although the Value parameter accepts numbers of type Double, Amazon CloudWatch
  780. // rejects values that are either too small or too large. Values must be in
  781. // the range of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360
  782. // (Base 2). In addition, special values (e.g., NaN, +Infinity, -Infinity) are
  783. // not supported.
  784. //
  785. // Data points with time stamps from 24 hours ago or longer can take at least
  786. // 48 hours to become available for GetMetricStatistics from the time they are
  787. // submitted.
  788. //
  789. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  790. // with awserr.Error's Code and Message methods to get detailed information about
  791. // the error.
  792. //
  793. // See the AWS API reference guide for Amazon CloudWatch's
  794. // API operation PutMetricData for usage and error information.
  795. //
  796. // Returned Error Codes:
  797. // * InvalidParameterValue
  798. // The value of an input parameter is bad or out-of-range.
  799. //
  800. // * MissingParameter
  801. // An input parameter that is required is missing.
  802. //
  803. // * InvalidParameterCombination
  804. // Parameters that cannot be used together were used together.
  805. //
  806. // * InternalServiceError
  807. // Request processing has failed due to some unknown error, exception, or failure.
  808. //
  809. func (c *CloudWatch) PutMetricData(input *PutMetricDataInput) (*PutMetricDataOutput, error) {
  810. req, out := c.PutMetricDataRequest(input)
  811. err := req.Send()
  812. return out, err
  813. }
  814. const opSetAlarmState = "SetAlarmState"
  815. // SetAlarmStateRequest generates a "aws/request.Request" representing the
  816. // client's request for the SetAlarmState operation. The "output" return
  817. // value can be used to capture response data after the request's "Send" method
  818. // is called.
  819. //
  820. // See SetAlarmState for usage and error information.
  821. //
  822. // Creating a request object using this method should be used when you want to inject
  823. // custom logic into the request's lifecycle using a custom handler, or if you want to
  824. // access properties on the request object before or after sending the request. If
  825. // you just want the service response, call the SetAlarmState method directly
  826. // instead.
  827. //
  828. // Note: You must call the "Send" method on the returned request object in order
  829. // to execute the request.
  830. //
  831. // // Example sending a request using the SetAlarmStateRequest method.
  832. // req, resp := client.SetAlarmStateRequest(params)
  833. //
  834. // err := req.Send()
  835. // if err == nil { // resp is now filled
  836. // fmt.Println(resp)
  837. // }
  838. //
  839. func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *request.Request, output *SetAlarmStateOutput) {
  840. op := &request.Operation{
  841. Name: opSetAlarmState,
  842. HTTPMethod: "POST",
  843. HTTPPath: "/",
  844. }
  845. if input == nil {
  846. input = &SetAlarmStateInput{}
  847. }
  848. req = c.newRequest(op, input, output)
  849. req.Handlers.Unmarshal.Remove(query.UnmarshalHandler)
  850. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  851. output = &SetAlarmStateOutput{}
  852. req.Data = output
  853. return
  854. }
  855. // SetAlarmState API operation for Amazon CloudWatch.
  856. //
  857. // Temporarily sets the state of an alarm for testing purposes. When the updated
  858. // state differs from the previous value, the action configured for the appropriate
  859. // state is invoked. For example, if your alarm is configured to send an Amazon
  860. // SNS message when an alarm is triggered, temporarily changing the alarm state
  861. // to ALARM sends an Amazon SNS message. The alarm returns to its actual state
  862. // (often within seconds). Because the alarm state change happens very quickly,
  863. // it is typically only visible in the alarm's History tab in the Amazon CloudWatch
  864. // console or through DescribeAlarmHistory.
  865. //
  866. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  867. // with awserr.Error's Code and Message methods to get detailed information about
  868. // the error.
  869. //
  870. // See the AWS API reference guide for Amazon CloudWatch's
  871. // API operation SetAlarmState for usage and error information.
  872. //
  873. // Returned Error Codes:
  874. // * ResourceNotFound
  875. // The named resource does not exist.
  876. //
  877. // * InvalidFormat
  878. // Data was not syntactically valid JSON.
  879. //
  880. func (c *CloudWatch) SetAlarmState(input *SetAlarmStateInput) (*SetAlarmStateOutput, error) {
  881. req, out := c.SetAlarmStateRequest(input)
  882. err := req.Send()
  883. return out, err
  884. }
  885. // Represents the history of a specific alarm.
  886. type AlarmHistoryItem struct {
  887. _ struct{} `type:"structure"`
  888. // The descriptive name for the alarm.
  889. AlarmName *string `min:"1" type:"string"`
  890. // Data about the alarm, in JSON format.
  891. HistoryData *string `min:"1" type:"string"`
  892. // The type of alarm history item.
  893. HistoryItemType *string `type:"string" enum:"HistoryItemType"`
  894. // A summary of the alarm history, in text format.
  895. HistorySummary *string `min:"1" type:"string"`
  896. // The time stamp for the alarm history item.
  897. Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  898. }
  899. // String returns the string representation
  900. func (s AlarmHistoryItem) String() string {
  901. return awsutil.Prettify(s)
  902. }
  903. // GoString returns the string representation
  904. func (s AlarmHistoryItem) GoString() string {
  905. return s.String()
  906. }
  907. // SetAlarmName sets the AlarmName field's value.
  908. func (s *AlarmHistoryItem) SetAlarmName(v string) *AlarmHistoryItem {
  909. s.AlarmName = &v
  910. return s
  911. }
  912. // SetHistoryData sets the HistoryData field's value.
  913. func (s *AlarmHistoryItem) SetHistoryData(v string) *AlarmHistoryItem {
  914. s.HistoryData = &v
  915. return s
  916. }
  917. // SetHistoryItemType sets the HistoryItemType field's value.
  918. func (s *AlarmHistoryItem) SetHistoryItemType(v string) *AlarmHistoryItem {
  919. s.HistoryItemType = &v
  920. return s
  921. }
  922. // SetHistorySummary sets the HistorySummary field's value.
  923. func (s *AlarmHistoryItem) SetHistorySummary(v string) *AlarmHistoryItem {
  924. s.HistorySummary = &v
  925. return s
  926. }
  927. // SetTimestamp sets the Timestamp field's value.
  928. func (s *AlarmHistoryItem) SetTimestamp(v time.Time) *AlarmHistoryItem {
  929. s.Timestamp = &v
  930. return s
  931. }
  932. // Encapsulates the statistical data that Amazon CloudWatch computes from metric
  933. // data.
  934. type Datapoint struct {
  935. _ struct{} `type:"structure"`
  936. // The average of the metric values that correspond to the data point.
  937. Average *float64 `type:"double"`
  938. // The percentile statistic for the data point.
  939. ExtendedStatistics map[string]*float64 `type:"map"`
  940. // The maximum metric value for the data point.
  941. Maximum *float64 `type:"double"`
  942. // The minimum metric value for the data point.
  943. Minimum *float64 `type:"double"`
  944. // The number of metric values that contributed to the aggregate value of this
  945. // data point.
  946. SampleCount *float64 `type:"double"`
  947. // The sum of the metric values for the data point.
  948. Sum *float64 `type:"double"`
  949. // The time stamp used for the data point.
  950. Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  951. // The standard unit for the data point.
  952. Unit *string `type:"string" enum:"StandardUnit"`
  953. }
  954. // String returns the string representation
  955. func (s Datapoint) String() string {
  956. return awsutil.Prettify(s)
  957. }
  958. // GoString returns the string representation
  959. func (s Datapoint) GoString() string {
  960. return s.String()
  961. }
  962. // SetAverage sets the Average field's value.
  963. func (s *Datapoint) SetAverage(v float64) *Datapoint {
  964. s.Average = &v
  965. return s
  966. }
  967. // SetExtendedStatistics sets the ExtendedStatistics field's value.
  968. func (s *Datapoint) SetExtendedStatistics(v map[string]*float64) *Datapoint {
  969. s.ExtendedStatistics = v
  970. return s
  971. }
  972. // SetMaximum sets the Maximum field's value.
  973. func (s *Datapoint) SetMaximum(v float64) *Datapoint {
  974. s.Maximum = &v
  975. return s
  976. }
  977. // SetMinimum sets the Minimum field's value.
  978. func (s *Datapoint) SetMinimum(v float64) *Datapoint {
  979. s.Minimum = &v
  980. return s
  981. }
  982. // SetSampleCount sets the SampleCount field's value.
  983. func (s *Datapoint) SetSampleCount(v float64) *Datapoint {
  984. s.SampleCount = &v
  985. return s
  986. }
  987. // SetSum sets the Sum field's value.
  988. func (s *Datapoint) SetSum(v float64) *Datapoint {
  989. s.Sum = &v
  990. return s
  991. }
  992. // SetTimestamp sets the Timestamp field's value.
  993. func (s *Datapoint) SetTimestamp(v time.Time) *Datapoint {
  994. s.Timestamp = &v
  995. return s
  996. }
  997. // SetUnit sets the Unit field's value.
  998. func (s *Datapoint) SetUnit(v string) *Datapoint {
  999. s.Unit = &v
  1000. return s
  1001. }
  1002. type DeleteAlarmsInput struct {
  1003. _ struct{} `type:"structure"`
  1004. // The alarms to be deleted.
  1005. //
  1006. // AlarmNames is a required field
  1007. AlarmNames []*string `type:"list" required:"true"`
  1008. }
  1009. // String returns the string representation
  1010. func (s DeleteAlarmsInput) String() string {
  1011. return awsutil.Prettify(s)
  1012. }
  1013. // GoString returns the string representation
  1014. func (s DeleteAlarmsInput) GoString() string {
  1015. return s.String()
  1016. }
  1017. // Validate inspects the fields of the type to determine if they are valid.
  1018. func (s *DeleteAlarmsInput) Validate() error {
  1019. invalidParams := request.ErrInvalidParams{Context: "DeleteAlarmsInput"}
  1020. if s.AlarmNames == nil {
  1021. invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
  1022. }
  1023. if invalidParams.Len() > 0 {
  1024. return invalidParams
  1025. }
  1026. return nil
  1027. }
  1028. // SetAlarmNames sets the AlarmNames field's value.
  1029. func (s *DeleteAlarmsInput) SetAlarmNames(v []*string) *DeleteAlarmsInput {
  1030. s.AlarmNames = v
  1031. return s
  1032. }
  1033. type DeleteAlarmsOutput struct {
  1034. _ struct{} `type:"structure"`
  1035. }
  1036. // String returns the string representation
  1037. func (s DeleteAlarmsOutput) String() string {
  1038. return awsutil.Prettify(s)
  1039. }
  1040. // GoString returns the string representation
  1041. func (s DeleteAlarmsOutput) GoString() string {
  1042. return s.String()
  1043. }
  1044. type DescribeAlarmHistoryInput struct {
  1045. _ struct{} `type:"structure"`
  1046. // The name of the alarm.
  1047. AlarmName *string `min:"1" type:"string"`
  1048. // The ending date to retrieve alarm history.
  1049. EndDate *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1050. // The type of alarm histories to retrieve.
  1051. HistoryItemType *string `type:"string" enum:"HistoryItemType"`
  1052. // The maximum number of alarm history records to retrieve.
  1053. MaxRecords *int64 `min:"1" type:"integer"`
  1054. // The token returned by a previous call to indicate that there is more data
  1055. // available.
  1056. NextToken *string `type:"string"`
  1057. // The starting date to retrieve alarm history.
  1058. StartDate *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1059. }
  1060. // String returns the string representation
  1061. func (s DescribeAlarmHistoryInput) String() string {
  1062. return awsutil.Prettify(s)
  1063. }
  1064. // GoString returns the string representation
  1065. func (s DescribeAlarmHistoryInput) GoString() string {
  1066. return s.String()
  1067. }
  1068. // Validate inspects the fields of the type to determine if they are valid.
  1069. func (s *DescribeAlarmHistoryInput) Validate() error {
  1070. invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmHistoryInput"}
  1071. if s.AlarmName != nil && len(*s.AlarmName) < 1 {
  1072. invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
  1073. }
  1074. if s.MaxRecords != nil && *s.MaxRecords < 1 {
  1075. invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1))
  1076. }
  1077. if invalidParams.Len() > 0 {
  1078. return invalidParams
  1079. }
  1080. return nil
  1081. }
  1082. // SetAlarmName sets the AlarmName field's value.
  1083. func (s *DescribeAlarmHistoryInput) SetAlarmName(v string) *DescribeAlarmHistoryInput {
  1084. s.AlarmName = &v
  1085. return s
  1086. }
  1087. // SetEndDate sets the EndDate field's value.
  1088. func (s *DescribeAlarmHistoryInput) SetEndDate(v time.Time) *DescribeAlarmHistoryInput {
  1089. s.EndDate = &v
  1090. return s
  1091. }
  1092. // SetHistoryItemType sets the HistoryItemType field's value.
  1093. func (s *DescribeAlarmHistoryInput) SetHistoryItemType(v string) *DescribeAlarmHistoryInput {
  1094. s.HistoryItemType = &v
  1095. return s
  1096. }
  1097. // SetMaxRecords sets the MaxRecords field's value.
  1098. func (s *DescribeAlarmHistoryInput) SetMaxRecords(v int64) *DescribeAlarmHistoryInput {
  1099. s.MaxRecords = &v
  1100. return s
  1101. }
  1102. // SetNextToken sets the NextToken field's value.
  1103. func (s *DescribeAlarmHistoryInput) SetNextToken(v string) *DescribeAlarmHistoryInput {
  1104. s.NextToken = &v
  1105. return s
  1106. }
  1107. // SetStartDate sets the StartDate field's value.
  1108. func (s *DescribeAlarmHistoryInput) SetStartDate(v time.Time) *DescribeAlarmHistoryInput {
  1109. s.StartDate = &v
  1110. return s
  1111. }
  1112. type DescribeAlarmHistoryOutput struct {
  1113. _ struct{} `type:"structure"`
  1114. // The alarm histories, in JSON format.
  1115. AlarmHistoryItems []*AlarmHistoryItem `type:"list"`
  1116. // The token that marks the start of the next batch of returned results.
  1117. NextToken *string `type:"string"`
  1118. }
  1119. // String returns the string representation
  1120. func (s DescribeAlarmHistoryOutput) String() string {
  1121. return awsutil.Prettify(s)
  1122. }
  1123. // GoString returns the string representation
  1124. func (s DescribeAlarmHistoryOutput) GoString() string {
  1125. return s.String()
  1126. }
  1127. // SetAlarmHistoryItems sets the AlarmHistoryItems field's value.
  1128. func (s *DescribeAlarmHistoryOutput) SetAlarmHistoryItems(v []*AlarmHistoryItem) *DescribeAlarmHistoryOutput {
  1129. s.AlarmHistoryItems = v
  1130. return s
  1131. }
  1132. // SetNextToken sets the NextToken field's value.
  1133. func (s *DescribeAlarmHistoryOutput) SetNextToken(v string) *DescribeAlarmHistoryOutput {
  1134. s.NextToken = &v
  1135. return s
  1136. }
  1137. type DescribeAlarmsForMetricInput struct {
  1138. _ struct{} `type:"structure"`
  1139. // The dimensions associated with the metric. If the metric has any associated
  1140. // dimensions, you must specify them in order for the call to succeed.
  1141. Dimensions []*Dimension `type:"list"`
  1142. // The percentile statistic for the metric. Specify a value between p0.0 and
  1143. // p100.
  1144. ExtendedStatistic *string `type:"string"`
  1145. // The name of the metric.
  1146. //
  1147. // MetricName is a required field
  1148. MetricName *string `min:"1" type:"string" required:"true"`
  1149. // The namespace of the metric.
  1150. //
  1151. // Namespace is a required field
  1152. Namespace *string `min:"1" type:"string" required:"true"`
  1153. // The period, in seconds, over which the statistic is applied.
  1154. Period *int64 `min:"60" type:"integer"`
  1155. // The statistic for the metric, other than percentiles. For percentile statistics,
  1156. // use ExtendedStatistics.
  1157. Statistic *string `type:"string" enum:"Statistic"`
  1158. // The unit for the metric.
  1159. Unit *string `type:"string" enum:"StandardUnit"`
  1160. }
  1161. // String returns the string representation
  1162. func (s DescribeAlarmsForMetricInput) String() string {
  1163. return awsutil.Prettify(s)
  1164. }
  1165. // GoString returns the string representation
  1166. func (s DescribeAlarmsForMetricInput) GoString() string {
  1167. return s.String()
  1168. }
  1169. // Validate inspects the fields of the type to determine if they are valid.
  1170. func (s *DescribeAlarmsForMetricInput) Validate() error {
  1171. invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsForMetricInput"}
  1172. if s.MetricName == nil {
  1173. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  1174. }
  1175. if s.MetricName != nil && len(*s.MetricName) < 1 {
  1176. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  1177. }
  1178. if s.Namespace == nil {
  1179. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  1180. }
  1181. if s.Namespace != nil && len(*s.Namespace) < 1 {
  1182. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  1183. }
  1184. if s.Period != nil && *s.Period < 60 {
  1185. invalidParams.Add(request.NewErrParamMinValue("Period", 60))
  1186. }
  1187. if s.Dimensions != nil {
  1188. for i, v := range s.Dimensions {
  1189. if v == nil {
  1190. continue
  1191. }
  1192. if err := v.Validate(); err != nil {
  1193. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  1194. }
  1195. }
  1196. }
  1197. if invalidParams.Len() > 0 {
  1198. return invalidParams
  1199. }
  1200. return nil
  1201. }
  1202. // SetDimensions sets the Dimensions field's value.
  1203. func (s *DescribeAlarmsForMetricInput) SetDimensions(v []*Dimension) *DescribeAlarmsForMetricInput {
  1204. s.Dimensions = v
  1205. return s
  1206. }
  1207. // SetExtendedStatistic sets the ExtendedStatistic field's value.
  1208. func (s *DescribeAlarmsForMetricInput) SetExtendedStatistic(v string) *DescribeAlarmsForMetricInput {
  1209. s.ExtendedStatistic = &v
  1210. return s
  1211. }
  1212. // SetMetricName sets the MetricName field's value.
  1213. func (s *DescribeAlarmsForMetricInput) SetMetricName(v string) *DescribeAlarmsForMetricInput {
  1214. s.MetricName = &v
  1215. return s
  1216. }
  1217. // SetNamespace sets the Namespace field's value.
  1218. func (s *DescribeAlarmsForMetricInput) SetNamespace(v string) *DescribeAlarmsForMetricInput {
  1219. s.Namespace = &v
  1220. return s
  1221. }
  1222. // SetPeriod sets the Period field's value.
  1223. func (s *DescribeAlarmsForMetricInput) SetPeriod(v int64) *DescribeAlarmsForMetricInput {
  1224. s.Period = &v
  1225. return s
  1226. }
  1227. // SetStatistic sets the Statistic field's value.
  1228. func (s *DescribeAlarmsForMetricInput) SetStatistic(v string) *DescribeAlarmsForMetricInput {
  1229. s.Statistic = &v
  1230. return s
  1231. }
  1232. // SetUnit sets the Unit field's value.
  1233. func (s *DescribeAlarmsForMetricInput) SetUnit(v string) *DescribeAlarmsForMetricInput {
  1234. s.Unit = &v
  1235. return s
  1236. }
  1237. type DescribeAlarmsForMetricOutput struct {
  1238. _ struct{} `type:"structure"`
  1239. // The information for each alarm with the specified metric.
  1240. MetricAlarms []*MetricAlarm `type:"list"`
  1241. }
  1242. // String returns the string representation
  1243. func (s DescribeAlarmsForMetricOutput) String() string {
  1244. return awsutil.Prettify(s)
  1245. }
  1246. // GoString returns the string representation
  1247. func (s DescribeAlarmsForMetricOutput) GoString() string {
  1248. return s.String()
  1249. }
  1250. // SetMetricAlarms sets the MetricAlarms field's value.
  1251. func (s *DescribeAlarmsForMetricOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsForMetricOutput {
  1252. s.MetricAlarms = v
  1253. return s
  1254. }
  1255. type DescribeAlarmsInput struct {
  1256. _ struct{} `type:"structure"`
  1257. // The action name prefix.
  1258. ActionPrefix *string `min:"1" type:"string"`
  1259. // The alarm name prefix. You cannot specify AlarmNames if this parameter is
  1260. // specified.
  1261. AlarmNamePrefix *string `min:"1" type:"string"`
  1262. // The names of the alarms.
  1263. AlarmNames []*string `type:"list"`
  1264. // The maximum number of alarm descriptions to retrieve.
  1265. MaxRecords *int64 `min:"1" type:"integer"`
  1266. // The token returned by a previous call to indicate that there is more data
  1267. // available.
  1268. NextToken *string `type:"string"`
  1269. // The state value to be used in matching alarms.
  1270. StateValue *string `type:"string" enum:"StateValue"`
  1271. }
  1272. // String returns the string representation
  1273. func (s DescribeAlarmsInput) String() string {
  1274. return awsutil.Prettify(s)
  1275. }
  1276. // GoString returns the string representation
  1277. func (s DescribeAlarmsInput) GoString() string {
  1278. return s.String()
  1279. }
  1280. // Validate inspects the fields of the type to determine if they are valid.
  1281. func (s *DescribeAlarmsInput) Validate() error {
  1282. invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsInput"}
  1283. if s.ActionPrefix != nil && len(*s.ActionPrefix) < 1 {
  1284. invalidParams.Add(request.NewErrParamMinLen("ActionPrefix", 1))
  1285. }
  1286. if s.AlarmNamePrefix != nil && len(*s.AlarmNamePrefix) < 1 {
  1287. invalidParams.Add(request.NewErrParamMinLen("AlarmNamePrefix", 1))
  1288. }
  1289. if s.MaxRecords != nil && *s.MaxRecords < 1 {
  1290. invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1))
  1291. }
  1292. if invalidParams.Len() > 0 {
  1293. return invalidParams
  1294. }
  1295. return nil
  1296. }
  1297. // SetActionPrefix sets the ActionPrefix field's value.
  1298. func (s *DescribeAlarmsInput) SetActionPrefix(v string) *DescribeAlarmsInput {
  1299. s.ActionPrefix = &v
  1300. return s
  1301. }
  1302. // SetAlarmNamePrefix sets the AlarmNamePrefix field's value.
  1303. func (s *DescribeAlarmsInput) SetAlarmNamePrefix(v string) *DescribeAlarmsInput {
  1304. s.AlarmNamePrefix = &v
  1305. return s
  1306. }
  1307. // SetAlarmNames sets the AlarmNames field's value.
  1308. func (s *DescribeAlarmsInput) SetAlarmNames(v []*string) *DescribeAlarmsInput {
  1309. s.AlarmNames = v
  1310. return s
  1311. }
  1312. // SetMaxRecords sets the MaxRecords field's value.
  1313. func (s *DescribeAlarmsInput) SetMaxRecords(v int64) *DescribeAlarmsInput {
  1314. s.MaxRecords = &v
  1315. return s
  1316. }
  1317. // SetNextToken sets the NextToken field's value.
  1318. func (s *DescribeAlarmsInput) SetNextToken(v string) *DescribeAlarmsInput {
  1319. s.NextToken = &v
  1320. return s
  1321. }
  1322. // SetStateValue sets the StateValue field's value.
  1323. func (s *DescribeAlarmsInput) SetStateValue(v string) *DescribeAlarmsInput {
  1324. s.StateValue = &v
  1325. return s
  1326. }
  1327. type DescribeAlarmsOutput struct {
  1328. _ struct{} `type:"structure"`
  1329. // The information for the specified alarms.
  1330. MetricAlarms []*MetricAlarm `type:"list"`
  1331. // The token that marks the start of the next batch of returned results.
  1332. NextToken *string `type:"string"`
  1333. }
  1334. // String returns the string representation
  1335. func (s DescribeAlarmsOutput) String() string {
  1336. return awsutil.Prettify(s)
  1337. }
  1338. // GoString returns the string representation
  1339. func (s DescribeAlarmsOutput) GoString() string {
  1340. return s.String()
  1341. }
  1342. // SetMetricAlarms sets the MetricAlarms field's value.
  1343. func (s *DescribeAlarmsOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsOutput {
  1344. s.MetricAlarms = v
  1345. return s
  1346. }
  1347. // SetNextToken sets the NextToken field's value.
  1348. func (s *DescribeAlarmsOutput) SetNextToken(v string) *DescribeAlarmsOutput {
  1349. s.NextToken = &v
  1350. return s
  1351. }
  1352. // Expands the identity of a metric.
  1353. type Dimension struct {
  1354. _ struct{} `type:"structure"`
  1355. // The name of the dimension.
  1356. //
  1357. // Name is a required field
  1358. Name *string `min:"1" type:"string" required:"true"`
  1359. // The value representing the dimension measurement.
  1360. //
  1361. // Value is a required field
  1362. Value *string `min:"1" type:"string" required:"true"`
  1363. }
  1364. // String returns the string representation
  1365. func (s Dimension) String() string {
  1366. return awsutil.Prettify(s)
  1367. }
  1368. // GoString returns the string representation
  1369. func (s Dimension) GoString() string {
  1370. return s.String()
  1371. }
  1372. // Validate inspects the fields of the type to determine if they are valid.
  1373. func (s *Dimension) Validate() error {
  1374. invalidParams := request.ErrInvalidParams{Context: "Dimension"}
  1375. if s.Name == nil {
  1376. invalidParams.Add(request.NewErrParamRequired("Name"))
  1377. }
  1378. if s.Name != nil && len(*s.Name) < 1 {
  1379. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  1380. }
  1381. if s.Value == nil {
  1382. invalidParams.Add(request.NewErrParamRequired("Value"))
  1383. }
  1384. if s.Value != nil && len(*s.Value) < 1 {
  1385. invalidParams.Add(request.NewErrParamMinLen("Value", 1))
  1386. }
  1387. if invalidParams.Len() > 0 {
  1388. return invalidParams
  1389. }
  1390. return nil
  1391. }
  1392. // SetName sets the Name field's value.
  1393. func (s *Dimension) SetName(v string) *Dimension {
  1394. s.Name = &v
  1395. return s
  1396. }
  1397. // SetValue sets the Value field's value.
  1398. func (s *Dimension) SetValue(v string) *Dimension {
  1399. s.Value = &v
  1400. return s
  1401. }
  1402. // Represents filters for a dimension.
  1403. type DimensionFilter struct {
  1404. _ struct{} `type:"structure"`
  1405. // The dimension name to be matched.
  1406. //
  1407. // Name is a required field
  1408. Name *string `min:"1" type:"string" required:"true"`
  1409. // The value of the dimension to be matched.
  1410. Value *string `min:"1" type:"string"`
  1411. }
  1412. // String returns the string representation
  1413. func (s DimensionFilter) String() string {
  1414. return awsutil.Prettify(s)
  1415. }
  1416. // GoString returns the string representation
  1417. func (s DimensionFilter) GoString() string {
  1418. return s.String()
  1419. }
  1420. // Validate inspects the fields of the type to determine if they are valid.
  1421. func (s *DimensionFilter) Validate() error {
  1422. invalidParams := request.ErrInvalidParams{Context: "DimensionFilter"}
  1423. if s.Name == nil {
  1424. invalidParams.Add(request.NewErrParamRequired("Name"))
  1425. }
  1426. if s.Name != nil && len(*s.Name) < 1 {
  1427. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  1428. }
  1429. if s.Value != nil && len(*s.Value) < 1 {
  1430. invalidParams.Add(request.NewErrParamMinLen("Value", 1))
  1431. }
  1432. if invalidParams.Len() > 0 {
  1433. return invalidParams
  1434. }
  1435. return nil
  1436. }
  1437. // SetName sets the Name field's value.
  1438. func (s *DimensionFilter) SetName(v string) *DimensionFilter {
  1439. s.Name = &v
  1440. return s
  1441. }
  1442. // SetValue sets the Value field's value.
  1443. func (s *DimensionFilter) SetValue(v string) *DimensionFilter {
  1444. s.Value = &v
  1445. return s
  1446. }
  1447. type DisableAlarmActionsInput struct {
  1448. _ struct{} `type:"structure"`
  1449. // The names of the alarms.
  1450. //
  1451. // AlarmNames is a required field
  1452. AlarmNames []*string `type:"list" required:"true"`
  1453. }
  1454. // String returns the string representation
  1455. func (s DisableAlarmActionsInput) String() string {
  1456. return awsutil.Prettify(s)
  1457. }
  1458. // GoString returns the string representation
  1459. func (s DisableAlarmActionsInput) GoString() string {
  1460. return s.String()
  1461. }
  1462. // Validate inspects the fields of the type to determine if they are valid.
  1463. func (s *DisableAlarmActionsInput) Validate() error {
  1464. invalidParams := request.ErrInvalidParams{Context: "DisableAlarmActionsInput"}
  1465. if s.AlarmNames == nil {
  1466. invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
  1467. }
  1468. if invalidParams.Len() > 0 {
  1469. return invalidParams
  1470. }
  1471. return nil
  1472. }
  1473. // SetAlarmNames sets the AlarmNames field's value.
  1474. func (s *DisableAlarmActionsInput) SetAlarmNames(v []*string) *DisableAlarmActionsInput {
  1475. s.AlarmNames = v
  1476. return s
  1477. }
  1478. type DisableAlarmActionsOutput struct {
  1479. _ struct{} `type:"structure"`
  1480. }
  1481. // String returns the string representation
  1482. func (s DisableAlarmActionsOutput) String() string {
  1483. return awsutil.Prettify(s)
  1484. }
  1485. // GoString returns the string representation
  1486. func (s DisableAlarmActionsOutput) GoString() string {
  1487. return s.String()
  1488. }
  1489. type EnableAlarmActionsInput struct {
  1490. _ struct{} `type:"structure"`
  1491. // The names of the alarms.
  1492. //
  1493. // AlarmNames is a required field
  1494. AlarmNames []*string `type:"list" required:"true"`
  1495. }
  1496. // String returns the string representation
  1497. func (s EnableAlarmActionsInput) String() string {
  1498. return awsutil.Prettify(s)
  1499. }
  1500. // GoString returns the string representation
  1501. func (s EnableAlarmActionsInput) GoString() string {
  1502. return s.String()
  1503. }
  1504. // Validate inspects the fields of the type to determine if they are valid.
  1505. func (s *EnableAlarmActionsInput) Validate() error {
  1506. invalidParams := request.ErrInvalidParams{Context: "EnableAlarmActionsInput"}
  1507. if s.AlarmNames == nil {
  1508. invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
  1509. }
  1510. if invalidParams.Len() > 0 {
  1511. return invalidParams
  1512. }
  1513. return nil
  1514. }
  1515. // SetAlarmNames sets the AlarmNames field's value.
  1516. func (s *EnableAlarmActionsInput) SetAlarmNames(v []*string) *EnableAlarmActionsInput {
  1517. s.AlarmNames = v
  1518. return s
  1519. }
  1520. type EnableAlarmActionsOutput struct {
  1521. _ struct{} `type:"structure"`
  1522. }
  1523. // String returns the string representation
  1524. func (s EnableAlarmActionsOutput) String() string {
  1525. return awsutil.Prettify(s)
  1526. }
  1527. // GoString returns the string representation
  1528. func (s EnableAlarmActionsOutput) GoString() string {
  1529. return s.String()
  1530. }
  1531. type GetMetricStatisticsInput struct {
  1532. _ struct{} `type:"structure"`
  1533. // The dimensions. CloudWatch treats each unique combination of dimensions as
  1534. // a separate metric. You can't retrieve statistics using combinations of dimensions
  1535. // that were not specially published. You must specify the same dimensions that
  1536. // were used when the metrics were created. For an example, see Dimension Combinations
  1537. // (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations)
  1538. // in the Amazon CloudWatch User Guide.
  1539. Dimensions []*Dimension `type:"list"`
  1540. // The time stamp that determines the last data point to return.
  1541. //
  1542. // The value specified is exclusive; results will include data points up to
  1543. // the specified time stamp. The time stamp must be in ISO 8601 UTC format (for
  1544. // example, 2016-10-10T23:00:00Z).
  1545. //
  1546. // EndTime is a required field
  1547. EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
  1548. // The percentile statistics. Specify values between p0.0 and p100.
  1549. ExtendedStatistics []*string `min:"1" type:"list"`
  1550. // The name of the metric, with or without spaces.
  1551. //
  1552. // MetricName is a required field
  1553. MetricName *string `min:"1" type:"string" required:"true"`
  1554. // The namespace of the metric, with or without spaces.
  1555. //
  1556. // Namespace is a required field
  1557. Namespace *string `min:"1" type:"string" required:"true"`
  1558. // The granularity, in seconds, of the returned data points. A period can be
  1559. // as short as one minute (60 seconds) and must be a multiple of 60. The default
  1560. // value is 60.
  1561. //
  1562. // If the StartTime parameter specifies a time stamp that is greater than 15
  1563. // days ago, you must specify the period as follows or no data points in that
  1564. // time range is returned:
  1565. //
  1566. // * Start time between 15 and 63 days ago - Use a multiple of 300 seconds
  1567. // (5 minutes).
  1568. //
  1569. // * Start time greater than 63 days ago - Use a multiple of 3600 seconds
  1570. // (1 hour).
  1571. //
  1572. // Period is a required field
  1573. Period *int64 `min:"60" type:"integer" required:"true"`
  1574. // The time stamp that determines the first data point to return. Note that
  1575. // start times are evaluated relative to the time that CloudWatch receives the
  1576. // request.
  1577. //
  1578. // The value specified is inclusive; results include data points with the specified
  1579. // time stamp. The time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).
  1580. //
  1581. // CloudWatch rounds the specified time stamp as follows:
  1582. //
  1583. // * Start time less than 15 days ago - Round down to the nearest whole minute.
  1584. // For example, 12:32:34 is rounded down to 12:32:00.
  1585. //
  1586. // * Start time between 15 and 63 days ago - Round down to the nearest 5-minute
  1587. // clock interval. For example, 12:32:34 is rounded down to 12:30:00.
  1588. //
  1589. // * Start time greater than 63 days ago - Round down to the nearest 1-hour
  1590. // clock interval. For example, 12:32:34 is rounded down to 12:00:00.
  1591. //
  1592. // StartTime is a required field
  1593. StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
  1594. // The metric statistics, other than percentile. For percentile statistics,
  1595. // use ExtendedStatistic.
  1596. Statistics []*string `min:"1" type:"list"`
  1597. // The unit for a given metric. Metrics may be reported in multiple units. Not
  1598. // supplying a unit results in all units being returned. If the metric only
  1599. // ever reports one unit, specifying a unit has no effect.
  1600. Unit *string `type:"string" enum:"StandardUnit"`
  1601. }
  1602. // String returns the string representation
  1603. func (s GetMetricStatisticsInput) String() string {
  1604. return awsutil.Prettify(s)
  1605. }
  1606. // GoString returns the string representation
  1607. func (s GetMetricStatisticsInput) GoString() string {
  1608. return s.String()
  1609. }
  1610. // Validate inspects the fields of the type to determine if they are valid.
  1611. func (s *GetMetricStatisticsInput) Validate() error {
  1612. invalidParams := request.ErrInvalidParams{Context: "GetMetricStatisticsInput"}
  1613. if s.EndTime == nil {
  1614. invalidParams.Add(request.NewErrParamRequired("EndTime"))
  1615. }
  1616. if s.ExtendedStatistics != nil && len(s.ExtendedStatistics) < 1 {
  1617. invalidParams.Add(request.NewErrParamMinLen("ExtendedStatistics", 1))
  1618. }
  1619. if s.MetricName == nil {
  1620. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  1621. }
  1622. if s.MetricName != nil && len(*s.MetricName) < 1 {
  1623. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  1624. }
  1625. if s.Namespace == nil {
  1626. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  1627. }
  1628. if s.Namespace != nil && len(*s.Namespace) < 1 {
  1629. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  1630. }
  1631. if s.Period == nil {
  1632. invalidParams.Add(request.NewErrParamRequired("Period"))
  1633. }
  1634. if s.Period != nil && *s.Period < 60 {
  1635. invalidParams.Add(request.NewErrParamMinValue("Period", 60))
  1636. }
  1637. if s.StartTime == nil {
  1638. invalidParams.Add(request.NewErrParamRequired("StartTime"))
  1639. }
  1640. if s.Statistics != nil && len(s.Statistics) < 1 {
  1641. invalidParams.Add(request.NewErrParamMinLen("Statistics", 1))
  1642. }
  1643. if s.Dimensions != nil {
  1644. for i, v := range s.Dimensions {
  1645. if v == nil {
  1646. continue
  1647. }
  1648. if err := v.Validate(); err != nil {
  1649. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  1650. }
  1651. }
  1652. }
  1653. if invalidParams.Len() > 0 {
  1654. return invalidParams
  1655. }
  1656. return nil
  1657. }
  1658. // SetDimensions sets the Dimensions field's value.
  1659. func (s *GetMetricStatisticsInput) SetDimensions(v []*Dimension) *GetMetricStatisticsInput {
  1660. s.Dimensions = v
  1661. return s
  1662. }
  1663. // SetEndTime sets the EndTime field's value.
  1664. func (s *GetMetricStatisticsInput) SetEndTime(v time.Time) *GetMetricStatisticsInput {
  1665. s.EndTime = &v
  1666. return s
  1667. }
  1668. // SetExtendedStatistics sets the ExtendedStatistics field's value.
  1669. func (s *GetMetricStatisticsInput) SetExtendedStatistics(v []*string) *GetMetricStatisticsInput {
  1670. s.ExtendedStatistics = v
  1671. return s
  1672. }
  1673. // SetMetricName sets the MetricName field's value.
  1674. func (s *GetMetricStatisticsInput) SetMetricName(v string) *GetMetricStatisticsInput {
  1675. s.MetricName = &v
  1676. return s
  1677. }
  1678. // SetNamespace sets the Namespace field's value.
  1679. func (s *GetMetricStatisticsInput) SetNamespace(v string) *GetMetricStatisticsInput {
  1680. s.Namespace = &v
  1681. return s
  1682. }
  1683. // SetPeriod sets the Period field's value.
  1684. func (s *GetMetricStatisticsInput) SetPeriod(v int64) *GetMetricStatisticsInput {
  1685. s.Period = &v
  1686. return s
  1687. }
  1688. // SetStartTime sets the StartTime field's value.
  1689. func (s *GetMetricStatisticsInput) SetStartTime(v time.Time) *GetMetricStatisticsInput {
  1690. s.StartTime = &v
  1691. return s
  1692. }
  1693. // SetStatistics sets the Statistics field's value.
  1694. func (s *GetMetricStatisticsInput) SetStatistics(v []*string) *GetMetricStatisticsInput {
  1695. s.Statistics = v
  1696. return s
  1697. }
  1698. // SetUnit sets the Unit field's value.
  1699. func (s *GetMetricStatisticsInput) SetUnit(v string) *GetMetricStatisticsInput {
  1700. s.Unit = &v
  1701. return s
  1702. }
  1703. type GetMetricStatisticsOutput struct {
  1704. _ struct{} `type:"structure"`
  1705. // The data points for the specified metric.
  1706. Datapoints []*Datapoint `type:"list"`
  1707. // A label for the specified metric.
  1708. Label *string `type:"string"`
  1709. }
  1710. // String returns the string representation
  1711. func (s GetMetricStatisticsOutput) String() string {
  1712. return awsutil.Prettify(s)
  1713. }
  1714. // GoString returns the string representation
  1715. func (s GetMetricStatisticsOutput) GoString() string {
  1716. return s.String()
  1717. }
  1718. // SetDatapoints sets the Datapoints field's value.
  1719. func (s *GetMetricStatisticsOutput) SetDatapoints(v []*Datapoint) *GetMetricStatisticsOutput {
  1720. s.Datapoints = v
  1721. return s
  1722. }
  1723. // SetLabel sets the Label field's value.
  1724. func (s *GetMetricStatisticsOutput) SetLabel(v string) *GetMetricStatisticsOutput {
  1725. s.Label = &v
  1726. return s
  1727. }
  1728. type ListMetricsInput struct {
  1729. _ struct{} `type:"structure"`
  1730. // The dimensions to filter against.
  1731. Dimensions []*DimensionFilter `type:"list"`
  1732. // The name of the metric to filter against.
  1733. MetricName *string `min:"1" type:"string"`
  1734. // The namespace to filter against.
  1735. Namespace *string `min:"1" type:"string"`
  1736. // The token returned by a previous call to indicate that there is more data
  1737. // available.
  1738. NextToken *string `type:"string"`
  1739. }
  1740. // String returns the string representation
  1741. func (s ListMetricsInput) String() string {
  1742. return awsutil.Prettify(s)
  1743. }
  1744. // GoString returns the string representation
  1745. func (s ListMetricsInput) GoString() string {
  1746. return s.String()
  1747. }
  1748. // Validate inspects the fields of the type to determine if they are valid.
  1749. func (s *ListMetricsInput) Validate() error {
  1750. invalidParams := request.ErrInvalidParams{Context: "ListMetricsInput"}
  1751. if s.MetricName != nil && len(*s.MetricName) < 1 {
  1752. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  1753. }
  1754. if s.Namespace != nil && len(*s.Namespace) < 1 {
  1755. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  1756. }
  1757. if s.Dimensions != nil {
  1758. for i, v := range s.Dimensions {
  1759. if v == nil {
  1760. continue
  1761. }
  1762. if err := v.Validate(); err != nil {
  1763. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  1764. }
  1765. }
  1766. }
  1767. if invalidParams.Len() > 0 {
  1768. return invalidParams
  1769. }
  1770. return nil
  1771. }
  1772. // SetDimensions sets the Dimensions field's value.
  1773. func (s *ListMetricsInput) SetDimensions(v []*DimensionFilter) *ListMetricsInput {
  1774. s.Dimensions = v
  1775. return s
  1776. }
  1777. // SetMetricName sets the MetricName field's value.
  1778. func (s *ListMetricsInput) SetMetricName(v string) *ListMetricsInput {
  1779. s.MetricName = &v
  1780. return s
  1781. }
  1782. // SetNamespace sets the Namespace field's value.
  1783. func (s *ListMetricsInput) SetNamespace(v string) *ListMetricsInput {
  1784. s.Namespace = &v
  1785. return s
  1786. }
  1787. // SetNextToken sets the NextToken field's value.
  1788. func (s *ListMetricsInput) SetNextToken(v string) *ListMetricsInput {
  1789. s.NextToken = &v
  1790. return s
  1791. }
  1792. type ListMetricsOutput struct {
  1793. _ struct{} `type:"structure"`
  1794. // The metrics.
  1795. Metrics []*Metric `type:"list"`
  1796. // The token that marks the start of the next batch of returned results.
  1797. NextToken *string `type:"string"`
  1798. }
  1799. // String returns the string representation
  1800. func (s ListMetricsOutput) String() string {
  1801. return awsutil.Prettify(s)
  1802. }
  1803. // GoString returns the string representation
  1804. func (s ListMetricsOutput) GoString() string {
  1805. return s.String()
  1806. }
  1807. // SetMetrics sets the Metrics field's value.
  1808. func (s *ListMetricsOutput) SetMetrics(v []*Metric) *ListMetricsOutput {
  1809. s.Metrics = v
  1810. return s
  1811. }
  1812. // SetNextToken sets the NextToken field's value.
  1813. func (s *ListMetricsOutput) SetNextToken(v string) *ListMetricsOutput {
  1814. s.NextToken = &v
  1815. return s
  1816. }
  1817. // Represents a specific metric.
  1818. type Metric struct {
  1819. _ struct{} `type:"structure"`
  1820. // The dimensions for the metric.
  1821. Dimensions []*Dimension `type:"list"`
  1822. // The name of the metric.
  1823. MetricName *string `min:"1" type:"string"`
  1824. // The namespace of the metric.
  1825. Namespace *string `min:"1" type:"string"`
  1826. }
  1827. // String returns the string representation
  1828. func (s Metric) String() string {
  1829. return awsutil.Prettify(s)
  1830. }
  1831. // GoString returns the string representation
  1832. func (s Metric) GoString() string {
  1833. return s.String()
  1834. }
  1835. // SetDimensions sets the Dimensions field's value.
  1836. func (s *Metric) SetDimensions(v []*Dimension) *Metric {
  1837. s.Dimensions = v
  1838. return s
  1839. }
  1840. // SetMetricName sets the MetricName field's value.
  1841. func (s *Metric) SetMetricName(v string) *Metric {
  1842. s.MetricName = &v
  1843. return s
  1844. }
  1845. // SetNamespace sets the Namespace field's value.
  1846. func (s *Metric) SetNamespace(v string) *Metric {
  1847. s.Namespace = &v
  1848. return s
  1849. }
  1850. // Represents an alarm.
  1851. type MetricAlarm struct {
  1852. _ struct{} `type:"structure"`
  1853. // Indicates whether actions should be executed during any changes to the alarm
  1854. // state.
  1855. ActionsEnabled *bool `type:"boolean"`
  1856. // The actions to execute when this alarm transitions to the ALARM state from
  1857. // any other state. Each action is specified as an Amazon Resource Name (ARN).
  1858. AlarmActions []*string `type:"list"`
  1859. // The Amazon Resource Name (ARN) of the alarm.
  1860. AlarmArn *string `min:"1" type:"string"`
  1861. // The time stamp of the last update to the alarm configuration.
  1862. AlarmConfigurationUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1863. // The description of the alarm.
  1864. AlarmDescription *string `type:"string"`
  1865. // The name of the alarm.
  1866. AlarmName *string `min:"1" type:"string"`
  1867. // The arithmetic operation to use when comparing the specified statistic and
  1868. // threshold. The specified statistic value is used as the first operand.
  1869. ComparisonOperator *string `type:"string" enum:"ComparisonOperator"`
  1870. // The dimensions for the metric associated with the alarm.
  1871. Dimensions []*Dimension `type:"list"`
  1872. // The number of periods over which data is compared to the specified threshold.
  1873. EvaluationPeriods *int64 `min:"1" type:"integer"`
  1874. // The percentile statistic for the metric associated with the alarm. Specify
  1875. // a value between p0.0 and p100.
  1876. ExtendedStatistic *string `type:"string"`
  1877. // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
  1878. // state from any other state. Each action is specified as an Amazon Resource
  1879. // Name (ARN).
  1880. InsufficientDataActions []*string `type:"list"`
  1881. // The name of the metric associated with the alarm.
  1882. MetricName *string `min:"1" type:"string"`
  1883. // The namespace of the metric associated with the alarm.
  1884. Namespace *string `min:"1" type:"string"`
  1885. // The actions to execute when this alarm transitions to the OK state from any
  1886. // other state. Each action is specified as an Amazon Resource Name (ARN).
  1887. OKActions []*string `type:"list"`
  1888. // The period, in seconds, over which the statistic is applied.
  1889. Period *int64 `min:"60" type:"integer"`
  1890. // An explanation for the alarm state, in text format.
  1891. StateReason *string `type:"string"`
  1892. // An explanation for the alarm state, in JSON format.
  1893. StateReasonData *string `type:"string"`
  1894. // The time stamp of the last update to the alarm state.
  1895. StateUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  1896. // The state value for the alarm.
  1897. StateValue *string `type:"string" enum:"StateValue"`
  1898. // The statistic for the metric associated with the alarm, other than percentile.
  1899. // For percentile statistics, use ExtendedStatistic.
  1900. Statistic *string `type:"string" enum:"Statistic"`
  1901. // The value to compare with the specified statistic.
  1902. Threshold *float64 `type:"double"`
  1903. // The unit of the metric associated with the alarm.
  1904. Unit *string `type:"string" enum:"StandardUnit"`
  1905. }
  1906. // String returns the string representation
  1907. func (s MetricAlarm) String() string {
  1908. return awsutil.Prettify(s)
  1909. }
  1910. // GoString returns the string representation
  1911. func (s MetricAlarm) GoString() string {
  1912. return s.String()
  1913. }
  1914. // SetActionsEnabled sets the ActionsEnabled field's value.
  1915. func (s *MetricAlarm) SetActionsEnabled(v bool) *MetricAlarm {
  1916. s.ActionsEnabled = &v
  1917. return s
  1918. }
  1919. // SetAlarmActions sets the AlarmActions field's value.
  1920. func (s *MetricAlarm) SetAlarmActions(v []*string) *MetricAlarm {
  1921. s.AlarmActions = v
  1922. return s
  1923. }
  1924. // SetAlarmArn sets the AlarmArn field's value.
  1925. func (s *MetricAlarm) SetAlarmArn(v string) *MetricAlarm {
  1926. s.AlarmArn = &v
  1927. return s
  1928. }
  1929. // SetAlarmConfigurationUpdatedTimestamp sets the AlarmConfigurationUpdatedTimestamp field's value.
  1930. func (s *MetricAlarm) SetAlarmConfigurationUpdatedTimestamp(v time.Time) *MetricAlarm {
  1931. s.AlarmConfigurationUpdatedTimestamp = &v
  1932. return s
  1933. }
  1934. // SetAlarmDescription sets the AlarmDescription field's value.
  1935. func (s *MetricAlarm) SetAlarmDescription(v string) *MetricAlarm {
  1936. s.AlarmDescription = &v
  1937. return s
  1938. }
  1939. // SetAlarmName sets the AlarmName field's value.
  1940. func (s *MetricAlarm) SetAlarmName(v string) *MetricAlarm {
  1941. s.AlarmName = &v
  1942. return s
  1943. }
  1944. // SetComparisonOperator sets the ComparisonOperator field's value.
  1945. func (s *MetricAlarm) SetComparisonOperator(v string) *MetricAlarm {
  1946. s.ComparisonOperator = &v
  1947. return s
  1948. }
  1949. // SetDimensions sets the Dimensions field's value.
  1950. func (s *MetricAlarm) SetDimensions(v []*Dimension) *MetricAlarm {
  1951. s.Dimensions = v
  1952. return s
  1953. }
  1954. // SetEvaluationPeriods sets the EvaluationPeriods field's value.
  1955. func (s *MetricAlarm) SetEvaluationPeriods(v int64) *MetricAlarm {
  1956. s.EvaluationPeriods = &v
  1957. return s
  1958. }
  1959. // SetExtendedStatistic sets the ExtendedStatistic field's value.
  1960. func (s *MetricAlarm) SetExtendedStatistic(v string) *MetricAlarm {
  1961. s.ExtendedStatistic = &v
  1962. return s
  1963. }
  1964. // SetInsufficientDataActions sets the InsufficientDataActions field's value.
  1965. func (s *MetricAlarm) SetInsufficientDataActions(v []*string) *MetricAlarm {
  1966. s.InsufficientDataActions = v
  1967. return s
  1968. }
  1969. // SetMetricName sets the MetricName field's value.
  1970. func (s *MetricAlarm) SetMetricName(v string) *MetricAlarm {
  1971. s.MetricName = &v
  1972. return s
  1973. }
  1974. // SetNamespace sets the Namespace field's value.
  1975. func (s *MetricAlarm) SetNamespace(v string) *MetricAlarm {
  1976. s.Namespace = &v
  1977. return s
  1978. }
  1979. // SetOKActions sets the OKActions field's value.
  1980. func (s *MetricAlarm) SetOKActions(v []*string) *MetricAlarm {
  1981. s.OKActions = v
  1982. return s
  1983. }
  1984. // SetPeriod sets the Period field's value.
  1985. func (s *MetricAlarm) SetPeriod(v int64) *MetricAlarm {
  1986. s.Period = &v
  1987. return s
  1988. }
  1989. // SetStateReason sets the StateReason field's value.
  1990. func (s *MetricAlarm) SetStateReason(v string) *MetricAlarm {
  1991. s.StateReason = &v
  1992. return s
  1993. }
  1994. // SetStateReasonData sets the StateReasonData field's value.
  1995. func (s *MetricAlarm) SetStateReasonData(v string) *MetricAlarm {
  1996. s.StateReasonData = &v
  1997. return s
  1998. }
  1999. // SetStateUpdatedTimestamp sets the StateUpdatedTimestamp field's value.
  2000. func (s *MetricAlarm) SetStateUpdatedTimestamp(v time.Time) *MetricAlarm {
  2001. s.StateUpdatedTimestamp = &v
  2002. return s
  2003. }
  2004. // SetStateValue sets the StateValue field's value.
  2005. func (s *MetricAlarm) SetStateValue(v string) *MetricAlarm {
  2006. s.StateValue = &v
  2007. return s
  2008. }
  2009. // SetStatistic sets the Statistic field's value.
  2010. func (s *MetricAlarm) SetStatistic(v string) *MetricAlarm {
  2011. s.Statistic = &v
  2012. return s
  2013. }
  2014. // SetThreshold sets the Threshold field's value.
  2015. func (s *MetricAlarm) SetThreshold(v float64) *MetricAlarm {
  2016. s.Threshold = &v
  2017. return s
  2018. }
  2019. // SetUnit sets the Unit field's value.
  2020. func (s *MetricAlarm) SetUnit(v string) *MetricAlarm {
  2021. s.Unit = &v
  2022. return s
  2023. }
  2024. // Encapsulates the information sent to either create a metric or add new values
  2025. // to be aggregated into an existing metric.
  2026. type MetricDatum struct {
  2027. _ struct{} `type:"structure"`
  2028. // The dimensions associated with the metric.
  2029. Dimensions []*Dimension `type:"list"`
  2030. // The name of the metric.
  2031. //
  2032. // MetricName is a required field
  2033. MetricName *string `min:"1" type:"string" required:"true"`
  2034. // The statistical values for the metric.
  2035. StatisticValues *StatisticSet `type:"structure"`
  2036. // The time the metric data was received, expressed as the number of milliseconds
  2037. // since Jan 1, 1970 00:00:00 UTC.
  2038. Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"`
  2039. // The unit of the metric.
  2040. Unit *string `type:"string" enum:"StandardUnit"`
  2041. // The value for the metric.
  2042. //
  2043. // Although the parameter accepts numbers of type Double, Amazon CloudWatch
  2044. // rejects values that are either too small or too large. Values must be in
  2045. // the range of 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360
  2046. // (Base 2). In addition, special values (for example, NaN, +Infinity, -Infinity)
  2047. // are not supported.
  2048. Value *float64 `type:"double"`
  2049. }
  2050. // String returns the string representation
  2051. func (s MetricDatum) String() string {
  2052. return awsutil.Prettify(s)
  2053. }
  2054. // GoString returns the string representation
  2055. func (s MetricDatum) GoString() string {
  2056. return s.String()
  2057. }
  2058. // Validate inspects the fields of the type to determine if they are valid.
  2059. func (s *MetricDatum) Validate() error {
  2060. invalidParams := request.ErrInvalidParams{Context: "MetricDatum"}
  2061. if s.MetricName == nil {
  2062. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  2063. }
  2064. if s.MetricName != nil && len(*s.MetricName) < 1 {
  2065. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  2066. }
  2067. if s.Dimensions != nil {
  2068. for i, v := range s.Dimensions {
  2069. if v == nil {
  2070. continue
  2071. }
  2072. if err := v.Validate(); err != nil {
  2073. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  2074. }
  2075. }
  2076. }
  2077. if s.StatisticValues != nil {
  2078. if err := s.StatisticValues.Validate(); err != nil {
  2079. invalidParams.AddNested("StatisticValues", err.(request.ErrInvalidParams))
  2080. }
  2081. }
  2082. if invalidParams.Len() > 0 {
  2083. return invalidParams
  2084. }
  2085. return nil
  2086. }
  2087. // SetDimensions sets the Dimensions field's value.
  2088. func (s *MetricDatum) SetDimensions(v []*Dimension) *MetricDatum {
  2089. s.Dimensions = v
  2090. return s
  2091. }
  2092. // SetMetricName sets the MetricName field's value.
  2093. func (s *MetricDatum) SetMetricName(v string) *MetricDatum {
  2094. s.MetricName = &v
  2095. return s
  2096. }
  2097. // SetStatisticValues sets the StatisticValues field's value.
  2098. func (s *MetricDatum) SetStatisticValues(v *StatisticSet) *MetricDatum {
  2099. s.StatisticValues = v
  2100. return s
  2101. }
  2102. // SetTimestamp sets the Timestamp field's value.
  2103. func (s *MetricDatum) SetTimestamp(v time.Time) *MetricDatum {
  2104. s.Timestamp = &v
  2105. return s
  2106. }
  2107. // SetUnit sets the Unit field's value.
  2108. func (s *MetricDatum) SetUnit(v string) *MetricDatum {
  2109. s.Unit = &v
  2110. return s
  2111. }
  2112. // SetValue sets the Value field's value.
  2113. func (s *MetricDatum) SetValue(v float64) *MetricDatum {
  2114. s.Value = &v
  2115. return s
  2116. }
  2117. type PutMetricAlarmInput struct {
  2118. _ struct{} `type:"structure"`
  2119. // Indicates whether actions should be executed during any changes to the alarm
  2120. // state.
  2121. ActionsEnabled *bool `type:"boolean"`
  2122. // The actions to execute when this alarm transitions to the ALARM state from
  2123. // any other state. Each action is specified as an Amazon Resource Name (ARN).
  2124. //
  2125. // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate
  2126. // | arn:aws:automate:region:ec2:recover
  2127. //
  2128. // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0
  2129. // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0
  2130. // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0
  2131. AlarmActions []*string `type:"list"`
  2132. // The description for the alarm.
  2133. AlarmDescription *string `type:"string"`
  2134. // The name for the alarm. This name must be unique within the AWS account.
  2135. //
  2136. // AlarmName is a required field
  2137. AlarmName *string `min:"1" type:"string" required:"true"`
  2138. // The arithmetic operation to use when comparing the specified statistic and
  2139. // threshold. The specified statistic value is used as the first operand.
  2140. //
  2141. // ComparisonOperator is a required field
  2142. ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"`
  2143. // The dimensions for the metric associated with the alarm.
  2144. Dimensions []*Dimension `type:"list"`
  2145. // The number of periods over which data is compared to the specified threshold.
  2146. //
  2147. // EvaluationPeriods is a required field
  2148. EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"`
  2149. // The percentile statistic for the metric associated with the alarm. Specify
  2150. // a value between p0.0 and p100.
  2151. ExtendedStatistic *string `type:"string"`
  2152. // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
  2153. // state from any other state. Each action is specified as an Amazon Resource
  2154. // Name (ARN).
  2155. //
  2156. // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate
  2157. // | arn:aws:automate:region:ec2:recover
  2158. //
  2159. // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0
  2160. // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0
  2161. // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0
  2162. InsufficientDataActions []*string `type:"list"`
  2163. // The name for the metric associated with the alarm.
  2164. //
  2165. // MetricName is a required field
  2166. MetricName *string `min:"1" type:"string" required:"true"`
  2167. // The namespace for the metric associated with the alarm.
  2168. //
  2169. // Namespace is a required field
  2170. Namespace *string `min:"1" type:"string" required:"true"`
  2171. // The actions to execute when this alarm transitions to an OK state from any
  2172. // other state. Each action is specified as an Amazon Resource Name (ARN).
  2173. //
  2174. // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate
  2175. // | arn:aws:automate:region:ec2:recover
  2176. //
  2177. // Valid Values (for use with IAM roles): arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Stop/1.0
  2178. // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Terminate/1.0
  2179. // | arn:aws:swf:us-east-1:{customer-account}:action/actions/AWS_EC2.InstanceId.Reboot/1.0
  2180. OKActions []*string `type:"list"`
  2181. // The period, in seconds, over which the specified statistic is applied.
  2182. //
  2183. // Period is a required field
  2184. Period *int64 `min:"60" type:"integer" required:"true"`
  2185. // The statistic for the metric associated with the alarm, other than percentile.
  2186. // For percentile statistics, use ExtendedStatistic.
  2187. Statistic *string `type:"string" enum:"Statistic"`
  2188. // The value against which the specified statistic is compared.
  2189. //
  2190. // Threshold is a required field
  2191. Threshold *float64 `type:"double" required:"true"`
  2192. // The unit of measure for the statistic. For example, the units for the Amazon
  2193. // EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes
  2194. // that an instance receives on all network interfaces. You can also specify
  2195. // a unit when you create a custom metric. Units help provide conceptual meaning
  2196. // to your data. Metric data points that specify a unit of measure, such as
  2197. // Percent, are aggregated separately.
  2198. //
  2199. // If you specify a unit, you must use a unit that is appropriate for the metric.
  2200. // Otherwise, the Amazon CloudWatch alarm can get stuck in the INSUFFICIENT
  2201. // DATA state.
  2202. Unit *string `type:"string" enum:"StandardUnit"`
  2203. }
  2204. // String returns the string representation
  2205. func (s PutMetricAlarmInput) String() string {
  2206. return awsutil.Prettify(s)
  2207. }
  2208. // GoString returns the string representation
  2209. func (s PutMetricAlarmInput) GoString() string {
  2210. return s.String()
  2211. }
  2212. // Validate inspects the fields of the type to determine if they are valid.
  2213. func (s *PutMetricAlarmInput) Validate() error {
  2214. invalidParams := request.ErrInvalidParams{Context: "PutMetricAlarmInput"}
  2215. if s.AlarmName == nil {
  2216. invalidParams.Add(request.NewErrParamRequired("AlarmName"))
  2217. }
  2218. if s.AlarmName != nil && len(*s.AlarmName) < 1 {
  2219. invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
  2220. }
  2221. if s.ComparisonOperator == nil {
  2222. invalidParams.Add(request.NewErrParamRequired("ComparisonOperator"))
  2223. }
  2224. if s.EvaluationPeriods == nil {
  2225. invalidParams.Add(request.NewErrParamRequired("EvaluationPeriods"))
  2226. }
  2227. if s.EvaluationPeriods != nil && *s.EvaluationPeriods < 1 {
  2228. invalidParams.Add(request.NewErrParamMinValue("EvaluationPeriods", 1))
  2229. }
  2230. if s.MetricName == nil {
  2231. invalidParams.Add(request.NewErrParamRequired("MetricName"))
  2232. }
  2233. if s.MetricName != nil && len(*s.MetricName) < 1 {
  2234. invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
  2235. }
  2236. if s.Namespace == nil {
  2237. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  2238. }
  2239. if s.Namespace != nil && len(*s.Namespace) < 1 {
  2240. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  2241. }
  2242. if s.Period == nil {
  2243. invalidParams.Add(request.NewErrParamRequired("Period"))
  2244. }
  2245. if s.Period != nil && *s.Period < 60 {
  2246. invalidParams.Add(request.NewErrParamMinValue("Period", 60))
  2247. }
  2248. if s.Threshold == nil {
  2249. invalidParams.Add(request.NewErrParamRequired("Threshold"))
  2250. }
  2251. if s.Dimensions != nil {
  2252. for i, v := range s.Dimensions {
  2253. if v == nil {
  2254. continue
  2255. }
  2256. if err := v.Validate(); err != nil {
  2257. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
  2258. }
  2259. }
  2260. }
  2261. if invalidParams.Len() > 0 {
  2262. return invalidParams
  2263. }
  2264. return nil
  2265. }
  2266. // SetActionsEnabled sets the ActionsEnabled field's value.
  2267. func (s *PutMetricAlarmInput) SetActionsEnabled(v bool) *PutMetricAlarmInput {
  2268. s.ActionsEnabled = &v
  2269. return s
  2270. }
  2271. // SetAlarmActions sets the AlarmActions field's value.
  2272. func (s *PutMetricAlarmInput) SetAlarmActions(v []*string) *PutMetricAlarmInput {
  2273. s.AlarmActions = v
  2274. return s
  2275. }
  2276. // SetAlarmDescription sets the AlarmDescription field's value.
  2277. func (s *PutMetricAlarmInput) SetAlarmDescription(v string) *PutMetricAlarmInput {
  2278. s.AlarmDescription = &v
  2279. return s
  2280. }
  2281. // SetAlarmName sets the AlarmName field's value.
  2282. func (s *PutMetricAlarmInput) SetAlarmName(v string) *PutMetricAlarmInput {
  2283. s.AlarmName = &v
  2284. return s
  2285. }
  2286. // SetComparisonOperator sets the ComparisonOperator field's value.
  2287. func (s *PutMetricAlarmInput) SetComparisonOperator(v string) *PutMetricAlarmInput {
  2288. s.ComparisonOperator = &v
  2289. return s
  2290. }
  2291. // SetDimensions sets the Dimensions field's value.
  2292. func (s *PutMetricAlarmInput) SetDimensions(v []*Dimension) *PutMetricAlarmInput {
  2293. s.Dimensions = v
  2294. return s
  2295. }
  2296. // SetEvaluationPeriods sets the EvaluationPeriods field's value.
  2297. func (s *PutMetricAlarmInput) SetEvaluationPeriods(v int64) *PutMetricAlarmInput {
  2298. s.EvaluationPeriods = &v
  2299. return s
  2300. }
  2301. // SetExtendedStatistic sets the ExtendedStatistic field's value.
  2302. func (s *PutMetricAlarmInput) SetExtendedStatistic(v string) *PutMetricAlarmInput {
  2303. s.ExtendedStatistic = &v
  2304. return s
  2305. }
  2306. // SetInsufficientDataActions sets the InsufficientDataActions field's value.
  2307. func (s *PutMetricAlarmInput) SetInsufficientDataActions(v []*string) *PutMetricAlarmInput {
  2308. s.InsufficientDataActions = v
  2309. return s
  2310. }
  2311. // SetMetricName sets the MetricName field's value.
  2312. func (s *PutMetricAlarmInput) SetMetricName(v string) *PutMetricAlarmInput {
  2313. s.MetricName = &v
  2314. return s
  2315. }
  2316. // SetNamespace sets the Namespace field's value.
  2317. func (s *PutMetricAlarmInput) SetNamespace(v string) *PutMetricAlarmInput {
  2318. s.Namespace = &v
  2319. return s
  2320. }
  2321. // SetOKActions sets the OKActions field's value.
  2322. func (s *PutMetricAlarmInput) SetOKActions(v []*string) *PutMetricAlarmInput {
  2323. s.OKActions = v
  2324. return s
  2325. }
  2326. // SetPeriod sets the Period field's value.
  2327. func (s *PutMetricAlarmInput) SetPeriod(v int64) *PutMetricAlarmInput {
  2328. s.Period = &v
  2329. return s
  2330. }
  2331. // SetStatistic sets the Statistic field's value.
  2332. func (s *PutMetricAlarmInput) SetStatistic(v string) *PutMetricAlarmInput {
  2333. s.Statistic = &v
  2334. return s
  2335. }
  2336. // SetThreshold sets the Threshold field's value.
  2337. func (s *PutMetricAlarmInput) SetThreshold(v float64) *PutMetricAlarmInput {
  2338. s.Threshold = &v
  2339. return s
  2340. }
  2341. // SetUnit sets the Unit field's value.
  2342. func (s *PutMetricAlarmInput) SetUnit(v string) *PutMetricAlarmInput {
  2343. s.Unit = &v
  2344. return s
  2345. }
  2346. type PutMetricAlarmOutput struct {
  2347. _ struct{} `type:"structure"`
  2348. }
  2349. // String returns the string representation
  2350. func (s PutMetricAlarmOutput) String() string {
  2351. return awsutil.Prettify(s)
  2352. }
  2353. // GoString returns the string representation
  2354. func (s PutMetricAlarmOutput) GoString() string {
  2355. return s.String()
  2356. }
  2357. type PutMetricDataInput struct {
  2358. _ struct{} `type:"structure"`
  2359. // The data for the metric.
  2360. //
  2361. // MetricData is a required field
  2362. MetricData []*MetricDatum `type:"list" required:"true"`
  2363. // The namespace for the metric data.
  2364. //
  2365. // You cannot specify a namespace that begins with "AWS/". Namespaces that begin
  2366. // with "AWS/" are reserved for use by Amazon Web Services products.
  2367. //
  2368. // Namespace is a required field
  2369. Namespace *string `min:"1" type:"string" required:"true"`
  2370. }
  2371. // String returns the string representation
  2372. func (s PutMetricDataInput) String() string {
  2373. return awsutil.Prettify(s)
  2374. }
  2375. // GoString returns the string representation
  2376. func (s PutMetricDataInput) GoString() string {
  2377. return s.String()
  2378. }
  2379. // Validate inspects the fields of the type to determine if they are valid.
  2380. func (s *PutMetricDataInput) Validate() error {
  2381. invalidParams := request.ErrInvalidParams{Context: "PutMetricDataInput"}
  2382. if s.MetricData == nil {
  2383. invalidParams.Add(request.NewErrParamRequired("MetricData"))
  2384. }
  2385. if s.Namespace == nil {
  2386. invalidParams.Add(request.NewErrParamRequired("Namespace"))
  2387. }
  2388. if s.Namespace != nil && len(*s.Namespace) < 1 {
  2389. invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
  2390. }
  2391. if s.MetricData != nil {
  2392. for i, v := range s.MetricData {
  2393. if v == nil {
  2394. continue
  2395. }
  2396. if err := v.Validate(); err != nil {
  2397. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricData", i), err.(request.ErrInvalidParams))
  2398. }
  2399. }
  2400. }
  2401. if invalidParams.Len() > 0 {
  2402. return invalidParams
  2403. }
  2404. return nil
  2405. }
  2406. // SetMetricData sets the MetricData field's value.
  2407. func (s *PutMetricDataInput) SetMetricData(v []*MetricDatum) *PutMetricDataInput {
  2408. s.MetricData = v
  2409. return s
  2410. }
  2411. // SetNamespace sets the Namespace field's value.
  2412. func (s *PutMetricDataInput) SetNamespace(v string) *PutMetricDataInput {
  2413. s.Namespace = &v
  2414. return s
  2415. }
  2416. type PutMetricDataOutput struct {
  2417. _ struct{} `type:"structure"`
  2418. }
  2419. // String returns the string representation
  2420. func (s PutMetricDataOutput) String() string {
  2421. return awsutil.Prettify(s)
  2422. }
  2423. // GoString returns the string representation
  2424. func (s PutMetricDataOutput) GoString() string {
  2425. return s.String()
  2426. }
  2427. type SetAlarmStateInput struct {
  2428. _ struct{} `type:"structure"`
  2429. // The name for the alarm. This name must be unique within the AWS account.
  2430. // The maximum length is 255 characters.
  2431. //
  2432. // AlarmName is a required field
  2433. AlarmName *string `min:"1" type:"string" required:"true"`
  2434. // The reason that this alarm is set to this specific state, in text format.
  2435. //
  2436. // StateReason is a required field
  2437. StateReason *string `type:"string" required:"true"`
  2438. // The reason that this alarm is set to this specific state, in JSON format.
  2439. StateReasonData *string `type:"string"`
  2440. // The value of the state.
  2441. //
  2442. // StateValue is a required field
  2443. StateValue *string `type:"string" required:"true" enum:"StateValue"`
  2444. }
  2445. // String returns the string representation
  2446. func (s SetAlarmStateInput) String() string {
  2447. return awsutil.Prettify(s)
  2448. }
  2449. // GoString returns the string representation
  2450. func (s SetAlarmStateInput) GoString() string {
  2451. return s.String()
  2452. }
  2453. // Validate inspects the fields of the type to determine if they are valid.
  2454. func (s *SetAlarmStateInput) Validate() error {
  2455. invalidParams := request.ErrInvalidParams{Context: "SetAlarmStateInput"}
  2456. if s.AlarmName == nil {
  2457. invalidParams.Add(request.NewErrParamRequired("AlarmName"))
  2458. }
  2459. if s.AlarmName != nil && len(*s.AlarmName) < 1 {
  2460. invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
  2461. }
  2462. if s.StateReason == nil {
  2463. invalidParams.Add(request.NewErrParamRequired("StateReason"))
  2464. }
  2465. if s.StateValue == nil {
  2466. invalidParams.Add(request.NewErrParamRequired("StateValue"))
  2467. }
  2468. if invalidParams.Len() > 0 {
  2469. return invalidParams
  2470. }
  2471. return nil
  2472. }
  2473. // SetAlarmName sets the AlarmName field's value.
  2474. func (s *SetAlarmStateInput) SetAlarmName(v string) *SetAlarmStateInput {
  2475. s.AlarmName = &v
  2476. return s
  2477. }
  2478. // SetStateReason sets the StateReason field's value.
  2479. func (s *SetAlarmStateInput) SetStateReason(v string) *SetAlarmStateInput {
  2480. s.StateReason = &v
  2481. return s
  2482. }
  2483. // SetStateReasonData sets the StateReasonData field's value.
  2484. func (s *SetAlarmStateInput) SetStateReasonData(v string) *SetAlarmStateInput {
  2485. s.StateReasonData = &v
  2486. return s
  2487. }
  2488. // SetStateValue sets the StateValue field's value.
  2489. func (s *SetAlarmStateInput) SetStateValue(v string) *SetAlarmStateInput {
  2490. s.StateValue = &v
  2491. return s
  2492. }
  2493. type SetAlarmStateOutput struct {
  2494. _ struct{} `type:"structure"`
  2495. }
  2496. // String returns the string representation
  2497. func (s SetAlarmStateOutput) String() string {
  2498. return awsutil.Prettify(s)
  2499. }
  2500. // GoString returns the string representation
  2501. func (s SetAlarmStateOutput) GoString() string {
  2502. return s.String()
  2503. }
  2504. // Represents a set of statistics that describes a specific metric.
  2505. type StatisticSet struct {
  2506. _ struct{} `type:"structure"`
  2507. // The maximum value of the sample set.
  2508. //
  2509. // Maximum is a required field
  2510. Maximum *float64 `type:"double" required:"true"`
  2511. // The minimum value of the sample set.
  2512. //
  2513. // Minimum is a required field
  2514. Minimum *float64 `type:"double" required:"true"`
  2515. // The number of samples used for the statistic set.
  2516. //
  2517. // SampleCount is a required field
  2518. SampleCount *float64 `type:"double" required:"true"`
  2519. // The sum of values for the sample set.
  2520. //
  2521. // Sum is a required field
  2522. Sum *float64 `type:"double" required:"true"`
  2523. }
  2524. // String returns the string representation
  2525. func (s StatisticSet) String() string {
  2526. return awsutil.Prettify(s)
  2527. }
  2528. // GoString returns the string representation
  2529. func (s StatisticSet) GoString() string {
  2530. return s.String()
  2531. }
  2532. // Validate inspects the fields of the type to determine if they are valid.
  2533. func (s *StatisticSet) Validate() error {
  2534. invalidParams := request.ErrInvalidParams{Context: "StatisticSet"}
  2535. if s.Maximum == nil {
  2536. invalidParams.Add(request.NewErrParamRequired("Maximum"))
  2537. }
  2538. if s.Minimum == nil {
  2539. invalidParams.Add(request.NewErrParamRequired("Minimum"))
  2540. }
  2541. if s.SampleCount == nil {
  2542. invalidParams.Add(request.NewErrParamRequired("SampleCount"))
  2543. }
  2544. if s.Sum == nil {
  2545. invalidParams.Add(request.NewErrParamRequired("Sum"))
  2546. }
  2547. if invalidParams.Len() > 0 {
  2548. return invalidParams
  2549. }
  2550. return nil
  2551. }
  2552. // SetMaximum sets the Maximum field's value.
  2553. func (s *StatisticSet) SetMaximum(v float64) *StatisticSet {
  2554. s.Maximum = &v
  2555. return s
  2556. }
  2557. // SetMinimum sets the Minimum field's value.
  2558. func (s *StatisticSet) SetMinimum(v float64) *StatisticSet {
  2559. s.Minimum = &v
  2560. return s
  2561. }
  2562. // SetSampleCount sets the SampleCount field's value.
  2563. func (s *StatisticSet) SetSampleCount(v float64) *StatisticSet {
  2564. s.SampleCount = &v
  2565. return s
  2566. }
  2567. // SetSum sets the Sum field's value.
  2568. func (s *StatisticSet) SetSum(v float64) *StatisticSet {
  2569. s.Sum = &v
  2570. return s
  2571. }
  2572. const (
  2573. // ComparisonOperatorGreaterThanOrEqualToThreshold is a ComparisonOperator enum value
  2574. ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold"
  2575. // ComparisonOperatorGreaterThanThreshold is a ComparisonOperator enum value
  2576. ComparisonOperatorGreaterThanThreshold = "GreaterThanThreshold"
  2577. // ComparisonOperatorLessThanThreshold is a ComparisonOperator enum value
  2578. ComparisonOperatorLessThanThreshold = "LessThanThreshold"
  2579. // ComparisonOperatorLessThanOrEqualToThreshold is a ComparisonOperator enum value
  2580. ComparisonOperatorLessThanOrEqualToThreshold = "LessThanOrEqualToThreshold"
  2581. )
  2582. const (
  2583. // HistoryItemTypeConfigurationUpdate is a HistoryItemType enum value
  2584. HistoryItemTypeConfigurationUpdate = "ConfigurationUpdate"
  2585. // HistoryItemTypeStateUpdate is a HistoryItemType enum value
  2586. HistoryItemTypeStateUpdate = "StateUpdate"
  2587. // HistoryItemTypeAction is a HistoryItemType enum value
  2588. HistoryItemTypeAction = "Action"
  2589. )
  2590. const (
  2591. // StandardUnitSeconds is a StandardUnit enum value
  2592. StandardUnitSeconds = "Seconds"
  2593. // StandardUnitMicroseconds is a StandardUnit enum value
  2594. StandardUnitMicroseconds = "Microseconds"
  2595. // StandardUnitMilliseconds is a StandardUnit enum value
  2596. StandardUnitMilliseconds = "Milliseconds"
  2597. // StandardUnitBytes is a StandardUnit enum value
  2598. StandardUnitBytes = "Bytes"
  2599. // StandardUnitKilobytes is a StandardUnit enum value
  2600. StandardUnitKilobytes = "Kilobytes"
  2601. // StandardUnitMegabytes is a StandardUnit enum value
  2602. StandardUnitMegabytes = "Megabytes"
  2603. // StandardUnitGigabytes is a StandardUnit enum value
  2604. StandardUnitGigabytes = "Gigabytes"
  2605. // StandardUnitTerabytes is a StandardUnit enum value
  2606. StandardUnitTerabytes = "Terabytes"
  2607. // StandardUnitBits is a StandardUnit enum value
  2608. StandardUnitBits = "Bits"
  2609. // StandardUnitKilobits is a StandardUnit enum value
  2610. StandardUnitKilobits = "Kilobits"
  2611. // StandardUnitMegabits is a StandardUnit enum value
  2612. StandardUnitMegabits = "Megabits"
  2613. // StandardUnitGigabits is a StandardUnit enum value
  2614. StandardUnitGigabits = "Gigabits"
  2615. // StandardUnitTerabits is a StandardUnit enum value
  2616. StandardUnitTerabits = "Terabits"
  2617. // StandardUnitPercent is a StandardUnit enum value
  2618. StandardUnitPercent = "Percent"
  2619. // StandardUnitCount is a StandardUnit enum value
  2620. StandardUnitCount = "Count"
  2621. // StandardUnitBytesSecond is a StandardUnit enum value
  2622. StandardUnitBytesSecond = "Bytes/Second"
  2623. // StandardUnitKilobytesSecond is a StandardUnit enum value
  2624. StandardUnitKilobytesSecond = "Kilobytes/Second"
  2625. // StandardUnitMegabytesSecond is a StandardUnit enum value
  2626. StandardUnitMegabytesSecond = "Megabytes/Second"
  2627. // StandardUnitGigabytesSecond is a StandardUnit enum value
  2628. StandardUnitGigabytesSecond = "Gigabytes/Second"
  2629. // StandardUnitTerabytesSecond is a StandardUnit enum value
  2630. StandardUnitTerabytesSecond = "Terabytes/Second"
  2631. // StandardUnitBitsSecond is a StandardUnit enum value
  2632. StandardUnitBitsSecond = "Bits/Second"
  2633. // StandardUnitKilobitsSecond is a StandardUnit enum value
  2634. StandardUnitKilobitsSecond = "Kilobits/Second"
  2635. // StandardUnitMegabitsSecond is a StandardUnit enum value
  2636. StandardUnitMegabitsSecond = "Megabits/Second"
  2637. // StandardUnitGigabitsSecond is a StandardUnit enum value
  2638. StandardUnitGigabitsSecond = "Gigabits/Second"
  2639. // StandardUnitTerabitsSecond is a StandardUnit enum value
  2640. StandardUnitTerabitsSecond = "Terabits/Second"
  2641. // StandardUnitCountSecond is a StandardUnit enum value
  2642. StandardUnitCountSecond = "Count/Second"
  2643. // StandardUnitNone is a StandardUnit enum value
  2644. StandardUnitNone = "None"
  2645. )
  2646. const (
  2647. // StateValueOk is a StateValue enum value
  2648. StateValueOk = "OK"
  2649. // StateValueAlarm is a StateValue enum value
  2650. StateValueAlarm = "ALARM"
  2651. // StateValueInsufficientData is a StateValue enum value
  2652. StateValueInsufficientData = "INSUFFICIENT_DATA"
  2653. )
  2654. const (
  2655. // StatisticSampleCount is a Statistic enum value
  2656. StatisticSampleCount = "SampleCount"
  2657. // StatisticAverage is a Statistic enum value
  2658. StatisticAverage = "Average"
  2659. // StatisticSum is a Statistic enum value
  2660. StatisticSum = "Sum"
  2661. // StatisticMinimum is a Statistic enum value
  2662. StatisticMinimum = "Minimum"
  2663. // StatisticMaximum is a Statistic enum value
  2664. StatisticMaximum = "Maximum"
  2665. )