当前位置: 首页>>代码示例>>Golang>>正文


Golang redshift.New函数代码示例

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


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

示例1: ExampleRedshift_DescribeEvents

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

	params := &redshift.DescribeEventsInput{
		Duration:         aws.Long(1),
		EndTime:          aws.Time(time.Now()),
		Marker:           aws.String("String"),
		MaxRecords:       aws.Long(1),
		SourceIdentifier: aws.String("String"),
		SourceType:       aws.String("SourceType"),
		StartTime:        aws.Time(time.Now()),
	}
	resp, err := svc.DescribeEvents(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:25,代码来源:examples_test.go

示例2: ExampleRedshift_ResetClusterParameterGroup

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

	params := &redshift.ResetClusterParameterGroupInput{
		ParameterGroupName: aws.String("String"), // Required
		Parameters: []*redshift.Parameter{
			&redshift.Parameter{ // Required
				AllowedValues:        aws.String("String"),
				DataType:             aws.String("String"),
				Description:          aws.String("String"),
				IsModifiable:         aws.Boolean(true),
				MinimumEngineVersion: aws.String("String"),
				ParameterName:        aws.String("String"),
				ParameterValue:       aws.String("String"),
				Source:               aws.String("String"),
			},
			// More values...
		},
		ResetAllParameters: aws.Boolean(true),
	}
	resp, err := svc.ResetClusterParameterGroup(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:33,代码来源:examples_test.go

示例3: ExampleRedshift_CreateTags

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

	params := &redshift.CreateTagsInput{
		ResourceName: aws.String("String"), // Required
		Tags: []*redshift.Tag{ // Required
			&redshift.Tag{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateTags(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go

示例4: ExampleRedshift_DescribeHSMConfigurations

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

	params := &redshift.DescribeHSMConfigurationsInput{
		HSMConfigurationIdentifier: aws.String("String"),
		Marker:     aws.String("String"),
		MaxRecords: aws.Long(1),
		TagKeys: []*string{
			aws.String("String"), // Required
			// More values...
		},
		TagValues: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeHSMConfigurations(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:29,代码来源:examples_test.go

示例5: ExampleRedshift_DescribeClusterSnapshots

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

	params := &redshift.DescribeClusterSnapshotsInput{
		ClusterIdentifier:  aws.String("String"),
		EndTime:            aws.Time(time.Now()),
		Marker:             aws.String("String"),
		MaxRecords:         aws.Long(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 awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:34,代码来源:examples_test.go

示例6: ExampleRedshift_ModifyEventSubscription

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

	params := &redshift.ModifyEventSubscriptionInput{
		SubscriptionName: aws.String("String"), // Required
		Enabled:          aws.Boolean(true),
		EventCategories: []*string{
			aws.String("String"), // Required
			// More values...
		},
		SNSTopicARN: aws.String("String"),
		Severity:    aws.String("String"),
		SourceIDs: []*string{
			aws.String("String"), // Required
			// More values...
		},
		SourceType: aws.String("String"),
	}
	resp, err := svc.ModifyEventSubscription(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go

示例7: ExampleRedshift_CreateClusterSubnetGroup

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

	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{
			&redshift.Tag{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateClusterSubnetGroup(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go

示例8: ExampleRedshift_CreateHSMConfiguration

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

	params := &redshift.CreateHSMConfigurationInput{
		Description:                aws.String("String"), // Required
		HSMConfigurationIdentifier: aws.String("String"), // Required
		HSMIPAddress:               aws.String("String"), // Required
		HSMPartitionName:           aws.String("String"), // Required
		HSMPartitionPassword:       aws.String("String"), // Required
		HSMServerPublicCertificate: aws.String("String"), // Required
		Tags: []*redshift.Tag{
			&redshift.Tag{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateHSMConfiguration(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go

示例9: ExampleRedshift_CreateCluster

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

	params := &redshift.CreateClusterInput{
		ClusterIdentifier:                aws.String("String"), // Required
		MasterUserPassword:               aws.String("String"), // Required
		MasterUsername:                   aws.String("String"), // Required
		NodeType:                         aws.String("String"), // Required
		AllowVersionUpgrade:              aws.Boolean(true),
		AutomatedSnapshotRetentionPeriod: aws.Long(1),
		AvailabilityZone:                 aws.String("String"),
		ClusterParameterGroupName:        aws.String("String"),
		ClusterSecurityGroups: []*string{
			aws.String("String"), // Required
			// More values...
		},
		ClusterSubnetGroupName:         aws.String("String"),
		ClusterType:                    aws.String("String"),
		ClusterVersion:                 aws.String("String"),
		DBName:                         aws.String("String"),
		ElasticIP:                      aws.String("String"),
		Encrypted:                      aws.Boolean(true),
		HSMClientCertificateIdentifier: aws.String("String"),
		HSMConfigurationIdentifier:     aws.String("String"),
		KMSKeyID:                       aws.String("String"),
		NumberOfNodes:                  aws.Long(1),
		Port:                           aws.Long(1),
		PreferredMaintenanceWindow: aws.String("String"),
		PubliclyAccessible:         aws.Boolean(true),
		Tags: []*redshift.Tag{
			&redshift.Tag{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
		VPCSecurityGroupIDs: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.CreateCluster(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:54,代码来源:examples_test.go

示例10: ExampleRedshift_DeleteEventSubscription

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

	params := &redshift.DeleteEventSubscriptionInput{
		SubscriptionName: aws.String("String"), // Required
	}
	resp, err := svc.DeleteEventSubscription(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go

示例11: ExampleRedshift_DescribeEventCategories

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

	params := &redshift.DescribeEventCategoriesInput{
		SourceType: aws.String("String"),
	}
	resp, err := svc.DescribeEventCategories(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go

示例12: ExampleRedshift_DescribeLoggingStatus

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

	params := &redshift.DescribeLoggingStatusInput{
		ClusterIdentifier: aws.String("String"), // Required
	}
	resp, err := svc.DescribeLoggingStatus(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go

示例13: ExampleRedshift_RestoreFromClusterSnapshot

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

	params := &redshift.RestoreFromClusterSnapshotInput{
		ClusterIdentifier:                aws.String("String"), // Required
		SnapshotIdentifier:               aws.String("String"), // Required
		AllowVersionUpgrade:              aws.Boolean(true),
		AutomatedSnapshotRetentionPeriod: aws.Long(1),
		AvailabilityZone:                 aws.String("String"),
		ClusterParameterGroupName:        aws.String("String"),
		ClusterSecurityGroups: []*string{
			aws.String("String"), // Required
			// More values...
		},
		ClusterSubnetGroupName:         aws.String("String"),
		ElasticIP:                      aws.String("String"),
		HSMClientCertificateIdentifier: aws.String("String"),
		HSMConfigurationIdentifier:     aws.String("String"),
		KMSKeyID:                       aws.String("String"),
		OwnerAccount:                   aws.String("String"),
		Port:                           aws.Long(1),
		PreferredMaintenanceWindow: aws.String("String"),
		PubliclyAccessible:         aws.Boolean(true),
		SnapshotClusterIdentifier:  aws.String("String"),
		VPCSecurityGroupIDs: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.RestoreFromClusterSnapshot(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:42,代码来源:examples_test.go

示例14: ExampleRedshift_ModifySnapshotCopyRetentionPeriod

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

	params := &redshift.ModifySnapshotCopyRetentionPeriodInput{
		ClusterIdentifier: aws.String("String"), // Required
		RetentionPeriod:   aws.Long(1),          // Required
	}
	resp, err := svc.ModifySnapshotCopyRetentionPeriod(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go

示例15: ExampleRedshift_PurchaseReservedNodeOffering

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

	params := &redshift.PurchaseReservedNodeOfferingInput{
		ReservedNodeOfferingID: aws.String("String"), // Required
		NodeCount:              aws.Long(1),
	}
	resp, err := svc.PurchaseReservedNodeOffering(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
开发者ID:datacratic,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go


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