examples_test.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elasticache_test
  3. import (
  4. "bytes"
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws"
  8. "github.com/aws/aws-sdk-go/service/elasticache"
  9. )
  10. var _ time.Duration
  11. var _ bytes.Buffer
  12. func ExampleElastiCache_AddTagsToResource() {
  13. svc := elasticache.New(nil)
  14. params := &elasticache.AddTagsToResourceInput{
  15. ResourceName: aws.String("String"), // Required
  16. Tags: []*elasticache.Tag{ // Required
  17. { // Required
  18. Key: aws.String("String"),
  19. Value: aws.String("String"),
  20. },
  21. // More values...
  22. },
  23. }
  24. resp, err := svc.AddTagsToResource(params)
  25. if err != nil {
  26. // Print the error, cast err to awserr.Error to get the Code and
  27. // Message from an error.
  28. fmt.Println(err.Error())
  29. return
  30. }
  31. // Pretty-print the response data.
  32. fmt.Println(resp)
  33. }
  34. func ExampleElastiCache_AuthorizeCacheSecurityGroupIngress() {
  35. svc := elasticache.New(nil)
  36. params := &elasticache.AuthorizeCacheSecurityGroupIngressInput{
  37. CacheSecurityGroupName: aws.String("String"), // Required
  38. EC2SecurityGroupName: aws.String("String"), // Required
  39. EC2SecurityGroupOwnerId: aws.String("String"), // Required
  40. }
  41. resp, err := svc.AuthorizeCacheSecurityGroupIngress(params)
  42. if err != nil {
  43. // Print the error, cast err to awserr.Error to get the Code and
  44. // Message from an error.
  45. fmt.Println(err.Error())
  46. return
  47. }
  48. // Pretty-print the response data.
  49. fmt.Println(resp)
  50. }
  51. func ExampleElastiCache_CopySnapshot() {
  52. svc := elasticache.New(nil)
  53. params := &elasticache.CopySnapshotInput{
  54. SourceSnapshotName: aws.String("String"), // Required
  55. TargetSnapshotName: aws.String("String"), // Required
  56. }
  57. resp, err := svc.CopySnapshot(params)
  58. if err != nil {
  59. // Print the error, cast err to awserr.Error to get the Code and
  60. // Message from an error.
  61. fmt.Println(err.Error())
  62. return
  63. }
  64. // Pretty-print the response data.
  65. fmt.Println(resp)
  66. }
  67. func ExampleElastiCache_CreateCacheCluster() {
  68. svc := elasticache.New(nil)
  69. params := &elasticache.CreateCacheClusterInput{
  70. CacheClusterId: aws.String("String"), // Required
  71. AZMode: aws.String("AZMode"),
  72. AutoMinorVersionUpgrade: aws.Bool(true),
  73. CacheNodeType: aws.String("String"),
  74. CacheParameterGroupName: aws.String("String"),
  75. CacheSecurityGroupNames: []*string{
  76. aws.String("String"), // Required
  77. // More values...
  78. },
  79. CacheSubnetGroupName: aws.String("String"),
  80. Engine: aws.String("String"),
  81. EngineVersion: aws.String("String"),
  82. NotificationTopicArn: aws.String("String"),
  83. NumCacheNodes: aws.Int64(1),
  84. Port: aws.Int64(1),
  85. PreferredAvailabilityZone: aws.String("String"),
  86. PreferredAvailabilityZones: []*string{
  87. aws.String("String"), // Required
  88. // More values...
  89. },
  90. PreferredMaintenanceWindow: aws.String("String"),
  91. ReplicationGroupId: aws.String("String"),
  92. SecurityGroupIds: []*string{
  93. aws.String("String"), // Required
  94. // More values...
  95. },
  96. SnapshotArns: []*string{
  97. aws.String("String"), // Required
  98. // More values...
  99. },
  100. SnapshotName: aws.String("String"),
  101. SnapshotRetentionLimit: aws.Int64(1),
  102. SnapshotWindow: aws.String("String"),
  103. Tags: []*elasticache.Tag{
  104. { // Required
  105. Key: aws.String("String"),
  106. Value: aws.String("String"),
  107. },
  108. // More values...
  109. },
  110. }
  111. resp, err := svc.CreateCacheCluster(params)
  112. if err != nil {
  113. // Print the error, cast err to awserr.Error to get the Code and
  114. // Message from an error.
  115. fmt.Println(err.Error())
  116. return
  117. }
  118. // Pretty-print the response data.
  119. fmt.Println(resp)
  120. }
  121. func ExampleElastiCache_CreateCacheParameterGroup() {
  122. svc := elasticache.New(nil)
  123. params := &elasticache.CreateCacheParameterGroupInput{
  124. CacheParameterGroupFamily: aws.String("String"), // Required
  125. CacheParameterGroupName: aws.String("String"), // Required
  126. Description: aws.String("String"), // Required
  127. }
  128. resp, err := svc.CreateCacheParameterGroup(params)
  129. if err != nil {
  130. // Print the error, cast err to awserr.Error to get the Code and
  131. // Message from an error.
  132. fmt.Println(err.Error())
  133. return
  134. }
  135. // Pretty-print the response data.
  136. fmt.Println(resp)
  137. }
  138. func ExampleElastiCache_CreateCacheSecurityGroup() {
  139. svc := elasticache.New(nil)
  140. params := &elasticache.CreateCacheSecurityGroupInput{
  141. CacheSecurityGroupName: aws.String("String"), // Required
  142. Description: aws.String("String"), // Required
  143. }
  144. resp, err := svc.CreateCacheSecurityGroup(params)
  145. if err != nil {
  146. // Print the error, cast err to awserr.Error to get the Code and
  147. // Message from an error.
  148. fmt.Println(err.Error())
  149. return
  150. }
  151. // Pretty-print the response data.
  152. fmt.Println(resp)
  153. }
  154. func ExampleElastiCache_CreateCacheSubnetGroup() {
  155. svc := elasticache.New(nil)
  156. params := &elasticache.CreateCacheSubnetGroupInput{
  157. CacheSubnetGroupDescription: aws.String("String"), // Required
  158. CacheSubnetGroupName: aws.String("String"), // Required
  159. SubnetIds: []*string{ // Required
  160. aws.String("String"), // Required
  161. // More values...
  162. },
  163. }
  164. resp, err := svc.CreateCacheSubnetGroup(params)
  165. if err != nil {
  166. // Print the error, cast err to awserr.Error to get the Code and
  167. // Message from an error.
  168. fmt.Println(err.Error())
  169. return
  170. }
  171. // Pretty-print the response data.
  172. fmt.Println(resp)
  173. }
  174. func ExampleElastiCache_CreateReplicationGroup() {
  175. svc := elasticache.New(nil)
  176. params := &elasticache.CreateReplicationGroupInput{
  177. ReplicationGroupDescription: aws.String("String"), // Required
  178. ReplicationGroupId: aws.String("String"), // Required
  179. AutoMinorVersionUpgrade: aws.Bool(true),
  180. AutomaticFailoverEnabled: aws.Bool(true),
  181. CacheNodeType: aws.String("String"),
  182. CacheParameterGroupName: aws.String("String"),
  183. CacheSecurityGroupNames: []*string{
  184. aws.String("String"), // Required
  185. // More values...
  186. },
  187. CacheSubnetGroupName: aws.String("String"),
  188. Engine: aws.String("String"),
  189. EngineVersion: aws.String("String"),
  190. NotificationTopicArn: aws.String("String"),
  191. NumCacheClusters: aws.Int64(1),
  192. Port: aws.Int64(1),
  193. PreferredCacheClusterAZs: []*string{
  194. aws.String("String"), // Required
  195. // More values...
  196. },
  197. PreferredMaintenanceWindow: aws.String("String"),
  198. PrimaryClusterId: aws.String("String"),
  199. SecurityGroupIds: []*string{
  200. aws.String("String"), // Required
  201. // More values...
  202. },
  203. SnapshotArns: []*string{
  204. aws.String("String"), // Required
  205. // More values...
  206. },
  207. SnapshotName: aws.String("String"),
  208. SnapshotRetentionLimit: aws.Int64(1),
  209. SnapshotWindow: aws.String("String"),
  210. Tags: []*elasticache.Tag{
  211. { // Required
  212. Key: aws.String("String"),
  213. Value: aws.String("String"),
  214. },
  215. // More values...
  216. },
  217. }
  218. resp, err := svc.CreateReplicationGroup(params)
  219. if err != nil {
  220. // Print the error, cast err to awserr.Error to get the Code and
  221. // Message from an error.
  222. fmt.Println(err.Error())
  223. return
  224. }
  225. // Pretty-print the response data.
  226. fmt.Println(resp)
  227. }
  228. func ExampleElastiCache_CreateSnapshot() {
  229. svc := elasticache.New(nil)
  230. params := &elasticache.CreateSnapshotInput{
  231. CacheClusterId: aws.String("String"), // Required
  232. SnapshotName: aws.String("String"), // Required
  233. }
  234. resp, err := svc.CreateSnapshot(params)
  235. if err != nil {
  236. // Print the error, cast err to awserr.Error to get the Code and
  237. // Message from an error.
  238. fmt.Println(err.Error())
  239. return
  240. }
  241. // Pretty-print the response data.
  242. fmt.Println(resp)
  243. }
  244. func ExampleElastiCache_DeleteCacheCluster() {
  245. svc := elasticache.New(nil)
  246. params := &elasticache.DeleteCacheClusterInput{
  247. CacheClusterId: aws.String("String"), // Required
  248. FinalSnapshotIdentifier: aws.String("String"),
  249. }
  250. resp, err := svc.DeleteCacheCluster(params)
  251. if err != nil {
  252. // Print the error, cast err to awserr.Error to get the Code and
  253. // Message from an error.
  254. fmt.Println(err.Error())
  255. return
  256. }
  257. // Pretty-print the response data.
  258. fmt.Println(resp)
  259. }
  260. func ExampleElastiCache_DeleteCacheParameterGroup() {
  261. svc := elasticache.New(nil)
  262. params := &elasticache.DeleteCacheParameterGroupInput{
  263. CacheParameterGroupName: aws.String("String"), // Required
  264. }
  265. resp, err := svc.DeleteCacheParameterGroup(params)
  266. if err != nil {
  267. // Print the error, cast err to awserr.Error to get the Code and
  268. // Message from an error.
  269. fmt.Println(err.Error())
  270. return
  271. }
  272. // Pretty-print the response data.
  273. fmt.Println(resp)
  274. }
  275. func ExampleElastiCache_DeleteCacheSecurityGroup() {
  276. svc := elasticache.New(nil)
  277. params := &elasticache.DeleteCacheSecurityGroupInput{
  278. CacheSecurityGroupName: aws.String("String"), // Required
  279. }
  280. resp, err := svc.DeleteCacheSecurityGroup(params)
  281. if err != nil {
  282. // Print the error, cast err to awserr.Error to get the Code and
  283. // Message from an error.
  284. fmt.Println(err.Error())
  285. return
  286. }
  287. // Pretty-print the response data.
  288. fmt.Println(resp)
  289. }
  290. func ExampleElastiCache_DeleteCacheSubnetGroup() {
  291. svc := elasticache.New(nil)
  292. params := &elasticache.DeleteCacheSubnetGroupInput{
  293. CacheSubnetGroupName: aws.String("String"), // Required
  294. }
  295. resp, err := svc.DeleteCacheSubnetGroup(params)
  296. if err != nil {
  297. // Print the error, cast err to awserr.Error to get the Code and
  298. // Message from an error.
  299. fmt.Println(err.Error())
  300. return
  301. }
  302. // Pretty-print the response data.
  303. fmt.Println(resp)
  304. }
  305. func ExampleElastiCache_DeleteReplicationGroup() {
  306. svc := elasticache.New(nil)
  307. params := &elasticache.DeleteReplicationGroupInput{
  308. ReplicationGroupId: aws.String("String"), // Required
  309. FinalSnapshotIdentifier: aws.String("String"),
  310. RetainPrimaryCluster: aws.Bool(true),
  311. }
  312. resp, err := svc.DeleteReplicationGroup(params)
  313. if err != nil {
  314. // Print the error, cast err to awserr.Error to get the Code and
  315. // Message from an error.
  316. fmt.Println(err.Error())
  317. return
  318. }
  319. // Pretty-print the response data.
  320. fmt.Println(resp)
  321. }
  322. func ExampleElastiCache_DeleteSnapshot() {
  323. svc := elasticache.New(nil)
  324. params := &elasticache.DeleteSnapshotInput{
  325. SnapshotName: aws.String("String"), // Required
  326. }
  327. resp, err := svc.DeleteSnapshot(params)
  328. if err != nil {
  329. // Print the error, cast err to awserr.Error to get the Code and
  330. // Message from an error.
  331. fmt.Println(err.Error())
  332. return
  333. }
  334. // Pretty-print the response data.
  335. fmt.Println(resp)
  336. }
  337. func ExampleElastiCache_DescribeCacheClusters() {
  338. svc := elasticache.New(nil)
  339. params := &elasticache.DescribeCacheClustersInput{
  340. CacheClusterId: aws.String("String"),
  341. Marker: aws.String("String"),
  342. MaxRecords: aws.Int64(1),
  343. ShowCacheNodeInfo: aws.Bool(true),
  344. }
  345. resp, err := svc.DescribeCacheClusters(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 ExampleElastiCache_DescribeCacheEngineVersions() {
  356. svc := elasticache.New(nil)
  357. params := &elasticache.DescribeCacheEngineVersionsInput{
  358. CacheParameterGroupFamily: aws.String("String"),
  359. DefaultOnly: aws.Bool(true),
  360. Engine: aws.String("String"),
  361. EngineVersion: aws.String("String"),
  362. Marker: aws.String("String"),
  363. MaxRecords: aws.Int64(1),
  364. }
  365. resp, err := svc.DescribeCacheEngineVersions(params)
  366. if err != nil {
  367. // Print the error, cast err to awserr.Error to get the Code and
  368. // Message from an error.
  369. fmt.Println(err.Error())
  370. return
  371. }
  372. // Pretty-print the response data.
  373. fmt.Println(resp)
  374. }
  375. func ExampleElastiCache_DescribeCacheParameterGroups() {
  376. svc := elasticache.New(nil)
  377. params := &elasticache.DescribeCacheParameterGroupsInput{
  378. CacheParameterGroupName: aws.String("String"),
  379. Marker: aws.String("String"),
  380. MaxRecords: aws.Int64(1),
  381. }
  382. resp, err := svc.DescribeCacheParameterGroups(params)
  383. if err != nil {
  384. // Print the error, cast err to awserr.Error to get the Code and
  385. // Message from an error.
  386. fmt.Println(err.Error())
  387. return
  388. }
  389. // Pretty-print the response data.
  390. fmt.Println(resp)
  391. }
  392. func ExampleElastiCache_DescribeCacheParameters() {
  393. svc := elasticache.New(nil)
  394. params := &elasticache.DescribeCacheParametersInput{
  395. CacheParameterGroupName: aws.String("String"), // Required
  396. Marker: aws.String("String"),
  397. MaxRecords: aws.Int64(1),
  398. Source: aws.String("String"),
  399. }
  400. resp, err := svc.DescribeCacheParameters(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 ExampleElastiCache_DescribeCacheSecurityGroups() {
  411. svc := elasticache.New(nil)
  412. params := &elasticache.DescribeCacheSecurityGroupsInput{
  413. CacheSecurityGroupName: aws.String("String"),
  414. Marker: aws.String("String"),
  415. MaxRecords: aws.Int64(1),
  416. }
  417. resp, err := svc.DescribeCacheSecurityGroups(params)
  418. if err != nil {
  419. // Print the error, cast err to awserr.Error to get the Code and
  420. // Message from an error.
  421. fmt.Println(err.Error())
  422. return
  423. }
  424. // Pretty-print the response data.
  425. fmt.Println(resp)
  426. }
  427. func ExampleElastiCache_DescribeCacheSubnetGroups() {
  428. svc := elasticache.New(nil)
  429. params := &elasticache.DescribeCacheSubnetGroupsInput{
  430. CacheSubnetGroupName: aws.String("String"),
  431. Marker: aws.String("String"),
  432. MaxRecords: aws.Int64(1),
  433. }
  434. resp, err := svc.DescribeCacheSubnetGroups(params)
  435. if err != nil {
  436. // Print the error, cast err to awserr.Error to get the Code and
  437. // Message from an error.
  438. fmt.Println(err.Error())
  439. return
  440. }
  441. // Pretty-print the response data.
  442. fmt.Println(resp)
  443. }
  444. func ExampleElastiCache_DescribeEngineDefaultParameters() {
  445. svc := elasticache.New(nil)
  446. params := &elasticache.DescribeEngineDefaultParametersInput{
  447. CacheParameterGroupFamily: aws.String("String"), // Required
  448. Marker: aws.String("String"),
  449. MaxRecords: aws.Int64(1),
  450. }
  451. resp, err := svc.DescribeEngineDefaultParameters(params)
  452. if err != nil {
  453. // Print the error, cast err to awserr.Error to get the Code and
  454. // Message from an error.
  455. fmt.Println(err.Error())
  456. return
  457. }
  458. // Pretty-print the response data.
  459. fmt.Println(resp)
  460. }
  461. func ExampleElastiCache_DescribeEvents() {
  462. svc := elasticache.New(nil)
  463. params := &elasticache.DescribeEventsInput{
  464. Duration: aws.Int64(1),
  465. EndTime: aws.Time(time.Now()),
  466. Marker: aws.String("String"),
  467. MaxRecords: aws.Int64(1),
  468. SourceIdentifier: aws.String("String"),
  469. SourceType: aws.String("SourceType"),
  470. StartTime: aws.Time(time.Now()),
  471. }
  472. resp, err := svc.DescribeEvents(params)
  473. if err != nil {
  474. // Print the error, cast err to awserr.Error to get the Code and
  475. // Message from an error.
  476. fmt.Println(err.Error())
  477. return
  478. }
  479. // Pretty-print the response data.
  480. fmt.Println(resp)
  481. }
  482. func ExampleElastiCache_DescribeReplicationGroups() {
  483. svc := elasticache.New(nil)
  484. params := &elasticache.DescribeReplicationGroupsInput{
  485. Marker: aws.String("String"),
  486. MaxRecords: aws.Int64(1),
  487. ReplicationGroupId: aws.String("String"),
  488. }
  489. resp, err := svc.DescribeReplicationGroups(params)
  490. if err != nil {
  491. // Print the error, cast err to awserr.Error to get the Code and
  492. // Message from an error.
  493. fmt.Println(err.Error())
  494. return
  495. }
  496. // Pretty-print the response data.
  497. fmt.Println(resp)
  498. }
  499. func ExampleElastiCache_DescribeReservedCacheNodes() {
  500. svc := elasticache.New(nil)
  501. params := &elasticache.DescribeReservedCacheNodesInput{
  502. CacheNodeType: aws.String("String"),
  503. Duration: aws.String("String"),
  504. Marker: aws.String("String"),
  505. MaxRecords: aws.Int64(1),
  506. OfferingType: aws.String("String"),
  507. ProductDescription: aws.String("String"),
  508. ReservedCacheNodeId: aws.String("String"),
  509. ReservedCacheNodesOfferingId: aws.String("String"),
  510. }
  511. resp, err := svc.DescribeReservedCacheNodes(params)
  512. if err != nil {
  513. // Print the error, cast err to awserr.Error to get the Code and
  514. // Message from an error.
  515. fmt.Println(err.Error())
  516. return
  517. }
  518. // Pretty-print the response data.
  519. fmt.Println(resp)
  520. }
  521. func ExampleElastiCache_DescribeReservedCacheNodesOfferings() {
  522. svc := elasticache.New(nil)
  523. params := &elasticache.DescribeReservedCacheNodesOfferingsInput{
  524. CacheNodeType: aws.String("String"),
  525. Duration: aws.String("String"),
  526. Marker: aws.String("String"),
  527. MaxRecords: aws.Int64(1),
  528. OfferingType: aws.String("String"),
  529. ProductDescription: aws.String("String"),
  530. ReservedCacheNodesOfferingId: aws.String("String"),
  531. }
  532. resp, err := svc.DescribeReservedCacheNodesOfferings(params)
  533. if err != nil {
  534. // Print the error, cast err to awserr.Error to get the Code and
  535. // Message from an error.
  536. fmt.Println(err.Error())
  537. return
  538. }
  539. // Pretty-print the response data.
  540. fmt.Println(resp)
  541. }
  542. func ExampleElastiCache_DescribeSnapshots() {
  543. svc := elasticache.New(nil)
  544. params := &elasticache.DescribeSnapshotsInput{
  545. CacheClusterId: aws.String("String"),
  546. Marker: aws.String("String"),
  547. MaxRecords: aws.Int64(1),
  548. SnapshotName: aws.String("String"),
  549. SnapshotSource: aws.String("String"),
  550. }
  551. resp, err := svc.DescribeSnapshots(params)
  552. if err != nil {
  553. // Print the error, cast err to awserr.Error to get the Code and
  554. // Message from an error.
  555. fmt.Println(err.Error())
  556. return
  557. }
  558. // Pretty-print the response data.
  559. fmt.Println(resp)
  560. }
  561. func ExampleElastiCache_ListTagsForResource() {
  562. svc := elasticache.New(nil)
  563. params := &elasticache.ListTagsForResourceInput{
  564. ResourceName: aws.String("String"), // Required
  565. }
  566. resp, err := svc.ListTagsForResource(params)
  567. if err != nil {
  568. // Print the error, cast err to awserr.Error to get the Code and
  569. // Message from an error.
  570. fmt.Println(err.Error())
  571. return
  572. }
  573. // Pretty-print the response data.
  574. fmt.Println(resp)
  575. }
  576. func ExampleElastiCache_ModifyCacheCluster() {
  577. svc := elasticache.New(nil)
  578. params := &elasticache.ModifyCacheClusterInput{
  579. CacheClusterId: aws.String("String"), // Required
  580. AZMode: aws.String("AZMode"),
  581. ApplyImmediately: aws.Bool(true),
  582. AutoMinorVersionUpgrade: aws.Bool(true),
  583. CacheNodeIdsToRemove: []*string{
  584. aws.String("String"), // Required
  585. // More values...
  586. },
  587. CacheParameterGroupName: aws.String("String"),
  588. CacheSecurityGroupNames: []*string{
  589. aws.String("String"), // Required
  590. // More values...
  591. },
  592. EngineVersion: aws.String("String"),
  593. NewAvailabilityZones: []*string{
  594. aws.String("String"), // Required
  595. // More values...
  596. },
  597. NotificationTopicArn: aws.String("String"),
  598. NotificationTopicStatus: aws.String("String"),
  599. NumCacheNodes: aws.Int64(1),
  600. PreferredMaintenanceWindow: aws.String("String"),
  601. SecurityGroupIds: []*string{
  602. aws.String("String"), // Required
  603. // More values...
  604. },
  605. SnapshotRetentionLimit: aws.Int64(1),
  606. SnapshotWindow: aws.String("String"),
  607. }
  608. resp, err := svc.ModifyCacheCluster(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 ExampleElastiCache_ModifyCacheParameterGroup() {
  619. svc := elasticache.New(nil)
  620. params := &elasticache.ModifyCacheParameterGroupInput{
  621. CacheParameterGroupName: aws.String("String"), // Required
  622. ParameterNameValues: []*elasticache.ParameterNameValue{ // Required
  623. { // Required
  624. ParameterName: aws.String("String"),
  625. ParameterValue: aws.String("String"),
  626. },
  627. // More values...
  628. },
  629. }
  630. resp, err := svc.ModifyCacheParameterGroup(params)
  631. if err != nil {
  632. // Print the error, cast err to awserr.Error to get the Code and
  633. // Message from an error.
  634. fmt.Println(err.Error())
  635. return
  636. }
  637. // Pretty-print the response data.
  638. fmt.Println(resp)
  639. }
  640. func ExampleElastiCache_ModifyCacheSubnetGroup() {
  641. svc := elasticache.New(nil)
  642. params := &elasticache.ModifyCacheSubnetGroupInput{
  643. CacheSubnetGroupName: aws.String("String"), // Required
  644. CacheSubnetGroupDescription: aws.String("String"),
  645. SubnetIds: []*string{
  646. aws.String("String"), // Required
  647. // More values...
  648. },
  649. }
  650. resp, err := svc.ModifyCacheSubnetGroup(params)
  651. if err != nil {
  652. // Print the error, cast err to awserr.Error to get the Code and
  653. // Message from an error.
  654. fmt.Println(err.Error())
  655. return
  656. }
  657. // Pretty-print the response data.
  658. fmt.Println(resp)
  659. }
  660. func ExampleElastiCache_ModifyReplicationGroup() {
  661. svc := elasticache.New(nil)
  662. params := &elasticache.ModifyReplicationGroupInput{
  663. ReplicationGroupId: aws.String("String"), // Required
  664. ApplyImmediately: aws.Bool(true),
  665. AutoMinorVersionUpgrade: aws.Bool(true),
  666. AutomaticFailoverEnabled: aws.Bool(true),
  667. CacheParameterGroupName: aws.String("String"),
  668. CacheSecurityGroupNames: []*string{
  669. aws.String("String"), // Required
  670. // More values...
  671. },
  672. EngineVersion: aws.String("String"),
  673. NotificationTopicArn: aws.String("String"),
  674. NotificationTopicStatus: aws.String("String"),
  675. PreferredMaintenanceWindow: aws.String("String"),
  676. PrimaryClusterId: aws.String("String"),
  677. ReplicationGroupDescription: aws.String("String"),
  678. SecurityGroupIds: []*string{
  679. aws.String("String"), // Required
  680. // More values...
  681. },
  682. SnapshotRetentionLimit: aws.Int64(1),
  683. SnapshotWindow: aws.String("String"),
  684. SnapshottingClusterId: aws.String("String"),
  685. }
  686. resp, err := svc.ModifyReplicationGroup(params)
  687. if err != nil {
  688. // Print the error, cast err to awserr.Error to get the Code and
  689. // Message from an error.
  690. fmt.Println(err.Error())
  691. return
  692. }
  693. // Pretty-print the response data.
  694. fmt.Println(resp)
  695. }
  696. func ExampleElastiCache_PurchaseReservedCacheNodesOffering() {
  697. svc := elasticache.New(nil)
  698. params := &elasticache.PurchaseReservedCacheNodesOfferingInput{
  699. ReservedCacheNodesOfferingId: aws.String("String"), // Required
  700. CacheNodeCount: aws.Int64(1),
  701. ReservedCacheNodeId: aws.String("String"),
  702. }
  703. resp, err := svc.PurchaseReservedCacheNodesOffering(params)
  704. if err != nil {
  705. // Print the error, cast err to awserr.Error to get the Code and
  706. // Message from an error.
  707. fmt.Println(err.Error())
  708. return
  709. }
  710. // Pretty-print the response data.
  711. fmt.Println(resp)
  712. }
  713. func ExampleElastiCache_RebootCacheCluster() {
  714. svc := elasticache.New(nil)
  715. params := &elasticache.RebootCacheClusterInput{
  716. CacheClusterId: aws.String("String"), // Required
  717. CacheNodeIdsToReboot: []*string{ // Required
  718. aws.String("String"), // Required
  719. // More values...
  720. },
  721. }
  722. resp, err := svc.RebootCacheCluster(params)
  723. if err != nil {
  724. // Print the error, cast err to awserr.Error to get the Code and
  725. // Message from an error.
  726. fmt.Println(err.Error())
  727. return
  728. }
  729. // Pretty-print the response data.
  730. fmt.Println(resp)
  731. }
  732. func ExampleElastiCache_RemoveTagsFromResource() {
  733. svc := elasticache.New(nil)
  734. params := &elasticache.RemoveTagsFromResourceInput{
  735. ResourceName: aws.String("String"), // Required
  736. TagKeys: []*string{ // Required
  737. aws.String("String"), // Required
  738. // More values...
  739. },
  740. }
  741. resp, err := svc.RemoveTagsFromResource(params)
  742. if err != nil {
  743. // Print the error, cast err to awserr.Error to get the Code and
  744. // Message from an error.
  745. fmt.Println(err.Error())
  746. return
  747. }
  748. // Pretty-print the response data.
  749. fmt.Println(resp)
  750. }
  751. func ExampleElastiCache_ResetCacheParameterGroup() {
  752. svc := elasticache.New(nil)
  753. params := &elasticache.ResetCacheParameterGroupInput{
  754. CacheParameterGroupName: aws.String("String"), // Required
  755. ParameterNameValues: []*elasticache.ParameterNameValue{ // Required
  756. { // Required
  757. ParameterName: aws.String("String"),
  758. ParameterValue: aws.String("String"),
  759. },
  760. // More values...
  761. },
  762. ResetAllParameters: aws.Bool(true),
  763. }
  764. resp, err := svc.ResetCacheParameterGroup(params)
  765. if err != nil {
  766. // Print the error, cast err to awserr.Error to get the Code and
  767. // Message from an error.
  768. fmt.Println(err.Error())
  769. return
  770. }
  771. // Pretty-print the response data.
  772. fmt.Println(resp)
  773. }
  774. func ExampleElastiCache_RevokeCacheSecurityGroupIngress() {
  775. svc := elasticache.New(nil)
  776. params := &elasticache.RevokeCacheSecurityGroupIngressInput{
  777. CacheSecurityGroupName: aws.String("String"), // Required
  778. EC2SecurityGroupName: aws.String("String"), // Required
  779. EC2SecurityGroupOwnerId: aws.String("String"), // Required
  780. }
  781. resp, err := svc.RevokeCacheSecurityGroupIngress(params)
  782. if err != nil {
  783. // Print the error, cast err to awserr.Error to get the Code and
  784. // Message from an error.
  785. fmt.Println(err.Error())
  786. return
  787. }
  788. // Pretty-print the response data.
  789. fmt.Println(resp)
  790. }