• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang cloudwatchlogs.New函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/convox/rack/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatchlogs.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了New函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: ExampleCloudWatchLogs_FilterLogEvents

func ExampleCloudWatchLogs_FilterLogEvents() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.FilterLogEventsInput{
		LogGroupName:  aws.String("LogGroupName"), // Required
		EndTime:       aws.Int64(1),
		FilterPattern: aws.String("FilterPattern"),
		Interleaved:   aws.Bool(true),
		Limit:         aws.Int64(1),
		LogStreamNames: []*string{
			aws.String("LogStreamName"), // Required
			// More values...
		},
		NextToken: aws.String("NextToken"),
		StartTime: aws.Int64(1),
	}
	resp, err := svc.FilterLogEvents(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:kuenzaa,项目名称:rack,代码行数:28,代码来源:examples_test.go


示例2: ExampleCloudWatchLogs_PutLogEvents

func ExampleCloudWatchLogs_PutLogEvents() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.PutLogEventsInput{
		LogEvents: []*cloudwatchlogs.InputLogEvent{ // Required
			{ // Required
				Message:   aws.String("EventMessage"), // Required
				Timestamp: aws.Int64(1),               // Required
			},
			// More values...
		},
		LogGroupName:  aws.String("LogGroupName"),  // Required
		LogStreamName: aws.String("LogStreamName"), // Required
		SequenceToken: aws.String("SequenceToken"),
	}
	resp, err := svc.PutLogEvents(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:kuenzaa,项目名称:rack,代码行数:27,代码来源:examples_test.go


示例3: ExampleCloudWatchLogs_PutMetricFilter

func ExampleCloudWatchLogs_PutMetricFilter() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.PutMetricFilterInput{
		FilterName:    aws.String("FilterName"),    // Required
		FilterPattern: aws.String("FilterPattern"), // Required
		LogGroupName:  aws.String("LogGroupName"),  // Required
		MetricTransformations: []*cloudwatchlogs.MetricTransformation{ // Required
			{ // Required
				MetricName:      aws.String("MetricName"),      // Required
				MetricNamespace: aws.String("MetricNamespace"), // Required
				MetricValue:     aws.String("MetricValue"),     // Required
			},
			// More values...
		},
	}
	resp, err := svc.PutMetricFilter(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:kuenzaa,项目名称:rack,代码行数:28,代码来源:examples_test.go


示例4: ExampleCloudWatchLogs_CancelExportTask

func ExampleCloudWatchLogs_CancelExportTask() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.CancelExportTaskInput{
		TaskId: aws.String("ExportTaskId"), // Required
	}
	resp, err := svc.CancelExportTask(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:kuenzaa,项目名称:rack,代码行数:18,代码来源:examples_test.go


示例5: ExampleCloudWatchLogs_DeleteDestination

func ExampleCloudWatchLogs_DeleteDestination() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.DeleteDestinationInput{
		DestinationName: aws.String("DestinationName"), // Required
	}
	resp, err := svc.DeleteDestination(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:kuenzaa,项目名称:rack,代码行数:18,代码来源:examples_test.go


示例6: ExampleCloudWatchLogs_CreateLogGroup

func ExampleCloudWatchLogs_CreateLogGroup() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.CreateLogGroupInput{
		LogGroupName: aws.String("LogGroupName"), // Required
	}
	resp, err := svc.CreateLogGroup(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:kuenzaa,项目名称:rack,代码行数:18,代码来源:examples_test.go


示例7: ExampleCloudWatchLogs_PutDestinationPolicy

func ExampleCloudWatchLogs_PutDestinationPolicy() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.PutDestinationPolicyInput{
		AccessPolicy:    aws.String("AccessPolicy"),    // Required
		DestinationName: aws.String("DestinationName"), // Required
	}
	resp, err := svc.PutDestinationPolicy(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:anthonyrisinger,项目名称:rack,代码行数:19,代码来源:examples_test.go


示例8: ExampleCloudWatchLogs_DeleteSubscriptionFilter

func ExampleCloudWatchLogs_DeleteSubscriptionFilter() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DeleteSubscriptionFilterInput{
		FilterName:   aws.String("FilterName"),   // Required
		LogGroupName: aws.String("LogGroupName"), // Required
	}
	resp, err := svc.DeleteSubscriptionFilter(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:anthonyrisinger,项目名称:rack,代码行数:19,代码来源:examples_test.go


示例9: ExampleCloudWatchLogs_PutRetentionPolicy

func ExampleCloudWatchLogs_PutRetentionPolicy() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.PutRetentionPolicyInput{
		LogGroupName:    aws.String("LogGroupName"), // Required
		RetentionInDays: aws.Int64(1),               // Required
	}
	resp, err := svc.PutRetentionPolicy(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:kuenzaa,项目名称:rack,代码行数:19,代码来源:examples_test.go


示例10: ExampleCloudWatchLogs_DescribeLogGroups

func ExampleCloudWatchLogs_DescribeLogGroups() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.DescribeLogGroupsInput{
		Limit:              aws.Int64(1),
		LogGroupNamePrefix: aws.String("LogGroupName"),
		NextToken:          aws.String("NextToken"),
	}
	resp, err := svc.DescribeLogGroups(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:kuenzaa,项目名称:rack,代码行数:20,代码来源:examples_test.go


示例11: ExampleCloudWatchLogs_DescribeExportTasks

func ExampleCloudWatchLogs_DescribeExportTasks() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DescribeExportTasksInput{
		Limit:      aws.Int64(1),
		NextToken:  aws.String("NextToken"),
		StatusCode: aws.String("ExportTaskStatusCode"),
		TaskId:     aws.String("ExportTaskId"),
	}
	resp, err := svc.DescribeExportTasks(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:anthonyrisinger,项目名称:rack,代码行数:21,代码来源:examples_test.go


示例12: ExampleCloudWatchLogs_TestMetricFilter

func ExampleCloudWatchLogs_TestMetricFilter() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.TestMetricFilterInput{
		FilterPattern: aws.String("FilterPattern"), // Required
		LogEventMessages: []*string{ // Required
			aws.String("EventMessage"), // Required
			// More values...
		},
	}
	resp, err := svc.TestMetricFilter(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:kuenzaa,项目名称:rack,代码行数:22,代码来源:examples_test.go


示例13: ExampleCloudWatchLogs_PutSubscriptionFilter

func ExampleCloudWatchLogs_PutSubscriptionFilter() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.PutSubscriptionFilterInput{
		DestinationArn: aws.String("DestinationArn"), // Required
		FilterName:     aws.String("FilterName"),     // Required
		FilterPattern:  aws.String("FilterPattern"),  // Required
		LogGroupName:   aws.String("LogGroupName"),   // Required
		RoleArn:        aws.String("RoleArn"),
	}
	resp, err := svc.PutSubscriptionFilter(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:kuenzaa,项目名称:rack,代码行数:22,代码来源:examples_test.go


示例14: ExampleCloudWatchLogs_DescribeLogStreams

func ExampleCloudWatchLogs_DescribeLogStreams() {
	svc := cloudwatchlogs.New(nil)

	params := &cloudwatchlogs.DescribeLogStreamsInput{
		LogGroupName:        aws.String("LogGroupName"), // Required
		Descending:          aws.Bool(true),
		Limit:               aws.Int64(1),
		LogStreamNamePrefix: aws.String("LogStreamName"),
		NextToken:           aws.String("NextToken"),
		OrderBy:             aws.String("OrderBy"),
	}
	resp, err := svc.DescribeLogStreams(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:anthonyrisinger,项目名称:rack,代码行数:23,代码来源:examples_test.go


示例15: ExampleCloudWatchLogs_GetLogEvents

func ExampleCloudWatchLogs_GetLogEvents() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.GetLogEventsInput{
		LogGroupName:  aws.String("LogGroupName"),  // Required
		LogStreamName: aws.String("LogStreamName"), // Required
		EndTime:       aws.Int64(1),
		Limit:         aws.Int64(1),
		NextToken:     aws.String("NextToken"),
		StartFromHead: aws.Bool(true),
		StartTime:     aws.Int64(1),
	}
	resp, err := svc.GetLogEvents(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:kuenzaa,项目名称:rack,代码行数:24,代码来源:examples_test.go


示例16: ExampleCloudWatchLogs_CreateExportTask

func ExampleCloudWatchLogs_CreateExportTask() {
	svc := cloudwatchlogs.New(session.New())

	params := &cloudwatchlogs.CreateExportTaskInput{
		Destination:         aws.String("ExportDestinationBucket"), // Required
		From:                aws.Int64(1),                          // Required
		LogGroupName:        aws.String("LogGroupName"),            // Required
		To:                  aws.Int64(1),                          // Required
		DestinationPrefix:   aws.String("ExportDestinationPrefix"),
		LogStreamNamePrefix: aws.String("LogStreamName"),
		TaskName:            aws.String("ExportTaskName"),
	}
	resp, err := svc.CreateExportTask(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:kuenzaa,项目名称:rack,代码行数:24,代码来源:examples_test.go


示例17: CloudWatchLogs

func CloudWatchLogs() *cloudwatchlogs.CloudWatchLogs {
	return cloudwatchlogs.New(awsConfig())
}
开发者ID:anthonyrisinger,项目名称:rack,代码行数:3,代码来源:models.go


示例18: CloudWatchLogs

func CloudWatchLogs() *cloudwatchlogs.CloudWatchLogs {
	return cloudwatchlogs.New(session.New(), awsConfig())
}
开发者ID:soulware,项目名称:rack,代码行数:3,代码来源:models.go


示例19: TestInterface

func TestInterface(t *testing.T) {
	assert.Implements(t, (*cloudwatchlogsiface.CloudWatchLogsAPI)(nil), cloudwatchlogs.New(nil))
}
开发者ID:anthonyrisinger,项目名称:rack,代码行数:3,代码来源:interface_test.go



注:本文中的github.com/convox/rack/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatchlogs.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang dynamodb.New函数代码示例发布时间:2022-05-23
下一篇:
Golang cloudformation.CloudFormation类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap