examples_test.go 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package databasemigrationservice_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/databasemigrationservice"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleDatabaseMigrationService_AddTagsToResource() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := databasemigrationservice.New(sess)
  20. params := &databasemigrationservice.AddTagsToResourceInput{
  21. ResourceArn: aws.String("String"), // Required
  22. Tags: []*databasemigrationservice.Tag{ // Required
  23. { // Required
  24. Key: aws.String("String"),
  25. Value: aws.String("String"),
  26. },
  27. // More values...
  28. },
  29. }
  30. resp, err := svc.AddTagsToResource(params)
  31. if err != nil {
  32. // Print the error, cast err to awserr.Error to get the Code and
  33. // Message from an error.
  34. fmt.Println(err.Error())
  35. return
  36. }
  37. // Pretty-print the response data.
  38. fmt.Println(resp)
  39. }
  40. func ExampleDatabaseMigrationService_CreateEndpoint() {
  41. sess, err := session.NewSession()
  42. if err != nil {
  43. fmt.Println("failed to create session,", err)
  44. return
  45. }
  46. svc := databasemigrationservice.New(sess)
  47. params := &databasemigrationservice.CreateEndpointInput{
  48. EndpointIdentifier: aws.String("String"), // Required
  49. EndpointType: aws.String("ReplicationEndpointTypeValue"), // Required
  50. EngineName: aws.String("String"), // Required
  51. Password: aws.String("SecretString"), // Required
  52. Port: aws.Int64(1), // Required
  53. ServerName: aws.String("String"), // Required
  54. Username: aws.String("String"), // Required
  55. CertificateArn: aws.String("String"),
  56. DatabaseName: aws.String("String"),
  57. ExtraConnectionAttributes: aws.String("String"),
  58. KmsKeyId: aws.String("String"),
  59. SslMode: aws.String("DmsSslModeValue"),
  60. Tags: []*databasemigrationservice.Tag{
  61. { // Required
  62. Key: aws.String("String"),
  63. Value: aws.String("String"),
  64. },
  65. // More values...
  66. },
  67. }
  68. resp, err := svc.CreateEndpoint(params)
  69. if err != nil {
  70. // Print the error, cast err to awserr.Error to get the Code and
  71. // Message from an error.
  72. fmt.Println(err.Error())
  73. return
  74. }
  75. // Pretty-print the response data.
  76. fmt.Println(resp)
  77. }
  78. func ExampleDatabaseMigrationService_CreateReplicationInstance() {
  79. sess, err := session.NewSession()
  80. if err != nil {
  81. fmt.Println("failed to create session,", err)
  82. return
  83. }
  84. svc := databasemigrationservice.New(sess)
  85. params := &databasemigrationservice.CreateReplicationInstanceInput{
  86. ReplicationInstanceClass: aws.String("String"), // Required
  87. ReplicationInstanceIdentifier: aws.String("String"), // Required
  88. AllocatedStorage: aws.Int64(1),
  89. AutoMinorVersionUpgrade: aws.Bool(true),
  90. AvailabilityZone: aws.String("String"),
  91. EngineVersion: aws.String("String"),
  92. KmsKeyId: aws.String("String"),
  93. MultiAZ: aws.Bool(true),
  94. PreferredMaintenanceWindow: aws.String("String"),
  95. PubliclyAccessible: aws.Bool(true),
  96. ReplicationSubnetGroupIdentifier: aws.String("String"),
  97. Tags: []*databasemigrationservice.Tag{
  98. { // Required
  99. Key: aws.String("String"),
  100. Value: aws.String("String"),
  101. },
  102. // More values...
  103. },
  104. VpcSecurityGroupIds: []*string{
  105. aws.String("String"), // Required
  106. // More values...
  107. },
  108. }
  109. resp, err := svc.CreateReplicationInstance(params)
  110. if err != nil {
  111. // Print the error, cast err to awserr.Error to get the Code and
  112. // Message from an error.
  113. fmt.Println(err.Error())
  114. return
  115. }
  116. // Pretty-print the response data.
  117. fmt.Println(resp)
  118. }
  119. func ExampleDatabaseMigrationService_CreateReplicationSubnetGroup() {
  120. sess, err := session.NewSession()
  121. if err != nil {
  122. fmt.Println("failed to create session,", err)
  123. return
  124. }
  125. svc := databasemigrationservice.New(sess)
  126. params := &databasemigrationservice.CreateReplicationSubnetGroupInput{
  127. ReplicationSubnetGroupDescription: aws.String("String"), // Required
  128. ReplicationSubnetGroupIdentifier: aws.String("String"), // Required
  129. SubnetIds: []*string{ // Required
  130. aws.String("String"), // Required
  131. // More values...
  132. },
  133. Tags: []*databasemigrationservice.Tag{
  134. { // Required
  135. Key: aws.String("String"),
  136. Value: aws.String("String"),
  137. },
  138. // More values...
  139. },
  140. }
  141. resp, err := svc.CreateReplicationSubnetGroup(params)
  142. if err != nil {
  143. // Print the error, cast err to awserr.Error to get the Code and
  144. // Message from an error.
  145. fmt.Println(err.Error())
  146. return
  147. }
  148. // Pretty-print the response data.
  149. fmt.Println(resp)
  150. }
  151. func ExampleDatabaseMigrationService_CreateReplicationTask() {
  152. sess, err := session.NewSession()
  153. if err != nil {
  154. fmt.Println("failed to create session,", err)
  155. return
  156. }
  157. svc := databasemigrationservice.New(sess)
  158. params := &databasemigrationservice.CreateReplicationTaskInput{
  159. MigrationType: aws.String("MigrationTypeValue"), // Required
  160. ReplicationInstanceArn: aws.String("String"), // Required
  161. ReplicationTaskIdentifier: aws.String("String"), // Required
  162. SourceEndpointArn: aws.String("String"), // Required
  163. TableMappings: aws.String("String"), // Required
  164. TargetEndpointArn: aws.String("String"), // Required
  165. CdcStartTime: aws.Time(time.Now()),
  166. ReplicationTaskSettings: aws.String("String"),
  167. Tags: []*databasemigrationservice.Tag{
  168. { // Required
  169. Key: aws.String("String"),
  170. Value: aws.String("String"),
  171. },
  172. // More values...
  173. },
  174. }
  175. resp, err := svc.CreateReplicationTask(params)
  176. if err != nil {
  177. // Print the error, cast err to awserr.Error to get the Code and
  178. // Message from an error.
  179. fmt.Println(err.Error())
  180. return
  181. }
  182. // Pretty-print the response data.
  183. fmt.Println(resp)
  184. }
  185. func ExampleDatabaseMigrationService_DeleteCertificate() {
  186. sess, err := session.NewSession()
  187. if err != nil {
  188. fmt.Println("failed to create session,", err)
  189. return
  190. }
  191. svc := databasemigrationservice.New(sess)
  192. params := &databasemigrationservice.DeleteCertificateInput{
  193. CertificateArn: aws.String("String"), // Required
  194. }
  195. resp, err := svc.DeleteCertificate(params)
  196. if err != nil {
  197. // Print the error, cast err to awserr.Error to get the Code and
  198. // Message from an error.
  199. fmt.Println(err.Error())
  200. return
  201. }
  202. // Pretty-print the response data.
  203. fmt.Println(resp)
  204. }
  205. func ExampleDatabaseMigrationService_DeleteEndpoint() {
  206. sess, err := session.NewSession()
  207. if err != nil {
  208. fmt.Println("failed to create session,", err)
  209. return
  210. }
  211. svc := databasemigrationservice.New(sess)
  212. params := &databasemigrationservice.DeleteEndpointInput{
  213. EndpointArn: aws.String("String"), // Required
  214. }
  215. resp, err := svc.DeleteEndpoint(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 ExampleDatabaseMigrationService_DeleteReplicationInstance() {
  226. sess, err := session.NewSession()
  227. if err != nil {
  228. fmt.Println("failed to create session,", err)
  229. return
  230. }
  231. svc := databasemigrationservice.New(sess)
  232. params := &databasemigrationservice.DeleteReplicationInstanceInput{
  233. ReplicationInstanceArn: aws.String("String"), // Required
  234. }
  235. resp, err := svc.DeleteReplicationInstance(params)
  236. if err != nil {
  237. // Print the error, cast err to awserr.Error to get the Code and
  238. // Message from an error.
  239. fmt.Println(err.Error())
  240. return
  241. }
  242. // Pretty-print the response data.
  243. fmt.Println(resp)
  244. }
  245. func ExampleDatabaseMigrationService_DeleteReplicationSubnetGroup() {
  246. sess, err := session.NewSession()
  247. if err != nil {
  248. fmt.Println("failed to create session,", err)
  249. return
  250. }
  251. svc := databasemigrationservice.New(sess)
  252. params := &databasemigrationservice.DeleteReplicationSubnetGroupInput{
  253. ReplicationSubnetGroupIdentifier: aws.String("String"), // Required
  254. }
  255. resp, err := svc.DeleteReplicationSubnetGroup(params)
  256. if err != nil {
  257. // Print the error, cast err to awserr.Error to get the Code and
  258. // Message from an error.
  259. fmt.Println(err.Error())
  260. return
  261. }
  262. // Pretty-print the response data.
  263. fmt.Println(resp)
  264. }
  265. func ExampleDatabaseMigrationService_DeleteReplicationTask() {
  266. sess, err := session.NewSession()
  267. if err != nil {
  268. fmt.Println("failed to create session,", err)
  269. return
  270. }
  271. svc := databasemigrationservice.New(sess)
  272. params := &databasemigrationservice.DeleteReplicationTaskInput{
  273. ReplicationTaskArn: aws.String("String"), // Required
  274. }
  275. resp, err := svc.DeleteReplicationTask(params)
  276. if err != nil {
  277. // Print the error, cast err to awserr.Error to get the Code and
  278. // Message from an error.
  279. fmt.Println(err.Error())
  280. return
  281. }
  282. // Pretty-print the response data.
  283. fmt.Println(resp)
  284. }
  285. func ExampleDatabaseMigrationService_DescribeAccountAttributes() {
  286. sess, err := session.NewSession()
  287. if err != nil {
  288. fmt.Println("failed to create session,", err)
  289. return
  290. }
  291. svc := databasemigrationservice.New(sess)
  292. var params *databasemigrationservice.DescribeAccountAttributesInput
  293. resp, err := svc.DescribeAccountAttributes(params)
  294. if err != nil {
  295. // Print the error, cast err to awserr.Error to get the Code and
  296. // Message from an error.
  297. fmt.Println(err.Error())
  298. return
  299. }
  300. // Pretty-print the response data.
  301. fmt.Println(resp)
  302. }
  303. func ExampleDatabaseMigrationService_DescribeCertificates() {
  304. sess, err := session.NewSession()
  305. if err != nil {
  306. fmt.Println("failed to create session,", err)
  307. return
  308. }
  309. svc := databasemigrationservice.New(sess)
  310. params := &databasemigrationservice.DescribeCertificatesInput{
  311. Filters: []*databasemigrationservice.Filter{
  312. { // Required
  313. Name: aws.String("String"), // Required
  314. Values: []*string{ // Required
  315. aws.String("String"), // Required
  316. // More values...
  317. },
  318. },
  319. // More values...
  320. },
  321. Marker: aws.String("String"),
  322. MaxRecords: aws.Int64(1),
  323. }
  324. resp, err := svc.DescribeCertificates(params)
  325. if err != nil {
  326. // Print the error, cast err to awserr.Error to get the Code and
  327. // Message from an error.
  328. fmt.Println(err.Error())
  329. return
  330. }
  331. // Pretty-print the response data.
  332. fmt.Println(resp)
  333. }
  334. func ExampleDatabaseMigrationService_DescribeConnections() {
  335. sess, err := session.NewSession()
  336. if err != nil {
  337. fmt.Println("failed to create session,", err)
  338. return
  339. }
  340. svc := databasemigrationservice.New(sess)
  341. params := &databasemigrationservice.DescribeConnectionsInput{
  342. Filters: []*databasemigrationservice.Filter{
  343. { // Required
  344. Name: aws.String("String"), // Required
  345. Values: []*string{ // Required
  346. aws.String("String"), // Required
  347. // More values...
  348. },
  349. },
  350. // More values...
  351. },
  352. Marker: aws.String("String"),
  353. MaxRecords: aws.Int64(1),
  354. }
  355. resp, err := svc.DescribeConnections(params)
  356. if err != nil {
  357. // Print the error, cast err to awserr.Error to get the Code and
  358. // Message from an error.
  359. fmt.Println(err.Error())
  360. return
  361. }
  362. // Pretty-print the response data.
  363. fmt.Println(resp)
  364. }
  365. func ExampleDatabaseMigrationService_DescribeEndpointTypes() {
  366. sess, err := session.NewSession()
  367. if err != nil {
  368. fmt.Println("failed to create session,", err)
  369. return
  370. }
  371. svc := databasemigrationservice.New(sess)
  372. params := &databasemigrationservice.DescribeEndpointTypesInput{
  373. Filters: []*databasemigrationservice.Filter{
  374. { // Required
  375. Name: aws.String("String"), // Required
  376. Values: []*string{ // Required
  377. aws.String("String"), // Required
  378. // More values...
  379. },
  380. },
  381. // More values...
  382. },
  383. Marker: aws.String("String"),
  384. MaxRecords: aws.Int64(1),
  385. }
  386. resp, err := svc.DescribeEndpointTypes(params)
  387. if err != nil {
  388. // Print the error, cast err to awserr.Error to get the Code and
  389. // Message from an error.
  390. fmt.Println(err.Error())
  391. return
  392. }
  393. // Pretty-print the response data.
  394. fmt.Println(resp)
  395. }
  396. func ExampleDatabaseMigrationService_DescribeEndpoints() {
  397. sess, err := session.NewSession()
  398. if err != nil {
  399. fmt.Println("failed to create session,", err)
  400. return
  401. }
  402. svc := databasemigrationservice.New(sess)
  403. params := &databasemigrationservice.DescribeEndpointsInput{
  404. Filters: []*databasemigrationservice.Filter{
  405. { // Required
  406. Name: aws.String("String"), // Required
  407. Values: []*string{ // Required
  408. aws.String("String"), // Required
  409. // More values...
  410. },
  411. },
  412. // More values...
  413. },
  414. Marker: aws.String("String"),
  415. MaxRecords: aws.Int64(1),
  416. }
  417. resp, err := svc.DescribeEndpoints(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 ExampleDatabaseMigrationService_DescribeOrderableReplicationInstances() {
  428. sess, err := session.NewSession()
  429. if err != nil {
  430. fmt.Println("failed to create session,", err)
  431. return
  432. }
  433. svc := databasemigrationservice.New(sess)
  434. params := &databasemigrationservice.DescribeOrderableReplicationInstancesInput{
  435. Marker: aws.String("String"),
  436. MaxRecords: aws.Int64(1),
  437. }
  438. resp, err := svc.DescribeOrderableReplicationInstances(params)
  439. if err != nil {
  440. // Print the error, cast err to awserr.Error to get the Code and
  441. // Message from an error.
  442. fmt.Println(err.Error())
  443. return
  444. }
  445. // Pretty-print the response data.
  446. fmt.Println(resp)
  447. }
  448. func ExampleDatabaseMigrationService_DescribeRefreshSchemasStatus() {
  449. sess, err := session.NewSession()
  450. if err != nil {
  451. fmt.Println("failed to create session,", err)
  452. return
  453. }
  454. svc := databasemigrationservice.New(sess)
  455. params := &databasemigrationservice.DescribeRefreshSchemasStatusInput{
  456. EndpointArn: aws.String("String"), // Required
  457. }
  458. resp, err := svc.DescribeRefreshSchemasStatus(params)
  459. if err != nil {
  460. // Print the error, cast err to awserr.Error to get the Code and
  461. // Message from an error.
  462. fmt.Println(err.Error())
  463. return
  464. }
  465. // Pretty-print the response data.
  466. fmt.Println(resp)
  467. }
  468. func ExampleDatabaseMigrationService_DescribeReplicationInstances() {
  469. sess, err := session.NewSession()
  470. if err != nil {
  471. fmt.Println("failed to create session,", err)
  472. return
  473. }
  474. svc := databasemigrationservice.New(sess)
  475. params := &databasemigrationservice.DescribeReplicationInstancesInput{
  476. Filters: []*databasemigrationservice.Filter{
  477. { // Required
  478. Name: aws.String("String"), // Required
  479. Values: []*string{ // Required
  480. aws.String("String"), // Required
  481. // More values...
  482. },
  483. },
  484. // More values...
  485. },
  486. Marker: aws.String("String"),
  487. MaxRecords: aws.Int64(1),
  488. }
  489. resp, err := svc.DescribeReplicationInstances(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 ExampleDatabaseMigrationService_DescribeReplicationSubnetGroups() {
  500. sess, err := session.NewSession()
  501. if err != nil {
  502. fmt.Println("failed to create session,", err)
  503. return
  504. }
  505. svc := databasemigrationservice.New(sess)
  506. params := &databasemigrationservice.DescribeReplicationSubnetGroupsInput{
  507. Filters: []*databasemigrationservice.Filter{
  508. { // Required
  509. Name: aws.String("String"), // Required
  510. Values: []*string{ // Required
  511. aws.String("String"), // Required
  512. // More values...
  513. },
  514. },
  515. // More values...
  516. },
  517. Marker: aws.String("String"),
  518. MaxRecords: aws.Int64(1),
  519. }
  520. resp, err := svc.DescribeReplicationSubnetGroups(params)
  521. if err != nil {
  522. // Print the error, cast err to awserr.Error to get the Code and
  523. // Message from an error.
  524. fmt.Println(err.Error())
  525. return
  526. }
  527. // Pretty-print the response data.
  528. fmt.Println(resp)
  529. }
  530. func ExampleDatabaseMigrationService_DescribeReplicationTasks() {
  531. sess, err := session.NewSession()
  532. if err != nil {
  533. fmt.Println("failed to create session,", err)
  534. return
  535. }
  536. svc := databasemigrationservice.New(sess)
  537. params := &databasemigrationservice.DescribeReplicationTasksInput{
  538. Filters: []*databasemigrationservice.Filter{
  539. { // Required
  540. Name: aws.String("String"), // Required
  541. Values: []*string{ // Required
  542. aws.String("String"), // Required
  543. // More values...
  544. },
  545. },
  546. // More values...
  547. },
  548. Marker: aws.String("String"),
  549. MaxRecords: aws.Int64(1),
  550. }
  551. resp, err := svc.DescribeReplicationTasks(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 ExampleDatabaseMigrationService_DescribeSchemas() {
  562. sess, err := session.NewSession()
  563. if err != nil {
  564. fmt.Println("failed to create session,", err)
  565. return
  566. }
  567. svc := databasemigrationservice.New(sess)
  568. params := &databasemigrationservice.DescribeSchemasInput{
  569. EndpointArn: aws.String("String"), // Required
  570. Marker: aws.String("String"),
  571. MaxRecords: aws.Int64(1),
  572. }
  573. resp, err := svc.DescribeSchemas(params)
  574. if err != nil {
  575. // Print the error, cast err to awserr.Error to get the Code and
  576. // Message from an error.
  577. fmt.Println(err.Error())
  578. return
  579. }
  580. // Pretty-print the response data.
  581. fmt.Println(resp)
  582. }
  583. func ExampleDatabaseMigrationService_DescribeTableStatistics() {
  584. sess, err := session.NewSession()
  585. if err != nil {
  586. fmt.Println("failed to create session,", err)
  587. return
  588. }
  589. svc := databasemigrationservice.New(sess)
  590. params := &databasemigrationservice.DescribeTableStatisticsInput{
  591. ReplicationTaskArn: aws.String("String"), // Required
  592. Marker: aws.String("String"),
  593. MaxRecords: aws.Int64(1),
  594. }
  595. resp, err := svc.DescribeTableStatistics(params)
  596. if err != nil {
  597. // Print the error, cast err to awserr.Error to get the Code and
  598. // Message from an error.
  599. fmt.Println(err.Error())
  600. return
  601. }
  602. // Pretty-print the response data.
  603. fmt.Println(resp)
  604. }
  605. func ExampleDatabaseMigrationService_ImportCertificate() {
  606. sess, err := session.NewSession()
  607. if err != nil {
  608. fmt.Println("failed to create session,", err)
  609. return
  610. }
  611. svc := databasemigrationservice.New(sess)
  612. params := &databasemigrationservice.ImportCertificateInput{
  613. CertificateIdentifier: aws.String("String"), // Required
  614. CertificatePem: aws.String("String"),
  615. }
  616. resp, err := svc.ImportCertificate(params)
  617. if err != nil {
  618. // Print the error, cast err to awserr.Error to get the Code and
  619. // Message from an error.
  620. fmt.Println(err.Error())
  621. return
  622. }
  623. // Pretty-print the response data.
  624. fmt.Println(resp)
  625. }
  626. func ExampleDatabaseMigrationService_ListTagsForResource() {
  627. sess, err := session.NewSession()
  628. if err != nil {
  629. fmt.Println("failed to create session,", err)
  630. return
  631. }
  632. svc := databasemigrationservice.New(sess)
  633. params := &databasemigrationservice.ListTagsForResourceInput{
  634. ResourceArn: aws.String("String"), // Required
  635. }
  636. resp, err := svc.ListTagsForResource(params)
  637. if err != nil {
  638. // Print the error, cast err to awserr.Error to get the Code and
  639. // Message from an error.
  640. fmt.Println(err.Error())
  641. return
  642. }
  643. // Pretty-print the response data.
  644. fmt.Println(resp)
  645. }
  646. func ExampleDatabaseMigrationService_ModifyEndpoint() {
  647. sess, err := session.NewSession()
  648. if err != nil {
  649. fmt.Println("failed to create session,", err)
  650. return
  651. }
  652. svc := databasemigrationservice.New(sess)
  653. params := &databasemigrationservice.ModifyEndpointInput{
  654. EndpointArn: aws.String("String"), // Required
  655. CertificateArn: aws.String("String"),
  656. DatabaseName: aws.String("String"),
  657. EndpointIdentifier: aws.String("String"),
  658. EndpointType: aws.String("ReplicationEndpointTypeValue"),
  659. EngineName: aws.String("String"),
  660. ExtraConnectionAttributes: aws.String("String"),
  661. Password: aws.String("SecretString"),
  662. Port: aws.Int64(1),
  663. ServerName: aws.String("String"),
  664. SslMode: aws.String("DmsSslModeValue"),
  665. Username: aws.String("String"),
  666. }
  667. resp, err := svc.ModifyEndpoint(params)
  668. if err != nil {
  669. // Print the error, cast err to awserr.Error to get the Code and
  670. // Message from an error.
  671. fmt.Println(err.Error())
  672. return
  673. }
  674. // Pretty-print the response data.
  675. fmt.Println(resp)
  676. }
  677. func ExampleDatabaseMigrationService_ModifyReplicationInstance() {
  678. sess, err := session.NewSession()
  679. if err != nil {
  680. fmt.Println("failed to create session,", err)
  681. return
  682. }
  683. svc := databasemigrationservice.New(sess)
  684. params := &databasemigrationservice.ModifyReplicationInstanceInput{
  685. ReplicationInstanceArn: aws.String("String"), // Required
  686. AllocatedStorage: aws.Int64(1),
  687. AllowMajorVersionUpgrade: aws.Bool(true),
  688. ApplyImmediately: aws.Bool(true),
  689. AutoMinorVersionUpgrade: aws.Bool(true),
  690. EngineVersion: aws.String("String"),
  691. MultiAZ: aws.Bool(true),
  692. PreferredMaintenanceWindow: aws.String("String"),
  693. ReplicationInstanceClass: aws.String("String"),
  694. ReplicationInstanceIdentifier: aws.String("String"),
  695. VpcSecurityGroupIds: []*string{
  696. aws.String("String"), // Required
  697. // More values...
  698. },
  699. }
  700. resp, err := svc.ModifyReplicationInstance(params)
  701. if err != nil {
  702. // Print the error, cast err to awserr.Error to get the Code and
  703. // Message from an error.
  704. fmt.Println(err.Error())
  705. return
  706. }
  707. // Pretty-print the response data.
  708. fmt.Println(resp)
  709. }
  710. func ExampleDatabaseMigrationService_ModifyReplicationSubnetGroup() {
  711. sess, err := session.NewSession()
  712. if err != nil {
  713. fmt.Println("failed to create session,", err)
  714. return
  715. }
  716. svc := databasemigrationservice.New(sess)
  717. params := &databasemigrationservice.ModifyReplicationSubnetGroupInput{
  718. ReplicationSubnetGroupIdentifier: aws.String("String"), // Required
  719. SubnetIds: []*string{ // Required
  720. aws.String("String"), // Required
  721. // More values...
  722. },
  723. ReplicationSubnetGroupDescription: aws.String("String"),
  724. }
  725. resp, err := svc.ModifyReplicationSubnetGroup(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 ExampleDatabaseMigrationService_RefreshSchemas() {
  736. sess, err := session.NewSession()
  737. if err != nil {
  738. fmt.Println("failed to create session,", err)
  739. return
  740. }
  741. svc := databasemigrationservice.New(sess)
  742. params := &databasemigrationservice.RefreshSchemasInput{
  743. EndpointArn: aws.String("String"), // Required
  744. ReplicationInstanceArn: aws.String("String"), // Required
  745. }
  746. resp, err := svc.RefreshSchemas(params)
  747. if err != nil {
  748. // Print the error, cast err to awserr.Error to get the Code and
  749. // Message from an error.
  750. fmt.Println(err.Error())
  751. return
  752. }
  753. // Pretty-print the response data.
  754. fmt.Println(resp)
  755. }
  756. func ExampleDatabaseMigrationService_RemoveTagsFromResource() {
  757. sess, err := session.NewSession()
  758. if err != nil {
  759. fmt.Println("failed to create session,", err)
  760. return
  761. }
  762. svc := databasemigrationservice.New(sess)
  763. params := &databasemigrationservice.RemoveTagsFromResourceInput{
  764. ResourceArn: aws.String("String"), // Required
  765. TagKeys: []*string{ // Required
  766. aws.String("String"), // Required
  767. // More values...
  768. },
  769. }
  770. resp, err := svc.RemoveTagsFromResource(params)
  771. if err != nil {
  772. // Print the error, cast err to awserr.Error to get the Code and
  773. // Message from an error.
  774. fmt.Println(err.Error())
  775. return
  776. }
  777. // Pretty-print the response data.
  778. fmt.Println(resp)
  779. }
  780. func ExampleDatabaseMigrationService_StartReplicationTask() {
  781. sess, err := session.NewSession()
  782. if err != nil {
  783. fmt.Println("failed to create session,", err)
  784. return
  785. }
  786. svc := databasemigrationservice.New(sess)
  787. params := &databasemigrationservice.StartReplicationTaskInput{
  788. ReplicationTaskArn: aws.String("String"), // Required
  789. StartReplicationTaskType: aws.String("StartReplicationTaskTypeValue"), // Required
  790. CdcStartTime: aws.Time(time.Now()),
  791. }
  792. resp, err := svc.StartReplicationTask(params)
  793. if err != nil {
  794. // Print the error, cast err to awserr.Error to get the Code and
  795. // Message from an error.
  796. fmt.Println(err.Error())
  797. return
  798. }
  799. // Pretty-print the response data.
  800. fmt.Println(resp)
  801. }
  802. func ExampleDatabaseMigrationService_StopReplicationTask() {
  803. sess, err := session.NewSession()
  804. if err != nil {
  805. fmt.Println("failed to create session,", err)
  806. return
  807. }
  808. svc := databasemigrationservice.New(sess)
  809. params := &databasemigrationservice.StopReplicationTaskInput{
  810. ReplicationTaskArn: aws.String("String"), // Required
  811. }
  812. resp, err := svc.StopReplicationTask(params)
  813. if err != nil {
  814. // Print the error, cast err to awserr.Error to get the Code and
  815. // Message from an error.
  816. fmt.Println(err.Error())
  817. return
  818. }
  819. // Pretty-print the response data.
  820. fmt.Println(resp)
  821. }
  822. func ExampleDatabaseMigrationService_TestConnection() {
  823. sess, err := session.NewSession()
  824. if err != nil {
  825. fmt.Println("failed to create session,", err)
  826. return
  827. }
  828. svc := databasemigrationservice.New(sess)
  829. params := &databasemigrationservice.TestConnectionInput{
  830. EndpointArn: aws.String("String"), // Required
  831. ReplicationInstanceArn: aws.String("String"), // Required
  832. }
  833. resp, err := svc.TestConnection(params)
  834. if err != nil {
  835. // Print the error, cast err to awserr.Error to get the Code and
  836. // Message from an error.
  837. fmt.Println(err.Error())
  838. return
  839. }
  840. // Pretty-print the response data.
  841. fmt.Println(resp)
  842. }