api.go 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package applicationautoscaling provides a client for Application Auto Scaling.
  3. package applicationautoscaling
  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. )
  10. const opDeleteScalingPolicy = "DeleteScalingPolicy"
  11. // DeleteScalingPolicyRequest generates a "aws/request.Request" representing the
  12. // client's request for the DeleteScalingPolicy operation. The "output" return
  13. // value can be used to capture response data after the request's "Send" method
  14. // is called.
  15. //
  16. // See DeleteScalingPolicy for usage and error information.
  17. //
  18. // Creating a request object using this method should be used when you want to inject
  19. // custom logic into the request's lifecycle using a custom handler, or if you want to
  20. // access properties on the request object before or after sending the request. If
  21. // you just want the service response, call the DeleteScalingPolicy method directly
  22. // instead.
  23. //
  24. // Note: You must call the "Send" method on the returned request object in order
  25. // to execute the request.
  26. //
  27. // // Example sending a request using the DeleteScalingPolicyRequest method.
  28. // req, resp := client.DeleteScalingPolicyRequest(params)
  29. //
  30. // err := req.Send()
  31. // if err == nil { // resp is now filled
  32. // fmt.Println(resp)
  33. // }
  34. //
  35. func (c *ApplicationAutoScaling) DeleteScalingPolicyRequest(input *DeleteScalingPolicyInput) (req *request.Request, output *DeleteScalingPolicyOutput) {
  36. op := &request.Operation{
  37. Name: opDeleteScalingPolicy,
  38. HTTPMethod: "POST",
  39. HTTPPath: "/",
  40. }
  41. if input == nil {
  42. input = &DeleteScalingPolicyInput{}
  43. }
  44. req = c.newRequest(op, input, output)
  45. output = &DeleteScalingPolicyOutput{}
  46. req.Data = output
  47. return
  48. }
  49. // DeleteScalingPolicy API operation for Application Auto Scaling.
  50. //
  51. // Deletes an Application Auto Scaling scaling policy that was previously created.
  52. // If you are no longer using a scaling policy, you can delete it with this
  53. // operation.
  54. //
  55. // Deleting a policy deletes the underlying alarm action, but does not delete
  56. // the CloudWatch alarm associated with the scaling policy, even if it no longer
  57. // has an associated action.
  58. //
  59. // To create a new scaling policy or update an existing one, see PutScalingPolicy.
  60. //
  61. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  62. // with awserr.Error's Code and Message methods to get detailed information about
  63. // the error.
  64. //
  65. // See the AWS API reference guide for Application Auto Scaling's
  66. // API operation DeleteScalingPolicy for usage and error information.
  67. //
  68. // Returned Error Codes:
  69. // * ValidationException
  70. // An exception was thrown for a validation issue. Review the available parameters
  71. // for the API request.
  72. //
  73. // * ObjectNotFoundException
  74. // The specified object could not be found. For any Put or Register API operation,
  75. // which depends on the existence of a scalable target, this exception is thrown
  76. // if the scalable target with the specified service namespace, resource ID,
  77. // and scalable dimension does not exist. For any Delete or Deregister API operation,
  78. // this exception is thrown if the resource that is to be deleted or deregistered
  79. // cannot be found.
  80. //
  81. // * ConcurrentUpdateException
  82. // Concurrent updates caused an exception, for example, if you request an update
  83. // to an Application Auto Scaling resource that already has a pending update.
  84. //
  85. // * InternalServiceException
  86. // The service encountered an internal error.
  87. //
  88. func (c *ApplicationAutoScaling) DeleteScalingPolicy(input *DeleteScalingPolicyInput) (*DeleteScalingPolicyOutput, error) {
  89. req, out := c.DeleteScalingPolicyRequest(input)
  90. err := req.Send()
  91. return out, err
  92. }
  93. const opDeregisterScalableTarget = "DeregisterScalableTarget"
  94. // DeregisterScalableTargetRequest generates a "aws/request.Request" representing the
  95. // client's request for the DeregisterScalableTarget operation. The "output" return
  96. // value can be used to capture response data after the request's "Send" method
  97. // is called.
  98. //
  99. // See DeregisterScalableTarget for usage and error information.
  100. //
  101. // Creating a request object using this method should be used when you want to inject
  102. // custom logic into the request's lifecycle using a custom handler, or if you want to
  103. // access properties on the request object before or after sending the request. If
  104. // you just want the service response, call the DeregisterScalableTarget method directly
  105. // instead.
  106. //
  107. // Note: You must call the "Send" method on the returned request object in order
  108. // to execute the request.
  109. //
  110. // // Example sending a request using the DeregisterScalableTargetRequest method.
  111. // req, resp := client.DeregisterScalableTargetRequest(params)
  112. //
  113. // err := req.Send()
  114. // if err == nil { // resp is now filled
  115. // fmt.Println(resp)
  116. // }
  117. //
  118. func (c *ApplicationAutoScaling) DeregisterScalableTargetRequest(input *DeregisterScalableTargetInput) (req *request.Request, output *DeregisterScalableTargetOutput) {
  119. op := &request.Operation{
  120. Name: opDeregisterScalableTarget,
  121. HTTPMethod: "POST",
  122. HTTPPath: "/",
  123. }
  124. if input == nil {
  125. input = &DeregisterScalableTargetInput{}
  126. }
  127. req = c.newRequest(op, input, output)
  128. output = &DeregisterScalableTargetOutput{}
  129. req.Data = output
  130. return
  131. }
  132. // DeregisterScalableTarget API operation for Application Auto Scaling.
  133. //
  134. // Deregisters a scalable target that was previously registered. If you are
  135. // no longer using a scalable target, you can delete it with this operation.
  136. // When you deregister a scalable target, all of the scaling policies that are
  137. // associated with that scalable target are deleted.
  138. //
  139. // To create a new scalable target or update an existing one, see RegisterScalableTarget.
  140. //
  141. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  142. // with awserr.Error's Code and Message methods to get detailed information about
  143. // the error.
  144. //
  145. // See the AWS API reference guide for Application Auto Scaling's
  146. // API operation DeregisterScalableTarget for usage and error information.
  147. //
  148. // Returned Error Codes:
  149. // * ValidationException
  150. // An exception was thrown for a validation issue. Review the available parameters
  151. // for the API request.
  152. //
  153. // * ObjectNotFoundException
  154. // The specified object could not be found. For any Put or Register API operation,
  155. // which depends on the existence of a scalable target, this exception is thrown
  156. // if the scalable target with the specified service namespace, resource ID,
  157. // and scalable dimension does not exist. For any Delete or Deregister API operation,
  158. // this exception is thrown if the resource that is to be deleted or deregistered
  159. // cannot be found.
  160. //
  161. // * ConcurrentUpdateException
  162. // Concurrent updates caused an exception, for example, if you request an update
  163. // to an Application Auto Scaling resource that already has a pending update.
  164. //
  165. // * InternalServiceException
  166. // The service encountered an internal error.
  167. //
  168. func (c *ApplicationAutoScaling) DeregisterScalableTarget(input *DeregisterScalableTargetInput) (*DeregisterScalableTargetOutput, error) {
  169. req, out := c.DeregisterScalableTargetRequest(input)
  170. err := req.Send()
  171. return out, err
  172. }
  173. const opDescribeScalableTargets = "DescribeScalableTargets"
  174. // DescribeScalableTargetsRequest generates a "aws/request.Request" representing the
  175. // client's request for the DescribeScalableTargets operation. The "output" return
  176. // value can be used to capture response data after the request's "Send" method
  177. // is called.
  178. //
  179. // See DescribeScalableTargets for usage and error information.
  180. //
  181. // Creating a request object using this method should be used when you want to inject
  182. // custom logic into the request's lifecycle using a custom handler, or if you want to
  183. // access properties on the request object before or after sending the request. If
  184. // you just want the service response, call the DescribeScalableTargets method directly
  185. // instead.
  186. //
  187. // Note: You must call the "Send" method on the returned request object in order
  188. // to execute the request.
  189. //
  190. // // Example sending a request using the DescribeScalableTargetsRequest method.
  191. // req, resp := client.DescribeScalableTargetsRequest(params)
  192. //
  193. // err := req.Send()
  194. // if err == nil { // resp is now filled
  195. // fmt.Println(resp)
  196. // }
  197. //
  198. func (c *ApplicationAutoScaling) DescribeScalableTargetsRequest(input *DescribeScalableTargetsInput) (req *request.Request, output *DescribeScalableTargetsOutput) {
  199. op := &request.Operation{
  200. Name: opDescribeScalableTargets,
  201. HTTPMethod: "POST",
  202. HTTPPath: "/",
  203. Paginator: &request.Paginator{
  204. InputTokens: []string{"NextToken"},
  205. OutputTokens: []string{"NextToken"},
  206. LimitToken: "MaxResults",
  207. TruncationToken: "",
  208. },
  209. }
  210. if input == nil {
  211. input = &DescribeScalableTargetsInput{}
  212. }
  213. req = c.newRequest(op, input, output)
  214. output = &DescribeScalableTargetsOutput{}
  215. req.Data = output
  216. return
  217. }
  218. // DescribeScalableTargets API operation for Application Auto Scaling.
  219. //
  220. // Provides descriptive information for scalable targets with a specified service
  221. // namespace.
  222. //
  223. // You can filter the results in a service namespace with the ResourceIds and
  224. // ScalableDimension parameters.
  225. //
  226. // To create a new scalable target or update an existing one, see RegisterScalableTarget.
  227. // If you are no longer using a scalable target, you can deregister it with
  228. // DeregisterScalableTarget.
  229. //
  230. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  231. // with awserr.Error's Code and Message methods to get detailed information about
  232. // the error.
  233. //
  234. // See the AWS API reference guide for Application Auto Scaling's
  235. // API operation DescribeScalableTargets for usage and error information.
  236. //
  237. // Returned Error Codes:
  238. // * ValidationException
  239. // An exception was thrown for a validation issue. Review the available parameters
  240. // for the API request.
  241. //
  242. // * InvalidNextTokenException
  243. // The next token supplied was invalid.
  244. //
  245. // * ConcurrentUpdateException
  246. // Concurrent updates caused an exception, for example, if you request an update
  247. // to an Application Auto Scaling resource that already has a pending update.
  248. //
  249. // * InternalServiceException
  250. // The service encountered an internal error.
  251. //
  252. func (c *ApplicationAutoScaling) DescribeScalableTargets(input *DescribeScalableTargetsInput) (*DescribeScalableTargetsOutput, error) {
  253. req, out := c.DescribeScalableTargetsRequest(input)
  254. err := req.Send()
  255. return out, err
  256. }
  257. // DescribeScalableTargetsPages iterates over the pages of a DescribeScalableTargets operation,
  258. // calling the "fn" function with the response data for each page. To stop
  259. // iterating, return false from the fn function.
  260. //
  261. // See DescribeScalableTargets method for more information on how to use this operation.
  262. //
  263. // Note: This operation can generate multiple requests to a service.
  264. //
  265. // // Example iterating over at most 3 pages of a DescribeScalableTargets operation.
  266. // pageNum := 0
  267. // err := client.DescribeScalableTargetsPages(params,
  268. // func(page *DescribeScalableTargetsOutput, lastPage bool) bool {
  269. // pageNum++
  270. // fmt.Println(page)
  271. // return pageNum <= 3
  272. // })
  273. //
  274. func (c *ApplicationAutoScaling) DescribeScalableTargetsPages(input *DescribeScalableTargetsInput, fn func(p *DescribeScalableTargetsOutput, lastPage bool) (shouldContinue bool)) error {
  275. page, _ := c.DescribeScalableTargetsRequest(input)
  276. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  277. return page.EachPage(func(p interface{}, lastPage bool) bool {
  278. return fn(p.(*DescribeScalableTargetsOutput), lastPage)
  279. })
  280. }
  281. const opDescribeScalingActivities = "DescribeScalingActivities"
  282. // DescribeScalingActivitiesRequest generates a "aws/request.Request" representing the
  283. // client's request for the DescribeScalingActivities operation. The "output" return
  284. // value can be used to capture response data after the request's "Send" method
  285. // is called.
  286. //
  287. // See DescribeScalingActivities for usage and error information.
  288. //
  289. // Creating a request object using this method should be used when you want to inject
  290. // custom logic into the request's lifecycle using a custom handler, or if you want to
  291. // access properties on the request object before or after sending the request. If
  292. // you just want the service response, call the DescribeScalingActivities method directly
  293. // instead.
  294. //
  295. // Note: You must call the "Send" method on the returned request object in order
  296. // to execute the request.
  297. //
  298. // // Example sending a request using the DescribeScalingActivitiesRequest method.
  299. // req, resp := client.DescribeScalingActivitiesRequest(params)
  300. //
  301. // err := req.Send()
  302. // if err == nil { // resp is now filled
  303. // fmt.Println(resp)
  304. // }
  305. //
  306. func (c *ApplicationAutoScaling) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) (req *request.Request, output *DescribeScalingActivitiesOutput) {
  307. op := &request.Operation{
  308. Name: opDescribeScalingActivities,
  309. HTTPMethod: "POST",
  310. HTTPPath: "/",
  311. Paginator: &request.Paginator{
  312. InputTokens: []string{"NextToken"},
  313. OutputTokens: []string{"NextToken"},
  314. LimitToken: "MaxResults",
  315. TruncationToken: "",
  316. },
  317. }
  318. if input == nil {
  319. input = &DescribeScalingActivitiesInput{}
  320. }
  321. req = c.newRequest(op, input, output)
  322. output = &DescribeScalingActivitiesOutput{}
  323. req.Data = output
  324. return
  325. }
  326. // DescribeScalingActivities API operation for Application Auto Scaling.
  327. //
  328. // Provides descriptive information for scaling activities with a specified
  329. // service namespace for the previous six weeks.
  330. //
  331. // You can filter the results in a service namespace with the ResourceId and
  332. // ScalableDimension parameters.
  333. //
  334. // Scaling activities are triggered by CloudWatch alarms that are associated
  335. // with scaling policies. To view the existing scaling policies for a service
  336. // namespace, see DescribeScalingPolicies. To create a new scaling policy or
  337. // update an existing one, see PutScalingPolicy.
  338. //
  339. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  340. // with awserr.Error's Code and Message methods to get detailed information about
  341. // the error.
  342. //
  343. // See the AWS API reference guide for Application Auto Scaling's
  344. // API operation DescribeScalingActivities for usage and error information.
  345. //
  346. // Returned Error Codes:
  347. // * ValidationException
  348. // An exception was thrown for a validation issue. Review the available parameters
  349. // for the API request.
  350. //
  351. // * InvalidNextTokenException
  352. // The next token supplied was invalid.
  353. //
  354. // * ConcurrentUpdateException
  355. // Concurrent updates caused an exception, for example, if you request an update
  356. // to an Application Auto Scaling resource that already has a pending update.
  357. //
  358. // * InternalServiceException
  359. // The service encountered an internal error.
  360. //
  361. func (c *ApplicationAutoScaling) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) {
  362. req, out := c.DescribeScalingActivitiesRequest(input)
  363. err := req.Send()
  364. return out, err
  365. }
  366. // DescribeScalingActivitiesPages iterates over the pages of a DescribeScalingActivities operation,
  367. // calling the "fn" function with the response data for each page. To stop
  368. // iterating, return false from the fn function.
  369. //
  370. // See DescribeScalingActivities method for more information on how to use this operation.
  371. //
  372. // Note: This operation can generate multiple requests to a service.
  373. //
  374. // // Example iterating over at most 3 pages of a DescribeScalingActivities operation.
  375. // pageNum := 0
  376. // err := client.DescribeScalingActivitiesPages(params,
  377. // func(page *DescribeScalingActivitiesOutput, lastPage bool) bool {
  378. // pageNum++
  379. // fmt.Println(page)
  380. // return pageNum <= 3
  381. // })
  382. //
  383. func (c *ApplicationAutoScaling) DescribeScalingActivitiesPages(input *DescribeScalingActivitiesInput, fn func(p *DescribeScalingActivitiesOutput, lastPage bool) (shouldContinue bool)) error {
  384. page, _ := c.DescribeScalingActivitiesRequest(input)
  385. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  386. return page.EachPage(func(p interface{}, lastPage bool) bool {
  387. return fn(p.(*DescribeScalingActivitiesOutput), lastPage)
  388. })
  389. }
  390. const opDescribeScalingPolicies = "DescribeScalingPolicies"
  391. // DescribeScalingPoliciesRequest generates a "aws/request.Request" representing the
  392. // client's request for the DescribeScalingPolicies operation. The "output" return
  393. // value can be used to capture response data after the request's "Send" method
  394. // is called.
  395. //
  396. // See DescribeScalingPolicies for usage and error information.
  397. //
  398. // Creating a request object using this method should be used when you want to inject
  399. // custom logic into the request's lifecycle using a custom handler, or if you want to
  400. // access properties on the request object before or after sending the request. If
  401. // you just want the service response, call the DescribeScalingPolicies method directly
  402. // instead.
  403. //
  404. // Note: You must call the "Send" method on the returned request object in order
  405. // to execute the request.
  406. //
  407. // // Example sending a request using the DescribeScalingPoliciesRequest method.
  408. // req, resp := client.DescribeScalingPoliciesRequest(params)
  409. //
  410. // err := req.Send()
  411. // if err == nil { // resp is now filled
  412. // fmt.Println(resp)
  413. // }
  414. //
  415. func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeScalingPoliciesInput) (req *request.Request, output *DescribeScalingPoliciesOutput) {
  416. op := &request.Operation{
  417. Name: opDescribeScalingPolicies,
  418. HTTPMethod: "POST",
  419. HTTPPath: "/",
  420. Paginator: &request.Paginator{
  421. InputTokens: []string{"NextToken"},
  422. OutputTokens: []string{"NextToken"},
  423. LimitToken: "MaxResults",
  424. TruncationToken: "",
  425. },
  426. }
  427. if input == nil {
  428. input = &DescribeScalingPoliciesInput{}
  429. }
  430. req = c.newRequest(op, input, output)
  431. output = &DescribeScalingPoliciesOutput{}
  432. req.Data = output
  433. return
  434. }
  435. // DescribeScalingPolicies API operation for Application Auto Scaling.
  436. //
  437. // Provides descriptive information for scaling policies with a specified service
  438. // namespace.
  439. //
  440. // You can filter the results in a service namespace with the ResourceId, ScalableDimension,
  441. // and PolicyNames parameters.
  442. //
  443. // To create a new scaling policy or update an existing one, see PutScalingPolicy.
  444. // If you are no longer using a scaling policy, you can delete it with DeleteScalingPolicy.
  445. //
  446. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  447. // with awserr.Error's Code and Message methods to get detailed information about
  448. // the error.
  449. //
  450. // See the AWS API reference guide for Application Auto Scaling's
  451. // API operation DescribeScalingPolicies for usage and error information.
  452. //
  453. // Returned Error Codes:
  454. // * ValidationException
  455. // An exception was thrown for a validation issue. Review the available parameters
  456. // for the API request.
  457. //
  458. // * FailedResourceAccessException
  459. // Failed access to resources caused an exception. This exception currently
  460. // only applies to DescribeScalingPolicies. It is thrown when Application Auto
  461. // Scaling is unable to retrieve the alarms associated with a scaling policy
  462. // due to a client error, for example, if the role ARN specified for a scalable
  463. // target does not have the proper permissions to call the CloudWatch DescribeAlarms
  464. // (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)
  465. // API operation on behalf of your account.
  466. //
  467. // * InvalidNextTokenException
  468. // The next token supplied was invalid.
  469. //
  470. // * ConcurrentUpdateException
  471. // Concurrent updates caused an exception, for example, if you request an update
  472. // to an Application Auto Scaling resource that already has a pending update.
  473. //
  474. // * InternalServiceException
  475. // The service encountered an internal error.
  476. //
  477. func (c *ApplicationAutoScaling) DescribeScalingPolicies(input *DescribeScalingPoliciesInput) (*DescribeScalingPoliciesOutput, error) {
  478. req, out := c.DescribeScalingPoliciesRequest(input)
  479. err := req.Send()
  480. return out, err
  481. }
  482. // DescribeScalingPoliciesPages iterates over the pages of a DescribeScalingPolicies operation,
  483. // calling the "fn" function with the response data for each page. To stop
  484. // iterating, return false from the fn function.
  485. //
  486. // See DescribeScalingPolicies method for more information on how to use this operation.
  487. //
  488. // Note: This operation can generate multiple requests to a service.
  489. //
  490. // // Example iterating over at most 3 pages of a DescribeScalingPolicies operation.
  491. // pageNum := 0
  492. // err := client.DescribeScalingPoliciesPages(params,
  493. // func(page *DescribeScalingPoliciesOutput, lastPage bool) bool {
  494. // pageNum++
  495. // fmt.Println(page)
  496. // return pageNum <= 3
  497. // })
  498. //
  499. func (c *ApplicationAutoScaling) DescribeScalingPoliciesPages(input *DescribeScalingPoliciesInput, fn func(p *DescribeScalingPoliciesOutput, lastPage bool) (shouldContinue bool)) error {
  500. page, _ := c.DescribeScalingPoliciesRequest(input)
  501. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  502. return page.EachPage(func(p interface{}, lastPage bool) bool {
  503. return fn(p.(*DescribeScalingPoliciesOutput), lastPage)
  504. })
  505. }
  506. const opPutScalingPolicy = "PutScalingPolicy"
  507. // PutScalingPolicyRequest generates a "aws/request.Request" representing the
  508. // client's request for the PutScalingPolicy operation. The "output" return
  509. // value can be used to capture response data after the request's "Send" method
  510. // is called.
  511. //
  512. // See PutScalingPolicy for usage and error information.
  513. //
  514. // Creating a request object using this method should be used when you want to inject
  515. // custom logic into the request's lifecycle using a custom handler, or if you want to
  516. // access properties on the request object before or after sending the request. If
  517. // you just want the service response, call the PutScalingPolicy method directly
  518. // instead.
  519. //
  520. // Note: You must call the "Send" method on the returned request object in order
  521. // to execute the request.
  522. //
  523. // // Example sending a request using the PutScalingPolicyRequest method.
  524. // req, resp := client.PutScalingPolicyRequest(params)
  525. //
  526. // err := req.Send()
  527. // if err == nil { // resp is now filled
  528. // fmt.Println(resp)
  529. // }
  530. //
  531. func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req *request.Request, output *PutScalingPolicyOutput) {
  532. op := &request.Operation{
  533. Name: opPutScalingPolicy,
  534. HTTPMethod: "POST",
  535. HTTPPath: "/",
  536. }
  537. if input == nil {
  538. input = &PutScalingPolicyInput{}
  539. }
  540. req = c.newRequest(op, input, output)
  541. output = &PutScalingPolicyOutput{}
  542. req.Data = output
  543. return
  544. }
  545. // PutScalingPolicy API operation for Application Auto Scaling.
  546. //
  547. // Creates or updates a policy for an existing Application Auto Scaling scalable
  548. // target. Each scalable target is identified by service namespace, a resource
  549. // ID, and a scalable dimension, and a scaling policy applies to a scalable
  550. // target that is identified by those three attributes. You cannot create a
  551. // scaling policy without first registering a scalable target with RegisterScalableTarget.
  552. //
  553. // To update an existing policy, use the existing policy name and set the parameters
  554. // you want to change. Any existing parameter not changed in an update to an
  555. // existing policy is not changed in this update request.
  556. //
  557. // You can view the existing scaling policies for a service namespace with DescribeScalingPolicies.
  558. // If you are no longer using a scaling policy, you can delete it with DeleteScalingPolicy.
  559. //
  560. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  561. // with awserr.Error's Code and Message methods to get detailed information about
  562. // the error.
  563. //
  564. // See the AWS API reference guide for Application Auto Scaling's
  565. // API operation PutScalingPolicy for usage and error information.
  566. //
  567. // Returned Error Codes:
  568. // * ValidationException
  569. // An exception was thrown for a validation issue. Review the available parameters
  570. // for the API request.
  571. //
  572. // * LimitExceededException
  573. // Your account exceeded a limit. This exception is thrown when a per-account
  574. // resource limit is exceeded. For more information, see Application Auto Scaling
  575. // Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_as-app).
  576. //
  577. // * ObjectNotFoundException
  578. // The specified object could not be found. For any Put or Register API operation,
  579. // which depends on the existence of a scalable target, this exception is thrown
  580. // if the scalable target with the specified service namespace, resource ID,
  581. // and scalable dimension does not exist. For any Delete or Deregister API operation,
  582. // this exception is thrown if the resource that is to be deleted or deregistered
  583. // cannot be found.
  584. //
  585. // * ConcurrentUpdateException
  586. // Concurrent updates caused an exception, for example, if you request an update
  587. // to an Application Auto Scaling resource that already has a pending update.
  588. //
  589. // * InternalServiceException
  590. // The service encountered an internal error.
  591. //
  592. func (c *ApplicationAutoScaling) PutScalingPolicy(input *PutScalingPolicyInput) (*PutScalingPolicyOutput, error) {
  593. req, out := c.PutScalingPolicyRequest(input)
  594. err := req.Send()
  595. return out, err
  596. }
  597. const opRegisterScalableTarget = "RegisterScalableTarget"
  598. // RegisterScalableTargetRequest generates a "aws/request.Request" representing the
  599. // client's request for the RegisterScalableTarget operation. The "output" return
  600. // value can be used to capture response data after the request's "Send" method
  601. // is called.
  602. //
  603. // See RegisterScalableTarget for usage and error information.
  604. //
  605. // Creating a request object using this method should be used when you want to inject
  606. // custom logic into the request's lifecycle using a custom handler, or if you want to
  607. // access properties on the request object before or after sending the request. If
  608. // you just want the service response, call the RegisterScalableTarget method directly
  609. // instead.
  610. //
  611. // Note: You must call the "Send" method on the returned request object in order
  612. // to execute the request.
  613. //
  614. // // Example sending a request using the RegisterScalableTargetRequest method.
  615. // req, resp := client.RegisterScalableTargetRequest(params)
  616. //
  617. // err := req.Send()
  618. // if err == nil { // resp is now filled
  619. // fmt.Println(resp)
  620. // }
  621. //
  622. func (c *ApplicationAutoScaling) RegisterScalableTargetRequest(input *RegisterScalableTargetInput) (req *request.Request, output *RegisterScalableTargetOutput) {
  623. op := &request.Operation{
  624. Name: opRegisterScalableTarget,
  625. HTTPMethod: "POST",
  626. HTTPPath: "/",
  627. }
  628. if input == nil {
  629. input = &RegisterScalableTargetInput{}
  630. }
  631. req = c.newRequest(op, input, output)
  632. output = &RegisterScalableTargetOutput{}
  633. req.Data = output
  634. return
  635. }
  636. // RegisterScalableTarget API operation for Application Auto Scaling.
  637. //
  638. // Registers or updates a scalable target. A scalable target is a resource that
  639. // can be scaled out or in with Application Auto Scaling. After you have registered
  640. // a scalable target, you can use this operation to update the minimum and maximum
  641. // values for your scalable dimension.
  642. //
  643. // After you register a scalable target with Application Auto Scaling, you can
  644. // create and apply scaling policies to it with PutScalingPolicy. You can view
  645. // the existing scaling policies for a service namespace with DescribeScalableTargets.
  646. // If you are no longer using a scalable target, you can deregister it with
  647. // DeregisterScalableTarget.
  648. //
  649. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  650. // with awserr.Error's Code and Message methods to get detailed information about
  651. // the error.
  652. //
  653. // See the AWS API reference guide for Application Auto Scaling's
  654. // API operation RegisterScalableTarget for usage and error information.
  655. //
  656. // Returned Error Codes:
  657. // * ValidationException
  658. // An exception was thrown for a validation issue. Review the available parameters
  659. // for the API request.
  660. //
  661. // * LimitExceededException
  662. // Your account exceeded a limit. This exception is thrown when a per-account
  663. // resource limit is exceeded. For more information, see Application Auto Scaling
  664. // Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_as-app).
  665. //
  666. // * ConcurrentUpdateException
  667. // Concurrent updates caused an exception, for example, if you request an update
  668. // to an Application Auto Scaling resource that already has a pending update.
  669. //
  670. // * InternalServiceException
  671. // The service encountered an internal error.
  672. //
  673. func (c *ApplicationAutoScaling) RegisterScalableTarget(input *RegisterScalableTargetInput) (*RegisterScalableTargetOutput, error) {
  674. req, out := c.RegisterScalableTargetRequest(input)
  675. err := req.Send()
  676. return out, err
  677. }
  678. // An object representing a CloudWatch alarm associated with a scaling policy.
  679. type Alarm struct {
  680. _ struct{} `type:"structure"`
  681. // The Amazon Resource Name (ARN) of the alarm.
  682. //
  683. // AlarmARN is a required field
  684. AlarmARN *string `type:"string" required:"true"`
  685. // The name of the alarm.
  686. //
  687. // AlarmName is a required field
  688. AlarmName *string `type:"string" required:"true"`
  689. }
  690. // String returns the string representation
  691. func (s Alarm) String() string {
  692. return awsutil.Prettify(s)
  693. }
  694. // GoString returns the string representation
  695. func (s Alarm) GoString() string {
  696. return s.String()
  697. }
  698. type DeleteScalingPolicyInput struct {
  699. _ struct{} `type:"structure"`
  700. // The name of the scaling policy to delete.
  701. //
  702. // PolicyName is a required field
  703. PolicyName *string `min:"1" type:"string" required:"true"`
  704. // The resource type and unique identifier string for the resource associated
  705. // with the scaling policy. For Amazon ECS services, the resource type is services,
  706. // and the identifier is the cluster name and service name; for example, service/default/sample-webapp.
  707. // For Amazon EC2 Spot fleet requests, the resource type is spot-fleet-request,
  708. // and the identifier is the Spot fleet request ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  709. //
  710. // ResourceId is a required field
  711. ResourceId *string `min:"1" type:"string" required:"true"`
  712. // The scalable dimension associated with the scaling policy. The scalable dimension
  713. // contains the service namespace, resource type, and scaling property, such
  714. // as ecs:service:DesiredCount for the desired task count of an Amazon ECS service,
  715. // or ec2:spot-fleet-request:TargetCapacity for the target capacity of an Amazon
  716. // EC2 Spot fleet request.
  717. //
  718. // ScalableDimension is a required field
  719. ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
  720. // The namespace for the AWS service that the scaling policy is associated with.
  721. // For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  722. // in the Amazon Web Services General Reference.
  723. //
  724. // ServiceNamespace is a required field
  725. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  726. }
  727. // String returns the string representation
  728. func (s DeleteScalingPolicyInput) String() string {
  729. return awsutil.Prettify(s)
  730. }
  731. // GoString returns the string representation
  732. func (s DeleteScalingPolicyInput) GoString() string {
  733. return s.String()
  734. }
  735. // Validate inspects the fields of the type to determine if they are valid.
  736. func (s *DeleteScalingPolicyInput) Validate() error {
  737. invalidParams := request.ErrInvalidParams{Context: "DeleteScalingPolicyInput"}
  738. if s.PolicyName == nil {
  739. invalidParams.Add(request.NewErrParamRequired("PolicyName"))
  740. }
  741. if s.PolicyName != nil && len(*s.PolicyName) < 1 {
  742. invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
  743. }
  744. if s.ResourceId == nil {
  745. invalidParams.Add(request.NewErrParamRequired("ResourceId"))
  746. }
  747. if s.ResourceId != nil && len(*s.ResourceId) < 1 {
  748. invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
  749. }
  750. if s.ScalableDimension == nil {
  751. invalidParams.Add(request.NewErrParamRequired("ScalableDimension"))
  752. }
  753. if s.ServiceNamespace == nil {
  754. invalidParams.Add(request.NewErrParamRequired("ServiceNamespace"))
  755. }
  756. if invalidParams.Len() > 0 {
  757. return invalidParams
  758. }
  759. return nil
  760. }
  761. type DeleteScalingPolicyOutput struct {
  762. _ struct{} `type:"structure"`
  763. }
  764. // String returns the string representation
  765. func (s DeleteScalingPolicyOutput) String() string {
  766. return awsutil.Prettify(s)
  767. }
  768. // GoString returns the string representation
  769. func (s DeleteScalingPolicyOutput) GoString() string {
  770. return s.String()
  771. }
  772. type DeregisterScalableTargetInput struct {
  773. _ struct{} `type:"structure"`
  774. // The resource type and unique identifier string for the resource associated
  775. // with the scalable target. For Amazon ECS services, the resource type is services,
  776. // and the identifier is the cluster name and service name; for example, service/default/sample-webapp.
  777. // For Amazon EC2 Spot fleet requests, the resource type is spot-fleet-request,
  778. // and the identifier is the Spot fleet request ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  779. //
  780. // ResourceId is a required field
  781. ResourceId *string `min:"1" type:"string" required:"true"`
  782. // The scalable dimension associated with the scalable target. The scalable
  783. // dimension contains the service namespace, resource type, and scaling property,
  784. // such as ecs:service:DesiredCount for the desired task count of an Amazon
  785. // ECS service, or ec2:spot-fleet-request:TargetCapacity for the target capacity
  786. // of an Amazon EC2 Spot fleet request.
  787. //
  788. // ScalableDimension is a required field
  789. ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
  790. // The namespace for the AWS service that the scalable target is associated
  791. // with. For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  792. // in the Amazon Web Services General Reference.
  793. //
  794. // ServiceNamespace is a required field
  795. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  796. }
  797. // String returns the string representation
  798. func (s DeregisterScalableTargetInput) String() string {
  799. return awsutil.Prettify(s)
  800. }
  801. // GoString returns the string representation
  802. func (s DeregisterScalableTargetInput) GoString() string {
  803. return s.String()
  804. }
  805. // Validate inspects the fields of the type to determine if they are valid.
  806. func (s *DeregisterScalableTargetInput) Validate() error {
  807. invalidParams := request.ErrInvalidParams{Context: "DeregisterScalableTargetInput"}
  808. if s.ResourceId == nil {
  809. invalidParams.Add(request.NewErrParamRequired("ResourceId"))
  810. }
  811. if s.ResourceId != nil && len(*s.ResourceId) < 1 {
  812. invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
  813. }
  814. if s.ScalableDimension == nil {
  815. invalidParams.Add(request.NewErrParamRequired("ScalableDimension"))
  816. }
  817. if s.ServiceNamespace == nil {
  818. invalidParams.Add(request.NewErrParamRequired("ServiceNamespace"))
  819. }
  820. if invalidParams.Len() > 0 {
  821. return invalidParams
  822. }
  823. return nil
  824. }
  825. type DeregisterScalableTargetOutput struct {
  826. _ struct{} `type:"structure"`
  827. }
  828. // String returns the string representation
  829. func (s DeregisterScalableTargetOutput) String() string {
  830. return awsutil.Prettify(s)
  831. }
  832. // GoString returns the string representation
  833. func (s DeregisterScalableTargetOutput) GoString() string {
  834. return s.String()
  835. }
  836. type DescribeScalableTargetsInput struct {
  837. _ struct{} `type:"structure"`
  838. // The maximum number of scalable target results returned by DescribeScalableTargets
  839. // in paginated output. When this parameter is used, DescribeScalableTargets
  840. // returns up to MaxResults results in a single page along with a NextToken
  841. // response element. The remaining results of the initial request can be seen
  842. // by sending another DescribeScalableTargets request with the returned NextToken
  843. // value. This value can be between 1 and 50. If this parameter is not used,
  844. // then DescribeScalableTargets returns up to 50 results and a NextToken value,
  845. // if applicable.
  846. MaxResults *int64 `type:"integer"`
  847. // The NextToken value returned from a previous paginated DescribeScalableTargets
  848. // request. Pagination continues from the end of the previous results that returned
  849. // the NextToken value. This value is null when there are no more results to
  850. // return.
  851. NextToken *string `type:"string"`
  852. // The resource type and unique identifier string for the resource associated
  853. // with the scalable target. For Amazon ECS services, the resource type is services,
  854. // and the identifier is the cluster name and service name; for example, service/default/sample-webapp.
  855. // For Amazon EC2 Spot fleet requests, the resource type is spot-fleet-request,
  856. // and the identifier is the Spot fleet request ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  857. // If you specify a scalable dimension, you must also specify a resource ID.
  858. ResourceIds []*string `type:"list"`
  859. // The scalable dimension associated with the scalable target. The scalable
  860. // dimension contains the service namespace, resource type, and scaling property,
  861. // such as ecs:service:DesiredCount for the desired task count of an Amazon
  862. // ECS service, or ec2:spot-fleet-request:TargetCapacity for the target capacity
  863. // of an Amazon EC2 Spot fleet request. If you specify a scalable dimension,
  864. // you must also specify a resource ID.
  865. ScalableDimension *string `type:"string" enum:"ScalableDimension"`
  866. // The namespace for the AWS service that the scalable target is associated
  867. // with. For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  868. // in the Amazon Web Services General Reference.
  869. //
  870. // ServiceNamespace is a required field
  871. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  872. }
  873. // String returns the string representation
  874. func (s DescribeScalableTargetsInput) String() string {
  875. return awsutil.Prettify(s)
  876. }
  877. // GoString returns the string representation
  878. func (s DescribeScalableTargetsInput) GoString() string {
  879. return s.String()
  880. }
  881. // Validate inspects the fields of the type to determine if they are valid.
  882. func (s *DescribeScalableTargetsInput) Validate() error {
  883. invalidParams := request.ErrInvalidParams{Context: "DescribeScalableTargetsInput"}
  884. if s.ServiceNamespace == nil {
  885. invalidParams.Add(request.NewErrParamRequired("ServiceNamespace"))
  886. }
  887. if invalidParams.Len() > 0 {
  888. return invalidParams
  889. }
  890. return nil
  891. }
  892. type DescribeScalableTargetsOutput struct {
  893. _ struct{} `type:"structure"`
  894. // The NextToken value to include in a future DescribeScalableTargets request.
  895. // When the results of a DescribeScalableTargets request exceed MaxResults,
  896. // this value can be used to retrieve the next page of results. This value is
  897. // null when there are no more results to return.
  898. NextToken *string `type:"string"`
  899. // The list of scalable targets that matches the request parameters.
  900. ScalableTargets []*ScalableTarget `type:"list"`
  901. }
  902. // String returns the string representation
  903. func (s DescribeScalableTargetsOutput) String() string {
  904. return awsutil.Prettify(s)
  905. }
  906. // GoString returns the string representation
  907. func (s DescribeScalableTargetsOutput) GoString() string {
  908. return s.String()
  909. }
  910. type DescribeScalingActivitiesInput struct {
  911. _ struct{} `type:"structure"`
  912. // The maximum number of scaling activity results returned by DescribeScalingActivities
  913. // in paginated output. When this parameter is used, DescribeScalingActivities
  914. // returns up to MaxResults results in a single page along with a NextToken
  915. // response element. The remaining results of the initial request can be seen
  916. // by sending another DescribeScalingActivities request with the returned NextToken
  917. // value. This value can be between 1 and 50. If this parameter is not used,
  918. // then DescribeScalingActivities returns up to 50 results and a NextToken value,
  919. // if applicable.
  920. MaxResults *int64 `type:"integer"`
  921. // The NextToken value returned from a previous paginated DescribeScalingActivities
  922. // request. Pagination continues from the end of the previous results that returned
  923. // the NextToken value. This value is null when there are no more results to
  924. // return.
  925. NextToken *string `type:"string"`
  926. // The resource type and unique identifier string for the resource associated
  927. // with the scaling activity. For Amazon ECS services, the resource type is
  928. // services, and the identifier is the cluster name and service name; for example,
  929. // service/default/sample-webapp. For Amazon EC2 Spot fleet requests, the resource
  930. // type is spot-fleet-request, and the identifier is the Spot fleet request
  931. // ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  932. // If you specify a scalable dimension, you must also specify a resource ID.
  933. ResourceId *string `min:"1" type:"string"`
  934. // The scalable dimension associated with the scaling activity. The scalable
  935. // dimension contains the service namespace, resource type, and scaling property,
  936. // such as ecs:service:DesiredCount for the desired task count of an Amazon
  937. // ECS service, or ec2:spot-fleet-request:TargetCapacity for the target capacity
  938. // of an Amazon EC2 Spot fleet request. If you specify a scalable dimension,
  939. // you must also specify a resource ID.
  940. ScalableDimension *string `type:"string" enum:"ScalableDimension"`
  941. // The namespace for the AWS service that the scaling activity is associated
  942. // with. For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  943. // in the Amazon Web Services General Reference.
  944. //
  945. // ServiceNamespace is a required field
  946. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  947. }
  948. // String returns the string representation
  949. func (s DescribeScalingActivitiesInput) String() string {
  950. return awsutil.Prettify(s)
  951. }
  952. // GoString returns the string representation
  953. func (s DescribeScalingActivitiesInput) GoString() string {
  954. return s.String()
  955. }
  956. // Validate inspects the fields of the type to determine if they are valid.
  957. func (s *DescribeScalingActivitiesInput) Validate() error {
  958. invalidParams := request.ErrInvalidParams{Context: "DescribeScalingActivitiesInput"}
  959. if s.ResourceId != nil && len(*s.ResourceId) < 1 {
  960. invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
  961. }
  962. if s.ServiceNamespace == nil {
  963. invalidParams.Add(request.NewErrParamRequired("ServiceNamespace"))
  964. }
  965. if invalidParams.Len() > 0 {
  966. return invalidParams
  967. }
  968. return nil
  969. }
  970. type DescribeScalingActivitiesOutput struct {
  971. _ struct{} `type:"structure"`
  972. // The NextToken value to include in a future DescribeScalingActivities request.
  973. // When the results of a DescribeScalingActivities request exceed MaxResults,
  974. // this value can be used to retrieve the next page of results. This value is
  975. // null when there are no more results to return.
  976. NextToken *string `type:"string"`
  977. // A list of scaling activity objects.
  978. ScalingActivities []*ScalingActivity `type:"list"`
  979. }
  980. // String returns the string representation
  981. func (s DescribeScalingActivitiesOutput) String() string {
  982. return awsutil.Prettify(s)
  983. }
  984. // GoString returns the string representation
  985. func (s DescribeScalingActivitiesOutput) GoString() string {
  986. return s.String()
  987. }
  988. type DescribeScalingPoliciesInput struct {
  989. _ struct{} `type:"structure"`
  990. // The maximum number of scaling policy results returned by DescribeScalingPolicies
  991. // in paginated output. When this parameter is used, DescribeScalingPolicies
  992. // returns up to MaxResults results in a single page along with a NextToken
  993. // response element. The remaining results of the initial request can be seen
  994. // by sending another DescribeScalingPolicies request with the returned NextToken
  995. // value. This value can be between 1 and 50. If this parameter is not used,
  996. // then DescribeScalingPolicies returns up to 50 results and a NextToken value,
  997. // if applicable.
  998. MaxResults *int64 `type:"integer"`
  999. // The NextToken value returned from a previous paginated DescribeScalingPolicies
  1000. // request. Pagination continues from the end of the previous results that returned
  1001. // the NextToken value. This value is null when there are no more results to
  1002. // return.
  1003. NextToken *string `type:"string"`
  1004. // The names of the scaling policies to describe.
  1005. PolicyNames []*string `type:"list"`
  1006. // The unique resource identifier string of the scalable target that the scaling
  1007. // policy is associated with. For Amazon ECS services, the resource type is
  1008. // services, and the identifier is the cluster name and service name; for example,
  1009. // service/default/sample-webapp. For Amazon EC2 Spot fleet requests, the resource
  1010. // type is spot-fleet-request, and the identifier is the Spot fleet request
  1011. // ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  1012. // If you specify a scalable dimension, you must also specify a resource ID.
  1013. ResourceId *string `min:"1" type:"string"`
  1014. // The scalable dimension of the scalable target that the scaling policy is
  1015. // associated with. The scalable dimension contains the service namespace, resource
  1016. // type, and scaling property, such as ecs:service:DesiredCount for the desired
  1017. // task count of an Amazon ECS service, or ec2:spot-fleet-request:TargetCapacity
  1018. // for the target capacity of an Amazon EC2 Spot fleet request. If you specify
  1019. // a scalable dimension, you must also specify a resource ID.
  1020. ScalableDimension *string `type:"string" enum:"ScalableDimension"`
  1021. // The AWS service namespace of the scalable target that the scaling policy
  1022. // is associated with. For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  1023. // in the Amazon Web Services General Reference.
  1024. //
  1025. // ServiceNamespace is a required field
  1026. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  1027. }
  1028. // String returns the string representation
  1029. func (s DescribeScalingPoliciesInput) String() string {
  1030. return awsutil.Prettify(s)
  1031. }
  1032. // GoString returns the string representation
  1033. func (s DescribeScalingPoliciesInput) GoString() string {
  1034. return s.String()
  1035. }
  1036. // Validate inspects the fields of the type to determine if they are valid.
  1037. func (s *DescribeScalingPoliciesInput) Validate() error {
  1038. invalidParams := request.ErrInvalidParams{Context: "DescribeScalingPoliciesInput"}
  1039. if s.ResourceId != nil && len(*s.ResourceId) < 1 {
  1040. invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
  1041. }
  1042. if s.ServiceNamespace == nil {
  1043. invalidParams.Add(request.NewErrParamRequired("ServiceNamespace"))
  1044. }
  1045. if invalidParams.Len() > 0 {
  1046. return invalidParams
  1047. }
  1048. return nil
  1049. }
  1050. type DescribeScalingPoliciesOutput struct {
  1051. _ struct{} `type:"structure"`
  1052. // The NextToken value to include in a future DescribeScalingPolicies request.
  1053. // When the results of a DescribeScalingPolicies request exceed MaxResults,
  1054. // this value can be used to retrieve the next page of results. This value is
  1055. // null when there are no more results to return.
  1056. NextToken *string `type:"string"`
  1057. // A list of scaling policy objects.
  1058. ScalingPolicies []*ScalingPolicy `type:"list"`
  1059. }
  1060. // String returns the string representation
  1061. func (s DescribeScalingPoliciesOutput) String() string {
  1062. return awsutil.Prettify(s)
  1063. }
  1064. // GoString returns the string representation
  1065. func (s DescribeScalingPoliciesOutput) GoString() string {
  1066. return s.String()
  1067. }
  1068. type PutScalingPolicyInput struct {
  1069. _ struct{} `type:"structure"`
  1070. // The name of the scaling policy.
  1071. //
  1072. // PolicyName is a required field
  1073. PolicyName *string `min:"1" type:"string" required:"true"`
  1074. // The policy type. If you are creating a new policy, this parameter is required.
  1075. // If you are updating an existing policy, this parameter is not required.
  1076. PolicyType *string `type:"string" enum:"PolicyType"`
  1077. // The unique resource identifier string for the scalable target that this scaling
  1078. // policy applies to. For Amazon ECS services, the resource type is services,
  1079. // and the identifier is the cluster name and service name; for example, service/default/sample-webapp.
  1080. // For Amazon EC2 Spot fleet requests, the resource type is spot-fleet-request,
  1081. // and the identifier is the Spot fleet request ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  1082. //
  1083. // ResourceId is a required field
  1084. ResourceId *string `min:"1" type:"string" required:"true"`
  1085. // The scalable dimension of the scalable target that this scaling policy applies
  1086. // to. The scalable dimension contains the service namespace, resource type,
  1087. // and scaling property, such as ecs:service:DesiredCount for the desired task
  1088. // count of an Amazon ECS service, or ec2:spot-fleet-request:TargetCapacity
  1089. // for the target capacity of an Amazon EC2 Spot fleet request.
  1090. //
  1091. // ScalableDimension is a required field
  1092. ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
  1093. // The AWS service namespace of the scalable target that this scaling policy
  1094. // applies to. For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  1095. // in the Amazon Web Services General Reference.
  1096. //
  1097. // ServiceNamespace is a required field
  1098. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  1099. // The configuration for the step scaling policy. If you are creating a new
  1100. // policy, this parameter is required. If you are updating an existing policy,
  1101. // this parameter is not required. For more information, see StepScalingPolicyConfiguration
  1102. // and StepAdjustment.
  1103. StepScalingPolicyConfiguration *StepScalingPolicyConfiguration `type:"structure"`
  1104. }
  1105. // String returns the string representation
  1106. func (s PutScalingPolicyInput) String() string {
  1107. return awsutil.Prettify(s)
  1108. }
  1109. // GoString returns the string representation
  1110. func (s PutScalingPolicyInput) GoString() string {
  1111. return s.String()
  1112. }
  1113. // Validate inspects the fields of the type to determine if they are valid.
  1114. func (s *PutScalingPolicyInput) Validate() error {
  1115. invalidParams := request.ErrInvalidParams{Context: "PutScalingPolicyInput"}
  1116. if s.PolicyName == nil {
  1117. invalidParams.Add(request.NewErrParamRequired("PolicyName"))
  1118. }
  1119. if s.PolicyName != nil && len(*s.PolicyName) < 1 {
  1120. invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
  1121. }
  1122. if s.ResourceId == nil {
  1123. invalidParams.Add(request.NewErrParamRequired("ResourceId"))
  1124. }
  1125. if s.ResourceId != nil && len(*s.ResourceId) < 1 {
  1126. invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
  1127. }
  1128. if s.ScalableDimension == nil {
  1129. invalidParams.Add(request.NewErrParamRequired("ScalableDimension"))
  1130. }
  1131. if s.ServiceNamespace == nil {
  1132. invalidParams.Add(request.NewErrParamRequired("ServiceNamespace"))
  1133. }
  1134. if s.StepScalingPolicyConfiguration != nil {
  1135. if err := s.StepScalingPolicyConfiguration.Validate(); err != nil {
  1136. invalidParams.AddNested("StepScalingPolicyConfiguration", err.(request.ErrInvalidParams))
  1137. }
  1138. }
  1139. if invalidParams.Len() > 0 {
  1140. return invalidParams
  1141. }
  1142. return nil
  1143. }
  1144. type PutScalingPolicyOutput struct {
  1145. _ struct{} `type:"structure"`
  1146. // The Amazon Resource Name (ARN) of the resulting scaling policy.
  1147. //
  1148. // PolicyARN is a required field
  1149. PolicyARN *string `min:"1" type:"string" required:"true"`
  1150. }
  1151. // String returns the string representation
  1152. func (s PutScalingPolicyOutput) String() string {
  1153. return awsutil.Prettify(s)
  1154. }
  1155. // GoString returns the string representation
  1156. func (s PutScalingPolicyOutput) GoString() string {
  1157. return s.String()
  1158. }
  1159. type RegisterScalableTargetInput struct {
  1160. _ struct{} `type:"structure"`
  1161. // The maximum value for this scalable target to scale out to in response to
  1162. // scaling activities. This parameter is required if you are registering a new
  1163. // scalable target, and it is optional if you are updating an existing one.
  1164. MaxCapacity *int64 `type:"integer"`
  1165. // The minimum value for this scalable target to scale in to in response to
  1166. // scaling activities. This parameter is required if you are registering a new
  1167. // scalable target, and it is optional if you are updating an existing one.
  1168. MinCapacity *int64 `type:"integer"`
  1169. // The resource type and unique identifier string for the resource to associate
  1170. // with the scalable target. For Amazon ECS services, the resource type is services,
  1171. // and the identifier is the cluster name and service name; for example, service/default/sample-webapp.
  1172. // For Amazon EC2 Spot fleet requests, the resource type is spot-fleet-request,
  1173. // and the identifier is the Spot fleet request ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  1174. //
  1175. // ResourceId is a required field
  1176. ResourceId *string `min:"1" type:"string" required:"true"`
  1177. // The ARN of the IAM role that allows Application Auto Scaling to modify your
  1178. // scalable target on your behalf. This parameter is required if you are registering
  1179. // a new scalable target, and it is optional if you are updating an existing
  1180. // one.
  1181. RoleARN *string `min:"1" type:"string"`
  1182. // The scalable dimension associated with the scalable target. The scalable
  1183. // dimension contains the service namespace, resource type, and scaling property,
  1184. // such as ecs:service:DesiredCount for the desired task count of an Amazon
  1185. // ECS service, or ec2:spot-fleet-request:TargetCapacity for the target capacity
  1186. // of an Amazon EC2 Spot fleet request.
  1187. //
  1188. // ScalableDimension is a required field
  1189. ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
  1190. // The namespace for the AWS service that the scalable target is associated
  1191. // with. For Amazon ECS services, the namespace value is ecs. For more information,
  1192. // see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  1193. // in the Amazon Web Services General Reference.
  1194. //
  1195. // ServiceNamespace is a required field
  1196. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  1197. }
  1198. // String returns the string representation
  1199. func (s RegisterScalableTargetInput) String() string {
  1200. return awsutil.Prettify(s)
  1201. }
  1202. // GoString returns the string representation
  1203. func (s RegisterScalableTargetInput) GoString() string {
  1204. return s.String()
  1205. }
  1206. // Validate inspects the fields of the type to determine if they are valid.
  1207. func (s *RegisterScalableTargetInput) Validate() error {
  1208. invalidParams := request.ErrInvalidParams{Context: "RegisterScalableTargetInput"}
  1209. if s.ResourceId == nil {
  1210. invalidParams.Add(request.NewErrParamRequired("ResourceId"))
  1211. }
  1212. if s.ResourceId != nil && len(*s.ResourceId) < 1 {
  1213. invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
  1214. }
  1215. if s.RoleARN != nil && len(*s.RoleARN) < 1 {
  1216. invalidParams.Add(request.NewErrParamMinLen("RoleARN", 1))
  1217. }
  1218. if s.ScalableDimension == nil {
  1219. invalidParams.Add(request.NewErrParamRequired("ScalableDimension"))
  1220. }
  1221. if s.ServiceNamespace == nil {
  1222. invalidParams.Add(request.NewErrParamRequired("ServiceNamespace"))
  1223. }
  1224. if invalidParams.Len() > 0 {
  1225. return invalidParams
  1226. }
  1227. return nil
  1228. }
  1229. type RegisterScalableTargetOutput struct {
  1230. _ struct{} `type:"structure"`
  1231. }
  1232. // String returns the string representation
  1233. func (s RegisterScalableTargetOutput) String() string {
  1234. return awsutil.Prettify(s)
  1235. }
  1236. // GoString returns the string representation
  1237. func (s RegisterScalableTargetOutput) GoString() string {
  1238. return s.String()
  1239. }
  1240. // An object representing a scalable target.
  1241. type ScalableTarget struct {
  1242. _ struct{} `type:"structure"`
  1243. // The Unix timestamp for when the scalable target was created.
  1244. //
  1245. // CreationTime is a required field
  1246. CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
  1247. // The maximum value for this scalable target to scale out to in response to
  1248. // scaling activities.
  1249. //
  1250. // MaxCapacity is a required field
  1251. MaxCapacity *int64 `type:"integer" required:"true"`
  1252. // The minimum value for this scalable target to scale in to in response to
  1253. // scaling activities.
  1254. //
  1255. // MinCapacity is a required field
  1256. MinCapacity *int64 `type:"integer" required:"true"`
  1257. // The resource type and unique identifier string for the resource associated
  1258. // with the scalable target. For Amazon ECS services, the resource type is services,
  1259. // and the identifier is the cluster name and service name; for example, service/default/sample-webapp.
  1260. // For Amazon EC2 Spot fleet requests, the resource type is spot-fleet-request,
  1261. // and the identifier is the Spot fleet request ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  1262. //
  1263. // ResourceId is a required field
  1264. ResourceId *string `min:"1" type:"string" required:"true"`
  1265. // The ARN of the IAM role that allows Application Auto Scaling to modify your
  1266. // scalable target on your behalf.
  1267. //
  1268. // RoleARN is a required field
  1269. RoleARN *string `min:"1" type:"string" required:"true"`
  1270. // The scalable dimension associated with the scalable target. The scalable
  1271. // dimension contains the service namespace, resource type, and scaling property,
  1272. // such as ecs:service:DesiredCount for the desired task count of an Amazon
  1273. // ECS service, or ec2:spot-fleet-request:TargetCapacity for the target capacity
  1274. // of an Amazon EC2 Spot fleet request.
  1275. //
  1276. // ScalableDimension is a required field
  1277. ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
  1278. // The namespace for the AWS service that the scalable target is associated
  1279. // with. For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  1280. // in the Amazon Web Services General Reference.
  1281. //
  1282. // ServiceNamespace is a required field
  1283. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  1284. }
  1285. // String returns the string representation
  1286. func (s ScalableTarget) String() string {
  1287. return awsutil.Prettify(s)
  1288. }
  1289. // GoString returns the string representation
  1290. func (s ScalableTarget) GoString() string {
  1291. return s.String()
  1292. }
  1293. // An object representing a scaling activity.
  1294. type ScalingActivity struct {
  1295. _ struct{} `type:"structure"`
  1296. // The unique identifier string for the scaling activity.
  1297. //
  1298. // ActivityId is a required field
  1299. ActivityId *string `type:"string" required:"true"`
  1300. // A simple description of what caused the scaling activity to happen.
  1301. //
  1302. // Cause is a required field
  1303. Cause *string `type:"string" required:"true"`
  1304. // A simple description of what action the scaling activity intends to accomplish.
  1305. //
  1306. // Description is a required field
  1307. Description *string `type:"string" required:"true"`
  1308. // The details about the scaling activity.
  1309. Details *string `type:"string"`
  1310. // The Unix timestamp for when the scaling activity ended.
  1311. EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  1312. // The resource type and unique identifier string for the resource associated
  1313. // with the scaling activity. For Amazon ECS services, the resource type is
  1314. // services, and the identifier is the cluster name and service name; for example,
  1315. // service/default/sample-webapp. For Amazon EC2 Spot fleet requests, the resource
  1316. // type is spot-fleet-request, and the identifier is the Spot fleet request
  1317. // ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  1318. //
  1319. // ResourceId is a required field
  1320. ResourceId *string `min:"1" type:"string" required:"true"`
  1321. // The scalable dimension associated with the scaling activity. The scalable
  1322. // dimension contains the service namespace, resource type, and scaling property,
  1323. // such as ecs:service:DesiredCount for the desired task count of an Amazon
  1324. // ECS service, or ec2:spot-fleet-request:TargetCapacity for the target capacity
  1325. // of an Amazon EC2 Spot fleet request.
  1326. //
  1327. // ScalableDimension is a required field
  1328. ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
  1329. // The namespace for the AWS service that the scaling activity is associated
  1330. // with. For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  1331. // in the Amazon Web Services General Reference.
  1332. //
  1333. // ServiceNamespace is a required field
  1334. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  1335. // The Unix timestamp for when the scaling activity began.
  1336. //
  1337. // StartTime is a required field
  1338. StartTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
  1339. // Indicates the status of the scaling activity.
  1340. //
  1341. // StatusCode is a required field
  1342. StatusCode *string `type:"string" required:"true" enum:"ScalingActivityStatusCode"`
  1343. // A simple message about the current status of the scaling activity.
  1344. StatusMessage *string `type:"string"`
  1345. }
  1346. // String returns the string representation
  1347. func (s ScalingActivity) String() string {
  1348. return awsutil.Prettify(s)
  1349. }
  1350. // GoString returns the string representation
  1351. func (s ScalingActivity) GoString() string {
  1352. return s.String()
  1353. }
  1354. // An object representing a scaling policy.
  1355. type ScalingPolicy struct {
  1356. _ struct{} `type:"structure"`
  1357. // The CloudWatch alarms that are associated with the scaling policy.
  1358. Alarms []*Alarm `type:"list"`
  1359. // The Unix timestamp for when the scaling policy was created.
  1360. //
  1361. // CreationTime is a required field
  1362. CreationTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
  1363. // The Amazon Resource Name (ARN) of the scaling policy.
  1364. //
  1365. // PolicyARN is a required field
  1366. PolicyARN *string `min:"1" type:"string" required:"true"`
  1367. // The name of the scaling policy.
  1368. //
  1369. // PolicyName is a required field
  1370. PolicyName *string `min:"1" type:"string" required:"true"`
  1371. // The scaling policy type.
  1372. //
  1373. // PolicyType is a required field
  1374. PolicyType *string `type:"string" required:"true" enum:"PolicyType"`
  1375. // The resource type and unique identifier string for the resource associated
  1376. // with the scaling policy. For Amazon ECS services, the resource type is services,
  1377. // and the identifier is the cluster name and service name; for example, service/default/sample-webapp.
  1378. // For Amazon EC2 Spot fleet requests, the resource type is spot-fleet-request,
  1379. // and the identifier is the Spot fleet request ID; for example, spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.
  1380. //
  1381. // ResourceId is a required field
  1382. ResourceId *string `min:"1" type:"string" required:"true"`
  1383. // The scalable dimension associated with the scaling policy. The scalable dimension
  1384. // contains the service namespace, resource type, and scaling property, such
  1385. // as ecs:service:DesiredCount for the desired task count of an Amazon ECS service,
  1386. // or ec2:spot-fleet-request:TargetCapacity for the target capacity of an Amazon
  1387. // EC2 Spot fleet request.
  1388. //
  1389. // ScalableDimension is a required field
  1390. ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"`
  1391. // The namespace for the AWS service that the scaling policy is associated with.
  1392. // For more information, see AWS Service Namespaces (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces)
  1393. // in the Amazon Web Services General Reference.
  1394. //
  1395. // ServiceNamespace is a required field
  1396. ServiceNamespace *string `type:"string" required:"true" enum:"ServiceNamespace"`
  1397. // The configuration for the step scaling policy.
  1398. StepScalingPolicyConfiguration *StepScalingPolicyConfiguration `type:"structure"`
  1399. }
  1400. // String returns the string representation
  1401. func (s ScalingPolicy) String() string {
  1402. return awsutil.Prettify(s)
  1403. }
  1404. // GoString returns the string representation
  1405. func (s ScalingPolicy) GoString() string {
  1406. return s.String()
  1407. }
  1408. // An object representing a step adjustment for a StepScalingPolicyConfiguration.
  1409. // Describes an adjustment based on the difference between the value of the
  1410. // aggregated CloudWatch metric and the breach threshold that you've defined
  1411. // for the alarm.
  1412. //
  1413. // For the following examples, suppose that you have an alarm with a breach
  1414. // threshold of 50:
  1415. //
  1416. // * If you want the adjustment to be triggered when the metric is greater
  1417. // than or equal to 50 and less than 60, specify a lower bound of 0 and an
  1418. // upper bound of 10.
  1419. //
  1420. // * If you want the adjustment to be triggered when the metric is greater
  1421. // than 40 and less than or equal to 50, specify a lower bound of -10 and
  1422. // an upper bound of 0.
  1423. //
  1424. // There are a few rules for the step adjustments for your step policy:
  1425. //
  1426. // * The ranges of your step adjustments can't overlap or have a gap.
  1427. //
  1428. // * At most one step adjustment can have a null lower bound. If one step
  1429. // adjustment has a negative lower bound, then there must be a step adjustment
  1430. // with a null lower bound.
  1431. //
  1432. // * At most one step adjustment can have a null upper bound. If one step
  1433. // adjustment has a positive upper bound, then there must be a step adjustment
  1434. // with a null upper bound.
  1435. //
  1436. // * The upper and lower bound can't be null in the same step adjustment.
  1437. type StepAdjustment struct {
  1438. _ struct{} `type:"structure"`
  1439. // The lower bound for the difference between the alarm threshold and the CloudWatch
  1440. // metric. If the metric value is above the breach threshold, the lower bound
  1441. // is inclusive (the metric must be greater than or equal to the threshold plus
  1442. // the lower bound). Otherwise, it is exclusive (the metric must be greater
  1443. // than the threshold plus the lower bound). A null value indicates negative
  1444. // infinity.
  1445. MetricIntervalLowerBound *float64 `type:"double"`
  1446. // The upper bound for the difference between the alarm threshold and the CloudWatch
  1447. // metric. If the metric value is above the breach threshold, the upper bound
  1448. // is exclusive (the metric must be less than the threshold plus the upper bound).
  1449. // Otherwise, it is inclusive (the metric must be less than or equal to the
  1450. // threshold plus the upper bound). A null value indicates positive infinity.
  1451. //
  1452. // The upper bound must be greater than the lower bound.
  1453. MetricIntervalUpperBound *float64 `type:"double"`
  1454. // The amount by which to scale, based on the specified adjustment type. A positive
  1455. // value adds to the current scalable dimension while a negative number removes
  1456. // from the current scalable dimension.
  1457. //
  1458. // ScalingAdjustment is a required field
  1459. ScalingAdjustment *int64 `type:"integer" required:"true"`
  1460. }
  1461. // String returns the string representation
  1462. func (s StepAdjustment) String() string {
  1463. return awsutil.Prettify(s)
  1464. }
  1465. // GoString returns the string representation
  1466. func (s StepAdjustment) GoString() string {
  1467. return s.String()
  1468. }
  1469. // Validate inspects the fields of the type to determine if they are valid.
  1470. func (s *StepAdjustment) Validate() error {
  1471. invalidParams := request.ErrInvalidParams{Context: "StepAdjustment"}
  1472. if s.ScalingAdjustment == nil {
  1473. invalidParams.Add(request.NewErrParamRequired("ScalingAdjustment"))
  1474. }
  1475. if invalidParams.Len() > 0 {
  1476. return invalidParams
  1477. }
  1478. return nil
  1479. }
  1480. // An object representing a step scaling policy configuration.
  1481. type StepScalingPolicyConfiguration struct {
  1482. _ struct{} `type:"structure"`
  1483. // The adjustment type, which specifies how the ScalingAdjustment parameter
  1484. // in a StepAdjustment is interpreted.
  1485. AdjustmentType *string `type:"string" enum:"AdjustmentType"`
  1486. // The amount of time, in seconds, after a scaling activity completes where
  1487. // previous trigger-related scaling activities can influence future scaling
  1488. // events.
  1489. //
  1490. // For scale out policies, while Cooldown is in effect, the capacity that has
  1491. // been added by the previous scale out event that initiated the Cooldown is
  1492. // calculated as part of the desired capacity for the next scale out. The intention
  1493. // is to continuously (but not excessively) scale out. For example, an alarm
  1494. // triggers a step scaling policy to scale out an Amazon ECS service by 2 tasks,
  1495. // the scaling activity completes successfully, and a Cooldown period of 5 minutes
  1496. // starts. During the Cooldown period, if the alarm triggers the same policy
  1497. // again but at a more aggressive step adjustment to scale out the service by
  1498. // 3 tasks, the 2 tasks that were added in the previous scale out event are
  1499. // considered part of that capacity and only 1 additional task is added to the
  1500. // desired count.
  1501. //
  1502. // For scale in policies, the Cooldown period is used to block subsequent scale
  1503. // in requests until it has expired. The intention is to scale in conservatively
  1504. // to protect your application's availability. However, if another alarm triggers
  1505. // a scale out policy during the Cooldown period after a scale-in, Application
  1506. // Auto Scaling scales out your scalable target immediately.
  1507. Cooldown *int64 `type:"integer"`
  1508. // The aggregation type for the CloudWatch metrics. Valid values are Minimum,
  1509. // Maximum, and Average.
  1510. MetricAggregationType *string `type:"string" enum:"MetricAggregationType"`
  1511. // The minimum number to adjust your scalable dimension as a result of a scaling
  1512. // activity. If the adjustment type is PercentChangeInCapacity, the scaling
  1513. // policy changes the scalable dimension of the scalable target by this amount.
  1514. MinAdjustmentMagnitude *int64 `type:"integer"`
  1515. // A set of adjustments that enable you to scale based on the size of the alarm
  1516. // breach.
  1517. StepAdjustments []*StepAdjustment `type:"list"`
  1518. }
  1519. // String returns the string representation
  1520. func (s StepScalingPolicyConfiguration) String() string {
  1521. return awsutil.Prettify(s)
  1522. }
  1523. // GoString returns the string representation
  1524. func (s StepScalingPolicyConfiguration) GoString() string {
  1525. return s.String()
  1526. }
  1527. // Validate inspects the fields of the type to determine if they are valid.
  1528. func (s *StepScalingPolicyConfiguration) Validate() error {
  1529. invalidParams := request.ErrInvalidParams{Context: "StepScalingPolicyConfiguration"}
  1530. if s.StepAdjustments != nil {
  1531. for i, v := range s.StepAdjustments {
  1532. if v == nil {
  1533. continue
  1534. }
  1535. if err := v.Validate(); err != nil {
  1536. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StepAdjustments", i), err.(request.ErrInvalidParams))
  1537. }
  1538. }
  1539. }
  1540. if invalidParams.Len() > 0 {
  1541. return invalidParams
  1542. }
  1543. return nil
  1544. }
  1545. const (
  1546. // AdjustmentTypeChangeInCapacity is a AdjustmentType enum value
  1547. AdjustmentTypeChangeInCapacity = "ChangeInCapacity"
  1548. // AdjustmentTypePercentChangeInCapacity is a AdjustmentType enum value
  1549. AdjustmentTypePercentChangeInCapacity = "PercentChangeInCapacity"
  1550. // AdjustmentTypeExactCapacity is a AdjustmentType enum value
  1551. AdjustmentTypeExactCapacity = "ExactCapacity"
  1552. )
  1553. const (
  1554. // MetricAggregationTypeAverage is a MetricAggregationType enum value
  1555. MetricAggregationTypeAverage = "Average"
  1556. // MetricAggregationTypeMinimum is a MetricAggregationType enum value
  1557. MetricAggregationTypeMinimum = "Minimum"
  1558. // MetricAggregationTypeMaximum is a MetricAggregationType enum value
  1559. MetricAggregationTypeMaximum = "Maximum"
  1560. )
  1561. const (
  1562. // PolicyTypeStepScaling is a PolicyType enum value
  1563. PolicyTypeStepScaling = "StepScaling"
  1564. )
  1565. const (
  1566. // ScalableDimensionEcsServiceDesiredCount is a ScalableDimension enum value
  1567. ScalableDimensionEcsServiceDesiredCount = "ecs:service:DesiredCount"
  1568. // ScalableDimensionEc2SpotFleetRequestTargetCapacity is a ScalableDimension enum value
  1569. ScalableDimensionEc2SpotFleetRequestTargetCapacity = "ec2:spot-fleet-request:TargetCapacity"
  1570. )
  1571. const (
  1572. // ScalingActivityStatusCodePending is a ScalingActivityStatusCode enum value
  1573. ScalingActivityStatusCodePending = "Pending"
  1574. // ScalingActivityStatusCodeInProgress is a ScalingActivityStatusCode enum value
  1575. ScalingActivityStatusCodeInProgress = "InProgress"
  1576. // ScalingActivityStatusCodeSuccessful is a ScalingActivityStatusCode enum value
  1577. ScalingActivityStatusCodeSuccessful = "Successful"
  1578. // ScalingActivityStatusCodeOverridden is a ScalingActivityStatusCode enum value
  1579. ScalingActivityStatusCodeOverridden = "Overridden"
  1580. // ScalingActivityStatusCodeUnfulfilled is a ScalingActivityStatusCode enum value
  1581. ScalingActivityStatusCodeUnfulfilled = "Unfulfilled"
  1582. // ScalingActivityStatusCodeFailed is a ScalingActivityStatusCode enum value
  1583. ScalingActivityStatusCodeFailed = "Failed"
  1584. )
  1585. const (
  1586. // ServiceNamespaceEcs is a ServiceNamespace enum value
  1587. ServiceNamespaceEcs = "ecs"
  1588. // ServiceNamespaceEc2 is a ServiceNamespace enum value
  1589. ServiceNamespaceEc2 = "ec2"
  1590. )