examples_test.go 47 KB

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