examples_test.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package emr_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/emr"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleEMR_AddInstanceGroups() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := emr.New(sess)
  20. params := &emr.AddInstanceGroupsInput{
  21. InstanceGroups: []*emr.InstanceGroupConfig{ // Required
  22. { // Required
  23. InstanceCount: aws.Int64(1), // Required
  24. InstanceRole: aws.String("InstanceRoleType"), // Required
  25. InstanceType: aws.String("InstanceType"), // Required
  26. BidPrice: aws.String("XmlStringMaxLen256"),
  27. Configurations: []*emr.Configuration{
  28. { // Required
  29. Classification: aws.String("String"),
  30. Configurations: []*emr.Configuration{
  31. // Recursive values...
  32. },
  33. Properties: map[string]*string{
  34. "Key": aws.String("String"), // Required
  35. // More values...
  36. },
  37. },
  38. // More values...
  39. },
  40. EbsConfiguration: &emr.EbsConfiguration{
  41. EbsBlockDeviceConfigs: []*emr.EbsBlockDeviceConfig{
  42. { // Required
  43. VolumeSpecification: &emr.VolumeSpecification{ // Required
  44. SizeInGB: aws.Int64(1), // Required
  45. VolumeType: aws.String("String"), // Required
  46. Iops: aws.Int64(1),
  47. },
  48. VolumesPerInstance: aws.Int64(1),
  49. },
  50. // More values...
  51. },
  52. EbsOptimized: aws.Bool(true),
  53. },
  54. Market: aws.String("MarketType"),
  55. Name: aws.String("XmlStringMaxLen256"),
  56. },
  57. // More values...
  58. },
  59. JobFlowId: aws.String("XmlStringMaxLen256"), // Required
  60. }
  61. resp, err := svc.AddInstanceGroups(params)
  62. if err != nil {
  63. // Print the error, cast err to awserr.Error to get the Code and
  64. // Message from an error.
  65. fmt.Println(err.Error())
  66. return
  67. }
  68. // Pretty-print the response data.
  69. fmt.Println(resp)
  70. }
  71. func ExampleEMR_AddJobFlowSteps() {
  72. sess, err := session.NewSession()
  73. if err != nil {
  74. fmt.Println("failed to create session,", err)
  75. return
  76. }
  77. svc := emr.New(sess)
  78. params := &emr.AddJobFlowStepsInput{
  79. JobFlowId: aws.String("XmlStringMaxLen256"), // Required
  80. Steps: []*emr.StepConfig{ // Required
  81. { // Required
  82. HadoopJarStep: &emr.HadoopJarStepConfig{ // Required
  83. Jar: aws.String("XmlString"), // Required
  84. Args: []*string{
  85. aws.String("XmlString"), // Required
  86. // More values...
  87. },
  88. MainClass: aws.String("XmlString"),
  89. Properties: []*emr.KeyValue{
  90. { // Required
  91. Key: aws.String("XmlString"),
  92. Value: aws.String("XmlString"),
  93. },
  94. // More values...
  95. },
  96. },
  97. Name: aws.String("XmlStringMaxLen256"), // Required
  98. ActionOnFailure: aws.String("ActionOnFailure"),
  99. },
  100. // More values...
  101. },
  102. }
  103. resp, err := svc.AddJobFlowSteps(params)
  104. if err != nil {
  105. // Print the error, cast err to awserr.Error to get the Code and
  106. // Message from an error.
  107. fmt.Println(err.Error())
  108. return
  109. }
  110. // Pretty-print the response data.
  111. fmt.Println(resp)
  112. }
  113. func ExampleEMR_AddTags() {
  114. sess, err := session.NewSession()
  115. if err != nil {
  116. fmt.Println("failed to create session,", err)
  117. return
  118. }
  119. svc := emr.New(sess)
  120. params := &emr.AddTagsInput{
  121. ResourceId: aws.String("ResourceId"), // Required
  122. Tags: []*emr.Tag{ // Required
  123. { // Required
  124. Key: aws.String("String"),
  125. Value: aws.String("String"),
  126. },
  127. // More values...
  128. },
  129. }
  130. resp, err := svc.AddTags(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 ExampleEMR_CreateSecurityConfiguration() {
  141. sess, err := session.NewSession()
  142. if err != nil {
  143. fmt.Println("failed to create session,", err)
  144. return
  145. }
  146. svc := emr.New(sess)
  147. params := &emr.CreateSecurityConfigurationInput{
  148. Name: aws.String("XmlString"), // Required
  149. SecurityConfiguration: aws.String("String"), // Required
  150. }
  151. resp, err := svc.CreateSecurityConfiguration(params)
  152. if err != nil {
  153. // Print the error, cast err to awserr.Error to get the Code and
  154. // Message from an error.
  155. fmt.Println(err.Error())
  156. return
  157. }
  158. // Pretty-print the response data.
  159. fmt.Println(resp)
  160. }
  161. func ExampleEMR_DeleteSecurityConfiguration() {
  162. sess, err := session.NewSession()
  163. if err != nil {
  164. fmt.Println("failed to create session,", err)
  165. return
  166. }
  167. svc := emr.New(sess)
  168. params := &emr.DeleteSecurityConfigurationInput{
  169. Name: aws.String("XmlString"), // Required
  170. }
  171. resp, err := svc.DeleteSecurityConfiguration(params)
  172. if err != nil {
  173. // Print the error, cast err to awserr.Error to get the Code and
  174. // Message from an error.
  175. fmt.Println(err.Error())
  176. return
  177. }
  178. // Pretty-print the response data.
  179. fmt.Println(resp)
  180. }
  181. func ExampleEMR_DescribeCluster() {
  182. sess, err := session.NewSession()
  183. if err != nil {
  184. fmt.Println("failed to create session,", err)
  185. return
  186. }
  187. svc := emr.New(sess)
  188. params := &emr.DescribeClusterInput{
  189. ClusterId: aws.String("ClusterId"), // Required
  190. }
  191. resp, err := svc.DescribeCluster(params)
  192. if err != nil {
  193. // Print the error, cast err to awserr.Error to get the Code and
  194. // Message from an error.
  195. fmt.Println(err.Error())
  196. return
  197. }
  198. // Pretty-print the response data.
  199. fmt.Println(resp)
  200. }
  201. func ExampleEMR_DescribeJobFlows() {
  202. sess, err := session.NewSession()
  203. if err != nil {
  204. fmt.Println("failed to create session,", err)
  205. return
  206. }
  207. svc := emr.New(sess)
  208. params := &emr.DescribeJobFlowsInput{
  209. CreatedAfter: aws.Time(time.Now()),
  210. CreatedBefore: aws.Time(time.Now()),
  211. JobFlowIds: []*string{
  212. aws.String("XmlString"), // Required
  213. // More values...
  214. },
  215. JobFlowStates: []*string{
  216. aws.String("JobFlowExecutionState"), // Required
  217. // More values...
  218. },
  219. }
  220. resp, err := svc.DescribeJobFlows(params)
  221. if err != nil {
  222. // Print the error, cast err to awserr.Error to get the Code and
  223. // Message from an error.
  224. fmt.Println(err.Error())
  225. return
  226. }
  227. // Pretty-print the response data.
  228. fmt.Println(resp)
  229. }
  230. func ExampleEMR_DescribeSecurityConfiguration() {
  231. sess, err := session.NewSession()
  232. if err != nil {
  233. fmt.Println("failed to create session,", err)
  234. return
  235. }
  236. svc := emr.New(sess)
  237. params := &emr.DescribeSecurityConfigurationInput{
  238. Name: aws.String("XmlString"), // Required
  239. }
  240. resp, err := svc.DescribeSecurityConfiguration(params)
  241. if err != nil {
  242. // Print the error, cast err to awserr.Error to get the Code and
  243. // Message from an error.
  244. fmt.Println(err.Error())
  245. return
  246. }
  247. // Pretty-print the response data.
  248. fmt.Println(resp)
  249. }
  250. func ExampleEMR_DescribeStep() {
  251. sess, err := session.NewSession()
  252. if err != nil {
  253. fmt.Println("failed to create session,", err)
  254. return
  255. }
  256. svc := emr.New(sess)
  257. params := &emr.DescribeStepInput{
  258. ClusterId: aws.String("ClusterId"), // Required
  259. StepId: aws.String("StepId"), // Required
  260. }
  261. resp, err := svc.DescribeStep(params)
  262. if err != nil {
  263. // Print the error, cast err to awserr.Error to get the Code and
  264. // Message from an error.
  265. fmt.Println(err.Error())
  266. return
  267. }
  268. // Pretty-print the response data.
  269. fmt.Println(resp)
  270. }
  271. func ExampleEMR_ListBootstrapActions() {
  272. sess, err := session.NewSession()
  273. if err != nil {
  274. fmt.Println("failed to create session,", err)
  275. return
  276. }
  277. svc := emr.New(sess)
  278. params := &emr.ListBootstrapActionsInput{
  279. ClusterId: aws.String("ClusterId"), // Required
  280. Marker: aws.String("Marker"),
  281. }
  282. resp, err := svc.ListBootstrapActions(params)
  283. if err != nil {
  284. // Print the error, cast err to awserr.Error to get the Code and
  285. // Message from an error.
  286. fmt.Println(err.Error())
  287. return
  288. }
  289. // Pretty-print the response data.
  290. fmt.Println(resp)
  291. }
  292. func ExampleEMR_ListClusters() {
  293. sess, err := session.NewSession()
  294. if err != nil {
  295. fmt.Println("failed to create session,", err)
  296. return
  297. }
  298. svc := emr.New(sess)
  299. params := &emr.ListClustersInput{
  300. ClusterStates: []*string{
  301. aws.String("ClusterState"), // Required
  302. // More values...
  303. },
  304. CreatedAfter: aws.Time(time.Now()),
  305. CreatedBefore: aws.Time(time.Now()),
  306. Marker: aws.String("Marker"),
  307. }
  308. resp, err := svc.ListClusters(params)
  309. if err != nil {
  310. // Print the error, cast err to awserr.Error to get the Code and
  311. // Message from an error.
  312. fmt.Println(err.Error())
  313. return
  314. }
  315. // Pretty-print the response data.
  316. fmt.Println(resp)
  317. }
  318. func ExampleEMR_ListInstanceGroups() {
  319. sess, err := session.NewSession()
  320. if err != nil {
  321. fmt.Println("failed to create session,", err)
  322. return
  323. }
  324. svc := emr.New(sess)
  325. params := &emr.ListInstanceGroupsInput{
  326. ClusterId: aws.String("ClusterId"), // Required
  327. Marker: aws.String("Marker"),
  328. }
  329. resp, err := svc.ListInstanceGroups(params)
  330. if err != nil {
  331. // Print the error, cast err to awserr.Error to get the Code and
  332. // Message from an error.
  333. fmt.Println(err.Error())
  334. return
  335. }
  336. // Pretty-print the response data.
  337. fmt.Println(resp)
  338. }
  339. func ExampleEMR_ListInstances() {
  340. sess, err := session.NewSession()
  341. if err != nil {
  342. fmt.Println("failed to create session,", err)
  343. return
  344. }
  345. svc := emr.New(sess)
  346. params := &emr.ListInstancesInput{
  347. ClusterId: aws.String("ClusterId"), // Required
  348. InstanceGroupId: aws.String("InstanceGroupId"),
  349. InstanceGroupTypes: []*string{
  350. aws.String("InstanceGroupType"), // Required
  351. // More values...
  352. },
  353. InstanceStates: []*string{
  354. aws.String("InstanceState"), // Required
  355. // More values...
  356. },
  357. Marker: aws.String("Marker"),
  358. }
  359. resp, err := svc.ListInstances(params)
  360. if err != nil {
  361. // Print the error, cast err to awserr.Error to get the Code and
  362. // Message from an error.
  363. fmt.Println(err.Error())
  364. return
  365. }
  366. // Pretty-print the response data.
  367. fmt.Println(resp)
  368. }
  369. func ExampleEMR_ListSecurityConfigurations() {
  370. sess, err := session.NewSession()
  371. if err != nil {
  372. fmt.Println("failed to create session,", err)
  373. return
  374. }
  375. svc := emr.New(sess)
  376. params := &emr.ListSecurityConfigurationsInput{
  377. Marker: aws.String("Marker"),
  378. }
  379. resp, err := svc.ListSecurityConfigurations(params)
  380. if err != nil {
  381. // Print the error, cast err to awserr.Error to get the Code and
  382. // Message from an error.
  383. fmt.Println(err.Error())
  384. return
  385. }
  386. // Pretty-print the response data.
  387. fmt.Println(resp)
  388. }
  389. func ExampleEMR_ListSteps() {
  390. sess, err := session.NewSession()
  391. if err != nil {
  392. fmt.Println("failed to create session,", err)
  393. return
  394. }
  395. svc := emr.New(sess)
  396. params := &emr.ListStepsInput{
  397. ClusterId: aws.String("ClusterId"), // Required
  398. Marker: aws.String("Marker"),
  399. StepIds: []*string{
  400. aws.String("XmlString"), // Required
  401. // More values...
  402. },
  403. StepStates: []*string{
  404. aws.String("StepState"), // Required
  405. // More values...
  406. },
  407. }
  408. resp, err := svc.ListSteps(params)
  409. if err != nil {
  410. // Print the error, cast err to awserr.Error to get the Code and
  411. // Message from an error.
  412. fmt.Println(err.Error())
  413. return
  414. }
  415. // Pretty-print the response data.
  416. fmt.Println(resp)
  417. }
  418. func ExampleEMR_ModifyInstanceGroups() {
  419. sess, err := session.NewSession()
  420. if err != nil {
  421. fmt.Println("failed to create session,", err)
  422. return
  423. }
  424. svc := emr.New(sess)
  425. params := &emr.ModifyInstanceGroupsInput{
  426. InstanceGroups: []*emr.InstanceGroupModifyConfig{
  427. { // Required
  428. InstanceGroupId: aws.String("XmlStringMaxLen256"), // Required
  429. EC2InstanceIdsToTerminate: []*string{
  430. aws.String("InstanceId"), // Required
  431. // More values...
  432. },
  433. InstanceCount: aws.Int64(1),
  434. ShrinkPolicy: &emr.ShrinkPolicy{
  435. DecommissionTimeout: aws.Int64(1),
  436. InstanceResizePolicy: &emr.InstanceResizePolicy{
  437. InstanceTerminationTimeout: aws.Int64(1),
  438. InstancesToProtect: []*string{
  439. aws.String("InstanceId"), // Required
  440. // More values...
  441. },
  442. InstancesToTerminate: []*string{
  443. aws.String("InstanceId"), // Required
  444. // More values...
  445. },
  446. },
  447. },
  448. },
  449. // More values...
  450. },
  451. }
  452. resp, err := svc.ModifyInstanceGroups(params)
  453. if err != nil {
  454. // Print the error, cast err to awserr.Error to get the Code and
  455. // Message from an error.
  456. fmt.Println(err.Error())
  457. return
  458. }
  459. // Pretty-print the response data.
  460. fmt.Println(resp)
  461. }
  462. func ExampleEMR_RemoveTags() {
  463. sess, err := session.NewSession()
  464. if err != nil {
  465. fmt.Println("failed to create session,", err)
  466. return
  467. }
  468. svc := emr.New(sess)
  469. params := &emr.RemoveTagsInput{
  470. ResourceId: aws.String("ResourceId"), // Required
  471. TagKeys: []*string{ // Required
  472. aws.String("String"), // Required
  473. // More values...
  474. },
  475. }
  476. resp, err := svc.RemoveTags(params)
  477. if err != nil {
  478. // Print the error, cast err to awserr.Error to get the Code and
  479. // Message from an error.
  480. fmt.Println(err.Error())
  481. return
  482. }
  483. // Pretty-print the response data.
  484. fmt.Println(resp)
  485. }
  486. func ExampleEMR_RunJobFlow() {
  487. sess, err := session.NewSession()
  488. if err != nil {
  489. fmt.Println("failed to create session,", err)
  490. return
  491. }
  492. svc := emr.New(sess)
  493. params := &emr.RunJobFlowInput{
  494. Instances: &emr.JobFlowInstancesConfig{ // Required
  495. AdditionalMasterSecurityGroups: []*string{
  496. aws.String("XmlStringMaxLen256"), // Required
  497. // More values...
  498. },
  499. AdditionalSlaveSecurityGroups: []*string{
  500. aws.String("XmlStringMaxLen256"), // Required
  501. // More values...
  502. },
  503. Ec2KeyName: aws.String("XmlStringMaxLen256"),
  504. Ec2SubnetId: aws.String("XmlStringMaxLen256"),
  505. EmrManagedMasterSecurityGroup: aws.String("XmlStringMaxLen256"),
  506. EmrManagedSlaveSecurityGroup: aws.String("XmlStringMaxLen256"),
  507. HadoopVersion: aws.String("XmlStringMaxLen256"),
  508. InstanceCount: aws.Int64(1),
  509. InstanceGroups: []*emr.InstanceGroupConfig{
  510. { // Required
  511. InstanceCount: aws.Int64(1), // Required
  512. InstanceRole: aws.String("InstanceRoleType"), // Required
  513. InstanceType: aws.String("InstanceType"), // Required
  514. BidPrice: aws.String("XmlStringMaxLen256"),
  515. Configurations: []*emr.Configuration{
  516. { // Required
  517. Classification: aws.String("String"),
  518. Configurations: []*emr.Configuration{
  519. // Recursive values...
  520. },
  521. Properties: map[string]*string{
  522. "Key": aws.String("String"), // Required
  523. // More values...
  524. },
  525. },
  526. // More values...
  527. },
  528. EbsConfiguration: &emr.EbsConfiguration{
  529. EbsBlockDeviceConfigs: []*emr.EbsBlockDeviceConfig{
  530. { // Required
  531. VolumeSpecification: &emr.VolumeSpecification{ // Required
  532. SizeInGB: aws.Int64(1), // Required
  533. VolumeType: aws.String("String"), // Required
  534. Iops: aws.Int64(1),
  535. },
  536. VolumesPerInstance: aws.Int64(1),
  537. },
  538. // More values...
  539. },
  540. EbsOptimized: aws.Bool(true),
  541. },
  542. Market: aws.String("MarketType"),
  543. Name: aws.String("XmlStringMaxLen256"),
  544. },
  545. // More values...
  546. },
  547. KeepJobFlowAliveWhenNoSteps: aws.Bool(true),
  548. MasterInstanceType: aws.String("InstanceType"),
  549. Placement: &emr.PlacementType{
  550. AvailabilityZone: aws.String("XmlString"), // Required
  551. },
  552. ServiceAccessSecurityGroup: aws.String("XmlStringMaxLen256"),
  553. SlaveInstanceType: aws.String("InstanceType"),
  554. TerminationProtected: aws.Bool(true),
  555. },
  556. Name: aws.String("XmlStringMaxLen256"), // Required
  557. AdditionalInfo: aws.String("XmlString"),
  558. AmiVersion: aws.String("XmlStringMaxLen256"),
  559. Applications: []*emr.Application{
  560. { // Required
  561. AdditionalInfo: map[string]*string{
  562. "Key": aws.String("String"), // Required
  563. // More values...
  564. },
  565. Args: []*string{
  566. aws.String("String"), // Required
  567. // More values...
  568. },
  569. Name: aws.String("String"),
  570. Version: aws.String("String"),
  571. },
  572. // More values...
  573. },
  574. BootstrapActions: []*emr.BootstrapActionConfig{
  575. { // Required
  576. Name: aws.String("XmlStringMaxLen256"), // Required
  577. ScriptBootstrapAction: &emr.ScriptBootstrapActionConfig{ // Required
  578. Path: aws.String("XmlString"), // Required
  579. Args: []*string{
  580. aws.String("XmlString"), // Required
  581. // More values...
  582. },
  583. },
  584. },
  585. // More values...
  586. },
  587. Configurations: []*emr.Configuration{
  588. { // Required
  589. Classification: aws.String("String"),
  590. Configurations: []*emr.Configuration{
  591. // Recursive values...
  592. },
  593. Properties: map[string]*string{
  594. "Key": aws.String("String"), // Required
  595. // More values...
  596. },
  597. },
  598. // More values...
  599. },
  600. JobFlowRole: aws.String("XmlString"),
  601. LogUri: aws.String("XmlString"),
  602. NewSupportedProducts: []*emr.SupportedProductConfig{
  603. { // Required
  604. Args: []*string{
  605. aws.String("XmlString"), // Required
  606. // More values...
  607. },
  608. Name: aws.String("XmlStringMaxLen256"),
  609. },
  610. // More values...
  611. },
  612. ReleaseLabel: aws.String("XmlStringMaxLen256"),
  613. SecurityConfiguration: aws.String("XmlString"),
  614. ServiceRole: aws.String("XmlString"),
  615. Steps: []*emr.StepConfig{
  616. { // Required
  617. HadoopJarStep: &emr.HadoopJarStepConfig{ // Required
  618. Jar: aws.String("XmlString"), // Required
  619. Args: []*string{
  620. aws.String("XmlString"), // Required
  621. // More values...
  622. },
  623. MainClass: aws.String("XmlString"),
  624. Properties: []*emr.KeyValue{
  625. { // Required
  626. Key: aws.String("XmlString"),
  627. Value: aws.String("XmlString"),
  628. },
  629. // More values...
  630. },
  631. },
  632. Name: aws.String("XmlStringMaxLen256"), // Required
  633. ActionOnFailure: aws.String("ActionOnFailure"),
  634. },
  635. // More values...
  636. },
  637. SupportedProducts: []*string{
  638. aws.String("XmlStringMaxLen256"), // Required
  639. // More values...
  640. },
  641. Tags: []*emr.Tag{
  642. { // Required
  643. Key: aws.String("String"),
  644. Value: aws.String("String"),
  645. },
  646. // More values...
  647. },
  648. VisibleToAllUsers: aws.Bool(true),
  649. }
  650. resp, err := svc.RunJobFlow(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 ExampleEMR_SetTerminationProtection() {
  661. sess, err := session.NewSession()
  662. if err != nil {
  663. fmt.Println("failed to create session,", err)
  664. return
  665. }
  666. svc := emr.New(sess)
  667. params := &emr.SetTerminationProtectionInput{
  668. JobFlowIds: []*string{ // Required
  669. aws.String("XmlString"), // Required
  670. // More values...
  671. },
  672. TerminationProtected: aws.Bool(true), // Required
  673. }
  674. resp, err := svc.SetTerminationProtection(params)
  675. if err != nil {
  676. // Print the error, cast err to awserr.Error to get the Code and
  677. // Message from an error.
  678. fmt.Println(err.Error())
  679. return
  680. }
  681. // Pretty-print the response data.
  682. fmt.Println(resp)
  683. }
  684. func ExampleEMR_SetVisibleToAllUsers() {
  685. sess, err := session.NewSession()
  686. if err != nil {
  687. fmt.Println("failed to create session,", err)
  688. return
  689. }
  690. svc := emr.New(sess)
  691. params := &emr.SetVisibleToAllUsersInput{
  692. JobFlowIds: []*string{ // Required
  693. aws.String("XmlString"), // Required
  694. // More values...
  695. },
  696. VisibleToAllUsers: aws.Bool(true), // Required
  697. }
  698. resp, err := svc.SetVisibleToAllUsers(params)
  699. if err != nil {
  700. // Print the error, cast err to awserr.Error to get the Code and
  701. // Message from an error.
  702. fmt.Println(err.Error())
  703. return
  704. }
  705. // Pretty-print the response data.
  706. fmt.Println(resp)
  707. }
  708. func ExampleEMR_TerminateJobFlows() {
  709. sess, err := session.NewSession()
  710. if err != nil {
  711. fmt.Println("failed to create session,", err)
  712. return
  713. }
  714. svc := emr.New(sess)
  715. params := &emr.TerminateJobFlowsInput{
  716. JobFlowIds: []*string{ // Required
  717. aws.String("XmlString"), // Required
  718. // More values...
  719. },
  720. }
  721. resp, err := svc.TerminateJobFlows(params)
  722. if err != nil {
  723. // Print the error, cast err to awserr.Error to get the Code and
  724. // Message from an error.
  725. fmt.Println(err.Error())
  726. return
  727. }
  728. // Pretty-print the response data.
  729. fmt.Println(resp)
  730. }