Beispiel #1
0
func ExampleEMR_AddTags() {
	svc := emr.New(nil)

	params := &emr.AddTagsInput{
		ResourceID: aws.String("ResourceId"), // Required
		Tags: []*emr.Tag{ // Required
			&emr.Tag{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.AddTags(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #2
0
func ExampleEMR_ModifyInstanceGroups() {
	svc := emr.New(nil)

	params := &emr.ModifyInstanceGroupsInput{
		InstanceGroups: []*emr.InstanceGroupModifyConfig{
			&emr.InstanceGroupModifyConfig{ // Required
				InstanceGroupID: aws.String("XmlStringMaxLen256"), // Required
				EC2InstanceIDsToTerminate: []*string{
					aws.String("InstanceId"), // Required
					// More values...
				},
				InstanceCount: aws.Long(1),
			},
			// More values...
		},
	}
	resp, err := svc.ModifyInstanceGroups(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #3
0
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 awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #4
0
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 awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #5
0
func ExampleEMR_AddInstanceGroups() {
	svc := emr.New(nil)

	params := &emr.AddInstanceGroupsInput{
		InstanceGroups: []*emr.InstanceGroupConfig{ // Required
			&emr.InstanceGroupConfig{ // Required
				InstanceCount: aws.Long(1),                    // Required
				InstanceRole:  aws.String("InstanceRoleType"), // Required
				InstanceType:  aws.String("InstanceType"),     // Required
				BidPrice:      aws.String("XmlStringMaxLen256"),
				Market:        aws.String("MarketType"),
				Name:          aws.String("XmlStringMaxLen256"),
			},
			// More values...
		},
		JobFlowID: aws.String("XmlStringMaxLen256"), // Required
	}
	resp, err := svc.AddInstanceGroups(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #6
0
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 awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #7
0
func ExampleEMR_DescribeCluster() {
	svc := emr.New(nil)

	params := &emr.DescribeClusterInput{
		ClusterID: aws.String("ClusterId"), // Required
	}
	resp, err := svc.DescribeCluster(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #8
0
func ExampleEMR_AddJobFlowSteps() {
	svc := emr.New(nil)

	params := &emr.AddJobFlowStepsInput{
		JobFlowID: aws.String("XmlStringMaxLen256"), // Required
		Steps: []*emr.StepConfig{ // Required
			&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{
						&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 awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #9
0
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 awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
Beispiel #10
0
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.Long(1),
			InstanceGroups: []*emr.InstanceGroupConfig{
				&emr.InstanceGroupConfig{ // Required
					InstanceCount: aws.Long(1),                    // Required
					InstanceRole:  aws.String("InstanceRoleType"), // Required
					InstanceType:  aws.String("InstanceType"),     // Required
					BidPrice:      aws.String("XmlStringMaxLen256"),
					Market:        aws.String("MarketType"),
					Name:          aws.String("XmlStringMaxLen256"),
				},
				// More values...
			},
			KeepJobFlowAliveWhenNoSteps: aws.Boolean(true),
			MasterInstanceType:          aws.String("InstanceType"),
			Placement: &emr.PlacementType{
				AvailabilityZone: aws.String("XmlString"), // Required
			},
			SlaveInstanceType:    aws.String("InstanceType"),
			TerminationProtected: aws.Boolean(true),
		},
		Name:           aws.String("XmlStringMaxLen256"), // Required
		AMIVersion:     aws.String("XmlStringMaxLen256"),
		AdditionalInfo: aws.String("XmlString"),
		BootstrapActions: []*emr.BootstrapActionConfig{
			&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...
		},
		JobFlowRole: aws.String("XmlString"),
		LogURI:      aws.String("XmlString"),
		NewSupportedProducts: []*emr.SupportedProductConfig{
			&emr.SupportedProductConfig{ // Required
				Args: []*string{
					aws.String("XmlString"), // Required
					// More values...
				},
				Name: aws.String("XmlStringMaxLen256"),
			},
			// More values...
		},
		ServiceRole: aws.String("XmlString"),
		Steps: []*emr.StepConfig{
			&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{
						&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{
			&emr.Tag{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
		VisibleToAllUsers: aws.Boolean(true),
	}
	resp, err := svc.RunJobFlow(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}