本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/datapipeline.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了New函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ExampleDataPipeline_ActivatePipeline
func ExampleDataPipeline_ActivatePipeline() {
svc := datapipeline.New(nil)
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 {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例2: ExampleDataPipeline_EvaluateExpression
func ExampleDataPipeline_EvaluateExpression() {
svc := datapipeline.New(nil)
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 {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例3: ExampleDataPipeline_DescribeObjects
func ExampleDataPipeline_DescribeObjects() {
svc := datapipeline.New(nil)
params := &datapipeline.DescribeObjectsInput{
ObjectIDs: []*string{ // Required
aws.String("id"), // Required
// More values...
},
PipelineID: aws.String("id"), // Required
EvaluateExpressions: aws.Boolean(true),
Marker: aws.String("string"),
}
resp, err := svc.DescribeObjects(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例4: ExampleDataPipeline_CreatePipeline
func ExampleDataPipeline_CreatePipeline() {
svc := datapipeline.New(session.New())
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)
}
示例5: ExampleDataPipeline_PollForTask
func ExampleDataPipeline_PollForTask() {
svc := datapipeline.New(nil)
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 {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例6: ExampleDataPipeline_ReportTaskProgress
func ExampleDataPipeline_ReportTaskProgress() {
svc := datapipeline.New(session.New())
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)
}
示例7: ExampleDataPipeline_SetTaskStatus
func ExampleDataPipeline_SetTaskStatus() {
svc := datapipeline.New(nil)
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 {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例8: ExampleDataPipeline_CreatePipeline
func ExampleDataPipeline_CreatePipeline() {
svc := datapipeline.New(nil)
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 {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例9: ExampleDataPipeline_ReportTaskRunnerHeartbeat
func ExampleDataPipeline_ReportTaskRunnerHeartbeat() {
svc := datapipeline.New(nil)
params := &datapipeline.ReportTaskRunnerHeartbeatInput{
TaskRunnerID: aws.String("id"), // Required
Hostname: aws.String("id"),
WorkerGroup: aws.String("string"),
}
resp, err := svc.ReportTaskRunnerHeartbeat(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例10: ExampleDataPipeline_GetPipelineDefinition
func ExampleDataPipeline_GetPipelineDefinition() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
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)
}
示例11: ExampleDataPipeline_AddTags
func ExampleDataPipeline_AddTags() {
svc := datapipeline.New(nil)
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)
}
示例12: ExampleDataPipeline_ActivatePipeline
func ExampleDataPipeline_ActivatePipeline() {
svc := datapipeline.New(session.New())
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)
}
示例13: ExampleDataPipeline_SetStatus
func ExampleDataPipeline_SetStatus() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
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)
}
示例14: ExampleDataPipeline_SetTaskStatus
func ExampleDataPipeline_SetTaskStatus() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
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)
}
示例15: ExampleDataPipeline_ReportTaskRunnerHeartbeat
func ExampleDataPipeline_ReportTaskRunnerHeartbeat() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
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)
}