examples_test.go 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elasticbeanstalk_test
  3. import (
  4. "bytes"
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws"
  8. "github.com/aws/aws-sdk-go/service/elasticbeanstalk"
  9. )
  10. var _ time.Duration
  11. var _ bytes.Buffer
  12. func ExampleElasticBeanstalk_AbortEnvironmentUpdate() {
  13. svc := elasticbeanstalk.New(nil)
  14. params := &elasticbeanstalk.AbortEnvironmentUpdateInput{
  15. EnvironmentId: aws.String("EnvironmentId"),
  16. EnvironmentName: aws.String("EnvironmentName"),
  17. }
  18. resp, err := svc.AbortEnvironmentUpdate(params)
  19. if err != nil {
  20. // Print the error, cast err to awserr.Error to get the Code and
  21. // Message from an error.
  22. fmt.Println(err.Error())
  23. return
  24. }
  25. // Pretty-print the response data.
  26. fmt.Println(resp)
  27. }
  28. func ExampleElasticBeanstalk_CheckDNSAvailability() {
  29. svc := elasticbeanstalk.New(nil)
  30. params := &elasticbeanstalk.CheckDNSAvailabilityInput{
  31. CNAMEPrefix: aws.String("DNSCnamePrefix"), // Required
  32. }
  33. resp, err := svc.CheckDNSAvailability(params)
  34. if err != nil {
  35. // Print the error, cast err to awserr.Error to get the Code and
  36. // Message from an error.
  37. fmt.Println(err.Error())
  38. return
  39. }
  40. // Pretty-print the response data.
  41. fmt.Println(resp)
  42. }
  43. func ExampleElasticBeanstalk_CreateApplication() {
  44. svc := elasticbeanstalk.New(nil)
  45. params := &elasticbeanstalk.CreateApplicationInput{
  46. ApplicationName: aws.String("ApplicationName"), // Required
  47. Description: aws.String("Description"),
  48. }
  49. resp, err := svc.CreateApplication(params)
  50. if err != nil {
  51. // Print the error, cast err to awserr.Error to get the Code and
  52. // Message from an error.
  53. fmt.Println(err.Error())
  54. return
  55. }
  56. // Pretty-print the response data.
  57. fmt.Println(resp)
  58. }
  59. func ExampleElasticBeanstalk_CreateApplicationVersion() {
  60. svc := elasticbeanstalk.New(nil)
  61. params := &elasticbeanstalk.CreateApplicationVersionInput{
  62. ApplicationName: aws.String("ApplicationName"), // Required
  63. VersionLabel: aws.String("VersionLabel"), // Required
  64. AutoCreateApplication: aws.Bool(true),
  65. Description: aws.String("Description"),
  66. SourceBundle: &elasticbeanstalk.S3Location{
  67. S3Bucket: aws.String("S3Bucket"),
  68. S3Key: aws.String("S3Key"),
  69. },
  70. }
  71. resp, err := svc.CreateApplicationVersion(params)
  72. if err != nil {
  73. // Print the error, cast err to awserr.Error to get the Code and
  74. // Message from an error.
  75. fmt.Println(err.Error())
  76. return
  77. }
  78. // Pretty-print the response data.
  79. fmt.Println(resp)
  80. }
  81. func ExampleElasticBeanstalk_CreateConfigurationTemplate() {
  82. svc := elasticbeanstalk.New(nil)
  83. params := &elasticbeanstalk.CreateConfigurationTemplateInput{
  84. ApplicationName: aws.String("ApplicationName"), // Required
  85. TemplateName: aws.String("ConfigurationTemplateName"), // Required
  86. Description: aws.String("Description"),
  87. EnvironmentId: aws.String("EnvironmentId"),
  88. OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{
  89. { // Required
  90. Namespace: aws.String("OptionNamespace"),
  91. OptionName: aws.String("ConfigurationOptionName"),
  92. ResourceName: aws.String("ResourceName"),
  93. Value: aws.String("ConfigurationOptionValue"),
  94. },
  95. // More values...
  96. },
  97. SolutionStackName: aws.String("SolutionStackName"),
  98. SourceConfiguration: &elasticbeanstalk.SourceConfiguration{
  99. ApplicationName: aws.String("ApplicationName"),
  100. TemplateName: aws.String("ConfigurationTemplateName"),
  101. },
  102. }
  103. resp, err := svc.CreateConfigurationTemplate(params)
  104. if err != nil {
  105. // Print the error, cast err to awserr.Error to get the Code and
  106. // Message from an error.
  107. fmt.Println(err.Error())
  108. return
  109. }
  110. // Pretty-print the response data.
  111. fmt.Println(resp)
  112. }
  113. func ExampleElasticBeanstalk_CreateEnvironment() {
  114. svc := elasticbeanstalk.New(nil)
  115. params := &elasticbeanstalk.CreateEnvironmentInput{
  116. ApplicationName: aws.String("ApplicationName"), // Required
  117. EnvironmentName: aws.String("EnvironmentName"), // Required
  118. CNAMEPrefix: aws.String("DNSCnamePrefix"),
  119. Description: aws.String("Description"),
  120. OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{
  121. { // Required
  122. Namespace: aws.String("OptionNamespace"),
  123. OptionName: aws.String("ConfigurationOptionName"),
  124. ResourceName: aws.String("ResourceName"),
  125. Value: aws.String("ConfigurationOptionValue"),
  126. },
  127. // More values...
  128. },
  129. OptionsToRemove: []*elasticbeanstalk.OptionSpecification{
  130. { // Required
  131. Namespace: aws.String("OptionNamespace"),
  132. OptionName: aws.String("ConfigurationOptionName"),
  133. ResourceName: aws.String("ResourceName"),
  134. },
  135. // More values...
  136. },
  137. SolutionStackName: aws.String("SolutionStackName"),
  138. Tags: []*elasticbeanstalk.Tag{
  139. { // Required
  140. Key: aws.String("TagKey"),
  141. Value: aws.String("TagValue"),
  142. },
  143. // More values...
  144. },
  145. TemplateName: aws.String("ConfigurationTemplateName"),
  146. Tier: &elasticbeanstalk.EnvironmentTier{
  147. Name: aws.String("String"),
  148. Type: aws.String("String"),
  149. Version: aws.String("String"),
  150. },
  151. VersionLabel: aws.String("VersionLabel"),
  152. }
  153. resp, err := svc.CreateEnvironment(params)
  154. if err != nil {
  155. // Print the error, cast err to awserr.Error to get the Code and
  156. // Message from an error.
  157. fmt.Println(err.Error())
  158. return
  159. }
  160. // Pretty-print the response data.
  161. fmt.Println(resp)
  162. }
  163. func ExampleElasticBeanstalk_CreateStorageLocation() {
  164. svc := elasticbeanstalk.New(nil)
  165. var params *elasticbeanstalk.CreateStorageLocationInput
  166. resp, err := svc.CreateStorageLocation(params)
  167. if err != nil {
  168. // Print the error, cast err to awserr.Error to get the Code and
  169. // Message from an error.
  170. fmt.Println(err.Error())
  171. return
  172. }
  173. // Pretty-print the response data.
  174. fmt.Println(resp)
  175. }
  176. func ExampleElasticBeanstalk_DeleteApplication() {
  177. svc := elasticbeanstalk.New(nil)
  178. params := &elasticbeanstalk.DeleteApplicationInput{
  179. ApplicationName: aws.String("ApplicationName"), // Required
  180. TerminateEnvByForce: aws.Bool(true),
  181. }
  182. resp, err := svc.DeleteApplication(params)
  183. if err != nil {
  184. // Print the error, cast err to awserr.Error to get the Code and
  185. // Message from an error.
  186. fmt.Println(err.Error())
  187. return
  188. }
  189. // Pretty-print the response data.
  190. fmt.Println(resp)
  191. }
  192. func ExampleElasticBeanstalk_DeleteApplicationVersion() {
  193. svc := elasticbeanstalk.New(nil)
  194. params := &elasticbeanstalk.DeleteApplicationVersionInput{
  195. ApplicationName: aws.String("ApplicationName"), // Required
  196. VersionLabel: aws.String("VersionLabel"), // Required
  197. DeleteSourceBundle: aws.Bool(true),
  198. }
  199. resp, err := svc.DeleteApplicationVersion(params)
  200. if err != nil {
  201. // Print the error, cast err to awserr.Error to get the Code and
  202. // Message from an error.
  203. fmt.Println(err.Error())
  204. return
  205. }
  206. // Pretty-print the response data.
  207. fmt.Println(resp)
  208. }
  209. func ExampleElasticBeanstalk_DeleteConfigurationTemplate() {
  210. svc := elasticbeanstalk.New(nil)
  211. params := &elasticbeanstalk.DeleteConfigurationTemplateInput{
  212. ApplicationName: aws.String("ApplicationName"), // Required
  213. TemplateName: aws.String("ConfigurationTemplateName"), // Required
  214. }
  215. resp, err := svc.DeleteConfigurationTemplate(params)
  216. if err != nil {
  217. // Print the error, cast err to awserr.Error to get the Code and
  218. // Message from an error.
  219. fmt.Println(err.Error())
  220. return
  221. }
  222. // Pretty-print the response data.
  223. fmt.Println(resp)
  224. }
  225. func ExampleElasticBeanstalk_DeleteEnvironmentConfiguration() {
  226. svc := elasticbeanstalk.New(nil)
  227. params := &elasticbeanstalk.DeleteEnvironmentConfigurationInput{
  228. ApplicationName: aws.String("ApplicationName"), // Required
  229. EnvironmentName: aws.String("EnvironmentName"), // Required
  230. }
  231. resp, err := svc.DeleteEnvironmentConfiguration(params)
  232. if err != nil {
  233. // Print the error, cast err to awserr.Error to get the Code and
  234. // Message from an error.
  235. fmt.Println(err.Error())
  236. return
  237. }
  238. // Pretty-print the response data.
  239. fmt.Println(resp)
  240. }
  241. func ExampleElasticBeanstalk_DescribeApplicationVersions() {
  242. svc := elasticbeanstalk.New(nil)
  243. params := &elasticbeanstalk.DescribeApplicationVersionsInput{
  244. ApplicationName: aws.String("ApplicationName"),
  245. VersionLabels: []*string{
  246. aws.String("VersionLabel"), // Required
  247. // More values...
  248. },
  249. }
  250. resp, err := svc.DescribeApplicationVersions(params)
  251. if err != nil {
  252. // Print the error, cast err to awserr.Error to get the Code and
  253. // Message from an error.
  254. fmt.Println(err.Error())
  255. return
  256. }
  257. // Pretty-print the response data.
  258. fmt.Println(resp)
  259. }
  260. func ExampleElasticBeanstalk_DescribeApplications() {
  261. svc := elasticbeanstalk.New(nil)
  262. params := &elasticbeanstalk.DescribeApplicationsInput{
  263. ApplicationNames: []*string{
  264. aws.String("ApplicationName"), // Required
  265. // More values...
  266. },
  267. }
  268. resp, err := svc.DescribeApplications(params)
  269. if err != nil {
  270. // Print the error, cast err to awserr.Error to get the Code and
  271. // Message from an error.
  272. fmt.Println(err.Error())
  273. return
  274. }
  275. // Pretty-print the response data.
  276. fmt.Println(resp)
  277. }
  278. func ExampleElasticBeanstalk_DescribeConfigurationOptions() {
  279. svc := elasticbeanstalk.New(nil)
  280. params := &elasticbeanstalk.DescribeConfigurationOptionsInput{
  281. ApplicationName: aws.String("ApplicationName"),
  282. EnvironmentName: aws.String("EnvironmentName"),
  283. Options: []*elasticbeanstalk.OptionSpecification{
  284. { // Required
  285. Namespace: aws.String("OptionNamespace"),
  286. OptionName: aws.String("ConfigurationOptionName"),
  287. ResourceName: aws.String("ResourceName"),
  288. },
  289. // More values...
  290. },
  291. SolutionStackName: aws.String("SolutionStackName"),
  292. TemplateName: aws.String("ConfigurationTemplateName"),
  293. }
  294. resp, err := svc.DescribeConfigurationOptions(params)
  295. if err != nil {
  296. // Print the error, cast err to awserr.Error to get the Code and
  297. // Message from an error.
  298. fmt.Println(err.Error())
  299. return
  300. }
  301. // Pretty-print the response data.
  302. fmt.Println(resp)
  303. }
  304. func ExampleElasticBeanstalk_DescribeConfigurationSettings() {
  305. svc := elasticbeanstalk.New(nil)
  306. params := &elasticbeanstalk.DescribeConfigurationSettingsInput{
  307. ApplicationName: aws.String("ApplicationName"), // Required
  308. EnvironmentName: aws.String("EnvironmentName"),
  309. TemplateName: aws.String("ConfigurationTemplateName"),
  310. }
  311. resp, err := svc.DescribeConfigurationSettings(params)
  312. if err != nil {
  313. // Print the error, cast err to awserr.Error to get the Code and
  314. // Message from an error.
  315. fmt.Println(err.Error())
  316. return
  317. }
  318. // Pretty-print the response data.
  319. fmt.Println(resp)
  320. }
  321. func ExampleElasticBeanstalk_DescribeEnvironmentHealth() {
  322. svc := elasticbeanstalk.New(nil)
  323. params := &elasticbeanstalk.DescribeEnvironmentHealthInput{
  324. AttributeNames: []*string{
  325. aws.String("EnvironmentHealthAttribute"), // Required
  326. // More values...
  327. },
  328. EnvironmentId: aws.String("EnvironmentId"),
  329. EnvironmentName: aws.String("EnvironmentName"),
  330. }
  331. resp, err := svc.DescribeEnvironmentHealth(params)
  332. if err != nil {
  333. // Print the error, cast err to awserr.Error to get the Code and
  334. // Message from an error.
  335. fmt.Println(err.Error())
  336. return
  337. }
  338. // Pretty-print the response data.
  339. fmt.Println(resp)
  340. }
  341. func ExampleElasticBeanstalk_DescribeEnvironmentResources() {
  342. svc := elasticbeanstalk.New(nil)
  343. params := &elasticbeanstalk.DescribeEnvironmentResourcesInput{
  344. EnvironmentId: aws.String("EnvironmentId"),
  345. EnvironmentName: aws.String("EnvironmentName"),
  346. }
  347. resp, err := svc.DescribeEnvironmentResources(params)
  348. if err != nil {
  349. // Print the error, cast err to awserr.Error to get the Code and
  350. // Message from an error.
  351. fmt.Println(err.Error())
  352. return
  353. }
  354. // Pretty-print the response data.
  355. fmt.Println(resp)
  356. }
  357. func ExampleElasticBeanstalk_DescribeEnvironments() {
  358. svc := elasticbeanstalk.New(nil)
  359. params := &elasticbeanstalk.DescribeEnvironmentsInput{
  360. ApplicationName: aws.String("ApplicationName"),
  361. EnvironmentIds: []*string{
  362. aws.String("EnvironmentId"), // Required
  363. // More values...
  364. },
  365. EnvironmentNames: []*string{
  366. aws.String("EnvironmentName"), // Required
  367. // More values...
  368. },
  369. IncludeDeleted: aws.Bool(true),
  370. IncludedDeletedBackTo: aws.Time(time.Now()),
  371. VersionLabel: aws.String("VersionLabel"),
  372. }
  373. resp, err := svc.DescribeEnvironments(params)
  374. if err != nil {
  375. // Print the error, cast err to awserr.Error to get the Code and
  376. // Message from an error.
  377. fmt.Println(err.Error())
  378. return
  379. }
  380. // Pretty-print the response data.
  381. fmt.Println(resp)
  382. }
  383. func ExampleElasticBeanstalk_DescribeEvents() {
  384. svc := elasticbeanstalk.New(nil)
  385. params := &elasticbeanstalk.DescribeEventsInput{
  386. ApplicationName: aws.String("ApplicationName"),
  387. EndTime: aws.Time(time.Now()),
  388. EnvironmentId: aws.String("EnvironmentId"),
  389. EnvironmentName: aws.String("EnvironmentName"),
  390. MaxRecords: aws.Int64(1),
  391. NextToken: aws.String("Token"),
  392. RequestId: aws.String("RequestId"),
  393. Severity: aws.String("EventSeverity"),
  394. StartTime: aws.Time(time.Now()),
  395. TemplateName: aws.String("ConfigurationTemplateName"),
  396. VersionLabel: aws.String("VersionLabel"),
  397. }
  398. resp, err := svc.DescribeEvents(params)
  399. if err != nil {
  400. // Print the error, cast err to awserr.Error to get the Code and
  401. // Message from an error.
  402. fmt.Println(err.Error())
  403. return
  404. }
  405. // Pretty-print the response data.
  406. fmt.Println(resp)
  407. }
  408. func ExampleElasticBeanstalk_DescribeInstancesHealth() {
  409. svc := elasticbeanstalk.New(nil)
  410. params := &elasticbeanstalk.DescribeInstancesHealthInput{
  411. AttributeNames: []*string{
  412. aws.String("InstancesHealthAttribute"), // Required
  413. // More values...
  414. },
  415. EnvironmentId: aws.String("EnvironmentId"),
  416. EnvironmentName: aws.String("EnvironmentName"),
  417. NextToken: aws.String("NextToken"),
  418. }
  419. resp, err := svc.DescribeInstancesHealth(params)
  420. if err != nil {
  421. // Print the error, cast err to awserr.Error to get the Code and
  422. // Message from an error.
  423. fmt.Println(err.Error())
  424. return
  425. }
  426. // Pretty-print the response data.
  427. fmt.Println(resp)
  428. }
  429. func ExampleElasticBeanstalk_ListAvailableSolutionStacks() {
  430. svc := elasticbeanstalk.New(nil)
  431. var params *elasticbeanstalk.ListAvailableSolutionStacksInput
  432. resp, err := svc.ListAvailableSolutionStacks(params)
  433. if err != nil {
  434. // Print the error, cast err to awserr.Error to get the Code and
  435. // Message from an error.
  436. fmt.Println(err.Error())
  437. return
  438. }
  439. // Pretty-print the response data.
  440. fmt.Println(resp)
  441. }
  442. func ExampleElasticBeanstalk_RebuildEnvironment() {
  443. svc := elasticbeanstalk.New(nil)
  444. params := &elasticbeanstalk.RebuildEnvironmentInput{
  445. EnvironmentId: aws.String("EnvironmentId"),
  446. EnvironmentName: aws.String("EnvironmentName"),
  447. }
  448. resp, err := svc.RebuildEnvironment(params)
  449. if err != nil {
  450. // Print the error, cast err to awserr.Error to get the Code and
  451. // Message from an error.
  452. fmt.Println(err.Error())
  453. return
  454. }
  455. // Pretty-print the response data.
  456. fmt.Println(resp)
  457. }
  458. func ExampleElasticBeanstalk_RequestEnvironmentInfo() {
  459. svc := elasticbeanstalk.New(nil)
  460. params := &elasticbeanstalk.RequestEnvironmentInfoInput{
  461. InfoType: aws.String("EnvironmentInfoType"), // Required
  462. EnvironmentId: aws.String("EnvironmentId"),
  463. EnvironmentName: aws.String("EnvironmentName"),
  464. }
  465. resp, err := svc.RequestEnvironmentInfo(params)
  466. if err != nil {
  467. // Print the error, cast err to awserr.Error to get the Code and
  468. // Message from an error.
  469. fmt.Println(err.Error())
  470. return
  471. }
  472. // Pretty-print the response data.
  473. fmt.Println(resp)
  474. }
  475. func ExampleElasticBeanstalk_RestartAppServer() {
  476. svc := elasticbeanstalk.New(nil)
  477. params := &elasticbeanstalk.RestartAppServerInput{
  478. EnvironmentId: aws.String("EnvironmentId"),
  479. EnvironmentName: aws.String("EnvironmentName"),
  480. }
  481. resp, err := svc.RestartAppServer(params)
  482. if err != nil {
  483. // Print the error, cast err to awserr.Error to get the Code and
  484. // Message from an error.
  485. fmt.Println(err.Error())
  486. return
  487. }
  488. // Pretty-print the response data.
  489. fmt.Println(resp)
  490. }
  491. func ExampleElasticBeanstalk_RetrieveEnvironmentInfo() {
  492. svc := elasticbeanstalk.New(nil)
  493. params := &elasticbeanstalk.RetrieveEnvironmentInfoInput{
  494. InfoType: aws.String("EnvironmentInfoType"), // Required
  495. EnvironmentId: aws.String("EnvironmentId"),
  496. EnvironmentName: aws.String("EnvironmentName"),
  497. }
  498. resp, err := svc.RetrieveEnvironmentInfo(params)
  499. if err != nil {
  500. // Print the error, cast err to awserr.Error to get the Code and
  501. // Message from an error.
  502. fmt.Println(err.Error())
  503. return
  504. }
  505. // Pretty-print the response data.
  506. fmt.Println(resp)
  507. }
  508. func ExampleElasticBeanstalk_SwapEnvironmentCNAMEs() {
  509. svc := elasticbeanstalk.New(nil)
  510. params := &elasticbeanstalk.SwapEnvironmentCNAMEsInput{
  511. DestinationEnvironmentId: aws.String("EnvironmentId"),
  512. DestinationEnvironmentName: aws.String("EnvironmentName"),
  513. SourceEnvironmentId: aws.String("EnvironmentId"),
  514. SourceEnvironmentName: aws.String("EnvironmentName"),
  515. }
  516. resp, err := svc.SwapEnvironmentCNAMEs(params)
  517. if err != nil {
  518. // Print the error, cast err to awserr.Error to get the Code and
  519. // Message from an error.
  520. fmt.Println(err.Error())
  521. return
  522. }
  523. // Pretty-print the response data.
  524. fmt.Println(resp)
  525. }
  526. func ExampleElasticBeanstalk_TerminateEnvironment() {
  527. svc := elasticbeanstalk.New(nil)
  528. params := &elasticbeanstalk.TerminateEnvironmentInput{
  529. EnvironmentId: aws.String("EnvironmentId"),
  530. EnvironmentName: aws.String("EnvironmentName"),
  531. TerminateResources: aws.Bool(true),
  532. }
  533. resp, err := svc.TerminateEnvironment(params)
  534. if err != nil {
  535. // Print the error, cast err to awserr.Error to get the Code and
  536. // Message from an error.
  537. fmt.Println(err.Error())
  538. return
  539. }
  540. // Pretty-print the response data.
  541. fmt.Println(resp)
  542. }
  543. func ExampleElasticBeanstalk_UpdateApplication() {
  544. svc := elasticbeanstalk.New(nil)
  545. params := &elasticbeanstalk.UpdateApplicationInput{
  546. ApplicationName: aws.String("ApplicationName"), // Required
  547. Description: aws.String("Description"),
  548. }
  549. resp, err := svc.UpdateApplication(params)
  550. if err != nil {
  551. // Print the error, cast err to awserr.Error to get the Code and
  552. // Message from an error.
  553. fmt.Println(err.Error())
  554. return
  555. }
  556. // Pretty-print the response data.
  557. fmt.Println(resp)
  558. }
  559. func ExampleElasticBeanstalk_UpdateApplicationVersion() {
  560. svc := elasticbeanstalk.New(nil)
  561. params := &elasticbeanstalk.UpdateApplicationVersionInput{
  562. ApplicationName: aws.String("ApplicationName"), // Required
  563. VersionLabel: aws.String("VersionLabel"), // Required
  564. Description: aws.String("Description"),
  565. }
  566. resp, err := svc.UpdateApplicationVersion(params)
  567. if err != nil {
  568. // Print the error, cast err to awserr.Error to get the Code and
  569. // Message from an error.
  570. fmt.Println(err.Error())
  571. return
  572. }
  573. // Pretty-print the response data.
  574. fmt.Println(resp)
  575. }
  576. func ExampleElasticBeanstalk_UpdateConfigurationTemplate() {
  577. svc := elasticbeanstalk.New(nil)
  578. params := &elasticbeanstalk.UpdateConfigurationTemplateInput{
  579. ApplicationName: aws.String("ApplicationName"), // Required
  580. TemplateName: aws.String("ConfigurationTemplateName"), // Required
  581. Description: aws.String("Description"),
  582. OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{
  583. { // Required
  584. Namespace: aws.String("OptionNamespace"),
  585. OptionName: aws.String("ConfigurationOptionName"),
  586. ResourceName: aws.String("ResourceName"),
  587. Value: aws.String("ConfigurationOptionValue"),
  588. },
  589. // More values...
  590. },
  591. OptionsToRemove: []*elasticbeanstalk.OptionSpecification{
  592. { // Required
  593. Namespace: aws.String("OptionNamespace"),
  594. OptionName: aws.String("ConfigurationOptionName"),
  595. ResourceName: aws.String("ResourceName"),
  596. },
  597. // More values...
  598. },
  599. }
  600. resp, err := svc.UpdateConfigurationTemplate(params)
  601. if err != nil {
  602. // Print the error, cast err to awserr.Error to get the Code and
  603. // Message from an error.
  604. fmt.Println(err.Error())
  605. return
  606. }
  607. // Pretty-print the response data.
  608. fmt.Println(resp)
  609. }
  610. func ExampleElasticBeanstalk_UpdateEnvironment() {
  611. svc := elasticbeanstalk.New(nil)
  612. params := &elasticbeanstalk.UpdateEnvironmentInput{
  613. Description: aws.String("Description"),
  614. EnvironmentId: aws.String("EnvironmentId"),
  615. EnvironmentName: aws.String("EnvironmentName"),
  616. OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{
  617. { // Required
  618. Namespace: aws.String("OptionNamespace"),
  619. OptionName: aws.String("ConfigurationOptionName"),
  620. ResourceName: aws.String("ResourceName"),
  621. Value: aws.String("ConfigurationOptionValue"),
  622. },
  623. // More values...
  624. },
  625. OptionsToRemove: []*elasticbeanstalk.OptionSpecification{
  626. { // Required
  627. Namespace: aws.String("OptionNamespace"),
  628. OptionName: aws.String("ConfigurationOptionName"),
  629. ResourceName: aws.String("ResourceName"),
  630. },
  631. // More values...
  632. },
  633. SolutionStackName: aws.String("SolutionStackName"),
  634. TemplateName: aws.String("ConfigurationTemplateName"),
  635. Tier: &elasticbeanstalk.EnvironmentTier{
  636. Name: aws.String("String"),
  637. Type: aws.String("String"),
  638. Version: aws.String("String"),
  639. },
  640. VersionLabel: aws.String("VersionLabel"),
  641. }
  642. resp, err := svc.UpdateEnvironment(params)
  643. if err != nil {
  644. // Print the error, cast err to awserr.Error to get the Code and
  645. // Message from an error.
  646. fmt.Println(err.Error())
  647. return
  648. }
  649. // Pretty-print the response data.
  650. fmt.Println(resp)
  651. }
  652. func ExampleElasticBeanstalk_ValidateConfigurationSettings() {
  653. svc := elasticbeanstalk.New(nil)
  654. params := &elasticbeanstalk.ValidateConfigurationSettingsInput{
  655. ApplicationName: aws.String("ApplicationName"), // Required
  656. OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{ // Required
  657. { // Required
  658. Namespace: aws.String("OptionNamespace"),
  659. OptionName: aws.String("ConfigurationOptionName"),
  660. ResourceName: aws.String("ResourceName"),
  661. Value: aws.String("ConfigurationOptionValue"),
  662. },
  663. // More values...
  664. },
  665. EnvironmentName: aws.String("EnvironmentName"),
  666. TemplateName: aws.String("ConfigurationTemplateName"),
  667. }
  668. resp, err := svc.ValidateConfigurationSettings(params)
  669. if err != nil {
  670. // Print the error, cast err to awserr.Error to get the Code and
  671. // Message from an error.
  672. fmt.Println(err.Error())
  673. return
  674. }
  675. // Pretty-print the response data.
  676. fmt.Println(resp)
  677. }