569 lines
14 KiB
Go
569 lines
14 KiB
Go
|
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||
|
|
||
|
package datapipeline_test
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"fmt"
|
||
|
"time"
|
||
|
|
||
|
"github.com/aws/aws-sdk-go/aws"
|
||
|
"github.com/aws/aws-sdk-go/aws/session"
|
||
|
"github.com/aws/aws-sdk-go/service/datapipeline"
|
||
|
)
|
||
|
|
||
|
var _ time.Duration
|
||
|
var _ bytes.Buffer
|
||
|
|
||
|
func ExampleDataPipeline_ActivatePipeline() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.ActivatePipelineInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
ParameterValues: []*datapipeline.ParameterValue{
|
||
|
{ // Required
|
||
|
Id: aws.String("fieldNameString"), // Required
|
||
|
StringValue: aws.String("fieldStringValue"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
StartTimestamp: aws.Time(time.Now()),
|
||
|
}
|
||
|
resp, err := svc.ActivatePipeline(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 ExampleDataPipeline_AddTags() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.AddTagsInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
Tags: []*datapipeline.Tag{ // Required
|
||
|
{ // Required
|
||
|
Key: aws.String("tagKey"), // Required
|
||
|
Value: aws.String("tagValue"), // Required
|
||
|
},
|
||
|
// 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 ExampleDataPipeline_CreatePipeline() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.CreatePipelineInput{
|
||
|
Name: aws.String("id"), // Required
|
||
|
UniqueId: aws.String("id"), // Required
|
||
|
Description: aws.String("string"),
|
||
|
Tags: []*datapipeline.Tag{
|
||
|
{ // Required
|
||
|
Key: aws.String("tagKey"), // Required
|
||
|
Value: aws.String("tagValue"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
}
|
||
|
resp, err := svc.CreatePipeline(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 ExampleDataPipeline_DeactivatePipeline() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.DeactivatePipelineInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
CancelActive: aws.Bool(true),
|
||
|
}
|
||
|
resp, err := svc.DeactivatePipeline(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 ExampleDataPipeline_DeletePipeline() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.DeletePipelineInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
}
|
||
|
resp, err := svc.DeletePipeline(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 ExampleDataPipeline_DescribeObjects() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.DescribeObjectsInput{
|
||
|
ObjectIds: []*string{ // Required
|
||
|
aws.String("id"), // Required
|
||
|
// More values...
|
||
|
},
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
EvaluateExpressions: aws.Bool(true),
|
||
|
Marker: aws.String("string"),
|
||
|
}
|
||
|
resp, err := svc.DescribeObjects(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 ExampleDataPipeline_DescribePipelines() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.DescribePipelinesInput{
|
||
|
PipelineIds: []*string{ // Required
|
||
|
aws.String("id"), // Required
|
||
|
// More values...
|
||
|
},
|
||
|
}
|
||
|
resp, err := svc.DescribePipelines(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 ExampleDataPipeline_EvaluateExpression() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.EvaluateExpressionInput{
|
||
|
Expression: aws.String("longString"), // Required
|
||
|
ObjectId: aws.String("id"), // Required
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
}
|
||
|
resp, err := svc.EvaluateExpression(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 ExampleDataPipeline_GetPipelineDefinition() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.GetPipelineDefinitionInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
Version: aws.String("string"),
|
||
|
}
|
||
|
resp, err := svc.GetPipelineDefinition(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 ExampleDataPipeline_ListPipelines() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.ListPipelinesInput{
|
||
|
Marker: aws.String("string"),
|
||
|
}
|
||
|
resp, err := svc.ListPipelines(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 ExampleDataPipeline_PollForTask() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.PollForTaskInput{
|
||
|
WorkerGroup: aws.String("string"), // Required
|
||
|
Hostname: aws.String("id"),
|
||
|
InstanceIdentity: &datapipeline.InstanceIdentity{
|
||
|
Document: aws.String("string"),
|
||
|
Signature: aws.String("string"),
|
||
|
},
|
||
|
}
|
||
|
resp, err := svc.PollForTask(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 ExampleDataPipeline_PutPipelineDefinition() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.PutPipelineDefinitionInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
PipelineObjects: []*datapipeline.PipelineObject{ // Required
|
||
|
{ // Required
|
||
|
Fields: []*datapipeline.Field{ // Required
|
||
|
{ // Required
|
||
|
Key: aws.String("fieldNameString"), // Required
|
||
|
RefValue: aws.String("fieldNameString"),
|
||
|
StringValue: aws.String("fieldStringValue"),
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
Id: aws.String("id"), // Required
|
||
|
Name: aws.String("id"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
ParameterObjects: []*datapipeline.ParameterObject{
|
||
|
{ // Required
|
||
|
Attributes: []*datapipeline.ParameterAttribute{ // Required
|
||
|
{ // Required
|
||
|
Key: aws.String("attributeNameString"), // Required
|
||
|
StringValue: aws.String("attributeValueString"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
Id: aws.String("fieldNameString"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
ParameterValues: []*datapipeline.ParameterValue{
|
||
|
{ // Required
|
||
|
Id: aws.String("fieldNameString"), // Required
|
||
|
StringValue: aws.String("fieldStringValue"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
}
|
||
|
resp, err := svc.PutPipelineDefinition(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 ExampleDataPipeline_QueryObjects() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.QueryObjectsInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
Sphere: aws.String("string"), // Required
|
||
|
Limit: aws.Int64(1),
|
||
|
Marker: aws.String("string"),
|
||
|
Query: &datapipeline.Query{
|
||
|
Selectors: []*datapipeline.Selector{
|
||
|
{ // Required
|
||
|
FieldName: aws.String("string"),
|
||
|
Operator: &datapipeline.Operator{
|
||
|
Type: aws.String("OperatorType"),
|
||
|
Values: []*string{
|
||
|
aws.String("string"), // Required
|
||
|
// More values...
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
resp, err := svc.QueryObjects(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 ExampleDataPipeline_RemoveTags() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.RemoveTagsInput{
|
||
|
PipelineId: aws.String("id"), // 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 ExampleDataPipeline_ReportTaskProgress() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.ReportTaskProgressInput{
|
||
|
TaskId: aws.String("taskId"), // Required
|
||
|
Fields: []*datapipeline.Field{
|
||
|
{ // Required
|
||
|
Key: aws.String("fieldNameString"), // Required
|
||
|
RefValue: aws.String("fieldNameString"),
|
||
|
StringValue: aws.String("fieldStringValue"),
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
}
|
||
|
resp, err := svc.ReportTaskProgress(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 ExampleDataPipeline_ReportTaskRunnerHeartbeat() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.ReportTaskRunnerHeartbeatInput{
|
||
|
TaskrunnerId: aws.String("id"), // Required
|
||
|
Hostname: aws.String("id"),
|
||
|
WorkerGroup: aws.String("string"),
|
||
|
}
|
||
|
resp, err := svc.ReportTaskRunnerHeartbeat(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 ExampleDataPipeline_SetStatus() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.SetStatusInput{
|
||
|
ObjectIds: []*string{ // Required
|
||
|
aws.String("id"), // Required
|
||
|
// More values...
|
||
|
},
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
Status: aws.String("string"), // Required
|
||
|
}
|
||
|
resp, err := svc.SetStatus(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 ExampleDataPipeline_SetTaskStatus() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.SetTaskStatusInput{
|
||
|
TaskId: aws.String("taskId"), // Required
|
||
|
TaskStatus: aws.String("TaskStatus"), // Required
|
||
|
ErrorId: aws.String("string"),
|
||
|
ErrorMessage: aws.String("errorMessage"),
|
||
|
ErrorStackTrace: aws.String("string"),
|
||
|
}
|
||
|
resp, err := svc.SetTaskStatus(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 ExampleDataPipeline_ValidatePipelineDefinition() {
|
||
|
sess := session.Must(session.NewSession())
|
||
|
|
||
|
svc := datapipeline.New(sess)
|
||
|
|
||
|
params := &datapipeline.ValidatePipelineDefinitionInput{
|
||
|
PipelineId: aws.String("id"), // Required
|
||
|
PipelineObjects: []*datapipeline.PipelineObject{ // Required
|
||
|
{ // Required
|
||
|
Fields: []*datapipeline.Field{ // Required
|
||
|
{ // Required
|
||
|
Key: aws.String("fieldNameString"), // Required
|
||
|
RefValue: aws.String("fieldNameString"),
|
||
|
StringValue: aws.String("fieldStringValue"),
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
Id: aws.String("id"), // Required
|
||
|
Name: aws.String("id"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
ParameterObjects: []*datapipeline.ParameterObject{
|
||
|
{ // Required
|
||
|
Attributes: []*datapipeline.ParameterAttribute{ // Required
|
||
|
{ // Required
|
||
|
Key: aws.String("attributeNameString"), // Required
|
||
|
StringValue: aws.String("attributeValueString"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
Id: aws.String("fieldNameString"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
ParameterValues: []*datapipeline.ParameterValue{
|
||
|
{ // Required
|
||
|
Id: aws.String("fieldNameString"), // Required
|
||
|
StringValue: aws.String("fieldStringValue"), // Required
|
||
|
},
|
||
|
// More values...
|
||
|
},
|
||
|
}
|
||
|
resp, err := svc.ValidatePipelineDefinition(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)
|
||
|
}
|