api.go 56 KB

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