examples_test.go 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package redshift_test
  3. import (
  4. "bytes"
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws"
  8. "github.com/aws/aws-sdk-go/aws/session"
  9. "github.com/aws/aws-sdk-go/service/redshift"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleRedshift_AuthorizeClusterSecurityGroupIngress() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := redshift.New(sess)
  20. params := &redshift.AuthorizeClusterSecurityGroupIngressInput{
  21. ClusterSecurityGroupName: aws.String("String"), // Required
  22. CIDRIP: aws.String("String"),
  23. EC2SecurityGroupName: aws.String("String"),
  24. EC2SecurityGroupOwnerId: aws.String("String"),
  25. }
  26. resp, err := svc.AuthorizeClusterSecurityGroupIngress(params)
  27. if err != nil {
  28. // Print the error, cast err to awserr.Error to get the Code and
  29. // Message from an error.
  30. fmt.Println(err.Error())
  31. return
  32. }
  33. // Pretty-print the response data.
  34. fmt.Println(resp)
  35. }
  36. func ExampleRedshift_AuthorizeSnapshotAccess() {
  37. sess, err := session.NewSession()
  38. if err != nil {
  39. fmt.Println("failed to create session,", err)
  40. return
  41. }
  42. svc := redshift.New(sess)
  43. params := &redshift.AuthorizeSnapshotAccessInput{
  44. AccountWithRestoreAccess: aws.String("String"), // Required
  45. SnapshotIdentifier: aws.String("String"), // Required
  46. SnapshotClusterIdentifier: aws.String("String"),
  47. }
  48. resp, err := svc.AuthorizeSnapshotAccess(params)
  49. if err != nil {
  50. // Print the error, cast err to awserr.Error to get the Code and
  51. // Message from an error.
  52. fmt.Println(err.Error())
  53. return
  54. }
  55. // Pretty-print the response data.
  56. fmt.Println(resp)
  57. }
  58. func ExampleRedshift_CopyClusterSnapshot() {
  59. sess, err := session.NewSession()
  60. if err != nil {
  61. fmt.Println("failed to create session,", err)
  62. return
  63. }
  64. svc := redshift.New(sess)
  65. params := &redshift.CopyClusterSnapshotInput{
  66. SourceSnapshotIdentifier: aws.String("String"), // Required
  67. TargetSnapshotIdentifier: aws.String("String"), // Required
  68. SourceSnapshotClusterIdentifier: aws.String("String"),
  69. }
  70. resp, err := svc.CopyClusterSnapshot(params)
  71. if err != nil {
  72. // Print the error, cast err to awserr.Error to get the Code and
  73. // Message from an error.
  74. fmt.Println(err.Error())
  75. return
  76. }
  77. // Pretty-print the response data.
  78. fmt.Println(resp)
  79. }
  80. func ExampleRedshift_CreateCluster() {
  81. sess, err := session.NewSession()
  82. if err != nil {
  83. fmt.Println("failed to create session,", err)
  84. return
  85. }
  86. svc := redshift.New(sess)
  87. params := &redshift.CreateClusterInput{
  88. ClusterIdentifier: aws.String("String"), // Required
  89. MasterUserPassword: aws.String("String"), // Required
  90. MasterUsername: aws.String("String"), // Required
  91. NodeType: aws.String("String"), // Required
  92. AdditionalInfo: aws.String("String"),
  93. AllowVersionUpgrade: aws.Bool(true),
  94. AutomatedSnapshotRetentionPeriod: aws.Int64(1),
  95. AvailabilityZone: aws.String("String"),
  96. ClusterParameterGroupName: aws.String("String"),
  97. ClusterSecurityGroups: []*string{
  98. aws.String("String"), // Required
  99. // More values...
  100. },
  101. ClusterSubnetGroupName: aws.String("String"),
  102. ClusterType: aws.String("String"),
  103. ClusterVersion: aws.String("String"),
  104. DBName: aws.String("String"),
  105. ElasticIp: aws.String("String"),
  106. Encrypted: aws.Bool(true),
  107. EnhancedVpcRouting: aws.Bool(true),
  108. HsmClientCertificateIdentifier: aws.String("String"),
  109. HsmConfigurationIdentifier: aws.String("String"),
  110. IamRoles: []*string{
  111. aws.String("String"), // Required
  112. // More values...
  113. },
  114. KmsKeyId: aws.String("String"),
  115. NumberOfNodes: aws.Int64(1),
  116. Port: aws.Int64(1),
  117. PreferredMaintenanceWindow: aws.String("String"),
  118. PubliclyAccessible: aws.Bool(true),
  119. Tags: []*redshift.Tag{
  120. { // Required
  121. Key: aws.String("String"),
  122. Value: aws.String("String"),
  123. },
  124. // More values...
  125. },
  126. VpcSecurityGroupIds: []*string{
  127. aws.String("String"), // Required
  128. // More values...
  129. },
  130. }
  131. resp, err := svc.CreateCluster(params)
  132. if err != nil {
  133. // Print the error, cast err to awserr.Error to get the Code and
  134. // Message from an error.
  135. fmt.Println(err.Error())
  136. return
  137. }
  138. // Pretty-print the response data.
  139. fmt.Println(resp)
  140. }
  141. func ExampleRedshift_CreateClusterParameterGroup() {
  142. sess, err := session.NewSession()
  143. if err != nil {
  144. fmt.Println("failed to create session,", err)
  145. return
  146. }
  147. svc := redshift.New(sess)
  148. params := &redshift.CreateClusterParameterGroupInput{
  149. Description: aws.String("String"), // Required
  150. ParameterGroupFamily: aws.String("String"), // Required
  151. ParameterGroupName: aws.String("String"), // Required
  152. Tags: []*redshift.Tag{
  153. { // Required
  154. Key: aws.String("String"),
  155. Value: aws.String("String"),
  156. },
  157. // More values...
  158. },
  159. }
  160. resp, err := svc.CreateClusterParameterGroup(params)
  161. if err != nil {
  162. // Print the error, cast err to awserr.Error to get the Code and
  163. // Message from an error.
  164. fmt.Println(err.Error())
  165. return
  166. }
  167. // Pretty-print the response data.
  168. fmt.Println(resp)
  169. }
  170. func ExampleRedshift_CreateClusterSecurityGroup() {
  171. sess, err := session.NewSession()
  172. if err != nil {
  173. fmt.Println("failed to create session,", err)
  174. return
  175. }
  176. svc := redshift.New(sess)
  177. params := &redshift.CreateClusterSecurityGroupInput{
  178. ClusterSecurityGroupName: aws.String("String"), // Required
  179. Description: aws.String("String"), // Required
  180. Tags: []*redshift.Tag{
  181. { // Required
  182. Key: aws.String("String"),
  183. Value: aws.String("String"),
  184. },
  185. // More values...
  186. },
  187. }
  188. resp, err := svc.CreateClusterSecurityGroup(params)
  189. if err != nil {
  190. // Print the error, cast err to awserr.Error to get the Code and
  191. // Message from an error.
  192. fmt.Println(err.Error())
  193. return
  194. }
  195. // Pretty-print the response data.
  196. fmt.Println(resp)
  197. }
  198. func ExampleRedshift_CreateClusterSnapshot() {
  199. sess, err := session.NewSession()
  200. if err != nil {
  201. fmt.Println("failed to create session,", err)
  202. return
  203. }
  204. svc := redshift.New(sess)
  205. params := &redshift.CreateClusterSnapshotInput{
  206. ClusterIdentifier: aws.String("String"), // Required
  207. SnapshotIdentifier: aws.String("String"), // Required
  208. Tags: []*redshift.Tag{
  209. { // Required
  210. Key: aws.String("String"),
  211. Value: aws.String("String"),
  212. },
  213. // More values...
  214. },
  215. }
  216. resp, err := svc.CreateClusterSnapshot(params)
  217. if err != nil {
  218. // Print the error, cast err to awserr.Error to get the Code and
  219. // Message from an error.
  220. fmt.Println(err.Error())
  221. return
  222. }
  223. // Pretty-print the response data.
  224. fmt.Println(resp)
  225. }
  226. func ExampleRedshift_CreateClusterSubnetGroup() {
  227. sess, err := session.NewSession()
  228. if err != nil {
  229. fmt.Println("failed to create session,", err)
  230. return
  231. }
  232. svc := redshift.New(sess)
  233. params := &redshift.CreateClusterSubnetGroupInput{
  234. ClusterSubnetGroupName: aws.String("String"), // Required
  235. Description: aws.String("String"), // Required
  236. SubnetIds: []*string{ // Required
  237. aws.String("String"), // Required
  238. // More values...
  239. },
  240. Tags: []*redshift.Tag{
  241. { // Required
  242. Key: aws.String("String"),
  243. Value: aws.String("String"),
  244. },
  245. // More values...
  246. },
  247. }
  248. resp, err := svc.CreateClusterSubnetGroup(params)
  249. if err != nil {
  250. // Print the error, cast err to awserr.Error to get the Code and
  251. // Message from an error.
  252. fmt.Println(err.Error())
  253. return
  254. }
  255. // Pretty-print the response data.
  256. fmt.Println(resp)
  257. }
  258. func ExampleRedshift_CreateEventSubscription() {
  259. sess, err := session.NewSession()
  260. if err != nil {
  261. fmt.Println("failed to create session,", err)
  262. return
  263. }
  264. svc := redshift.New(sess)
  265. params := &redshift.CreateEventSubscriptionInput{
  266. SnsTopicArn: aws.String("String"), // Required
  267. SubscriptionName: aws.String("String"), // Required
  268. Enabled: aws.Bool(true),
  269. EventCategories: []*string{
  270. aws.String("String"), // Required
  271. // More values...
  272. },
  273. Severity: aws.String("String"),
  274. SourceIds: []*string{
  275. aws.String("String"), // Required
  276. // More values...
  277. },
  278. SourceType: aws.String("String"),
  279. Tags: []*redshift.Tag{
  280. { // Required
  281. Key: aws.String("String"),
  282. Value: aws.String("String"),
  283. },
  284. // More values...
  285. },
  286. }
  287. resp, err := svc.CreateEventSubscription(params)
  288. if err != nil {
  289. // Print the error, cast err to awserr.Error to get the Code and
  290. // Message from an error.
  291. fmt.Println(err.Error())
  292. return
  293. }
  294. // Pretty-print the response data.
  295. fmt.Println(resp)
  296. }
  297. func ExampleRedshift_CreateHsmClientCertificate() {
  298. sess, err := session.NewSession()
  299. if err != nil {
  300. fmt.Println("failed to create session,", err)
  301. return
  302. }
  303. svc := redshift.New(sess)
  304. params := &redshift.CreateHsmClientCertificateInput{
  305. HsmClientCertificateIdentifier: aws.String("String"), // Required
  306. Tags: []*redshift.Tag{
  307. { // Required
  308. Key: aws.String("String"),
  309. Value: aws.String("String"),
  310. },
  311. // More values...
  312. },
  313. }
  314. resp, err := svc.CreateHsmClientCertificate(params)
  315. if err != nil {
  316. // Print the error, cast err to awserr.Error to get the Code and
  317. // Message from an error.
  318. fmt.Println(err.Error())
  319. return
  320. }
  321. // Pretty-print the response data.
  322. fmt.Println(resp)
  323. }
  324. func ExampleRedshift_CreateHsmConfiguration() {
  325. sess, err := session.NewSession()
  326. if err != nil {
  327. fmt.Println("failed to create session,", err)
  328. return
  329. }
  330. svc := redshift.New(sess)
  331. params := &redshift.CreateHsmConfigurationInput{
  332. Description: aws.String("String"), // Required
  333. HsmConfigurationIdentifier: aws.String("String"), // Required
  334. HsmIpAddress: aws.String("String"), // Required
  335. HsmPartitionName: aws.String("String"), // Required
  336. HsmPartitionPassword: aws.String("String"), // Required
  337. HsmServerPublicCertificate: aws.String("String"), // Required
  338. Tags: []*redshift.Tag{
  339. { // Required
  340. Key: aws.String("String"),
  341. Value: aws.String("String"),
  342. },
  343. // More values...
  344. },
  345. }
  346. resp, err := svc.CreateHsmConfiguration(params)
  347. if err != nil {
  348. // Print the error, cast err to awserr.Error to get the Code and
  349. // Message from an error.
  350. fmt.Println(err.Error())
  351. return
  352. }
  353. // Pretty-print the response data.
  354. fmt.Println(resp)
  355. }
  356. func ExampleRedshift_CreateSnapshotCopyGrant() {
  357. sess, err := session.NewSession()
  358. if err != nil {
  359. fmt.Println("failed to create session,", err)
  360. return
  361. }
  362. svc := redshift.New(sess)
  363. params := &redshift.CreateSnapshotCopyGrantInput{
  364. SnapshotCopyGrantName: aws.String("String"), // Required
  365. KmsKeyId: aws.String("String"),
  366. Tags: []*redshift.Tag{
  367. { // Required
  368. Key: aws.String("String"),
  369. Value: aws.String("String"),
  370. },
  371. // More values...
  372. },
  373. }
  374. resp, err := svc.CreateSnapshotCopyGrant(params)
  375. if err != nil {
  376. // Print the error, cast err to awserr.Error to get the Code and
  377. // Message from an error.
  378. fmt.Println(err.Error())
  379. return
  380. }
  381. // Pretty-print the response data.
  382. fmt.Println(resp)
  383. }
  384. func ExampleRedshift_CreateTags() {
  385. sess, err := session.NewSession()
  386. if err != nil {
  387. fmt.Println("failed to create session,", err)
  388. return
  389. }
  390. svc := redshift.New(sess)
  391. params := &redshift.CreateTagsInput{
  392. ResourceName: aws.String("String"), // Required
  393. Tags: []*redshift.Tag{ // Required
  394. { // Required
  395. Key: aws.String("String"),
  396. Value: aws.String("String"),
  397. },
  398. // More values...
  399. },
  400. }
  401. resp, err := svc.CreateTags(params)
  402. if err != nil {
  403. // Print the error, cast err to awserr.Error to get the Code and
  404. // Message from an error.
  405. fmt.Println(err.Error())
  406. return
  407. }
  408. // Pretty-print the response data.
  409. fmt.Println(resp)
  410. }
  411. func ExampleRedshift_DeleteCluster() {
  412. sess, err := session.NewSession()
  413. if err != nil {
  414. fmt.Println("failed to create session,", err)
  415. return
  416. }
  417. svc := redshift.New(sess)
  418. params := &redshift.DeleteClusterInput{
  419. ClusterIdentifier: aws.String("String"), // Required
  420. FinalClusterSnapshotIdentifier: aws.String("String"),
  421. SkipFinalClusterSnapshot: aws.Bool(true),
  422. }
  423. resp, err := svc.DeleteCluster(params)
  424. if err != nil {
  425. // Print the error, cast err to awserr.Error to get the Code and
  426. // Message from an error.
  427. fmt.Println(err.Error())
  428. return
  429. }
  430. // Pretty-print the response data.
  431. fmt.Println(resp)
  432. }
  433. func ExampleRedshift_DeleteClusterParameterGroup() {
  434. sess, err := session.NewSession()
  435. if err != nil {
  436. fmt.Println("failed to create session,", err)
  437. return
  438. }
  439. svc := redshift.New(sess)
  440. params := &redshift.DeleteClusterParameterGroupInput{
  441. ParameterGroupName: aws.String("String"), // Required
  442. }
  443. resp, err := svc.DeleteClusterParameterGroup(params)
  444. if err != nil {
  445. // Print the error, cast err to awserr.Error to get the Code and
  446. // Message from an error.
  447. fmt.Println(err.Error())
  448. return
  449. }
  450. // Pretty-print the response data.
  451. fmt.Println(resp)
  452. }
  453. func ExampleRedshift_DeleteClusterSecurityGroup() {
  454. sess, err := session.NewSession()
  455. if err != nil {
  456. fmt.Println("failed to create session,", err)
  457. return
  458. }
  459. svc := redshift.New(sess)
  460. params := &redshift.DeleteClusterSecurityGroupInput{
  461. ClusterSecurityGroupName: aws.String("String"), // Required
  462. }
  463. resp, err := svc.DeleteClusterSecurityGroup(params)
  464. if err != nil {
  465. // Print the error, cast err to awserr.Error to get the Code and
  466. // Message from an error.
  467. fmt.Println(err.Error())
  468. return
  469. }
  470. // Pretty-print the response data.
  471. fmt.Println(resp)
  472. }
  473. func ExampleRedshift_DeleteClusterSnapshot() {
  474. sess, err := session.NewSession()
  475. if err != nil {
  476. fmt.Println("failed to create session,", err)
  477. return
  478. }
  479. svc := redshift.New(sess)
  480. params := &redshift.DeleteClusterSnapshotInput{
  481. SnapshotIdentifier: aws.String("String"), // Required
  482. SnapshotClusterIdentifier: aws.String("String"),
  483. }
  484. resp, err := svc.DeleteClusterSnapshot(params)
  485. if err != nil {
  486. // Print the error, cast err to awserr.Error to get the Code and
  487. // Message from an error.
  488. fmt.Println(err.Error())
  489. return
  490. }
  491. // Pretty-print the response data.
  492. fmt.Println(resp)
  493. }
  494. func ExampleRedshift_DeleteClusterSubnetGroup() {
  495. sess, err := session.NewSession()
  496. if err != nil {
  497. fmt.Println("failed to create session,", err)
  498. return
  499. }
  500. svc := redshift.New(sess)
  501. params := &redshift.DeleteClusterSubnetGroupInput{
  502. ClusterSubnetGroupName: aws.String("String"), // Required
  503. }
  504. resp, err := svc.DeleteClusterSubnetGroup(params)
  505. if err != nil {
  506. // Print the error, cast err to awserr.Error to get the Code and
  507. // Message from an error.
  508. fmt.Println(err.Error())
  509. return
  510. }
  511. // Pretty-print the response data.
  512. fmt.Println(resp)
  513. }
  514. func ExampleRedshift_DeleteEventSubscription() {
  515. sess, err := session.NewSession()
  516. if err != nil {
  517. fmt.Println("failed to create session,", err)
  518. return
  519. }
  520. svc := redshift.New(sess)
  521. params := &redshift.DeleteEventSubscriptionInput{
  522. SubscriptionName: aws.String("String"), // Required
  523. }
  524. resp, err := svc.DeleteEventSubscription(params)
  525. if err != nil {
  526. // Print the error, cast err to awserr.Error to get the Code and
  527. // Message from an error.
  528. fmt.Println(err.Error())
  529. return
  530. }
  531. // Pretty-print the response data.
  532. fmt.Println(resp)
  533. }
  534. func ExampleRedshift_DeleteHsmClientCertificate() {
  535. sess, err := session.NewSession()
  536. if err != nil {
  537. fmt.Println("failed to create session,", err)
  538. return
  539. }
  540. svc := redshift.New(sess)
  541. params := &redshift.DeleteHsmClientCertificateInput{
  542. HsmClientCertificateIdentifier: aws.String("String"), // Required
  543. }
  544. resp, err := svc.DeleteHsmClientCertificate(params)
  545. if err != nil {
  546. // Print the error, cast err to awserr.Error to get the Code and
  547. // Message from an error.
  548. fmt.Println(err.Error())
  549. return
  550. }
  551. // Pretty-print the response data.
  552. fmt.Println(resp)
  553. }
  554. func ExampleRedshift_DeleteHsmConfiguration() {
  555. sess, err := session.NewSession()
  556. if err != nil {
  557. fmt.Println("failed to create session,", err)
  558. return
  559. }
  560. svc := redshift.New(sess)
  561. params := &redshift.DeleteHsmConfigurationInput{
  562. HsmConfigurationIdentifier: aws.String("String"), // Required
  563. }
  564. resp, err := svc.DeleteHsmConfiguration(params)
  565. if err != nil {
  566. // Print the error, cast err to awserr.Error to get the Code and
  567. // Message from an error.
  568. fmt.Println(err.Error())
  569. return
  570. }
  571. // Pretty-print the response data.
  572. fmt.Println(resp)
  573. }
  574. func ExampleRedshift_DeleteSnapshotCopyGrant() {
  575. sess, err := session.NewSession()
  576. if err != nil {
  577. fmt.Println("failed to create session,", err)
  578. return
  579. }
  580. svc := redshift.New(sess)
  581. params := &redshift.DeleteSnapshotCopyGrantInput{
  582. SnapshotCopyGrantName: aws.String("String"), // Required
  583. }
  584. resp, err := svc.DeleteSnapshotCopyGrant(params)
  585. if err != nil {
  586. // Print the error, cast err to awserr.Error to get the Code and
  587. // Message from an error.
  588. fmt.Println(err.Error())
  589. return
  590. }
  591. // Pretty-print the response data.
  592. fmt.Println(resp)
  593. }
  594. func ExampleRedshift_DeleteTags() {
  595. sess, err := session.NewSession()
  596. if err != nil {
  597. fmt.Println("failed to create session,", err)
  598. return
  599. }
  600. svc := redshift.New(sess)
  601. params := &redshift.DeleteTagsInput{
  602. ResourceName: aws.String("String"), // Required
  603. TagKeys: []*string{ // Required
  604. aws.String("String"), // Required
  605. // More values...
  606. },
  607. }
  608. resp, err := svc.DeleteTags(params)
  609. if err != nil {
  610. // Print the error, cast err to awserr.Error to get the Code and
  611. // Message from an error.
  612. fmt.Println(err.Error())
  613. return
  614. }
  615. // Pretty-print the response data.
  616. fmt.Println(resp)
  617. }
  618. func ExampleRedshift_DescribeClusterParameterGroups() {
  619. sess, err := session.NewSession()
  620. if err != nil {
  621. fmt.Println("failed to create session,", err)
  622. return
  623. }
  624. svc := redshift.New(sess)
  625. params := &redshift.DescribeClusterParameterGroupsInput{
  626. Marker: aws.String("String"),
  627. MaxRecords: aws.Int64(1),
  628. ParameterGroupName: aws.String("String"),
  629. TagKeys: []*string{
  630. aws.String("String"), // Required
  631. // More values...
  632. },
  633. TagValues: []*string{
  634. aws.String("String"), // Required
  635. // More values...
  636. },
  637. }
  638. resp, err := svc.DescribeClusterParameterGroups(params)
  639. if err != nil {
  640. // Print the error, cast err to awserr.Error to get the Code and
  641. // Message from an error.
  642. fmt.Println(err.Error())
  643. return
  644. }
  645. // Pretty-print the response data.
  646. fmt.Println(resp)
  647. }
  648. func ExampleRedshift_DescribeClusterParameters() {
  649. sess, err := session.NewSession()
  650. if err != nil {
  651. fmt.Println("failed to create session,", err)
  652. return
  653. }
  654. svc := redshift.New(sess)
  655. params := &redshift.DescribeClusterParametersInput{
  656. ParameterGroupName: aws.String("String"), // Required
  657. Marker: aws.String("String"),
  658. MaxRecords: aws.Int64(1),
  659. Source: aws.String("String"),
  660. }
  661. resp, err := svc.DescribeClusterParameters(params)
  662. if err != nil {
  663. // Print the error, cast err to awserr.Error to get the Code and
  664. // Message from an error.
  665. fmt.Println(err.Error())
  666. return
  667. }
  668. // Pretty-print the response data.
  669. fmt.Println(resp)
  670. }
  671. func ExampleRedshift_DescribeClusterSecurityGroups() {
  672. sess, err := session.NewSession()
  673. if err != nil {
  674. fmt.Println("failed to create session,", err)
  675. return
  676. }
  677. svc := redshift.New(sess)
  678. params := &redshift.DescribeClusterSecurityGroupsInput{
  679. ClusterSecurityGroupName: aws.String("String"),
  680. Marker: aws.String("String"),
  681. MaxRecords: aws.Int64(1),
  682. TagKeys: []*string{
  683. aws.String("String"), // Required
  684. // More values...
  685. },
  686. TagValues: []*string{
  687. aws.String("String"), // Required
  688. // More values...
  689. },
  690. }
  691. resp, err := svc.DescribeClusterSecurityGroups(params)
  692. if err != nil {
  693. // Print the error, cast err to awserr.Error to get the Code and
  694. // Message from an error.
  695. fmt.Println(err.Error())
  696. return
  697. }
  698. // Pretty-print the response data.
  699. fmt.Println(resp)
  700. }
  701. func ExampleRedshift_DescribeClusterSnapshots() {
  702. sess, err := session.NewSession()
  703. if err != nil {
  704. fmt.Println("failed to create session,", err)
  705. return
  706. }
  707. svc := redshift.New(sess)
  708. params := &redshift.DescribeClusterSnapshotsInput{
  709. ClusterIdentifier: aws.String("String"),
  710. EndTime: aws.Time(time.Now()),
  711. Marker: aws.String("String"),
  712. MaxRecords: aws.Int64(1),
  713. OwnerAccount: aws.String("String"),
  714. SnapshotIdentifier: aws.String("String"),
  715. SnapshotType: aws.String("String"),
  716. StartTime: aws.Time(time.Now()),
  717. TagKeys: []*string{
  718. aws.String("String"), // Required
  719. // More values...
  720. },
  721. TagValues: []*string{
  722. aws.String("String"), // Required
  723. // More values...
  724. },
  725. }
  726. resp, err := svc.DescribeClusterSnapshots(params)
  727. if err != nil {
  728. // Print the error, cast err to awserr.Error to get the Code and
  729. // Message from an error.
  730. fmt.Println(err.Error())
  731. return
  732. }
  733. // Pretty-print the response data.
  734. fmt.Println(resp)
  735. }
  736. func ExampleRedshift_DescribeClusterSubnetGroups() {
  737. sess, err := session.NewSession()
  738. if err != nil {
  739. fmt.Println("failed to create session,", err)
  740. return
  741. }
  742. svc := redshift.New(sess)
  743. params := &redshift.DescribeClusterSubnetGroupsInput{
  744. ClusterSubnetGroupName: aws.String("String"),
  745. Marker: aws.String("String"),
  746. MaxRecords: aws.Int64(1),
  747. TagKeys: []*string{
  748. aws.String("String"), // Required
  749. // More values...
  750. },
  751. TagValues: []*string{
  752. aws.String("String"), // Required
  753. // More values...
  754. },
  755. }
  756. resp, err := svc.DescribeClusterSubnetGroups(params)
  757. if err != nil {
  758. // Print the error, cast err to awserr.Error to get the Code and
  759. // Message from an error.
  760. fmt.Println(err.Error())
  761. return
  762. }
  763. // Pretty-print the response data.
  764. fmt.Println(resp)
  765. }
  766. func ExampleRedshift_DescribeClusterVersions() {
  767. sess, err := session.NewSession()
  768. if err != nil {
  769. fmt.Println("failed to create session,", err)
  770. return
  771. }
  772. svc := redshift.New(sess)
  773. params := &redshift.DescribeClusterVersionsInput{
  774. ClusterParameterGroupFamily: aws.String("String"),
  775. ClusterVersion: aws.String("String"),
  776. Marker: aws.String("String"),
  777. MaxRecords: aws.Int64(1),
  778. }
  779. resp, err := svc.DescribeClusterVersions(params)
  780. if err != nil {
  781. // Print the error, cast err to awserr.Error to get the Code and
  782. // Message from an error.
  783. fmt.Println(err.Error())
  784. return
  785. }
  786. // Pretty-print the response data.
  787. fmt.Println(resp)
  788. }
  789. func ExampleRedshift_DescribeClusters() {
  790. sess, err := session.NewSession()
  791. if err != nil {
  792. fmt.Println("failed to create session,", err)
  793. return
  794. }
  795. svc := redshift.New(sess)
  796. params := &redshift.DescribeClustersInput{
  797. ClusterIdentifier: aws.String("String"),
  798. Marker: aws.String("String"),
  799. MaxRecords: aws.Int64(1),
  800. TagKeys: []*string{
  801. aws.String("String"), // Required
  802. // More values...
  803. },
  804. TagValues: []*string{
  805. aws.String("String"), // Required
  806. // More values...
  807. },
  808. }
  809. resp, err := svc.DescribeClusters(params)
  810. if err != nil {
  811. // Print the error, cast err to awserr.Error to get the Code and
  812. // Message from an error.
  813. fmt.Println(err.Error())
  814. return
  815. }
  816. // Pretty-print the response data.
  817. fmt.Println(resp)
  818. }
  819. func ExampleRedshift_DescribeDefaultClusterParameters() {
  820. sess, err := session.NewSession()
  821. if err != nil {
  822. fmt.Println("failed to create session,", err)
  823. return
  824. }
  825. svc := redshift.New(sess)
  826. params := &redshift.DescribeDefaultClusterParametersInput{
  827. ParameterGroupFamily: aws.String("String"), // Required
  828. Marker: aws.String("String"),
  829. MaxRecords: aws.Int64(1),
  830. }
  831. resp, err := svc.DescribeDefaultClusterParameters(params)
  832. if err != nil {
  833. // Print the error, cast err to awserr.Error to get the Code and
  834. // Message from an error.
  835. fmt.Println(err.Error())
  836. return
  837. }
  838. // Pretty-print the response data.
  839. fmt.Println(resp)
  840. }
  841. func ExampleRedshift_DescribeEventCategories() {
  842. sess, err := session.NewSession()
  843. if err != nil {
  844. fmt.Println("failed to create session,", err)
  845. return
  846. }
  847. svc := redshift.New(sess)
  848. params := &redshift.DescribeEventCategoriesInput{
  849. SourceType: aws.String("String"),
  850. }
  851. resp, err := svc.DescribeEventCategories(params)
  852. if err != nil {
  853. // Print the error, cast err to awserr.Error to get the Code and
  854. // Message from an error.
  855. fmt.Println(err.Error())
  856. return
  857. }
  858. // Pretty-print the response data.
  859. fmt.Println(resp)
  860. }
  861. func ExampleRedshift_DescribeEventSubscriptions() {
  862. sess, err := session.NewSession()
  863. if err != nil {
  864. fmt.Println("failed to create session,", err)
  865. return
  866. }
  867. svc := redshift.New(sess)
  868. params := &redshift.DescribeEventSubscriptionsInput{
  869. Marker: aws.String("String"),
  870. MaxRecords: aws.Int64(1),
  871. SubscriptionName: aws.String("String"),
  872. }
  873. resp, err := svc.DescribeEventSubscriptions(params)
  874. if err != nil {
  875. // Print the error, cast err to awserr.Error to get the Code and
  876. // Message from an error.
  877. fmt.Println(err.Error())
  878. return
  879. }
  880. // Pretty-print the response data.
  881. fmt.Println(resp)
  882. }
  883. func ExampleRedshift_DescribeEvents() {
  884. sess, err := session.NewSession()
  885. if err != nil {
  886. fmt.Println("failed to create session,", err)
  887. return
  888. }
  889. svc := redshift.New(sess)
  890. params := &redshift.DescribeEventsInput{
  891. Duration: aws.Int64(1),
  892. EndTime: aws.Time(time.Now()),
  893. Marker: aws.String("String"),
  894. MaxRecords: aws.Int64(1),
  895. SourceIdentifier: aws.String("String"),
  896. SourceType: aws.String("SourceType"),
  897. StartTime: aws.Time(time.Now()),
  898. }
  899. resp, err := svc.DescribeEvents(params)
  900. if err != nil {
  901. // Print the error, cast err to awserr.Error to get the Code and
  902. // Message from an error.
  903. fmt.Println(err.Error())
  904. return
  905. }
  906. // Pretty-print the response data.
  907. fmt.Println(resp)
  908. }
  909. func ExampleRedshift_DescribeHsmClientCertificates() {
  910. sess, err := session.NewSession()
  911. if err != nil {
  912. fmt.Println("failed to create session,", err)
  913. return
  914. }
  915. svc := redshift.New(sess)
  916. params := &redshift.DescribeHsmClientCertificatesInput{
  917. HsmClientCertificateIdentifier: aws.String("String"),
  918. Marker: aws.String("String"),
  919. MaxRecords: aws.Int64(1),
  920. TagKeys: []*string{
  921. aws.String("String"), // Required
  922. // More values...
  923. },
  924. TagValues: []*string{
  925. aws.String("String"), // Required
  926. // More values...
  927. },
  928. }
  929. resp, err := svc.DescribeHsmClientCertificates(params)
  930. if err != nil {
  931. // Print the error, cast err to awserr.Error to get the Code and
  932. // Message from an error.
  933. fmt.Println(err.Error())
  934. return
  935. }
  936. // Pretty-print the response data.
  937. fmt.Println(resp)
  938. }
  939. func ExampleRedshift_DescribeHsmConfigurations() {
  940. sess, err := session.NewSession()
  941. if err != nil {
  942. fmt.Println("failed to create session,", err)
  943. return
  944. }
  945. svc := redshift.New(sess)
  946. params := &redshift.DescribeHsmConfigurationsInput{
  947. HsmConfigurationIdentifier: aws.String("String"),
  948. Marker: aws.String("String"),
  949. MaxRecords: aws.Int64(1),
  950. TagKeys: []*string{
  951. aws.String("String"), // Required
  952. // More values...
  953. },
  954. TagValues: []*string{
  955. aws.String("String"), // Required
  956. // More values...
  957. },
  958. }
  959. resp, err := svc.DescribeHsmConfigurations(params)
  960. if err != nil {
  961. // Print the error, cast err to awserr.Error to get the Code and
  962. // Message from an error.
  963. fmt.Println(err.Error())
  964. return
  965. }
  966. // Pretty-print the response data.
  967. fmt.Println(resp)
  968. }
  969. func ExampleRedshift_DescribeLoggingStatus() {
  970. sess, err := session.NewSession()
  971. if err != nil {
  972. fmt.Println("failed to create session,", err)
  973. return
  974. }
  975. svc := redshift.New(sess)
  976. params := &redshift.DescribeLoggingStatusInput{
  977. ClusterIdentifier: aws.String("String"), // Required
  978. }
  979. resp, err := svc.DescribeLoggingStatus(params)
  980. if err != nil {
  981. // Print the error, cast err to awserr.Error to get the Code and
  982. // Message from an error.
  983. fmt.Println(err.Error())
  984. return
  985. }
  986. // Pretty-print the response data.
  987. fmt.Println(resp)
  988. }
  989. func ExampleRedshift_DescribeOrderableClusterOptions() {
  990. sess, err := session.NewSession()
  991. if err != nil {
  992. fmt.Println("failed to create session,", err)
  993. return
  994. }
  995. svc := redshift.New(sess)
  996. params := &redshift.DescribeOrderableClusterOptionsInput{
  997. ClusterVersion: aws.String("String"),
  998. Marker: aws.String("String"),
  999. MaxRecords: aws.Int64(1),
  1000. NodeType: aws.String("String"),
  1001. }
  1002. resp, err := svc.DescribeOrderableClusterOptions(params)
  1003. if err != nil {
  1004. // Print the error, cast err to awserr.Error to get the Code and
  1005. // Message from an error.
  1006. fmt.Println(err.Error())
  1007. return
  1008. }
  1009. // Pretty-print the response data.
  1010. fmt.Println(resp)
  1011. }
  1012. func ExampleRedshift_DescribeReservedNodeOfferings() {
  1013. sess, err := session.NewSession()
  1014. if err != nil {
  1015. fmt.Println("failed to create session,", err)
  1016. return
  1017. }
  1018. svc := redshift.New(sess)
  1019. params := &redshift.DescribeReservedNodeOfferingsInput{
  1020. Marker: aws.String("String"),
  1021. MaxRecords: aws.Int64(1),
  1022. ReservedNodeOfferingId: aws.String("String"),
  1023. }
  1024. resp, err := svc.DescribeReservedNodeOfferings(params)
  1025. if err != nil {
  1026. // Print the error, cast err to awserr.Error to get the Code and
  1027. // Message from an error.
  1028. fmt.Println(err.Error())
  1029. return
  1030. }
  1031. // Pretty-print the response data.
  1032. fmt.Println(resp)
  1033. }
  1034. func ExampleRedshift_DescribeReservedNodes() {
  1035. sess, err := session.NewSession()
  1036. if err != nil {
  1037. fmt.Println("failed to create session,", err)
  1038. return
  1039. }
  1040. svc := redshift.New(sess)
  1041. params := &redshift.DescribeReservedNodesInput{
  1042. Marker: aws.String("String"),
  1043. MaxRecords: aws.Int64(1),
  1044. ReservedNodeId: aws.String("String"),
  1045. }
  1046. resp, err := svc.DescribeReservedNodes(params)
  1047. if err != nil {
  1048. // Print the error, cast err to awserr.Error to get the Code and
  1049. // Message from an error.
  1050. fmt.Println(err.Error())
  1051. return
  1052. }
  1053. // Pretty-print the response data.
  1054. fmt.Println(resp)
  1055. }
  1056. func ExampleRedshift_DescribeResize() {
  1057. sess, err := session.NewSession()
  1058. if err != nil {
  1059. fmt.Println("failed to create session,", err)
  1060. return
  1061. }
  1062. svc := redshift.New(sess)
  1063. params := &redshift.DescribeResizeInput{
  1064. ClusterIdentifier: aws.String("String"), // Required
  1065. }
  1066. resp, err := svc.DescribeResize(params)
  1067. if err != nil {
  1068. // Print the error, cast err to awserr.Error to get the Code and
  1069. // Message from an error.
  1070. fmt.Println(err.Error())
  1071. return
  1072. }
  1073. // Pretty-print the response data.
  1074. fmt.Println(resp)
  1075. }
  1076. func ExampleRedshift_DescribeSnapshotCopyGrants() {
  1077. sess, err := session.NewSession()
  1078. if err != nil {
  1079. fmt.Println("failed to create session,", err)
  1080. return
  1081. }
  1082. svc := redshift.New(sess)
  1083. params := &redshift.DescribeSnapshotCopyGrantsInput{
  1084. Marker: aws.String("String"),
  1085. MaxRecords: aws.Int64(1),
  1086. SnapshotCopyGrantName: aws.String("String"),
  1087. TagKeys: []*string{
  1088. aws.String("String"), // Required
  1089. // More values...
  1090. },
  1091. TagValues: []*string{
  1092. aws.String("String"), // Required
  1093. // More values...
  1094. },
  1095. }
  1096. resp, err := svc.DescribeSnapshotCopyGrants(params)
  1097. if err != nil {
  1098. // Print the error, cast err to awserr.Error to get the Code and
  1099. // Message from an error.
  1100. fmt.Println(err.Error())
  1101. return
  1102. }
  1103. // Pretty-print the response data.
  1104. fmt.Println(resp)
  1105. }
  1106. func ExampleRedshift_DescribeTableRestoreStatus() {
  1107. sess, err := session.NewSession()
  1108. if err != nil {
  1109. fmt.Println("failed to create session,", err)
  1110. return
  1111. }
  1112. svc := redshift.New(sess)
  1113. params := &redshift.DescribeTableRestoreStatusInput{
  1114. ClusterIdentifier: aws.String("String"),
  1115. Marker: aws.String("String"),
  1116. MaxRecords: aws.Int64(1),
  1117. TableRestoreRequestId: aws.String("String"),
  1118. }
  1119. resp, err := svc.DescribeTableRestoreStatus(params)
  1120. if err != nil {
  1121. // Print the error, cast err to awserr.Error to get the Code and
  1122. // Message from an error.
  1123. fmt.Println(err.Error())
  1124. return
  1125. }
  1126. // Pretty-print the response data.
  1127. fmt.Println(resp)
  1128. }
  1129. func ExampleRedshift_DescribeTags() {
  1130. sess, err := session.NewSession()
  1131. if err != nil {
  1132. fmt.Println("failed to create session,", err)
  1133. return
  1134. }
  1135. svc := redshift.New(sess)
  1136. params := &redshift.DescribeTagsInput{
  1137. Marker: aws.String("String"),
  1138. MaxRecords: aws.Int64(1),
  1139. ResourceName: aws.String("String"),
  1140. ResourceType: aws.String("String"),
  1141. TagKeys: []*string{
  1142. aws.String("String"), // Required
  1143. // More values...
  1144. },
  1145. TagValues: []*string{
  1146. aws.String("String"), // Required
  1147. // More values...
  1148. },
  1149. }
  1150. resp, err := svc.DescribeTags(params)
  1151. if err != nil {
  1152. // Print the error, cast err to awserr.Error to get the Code and
  1153. // Message from an error.
  1154. fmt.Println(err.Error())
  1155. return
  1156. }
  1157. // Pretty-print the response data.
  1158. fmt.Println(resp)
  1159. }
  1160. func ExampleRedshift_DisableLogging() {
  1161. sess, err := session.NewSession()
  1162. if err != nil {
  1163. fmt.Println("failed to create session,", err)
  1164. return
  1165. }
  1166. svc := redshift.New(sess)
  1167. params := &redshift.DisableLoggingInput{
  1168. ClusterIdentifier: aws.String("String"), // Required
  1169. }
  1170. resp, err := svc.DisableLogging(params)
  1171. if err != nil {
  1172. // Print the error, cast err to awserr.Error to get the Code and
  1173. // Message from an error.
  1174. fmt.Println(err.Error())
  1175. return
  1176. }
  1177. // Pretty-print the response data.
  1178. fmt.Println(resp)
  1179. }
  1180. func ExampleRedshift_DisableSnapshotCopy() {
  1181. sess, err := session.NewSession()
  1182. if err != nil {
  1183. fmt.Println("failed to create session,", err)
  1184. return
  1185. }
  1186. svc := redshift.New(sess)
  1187. params := &redshift.DisableSnapshotCopyInput{
  1188. ClusterIdentifier: aws.String("String"), // Required
  1189. }
  1190. resp, err := svc.DisableSnapshotCopy(params)
  1191. if err != nil {
  1192. // Print the error, cast err to awserr.Error to get the Code and
  1193. // Message from an error.
  1194. fmt.Println(err.Error())
  1195. return
  1196. }
  1197. // Pretty-print the response data.
  1198. fmt.Println(resp)
  1199. }
  1200. func ExampleRedshift_EnableLogging() {
  1201. sess, err := session.NewSession()
  1202. if err != nil {
  1203. fmt.Println("failed to create session,", err)
  1204. return
  1205. }
  1206. svc := redshift.New(sess)
  1207. params := &redshift.EnableLoggingInput{
  1208. BucketName: aws.String("String"), // Required
  1209. ClusterIdentifier: aws.String("String"), // Required
  1210. S3KeyPrefix: aws.String("String"),
  1211. }
  1212. resp, err := svc.EnableLogging(params)
  1213. if err != nil {
  1214. // Print the error, cast err to awserr.Error to get the Code and
  1215. // Message from an error.
  1216. fmt.Println(err.Error())
  1217. return
  1218. }
  1219. // Pretty-print the response data.
  1220. fmt.Println(resp)
  1221. }
  1222. func ExampleRedshift_EnableSnapshotCopy() {
  1223. sess, err := session.NewSession()
  1224. if err != nil {
  1225. fmt.Println("failed to create session,", err)
  1226. return
  1227. }
  1228. svc := redshift.New(sess)
  1229. params := &redshift.EnableSnapshotCopyInput{
  1230. ClusterIdentifier: aws.String("String"), // Required
  1231. DestinationRegion: aws.String("String"), // Required
  1232. RetentionPeriod: aws.Int64(1),
  1233. SnapshotCopyGrantName: aws.String("String"),
  1234. }
  1235. resp, err := svc.EnableSnapshotCopy(params)
  1236. if err != nil {
  1237. // Print the error, cast err to awserr.Error to get the Code and
  1238. // Message from an error.
  1239. fmt.Println(err.Error())
  1240. return
  1241. }
  1242. // Pretty-print the response data.
  1243. fmt.Println(resp)
  1244. }
  1245. func ExampleRedshift_ModifyCluster() {
  1246. sess, err := session.NewSession()
  1247. if err != nil {
  1248. fmt.Println("failed to create session,", err)
  1249. return
  1250. }
  1251. svc := redshift.New(sess)
  1252. params := &redshift.ModifyClusterInput{
  1253. ClusterIdentifier: aws.String("String"), // Required
  1254. AllowVersionUpgrade: aws.Bool(true),
  1255. AutomatedSnapshotRetentionPeriod: aws.Int64(1),
  1256. ClusterParameterGroupName: aws.String("String"),
  1257. ClusterSecurityGroups: []*string{
  1258. aws.String("String"), // Required
  1259. // More values...
  1260. },
  1261. ClusterType: aws.String("String"),
  1262. ClusterVersion: aws.String("String"),
  1263. ElasticIp: aws.String("String"),
  1264. EnhancedVpcRouting: aws.Bool(true),
  1265. HsmClientCertificateIdentifier: aws.String("String"),
  1266. HsmConfigurationIdentifier: aws.String("String"),
  1267. MasterUserPassword: aws.String("String"),
  1268. NewClusterIdentifier: aws.String("String"),
  1269. NodeType: aws.String("String"),
  1270. NumberOfNodes: aws.Int64(1),
  1271. PreferredMaintenanceWindow: aws.String("String"),
  1272. PubliclyAccessible: aws.Bool(true),
  1273. VpcSecurityGroupIds: []*string{
  1274. aws.String("String"), // Required
  1275. // More values...
  1276. },
  1277. }
  1278. resp, err := svc.ModifyCluster(params)
  1279. if err != nil {
  1280. // Print the error, cast err to awserr.Error to get the Code and
  1281. // Message from an error.
  1282. fmt.Println(err.Error())
  1283. return
  1284. }
  1285. // Pretty-print the response data.
  1286. fmt.Println(resp)
  1287. }
  1288. func ExampleRedshift_ModifyClusterIamRoles() {
  1289. sess, err := session.NewSession()
  1290. if err != nil {
  1291. fmt.Println("failed to create session,", err)
  1292. return
  1293. }
  1294. svc := redshift.New(sess)
  1295. params := &redshift.ModifyClusterIamRolesInput{
  1296. ClusterIdentifier: aws.String("String"), // Required
  1297. AddIamRoles: []*string{
  1298. aws.String("String"), // Required
  1299. // More values...
  1300. },
  1301. RemoveIamRoles: []*string{
  1302. aws.String("String"), // Required
  1303. // More values...
  1304. },
  1305. }
  1306. resp, err := svc.ModifyClusterIamRoles(params)
  1307. if err != nil {
  1308. // Print the error, cast err to awserr.Error to get the Code and
  1309. // Message from an error.
  1310. fmt.Println(err.Error())
  1311. return
  1312. }
  1313. // Pretty-print the response data.
  1314. fmt.Println(resp)
  1315. }
  1316. func ExampleRedshift_ModifyClusterParameterGroup() {
  1317. sess, err := session.NewSession()
  1318. if err != nil {
  1319. fmt.Println("failed to create session,", err)
  1320. return
  1321. }
  1322. svc := redshift.New(sess)
  1323. params := &redshift.ModifyClusterParameterGroupInput{
  1324. ParameterGroupName: aws.String("String"), // Required
  1325. Parameters: []*redshift.Parameter{ // Required
  1326. { // Required
  1327. AllowedValues: aws.String("String"),
  1328. ApplyType: aws.String("ParameterApplyType"),
  1329. DataType: aws.String("String"),
  1330. Description: aws.String("String"),
  1331. IsModifiable: aws.Bool(true),
  1332. MinimumEngineVersion: aws.String("String"),
  1333. ParameterName: aws.String("String"),
  1334. ParameterValue: aws.String("String"),
  1335. Source: aws.String("String"),
  1336. },
  1337. // More values...
  1338. },
  1339. }
  1340. resp, err := svc.ModifyClusterParameterGroup(params)
  1341. if err != nil {
  1342. // Print the error, cast err to awserr.Error to get the Code and
  1343. // Message from an error.
  1344. fmt.Println(err.Error())
  1345. return
  1346. }
  1347. // Pretty-print the response data.
  1348. fmt.Println(resp)
  1349. }
  1350. func ExampleRedshift_ModifyClusterSubnetGroup() {
  1351. sess, err := session.NewSession()
  1352. if err != nil {
  1353. fmt.Println("failed to create session,", err)
  1354. return
  1355. }
  1356. svc := redshift.New(sess)
  1357. params := &redshift.ModifyClusterSubnetGroupInput{
  1358. ClusterSubnetGroupName: aws.String("String"), // Required
  1359. SubnetIds: []*string{ // Required
  1360. aws.String("String"), // Required
  1361. // More values...
  1362. },
  1363. Description: aws.String("String"),
  1364. }
  1365. resp, err := svc.ModifyClusterSubnetGroup(params)
  1366. if err != nil {
  1367. // Print the error, cast err to awserr.Error to get the Code and
  1368. // Message from an error.
  1369. fmt.Println(err.Error())
  1370. return
  1371. }
  1372. // Pretty-print the response data.
  1373. fmt.Println(resp)
  1374. }
  1375. func ExampleRedshift_ModifyEventSubscription() {
  1376. sess, err := session.NewSession()
  1377. if err != nil {
  1378. fmt.Println("failed to create session,", err)
  1379. return
  1380. }
  1381. svc := redshift.New(sess)
  1382. params := &redshift.ModifyEventSubscriptionInput{
  1383. SubscriptionName: aws.String("String"), // Required
  1384. Enabled: aws.Bool(true),
  1385. EventCategories: []*string{
  1386. aws.String("String"), // Required
  1387. // More values...
  1388. },
  1389. Severity: aws.String("String"),
  1390. SnsTopicArn: aws.String("String"),
  1391. SourceIds: []*string{
  1392. aws.String("String"), // Required
  1393. // More values...
  1394. },
  1395. SourceType: aws.String("String"),
  1396. }
  1397. resp, err := svc.ModifyEventSubscription(params)
  1398. if err != nil {
  1399. // Print the error, cast err to awserr.Error to get the Code and
  1400. // Message from an error.
  1401. fmt.Println(err.Error())
  1402. return
  1403. }
  1404. // Pretty-print the response data.
  1405. fmt.Println(resp)
  1406. }
  1407. func ExampleRedshift_ModifySnapshotCopyRetentionPeriod() {
  1408. sess, err := session.NewSession()
  1409. if err != nil {
  1410. fmt.Println("failed to create session,", err)
  1411. return
  1412. }
  1413. svc := redshift.New(sess)
  1414. params := &redshift.ModifySnapshotCopyRetentionPeriodInput{
  1415. ClusterIdentifier: aws.String("String"), // Required
  1416. RetentionPeriod: aws.Int64(1), // Required
  1417. }
  1418. resp, err := svc.ModifySnapshotCopyRetentionPeriod(params)
  1419. if err != nil {
  1420. // Print the error, cast err to awserr.Error to get the Code and
  1421. // Message from an error.
  1422. fmt.Println(err.Error())
  1423. return
  1424. }
  1425. // Pretty-print the response data.
  1426. fmt.Println(resp)
  1427. }
  1428. func ExampleRedshift_PurchaseReservedNodeOffering() {
  1429. sess, err := session.NewSession()
  1430. if err != nil {
  1431. fmt.Println("failed to create session,", err)
  1432. return
  1433. }
  1434. svc := redshift.New(sess)
  1435. params := &redshift.PurchaseReservedNodeOfferingInput{
  1436. ReservedNodeOfferingId: aws.String("String"), // Required
  1437. NodeCount: aws.Int64(1),
  1438. }
  1439. resp, err := svc.PurchaseReservedNodeOffering(params)
  1440. if err != nil {
  1441. // Print the error, cast err to awserr.Error to get the Code and
  1442. // Message from an error.
  1443. fmt.Println(err.Error())
  1444. return
  1445. }
  1446. // Pretty-print the response data.
  1447. fmt.Println(resp)
  1448. }
  1449. func ExampleRedshift_RebootCluster() {
  1450. sess, err := session.NewSession()
  1451. if err != nil {
  1452. fmt.Println("failed to create session,", err)
  1453. return
  1454. }
  1455. svc := redshift.New(sess)
  1456. params := &redshift.RebootClusterInput{
  1457. ClusterIdentifier: aws.String("String"), // Required
  1458. }
  1459. resp, err := svc.RebootCluster(params)
  1460. if err != nil {
  1461. // Print the error, cast err to awserr.Error to get the Code and
  1462. // Message from an error.
  1463. fmt.Println(err.Error())
  1464. return
  1465. }
  1466. // Pretty-print the response data.
  1467. fmt.Println(resp)
  1468. }
  1469. func ExampleRedshift_ResetClusterParameterGroup() {
  1470. sess, err := session.NewSession()
  1471. if err != nil {
  1472. fmt.Println("failed to create session,", err)
  1473. return
  1474. }
  1475. svc := redshift.New(sess)
  1476. params := &redshift.ResetClusterParameterGroupInput{
  1477. ParameterGroupName: aws.String("String"), // Required
  1478. Parameters: []*redshift.Parameter{
  1479. { // Required
  1480. AllowedValues: aws.String("String"),
  1481. ApplyType: aws.String("ParameterApplyType"),
  1482. DataType: aws.String("String"),
  1483. Description: aws.String("String"),
  1484. IsModifiable: aws.Bool(true),
  1485. MinimumEngineVersion: aws.String("String"),
  1486. ParameterName: aws.String("String"),
  1487. ParameterValue: aws.String("String"),
  1488. Source: aws.String("String"),
  1489. },
  1490. // More values...
  1491. },
  1492. ResetAllParameters: aws.Bool(true),
  1493. }
  1494. resp, err := svc.ResetClusterParameterGroup(params)
  1495. if err != nil {
  1496. // Print the error, cast err to awserr.Error to get the Code and
  1497. // Message from an error.
  1498. fmt.Println(err.Error())
  1499. return
  1500. }
  1501. // Pretty-print the response data.
  1502. fmt.Println(resp)
  1503. }
  1504. func ExampleRedshift_RestoreFromClusterSnapshot() {
  1505. sess, err := session.NewSession()
  1506. if err != nil {
  1507. fmt.Println("failed to create session,", err)
  1508. return
  1509. }
  1510. svc := redshift.New(sess)
  1511. params := &redshift.RestoreFromClusterSnapshotInput{
  1512. ClusterIdentifier: aws.String("String"), // Required
  1513. SnapshotIdentifier: aws.String("String"), // Required
  1514. AdditionalInfo: aws.String("String"),
  1515. AllowVersionUpgrade: aws.Bool(true),
  1516. AutomatedSnapshotRetentionPeriod: aws.Int64(1),
  1517. AvailabilityZone: aws.String("String"),
  1518. ClusterParameterGroupName: aws.String("String"),
  1519. ClusterSecurityGroups: []*string{
  1520. aws.String("String"), // Required
  1521. // More values...
  1522. },
  1523. ClusterSubnetGroupName: aws.String("String"),
  1524. ElasticIp: aws.String("String"),
  1525. EnhancedVpcRouting: aws.Bool(true),
  1526. HsmClientCertificateIdentifier: aws.String("String"),
  1527. HsmConfigurationIdentifier: aws.String("String"),
  1528. IamRoles: []*string{
  1529. aws.String("String"), // Required
  1530. // More values...
  1531. },
  1532. KmsKeyId: aws.String("String"),
  1533. NodeType: aws.String("String"),
  1534. OwnerAccount: aws.String("String"),
  1535. Port: aws.Int64(1),
  1536. PreferredMaintenanceWindow: aws.String("String"),
  1537. PubliclyAccessible: aws.Bool(true),
  1538. SnapshotClusterIdentifier: aws.String("String"),
  1539. VpcSecurityGroupIds: []*string{
  1540. aws.String("String"), // Required
  1541. // More values...
  1542. },
  1543. }
  1544. resp, err := svc.RestoreFromClusterSnapshot(params)
  1545. if err != nil {
  1546. // Print the error, cast err to awserr.Error to get the Code and
  1547. // Message from an error.
  1548. fmt.Println(err.Error())
  1549. return
  1550. }
  1551. // Pretty-print the response data.
  1552. fmt.Println(resp)
  1553. }
  1554. func ExampleRedshift_RestoreTableFromClusterSnapshot() {
  1555. sess, err := session.NewSession()
  1556. if err != nil {
  1557. fmt.Println("failed to create session,", err)
  1558. return
  1559. }
  1560. svc := redshift.New(sess)
  1561. params := &redshift.RestoreTableFromClusterSnapshotInput{
  1562. ClusterIdentifier: aws.String("String"), // Required
  1563. NewTableName: aws.String("String"), // Required
  1564. SnapshotIdentifier: aws.String("String"), // Required
  1565. SourceDatabaseName: aws.String("String"), // Required
  1566. SourceTableName: aws.String("String"), // Required
  1567. SourceSchemaName: aws.String("String"),
  1568. TargetDatabaseName: aws.String("String"),
  1569. TargetSchemaName: aws.String("String"),
  1570. }
  1571. resp, err := svc.RestoreTableFromClusterSnapshot(params)
  1572. if err != nil {
  1573. // Print the error, cast err to awserr.Error to get the Code and
  1574. // Message from an error.
  1575. fmt.Println(err.Error())
  1576. return
  1577. }
  1578. // Pretty-print the response data.
  1579. fmt.Println(resp)
  1580. }
  1581. func ExampleRedshift_RevokeClusterSecurityGroupIngress() {
  1582. sess, err := session.NewSession()
  1583. if err != nil {
  1584. fmt.Println("failed to create session,", err)
  1585. return
  1586. }
  1587. svc := redshift.New(sess)
  1588. params := &redshift.RevokeClusterSecurityGroupIngressInput{
  1589. ClusterSecurityGroupName: aws.String("String"), // Required
  1590. CIDRIP: aws.String("String"),
  1591. EC2SecurityGroupName: aws.String("String"),
  1592. EC2SecurityGroupOwnerId: aws.String("String"),
  1593. }
  1594. resp, err := svc.RevokeClusterSecurityGroupIngress(params)
  1595. if err != nil {
  1596. // Print the error, cast err to awserr.Error to get the Code and
  1597. // Message from an error.
  1598. fmt.Println(err.Error())
  1599. return
  1600. }
  1601. // Pretty-print the response data.
  1602. fmt.Println(resp)
  1603. }
  1604. func ExampleRedshift_RevokeSnapshotAccess() {
  1605. sess, err := session.NewSession()
  1606. if err != nil {
  1607. fmt.Println("failed to create session,", err)
  1608. return
  1609. }
  1610. svc := redshift.New(sess)
  1611. params := &redshift.RevokeSnapshotAccessInput{
  1612. AccountWithRestoreAccess: aws.String("String"), // Required
  1613. SnapshotIdentifier: aws.String("String"), // Required
  1614. SnapshotClusterIdentifier: aws.String("String"),
  1615. }
  1616. resp, err := svc.RevokeSnapshotAccess(params)
  1617. if err != nil {
  1618. // Print the error, cast err to awserr.Error to get the Code and
  1619. // Message from an error.
  1620. fmt.Println(err.Error())
  1621. return
  1622. }
  1623. // Pretty-print the response data.
  1624. fmt.Println(resp)
  1625. }
  1626. func ExampleRedshift_RotateEncryptionKey() {
  1627. sess, err := session.NewSession()
  1628. if err != nil {
  1629. fmt.Println("failed to create session,", err)
  1630. return
  1631. }
  1632. svc := redshift.New(sess)
  1633. params := &redshift.RotateEncryptionKeyInput{
  1634. ClusterIdentifier: aws.String("String"), // Required
  1635. }
  1636. resp, err := svc.RotateEncryptionKey(params)
  1637. if err != nil {
  1638. // Print the error, cast err to awserr.Error to get the Code and
  1639. // Message from an error.
  1640. fmt.Println(err.Error())
  1641. return
  1642. }
  1643. // Pretty-print the response data.
  1644. fmt.Println(resp)
  1645. }