本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/datapipeline.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:34,代码来源:examples_test.go
示例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))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例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))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:32,代码来源:examples_test.go
示例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)
}
开发者ID:CNDonny,项目名称:scope,代码行数:27,代码来源:examples_test.go
示例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))
}
开发者ID:strife25,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go
示例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)
}
开发者ID:CNDonny,项目名称:scope,代码行数:26,代码来源:examples_test.go
示例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))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例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))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:35,代码来源:examples_test.go
示例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))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:25,代码来源:examples_test.go
示例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)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:25,代码来源:examples_test.go
示例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)
}
开发者ID:CNDonny,项目名称:scope,代码行数:26,代码来源:examples_test.go
示例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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:29,代码来源:examples_test.go
示例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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:28,代码来源:examples_test.go
示例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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:26,代码来源:examples_test.go
示例16: ExampleDataPipeline_ReportTaskProgress
func ExampleDataPipeline_ReportTaskProgress() {
svc := datapipeline.New(nil)
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 {
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))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:34,代码来源:examples_test.go
示例17: ExampleDataPipeline_RemoveTags
func ExampleDataPipeline_RemoveTags() {
svc := datapipeline.New(nil)
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 {
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))
}
开发者ID:strife25,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例18: ExampleDataPipeline_PollForTask
func ExampleDataPipeline_PollForTask() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:29,代码来源:examples_test.go
示例19: ExampleDataPipeline_DeactivatePipeline
func ExampleDataPipeline_DeactivatePipeline() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:25,代码来源:examples_test.go
示例20: ExampleDataPipeline_ValidatePipelineDefinition
func ExampleDataPipeline_ValidatePipelineDefinition() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:59,代码来源:examples_test.go
注:本文中的github.com/aws/aws-sdk-go/service/datapipeline.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论