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

Golang redshift.New函数代码示例

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

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



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

示例1: ExampleRedshift_CreateSnapshotCopyGrant

func ExampleRedshift_CreateSnapshotCopyGrant() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.CreateSnapshotCopyGrantInput{
		SnapshotCopyGrantName: aws.String("String"), // Required
		KmsKeyId:              aws.String("String"),
		Tags: []*redshift.Tag{
			{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateSnapshotCopyGrant(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:xibz,项目名称:aws-sdk-go,代码行数:32,代码来源:examples_test.go


示例2: ExampleRedshift_DescribeHsmConfigurations

func ExampleRedshift_DescribeHsmConfigurations() {
	svc := redshift.New(session.New())

	params := &redshift.DescribeHsmConfigurationsInput{
		HsmConfigurationIdentifier: aws.String("String"),
		Marker:     aws.String("String"),
		MaxRecords: aws.Int64(1),
		TagKeys: []*string{
			aws.String("String"), // Required
			// More values...
		},
		TagValues: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeHsmConfigurations(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:mattmcclean,项目名称:amazon-ecs-cli,代码行数:28,代码来源:examples_test.go


示例3: ExampleRedshift_EnableLogging

func ExampleRedshift_EnableLogging() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.EnableLoggingInput{
		BucketName:        aws.String("String"), // Required
		ClusterIdentifier: aws.String("String"), // Required
		S3KeyPrefix:       aws.String("String"),
	}
	resp, err := svc.EnableLogging(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:xibz,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go


示例4: ExampleRedshift_DescribeReservedNodeOfferings

func ExampleRedshift_DescribeReservedNodeOfferings() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.DescribeReservedNodeOfferingsInput{
		Marker:                 aws.String("String"),
		MaxRecords:             aws.Int64(1),
		ReservedNodeOfferingId: aws.String("String"),
	}
	resp, err := svc.DescribeReservedNodeOfferings(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:xibz,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go


示例5: ExampleRedshift_AuthorizeSnapshotAccess

func ExampleRedshift_AuthorizeSnapshotAccess() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.AuthorizeSnapshotAccessInput{
		AccountWithRestoreAccess:  aws.String("String"), // Required
		SnapshotIdentifier:        aws.String("String"), // Required
		SnapshotClusterIdentifier: aws.String("String"),
	}
	resp, err := svc.AuthorizeSnapshotAccess(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:xibz,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go


示例6: ExampleRedshift_CreateClusterSnapshot

func ExampleRedshift_CreateClusterSnapshot() {
	svc := redshift.New(nil)

	params := &redshift.CreateClusterSnapshotInput{
		ClusterIdentifier:  aws.String("String"), // Required
		SnapshotIdentifier: aws.String("String"), // Required
		Tags: []*redshift.Tag{
			{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateClusterSnapshot(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,代码行数:26,代码来源:examples_test.go


示例7: ExampleRedshift_CopyClusterSnapshot

func ExampleRedshift_CopyClusterSnapshot() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.CopyClusterSnapshotInput{
		SourceSnapshotIdentifier:        aws.String("String"), // Required
		TargetSnapshotIdentifier:        aws.String("String"), // Required
		SourceSnapshotClusterIdentifier: aws.String("String"),
	}
	resp, err := svc.CopyClusterSnapshot(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:xibz,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go


示例8: ExampleRedshift_DescribeClusters

func ExampleRedshift_DescribeClusters() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.DescribeClustersInput{
		ClusterIdentifier: aws.String("String"),
		Marker:            aws.String("String"),
		MaxRecords:        aws.Int64(1),
		TagKeys: []*string{
			aws.String("String"), // Required
			// More values...
		},
		TagValues: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeClusters(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:xibz,项目名称:aws-sdk-go,代码行数:34,代码来源:examples_test.go


示例9: ExampleRedshift_DeleteCluster

func ExampleRedshift_DeleteCluster() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.DeleteClusterInput{
		ClusterIdentifier:              aws.String("String"), // Required
		FinalClusterSnapshotIdentifier: aws.String("String"),
		SkipFinalClusterSnapshot:       aws.Bool(true),
	}
	resp, err := svc.DeleteCluster(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:xibz,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go


示例10: ExampleRedshift_ModifyClusterIamRoles

func ExampleRedshift_ModifyClusterIamRoles() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.ModifyClusterIamRolesInput{
		ClusterIdentifier: aws.String("String"), // Required
		AddIamRoles: []*string{
			aws.String("String"), // Required
			// More values...
		},
		RemoveIamRoles: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.ModifyClusterIamRoles(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:xibz,项目名称:aws-sdk-go,代码行数:32,代码来源:examples_test.go


示例11: ExampleRedshift_CreateClusterSubnetGroup

func ExampleRedshift_CreateClusterSubnetGroup() {
	svc := redshift.New(session.New())

	params := &redshift.CreateClusterSubnetGroupInput{
		ClusterSubnetGroupName: aws.String("String"), // Required
		Description:            aws.String("String"), // Required
		SubnetIds: []*string{ // Required
			aws.String("String"), // Required
			// More values...
		},
		Tags: []*redshift.Tag{
			{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateClusterSubnetGroup(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:mattmcclean,项目名称:amazon-ecs-cli,代码行数:30,代码来源:examples_test.go


示例12: ExampleRedshift_CreateTags

func ExampleRedshift_CreateTags() {
	svc := redshift.New(session.New())

	params := &redshift.CreateTagsInput{
		ResourceName: aws.String("String"), // Required
		Tags: []*redshift.Tag{ // Required
			{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateTags(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:mattmcclean,项目名称:amazon-ecs-cli,代码行数:25,代码来源:examples_test.go


示例13: ExampleRedshift_RevokeClusterSecurityGroupIngress

func ExampleRedshift_RevokeClusterSecurityGroupIngress() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.RevokeClusterSecurityGroupIngressInput{
		ClusterSecurityGroupName: aws.String("String"), // Required
		CIDRIP:                  aws.String("String"),
		EC2SecurityGroupName:    aws.String("String"),
		EC2SecurityGroupOwnerId: aws.String("String"),
	}
	resp, err := svc.RevokeClusterSecurityGroupIngress(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:xibz,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go


示例14: ExampleRedshift_ResetClusterParameterGroup

func ExampleRedshift_ResetClusterParameterGroup() {
	svc := redshift.New(session.New())

	params := &redshift.ResetClusterParameterGroupInput{
		ParameterGroupName: aws.String("String"), // Required
		Parameters: []*redshift.Parameter{
			{ // Required
				AllowedValues:        aws.String("String"),
				ApplyType:            aws.String("ParameterApplyType"),
				DataType:             aws.String("String"),
				Description:          aws.String("String"),
				IsModifiable:         aws.Bool(true),
				MinimumEngineVersion: aws.String("String"),
				ParameterName:        aws.String("String"),
				ParameterValue:       aws.String("String"),
				Source:               aws.String("String"),
			},
			// More values...
		},
		ResetAllParameters: aws.Bool(true),
	}
	resp, err := svc.ResetClusterParameterGroup(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:mattmcclean,项目名称:amazon-ecs-cli,代码行数:33,代码来源:examples_test.go


示例15: ExampleRedshift_PurchaseReservedNodeOffering

func ExampleRedshift_PurchaseReservedNodeOffering() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.PurchaseReservedNodeOfferingInput{
		ReservedNodeOfferingId: aws.String("String"), // Required
		NodeCount:              aws.Int64(1),
	}
	resp, err := svc.PurchaseReservedNodeOffering(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:xibz,项目名称:aws-sdk-go,代码行数:25,代码来源:examples_test.go


示例16: ExampleRedshift_DescribeClusterSnapshots

func ExampleRedshift_DescribeClusterSnapshots() {
	svc := redshift.New(session.New())

	params := &redshift.DescribeClusterSnapshotsInput{
		ClusterIdentifier:  aws.String("String"),
		EndTime:            aws.Time(time.Now()),
		Marker:             aws.String("String"),
		MaxRecords:         aws.Int64(1),
		OwnerAccount:       aws.String("String"),
		SnapshotIdentifier: aws.String("String"),
		SnapshotType:       aws.String("String"),
		StartTime:          aws.Time(time.Now()),
		TagKeys: []*string{
			aws.String("String"), // Required
			// More values...
		},
		TagValues: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeClusterSnapshots(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:mattmcclean,项目名称:amazon-ecs-cli,代码行数:33,代码来源:examples_test.go


示例17: ExampleRedshift_ModifySnapshotCopyRetentionPeriod

func ExampleRedshift_ModifySnapshotCopyRetentionPeriod() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.ModifySnapshotCopyRetentionPeriodInput{
		ClusterIdentifier: aws.String("String"), // Required
		RetentionPeriod:   aws.Int64(1),         // Required
	}
	resp, err := svc.ModifySnapshotCopyRetentionPeriod(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:xibz,项目名称:aws-sdk-go,代码行数:25,代码来源:examples_test.go


示例18: ExampleRedshift_CreateClusterParameterGroup

func ExampleRedshift_CreateClusterParameterGroup() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.CreateClusterParameterGroupInput{
		Description:          aws.String("String"), // Required
		ParameterGroupFamily: aws.String("String"), // Required
		ParameterGroupName:   aws.String("String"), // Required
		Tags: []*redshift.Tag{
			{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateClusterParameterGroup(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:xibz,项目名称:aws-sdk-go,代码行数:33,代码来源:examples_test.go


示例19: ExampleRedshift_ModifyClusterSubnetGroup

func ExampleRedshift_ModifyClusterSubnetGroup() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.ModifyClusterSubnetGroupInput{
		ClusterSubnetGroupName: aws.String("String"), // Required
		SubnetIds: []*string{ // Required
			aws.String("String"), // Required
			// More values...
		},
		Description: aws.String("String"),
	}
	resp, err := svc.ModifyClusterSubnetGroup(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:xibz,项目名称:aws-sdk-go,代码行数:29,代码来源:examples_test.go


示例20: ExampleRedshift_DescribeDefaultClusterParameters

func ExampleRedshift_DescribeDefaultClusterParameters() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := redshift.New(sess)

	params := &redshift.DescribeDefaultClusterParametersInput{
		ParameterGroupFamily: aws.String("String"), // Required
		Marker:               aws.String("String"),
		MaxRecords:           aws.Int64(1),
	}
	resp, err := svc.DescribeDefaultClusterParameters(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:xibz,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Golang redshift.AuthorizeClusterSecurityGroupIngressInput类代码示例发布时间:2022-05-24
下一篇:
Golang rds.RDS类代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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