本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/redshift.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了New函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}