123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package emr_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/emr"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleEMR_AddInstanceGroups() {
- svc := emr.New(nil)
- params := &emr.AddInstanceGroupsInput{
- InstanceGroups: []*emr.InstanceGroupConfig{ // Required
- { // Required
- InstanceCount: aws.Int64(1), // Required
- InstanceRole: aws.String("InstanceRoleType"), // Required
- InstanceType: aws.String("InstanceType"), // Required
- BidPrice: aws.String("XmlStringMaxLen256"),
- Configurations: []*emr.Configuration{
- { // Required
- Classification: aws.String("String"),
- Configurations: []*emr.Configuration{
- // Recursive values...
- },
- Properties: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- },
- // More values...
- },
- Market: aws.String("MarketType"),
- Name: aws.String("XmlStringMaxLen256"),
- },
- // More values...
- },
- JobFlowId: aws.String("XmlStringMaxLen256"), // Required
- }
- resp, err := svc.AddInstanceGroups(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_AddJobFlowSteps() {
- svc := emr.New(nil)
- params := &emr.AddJobFlowStepsInput{
- JobFlowId: aws.String("XmlStringMaxLen256"), // Required
- Steps: []*emr.StepConfig{ // Required
- { // Required
- HadoopJarStep: &emr.HadoopJarStepConfig{ // Required
- Jar: aws.String("XmlString"), // Required
- Args: []*string{
- aws.String("XmlString"), // Required
- // More values...
- },
- MainClass: aws.String("XmlString"),
- Properties: []*emr.KeyValue{
- { // Required
- Key: aws.String("XmlString"),
- Value: aws.String("XmlString"),
- },
- // More values...
- },
- },
- Name: aws.String("XmlStringMaxLen256"), // Required
- ActionOnFailure: aws.String("ActionOnFailure"),
- },
- // More values...
- },
- }
- resp, err := svc.AddJobFlowSteps(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_AddTags() {
- svc := emr.New(nil)
- params := &emr.AddTagsInput{
- ResourceId: aws.String("ResourceId"), // Required
- Tags: []*emr.Tag{ // Required
- { // Required
- Key: aws.String("String"),
- Value: aws.String("String"),
- },
- // More values...
- },
- }
- resp, err := svc.AddTags(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_DescribeCluster() {
- svc := emr.New(nil)
- params := &emr.DescribeClusterInput{
- ClusterId: aws.String("ClusterId"), // Required
- }
- resp, err := svc.DescribeCluster(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_DescribeJobFlows() {
- svc := emr.New(nil)
- params := &emr.DescribeJobFlowsInput{
- CreatedAfter: aws.Time(time.Now()),
- CreatedBefore: aws.Time(time.Now()),
- JobFlowIds: []*string{
- aws.String("XmlString"), // Required
- // More values...
- },
- JobFlowStates: []*string{
- aws.String("JobFlowExecutionState"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeJobFlows(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_DescribeStep() {
- svc := emr.New(nil)
- params := &emr.DescribeStepInput{
- ClusterId: aws.String("ClusterId"), // Required
- StepId: aws.String("StepId"), // Required
- }
- resp, err := svc.DescribeStep(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_ListBootstrapActions() {
- svc := emr.New(nil)
- params := &emr.ListBootstrapActionsInput{
- ClusterId: aws.String("ClusterId"), // Required
- Marker: aws.String("Marker"),
- }
- resp, err := svc.ListBootstrapActions(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_ListClusters() {
- svc := emr.New(nil)
- params := &emr.ListClustersInput{
- ClusterStates: []*string{
- aws.String("ClusterState"), // Required
- // More values...
- },
- CreatedAfter: aws.Time(time.Now()),
- CreatedBefore: aws.Time(time.Now()),
- Marker: aws.String("Marker"),
- }
- resp, err := svc.ListClusters(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_ListInstanceGroups() {
- svc := emr.New(nil)
- params := &emr.ListInstanceGroupsInput{
- ClusterId: aws.String("ClusterId"), // Required
- Marker: aws.String("Marker"),
- }
- resp, err := svc.ListInstanceGroups(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_ListInstances() {
- svc := emr.New(nil)
- params := &emr.ListInstancesInput{
- ClusterId: aws.String("ClusterId"), // Required
- InstanceGroupId: aws.String("InstanceGroupId"),
- InstanceGroupTypes: []*string{
- aws.String("InstanceGroupType"), // Required
- // More values...
- },
- Marker: aws.String("Marker"),
- }
- resp, err := svc.ListInstances(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_ListSteps() {
- svc := emr.New(nil)
- params := &emr.ListStepsInput{
- ClusterId: aws.String("ClusterId"), // Required
- Marker: aws.String("Marker"),
- StepIds: []*string{
- aws.String("XmlString"), // Required
- // More values...
- },
- StepStates: []*string{
- aws.String("StepState"), // Required
- // More values...
- },
- }
- resp, err := svc.ListSteps(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_ModifyInstanceGroups() {
- svc := emr.New(nil)
- params := &emr.ModifyInstanceGroupsInput{
- InstanceGroups: []*emr.InstanceGroupModifyConfig{
- { // Required
- InstanceGroupId: aws.String("XmlStringMaxLen256"), // Required
- EC2InstanceIdsToTerminate: []*string{
- aws.String("InstanceId"), // Required
- // More values...
- },
- InstanceCount: aws.Int64(1),
- },
- // More values...
- },
- }
- resp, err := svc.ModifyInstanceGroups(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_RemoveTags() {
- svc := emr.New(nil)
- params := &emr.RemoveTagsInput{
- ResourceId: aws.String("ResourceId"), // Required
- TagKeys: []*string{ // Required
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.RemoveTags(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_RunJobFlow() {
- svc := emr.New(nil)
- params := &emr.RunJobFlowInput{
- Instances: &emr.JobFlowInstancesConfig{ // Required
- AdditionalMasterSecurityGroups: []*string{
- aws.String("XmlStringMaxLen256"), // Required
- // More values...
- },
- AdditionalSlaveSecurityGroups: []*string{
- aws.String("XmlStringMaxLen256"), // Required
- // More values...
- },
- Ec2KeyName: aws.String("XmlStringMaxLen256"),
- Ec2SubnetId: aws.String("XmlStringMaxLen256"),
- EmrManagedMasterSecurityGroup: aws.String("XmlStringMaxLen256"),
- EmrManagedSlaveSecurityGroup: aws.String("XmlStringMaxLen256"),
- HadoopVersion: aws.String("XmlStringMaxLen256"),
- InstanceCount: aws.Int64(1),
- InstanceGroups: []*emr.InstanceGroupConfig{
- { // Required
- InstanceCount: aws.Int64(1), // Required
- InstanceRole: aws.String("InstanceRoleType"), // Required
- InstanceType: aws.String("InstanceType"), // Required
- BidPrice: aws.String("XmlStringMaxLen256"),
- Configurations: []*emr.Configuration{
- { // Required
- Classification: aws.String("String"),
- Configurations: []*emr.Configuration{
- // Recursive values...
- },
- Properties: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- },
- // More values...
- },
- Market: aws.String("MarketType"),
- Name: aws.String("XmlStringMaxLen256"),
- },
- // More values...
- },
- KeepJobFlowAliveWhenNoSteps: aws.Bool(true),
- MasterInstanceType: aws.String("InstanceType"),
- Placement: &emr.PlacementType{
- AvailabilityZone: aws.String("XmlString"), // Required
- },
- SlaveInstanceType: aws.String("InstanceType"),
- TerminationProtected: aws.Bool(true),
- },
- Name: aws.String("XmlStringMaxLen256"), // Required
- AdditionalInfo: aws.String("XmlString"),
- AmiVersion: aws.String("XmlStringMaxLen256"),
- Applications: []*emr.Application{
- { // Required
- AdditionalInfo: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- Args: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Name: aws.String("String"),
- Version: aws.String("String"),
- },
- // More values...
- },
- BootstrapActions: []*emr.BootstrapActionConfig{
- { // Required
- Name: aws.String("XmlStringMaxLen256"), // Required
- ScriptBootstrapAction: &emr.ScriptBootstrapActionConfig{ // Required
- Path: aws.String("XmlString"), // Required
- Args: []*string{
- aws.String("XmlString"), // Required
- // More values...
- },
- },
- },
- // More values...
- },
- Configurations: []*emr.Configuration{
- { // Required
- Classification: aws.String("String"),
- Configurations: []*emr.Configuration{
- // Recursive values...
- },
- Properties: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- },
- // More values...
- },
- JobFlowRole: aws.String("XmlString"),
- LogUri: aws.String("XmlString"),
- NewSupportedProducts: []*emr.SupportedProductConfig{
- { // Required
- Args: []*string{
- aws.String("XmlString"), // Required
- // More values...
- },
- Name: aws.String("XmlStringMaxLen256"),
- },
- // More values...
- },
- ReleaseLabel: aws.String("XmlStringMaxLen256"),
- ServiceRole: aws.String("XmlString"),
- Steps: []*emr.StepConfig{
- { // Required
- HadoopJarStep: &emr.HadoopJarStepConfig{ // Required
- Jar: aws.String("XmlString"), // Required
- Args: []*string{
- aws.String("XmlString"), // Required
- // More values...
- },
- MainClass: aws.String("XmlString"),
- Properties: []*emr.KeyValue{
- { // Required
- Key: aws.String("XmlString"),
- Value: aws.String("XmlString"),
- },
- // More values...
- },
- },
- Name: aws.String("XmlStringMaxLen256"), // Required
- ActionOnFailure: aws.String("ActionOnFailure"),
- },
- // More values...
- },
- SupportedProducts: []*string{
- aws.String("XmlStringMaxLen256"), // Required
- // More values...
- },
- Tags: []*emr.Tag{
- { // Required
- Key: aws.String("String"),
- Value: aws.String("String"),
- },
- // More values...
- },
- VisibleToAllUsers: aws.Bool(true),
- }
- resp, err := svc.RunJobFlow(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_SetTerminationProtection() {
- svc := emr.New(nil)
- params := &emr.SetTerminationProtectionInput{
- JobFlowIds: []*string{ // Required
- aws.String("XmlString"), // Required
- // More values...
- },
- TerminationProtected: aws.Bool(true), // Required
- }
- resp, err := svc.SetTerminationProtection(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_SetVisibleToAllUsers() {
- svc := emr.New(nil)
- params := &emr.SetVisibleToAllUsersInput{
- JobFlowIds: []*string{ // Required
- aws.String("XmlString"), // Required
- // More values...
- },
- VisibleToAllUsers: aws.Bool(true), // Required
- }
- resp, err := svc.SetVisibleToAllUsers(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleEMR_TerminateJobFlows() {
- svc := emr.New(nil)
- params := &emr.TerminateJobFlowsInput{
- JobFlowIds: []*string{ // Required
- aws.String("XmlString"), // Required
- // More values...
- },
- }
- resp, err := svc.TerminateJobFlows(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
|