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


Golang elasticache.New函数代码示例

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


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

示例1: ExampleElastiCache_DescribeReservedCacheNodes

func ExampleElastiCache_DescribeReservedCacheNodes() {
	svc := elasticache.New(nil)

	params := &elasticache.DescribeReservedCacheNodesInput{
		CacheNodeType:                aws.String("String"),
		Duration:                     aws.String("String"),
		Marker:                       aws.String("String"),
		MaxRecords:                   aws.Int64(1),
		OfferingType:                 aws.String("String"),
		ProductDescription:           aws.String("String"),
		ReservedCacheNodeId:          aws.String("String"),
		ReservedCacheNodesOfferingId: aws.String("String"),
	}
	resp, err := svc.DescribeReservedCacheNodes(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:marcosvm,项目名称:aws-sdk-go,代码行数:25,代码来源:examples_test.go

示例2: ExampleElastiCache_AddTagsToResource

func ExampleElastiCache_AddTagsToResource() {
	svc := elasticache.New(nil)

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

示例3: ExampleElastiCache_ResetCacheParameterGroup

func ExampleElastiCache_ResetCacheParameterGroup() {
	svc := elasticache.New(nil)

	params := &elasticache.ResetCacheParameterGroupInput{
		CacheParameterGroupName: aws.String("String"), // Required
		ParameterNameValues: []*elasticache.ParameterNameValue{ // Required
			{ // Required
				ParameterName:  aws.String("String"),
				ParameterValue: aws.String("String"),
			},
			// More values...
		},
		ResetAllParameters: aws.Bool(true),
	}
	resp, err := svc.ResetCacheParameterGroup(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:marcosvm,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go

示例4: ExampleElastiCache_CreateCacheCluster

func ExampleElastiCache_CreateCacheCluster() {
	svc := elasticache.New(nil)

	params := &elasticache.CreateCacheClusterInput{
		CacheClusterId:          aws.String("String"), // Required
		AZMode:                  aws.String("AZMode"),
		AutoMinorVersionUpgrade: aws.Bool(true),
		CacheNodeType:           aws.String("String"),
		CacheParameterGroupName: aws.String("String"),
		CacheSecurityGroupNames: []*string{
			aws.String("String"), // Required
			// More values...
		},
		CacheSubnetGroupName: aws.String("String"),
		Engine:               aws.String("String"),
		EngineVersion:        aws.String("String"),
		NotificationTopicArn: aws.String("String"),
		NumCacheNodes:        aws.Int64(1),
		Port:                 aws.Int64(1),
		PreferredAvailabilityZone: aws.String("String"),
		PreferredAvailabilityZones: []*string{
			aws.String("String"), // Required
			// More values...
		},
		PreferredMaintenanceWindow: aws.String("String"),
		ReplicationGroupId:         aws.String("String"),
		SecurityGroupIds: []*string{
			aws.String("String"), // Required
			// More values...
		},
		SnapshotArns: []*string{
			aws.String("String"), // Required
			// More values...
		},
		SnapshotName:           aws.String("String"),
		SnapshotRetentionLimit: aws.Int64(1),
		SnapshotWindow:         aws.String("String"),
		Tags: []*elasticache.Tag{
			{ // Required
				Key:   aws.String("String"),
				Value: aws.String("String"),
			},
			// More values...
		},
	}
	resp, err := svc.CreateCacheCluster(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:marcosvm,项目名称:aws-sdk-go,代码行数:57,代码来源:examples_test.go

示例5: ExampleElastiCache_ModifyCacheCluster

func ExampleElastiCache_ModifyCacheCluster() {
	svc := elasticache.New(nil)

	params := &elasticache.ModifyCacheClusterInput{
		CacheClusterId:          aws.String("String"), // Required
		AZMode:                  aws.String("AZMode"),
		ApplyImmediately:        aws.Bool(true),
		AutoMinorVersionUpgrade: aws.Bool(true),
		CacheNodeIdsToRemove: []*string{
			aws.String("String"), // Required
			// More values...
		},
		CacheParameterGroupName: aws.String("String"),
		CacheSecurityGroupNames: []*string{
			aws.String("String"), // Required
			// More values...
		},
		EngineVersion: aws.String("String"),
		NewAvailabilityZones: []*string{
			aws.String("String"), // Required
			// More values...
		},
		NotificationTopicArn:       aws.String("String"),
		NotificationTopicStatus:    aws.String("String"),
		NumCacheNodes:              aws.Int64(1),
		PreferredMaintenanceWindow: aws.String("String"),
		SecurityGroupIds: []*string{
			aws.String("String"), // Required
			// More values...
		},
		SnapshotRetentionLimit: aws.Int64(1),
		SnapshotWindow:         aws.String("String"),
	}
	resp, err := svc.ModifyCacheCluster(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:marcosvm,项目名称:aws-sdk-go,代码行数:45,代码来源:examples_test.go

示例6: ExampleElastiCache_DeleteSnapshot

func ExampleElastiCache_DeleteSnapshot() {
	svc := elasticache.New(nil)

	params := &elasticache.DeleteSnapshotInput{
		SnapshotName: aws.String("String"), // Required
	}
	resp, err := svc.DeleteSnapshot(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:marcosvm,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go

示例7: ExampleElastiCache_ListTagsForResource

func ExampleElastiCache_ListTagsForResource() {
	svc := elasticache.New(nil)

	params := &elasticache.ListTagsForResourceInput{
		ResourceName: aws.String("String"), // Required
	}
	resp, err := svc.ListTagsForResource(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:marcosvm,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go

示例8: ExampleElastiCache_CreateCacheSecurityGroup

func ExampleElastiCache_CreateCacheSecurityGroup() {
	svc := elasticache.New(nil)

	params := &elasticache.CreateCacheSecurityGroupInput{
		CacheSecurityGroupName: aws.String("String"), // Required
		Description:            aws.String("String"), // Required
	}
	resp, err := svc.CreateCacheSecurityGroup(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:marcosvm,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go

示例9: ExampleElastiCache_DescribeReplicationGroups

func ExampleElastiCache_DescribeReplicationGroups() {
	svc := elasticache.New(nil)

	params := &elasticache.DescribeReplicationGroupsInput{
		Marker:             aws.String("String"),
		MaxRecords:         aws.Int64(1),
		ReplicationGroupId: aws.String("String"),
	}
	resp, err := svc.DescribeReplicationGroups(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:marcosvm,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go

示例10: ExampleElastiCache_DescribeEngineDefaultParameters

func ExampleElastiCache_DescribeEngineDefaultParameters() {
	svc := elasticache.New(nil)

	params := &elasticache.DescribeEngineDefaultParametersInput{
		CacheParameterGroupFamily: aws.String("String"), // Required
		Marker:     aws.String("String"),
		MaxRecords: aws.Int64(1),
	}
	resp, err := svc.DescribeEngineDefaultParameters(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:marcosvm,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go

示例11: ExampleElastiCache_AuthorizeCacheSecurityGroupIngress

func ExampleElastiCache_AuthorizeCacheSecurityGroupIngress() {
	svc := elasticache.New(nil)

	params := &elasticache.AuthorizeCacheSecurityGroupIngressInput{
		CacheSecurityGroupName:  aws.String("String"), // Required
		EC2SecurityGroupName:    aws.String("String"), // Required
		EC2SecurityGroupOwnerId: aws.String("String"), // Required
	}
	resp, err := svc.AuthorizeCacheSecurityGroupIngress(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:marcosvm,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go

示例12: ExampleElastiCache_DeleteReplicationGroup

func ExampleElastiCache_DeleteReplicationGroup() {
	svc := elasticache.New(nil)

	params := &elasticache.DeleteReplicationGroupInput{
		ReplicationGroupId:      aws.String("String"), // Required
		FinalSnapshotIdentifier: aws.String("String"),
		RetainPrimaryCluster:    aws.Bool(true),
	}
	resp, err := svc.DeleteReplicationGroup(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:marcosvm,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go

示例13: ExampleElastiCache_PurchaseReservedCacheNodesOffering

func ExampleElastiCache_PurchaseReservedCacheNodesOffering() {
	svc := elasticache.New(nil)

	params := &elasticache.PurchaseReservedCacheNodesOfferingInput{
		ReservedCacheNodesOfferingId: aws.String("String"), // Required
		CacheNodeCount:               aws.Int64(1),
		ReservedCacheNodeId:          aws.String("String"),
	}
	resp, err := svc.PurchaseReservedCacheNodesOffering(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:marcosvm,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go

示例14: ExampleElastiCache_DescribeCacheClusters

func ExampleElastiCache_DescribeCacheClusters() {
	svc := elasticache.New(nil)

	params := &elasticache.DescribeCacheClustersInput{
		CacheClusterId:    aws.String("String"),
		Marker:            aws.String("String"),
		MaxRecords:        aws.Int64(1),
		ShowCacheNodeInfo: aws.Bool(true),
	}
	resp, err := svc.DescribeCacheClusters(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:marcosvm,项目名称:aws-sdk-go,代码行数:21,代码来源:examples_test.go

示例15: ExampleElastiCache_RebootCacheCluster

func ExampleElastiCache_RebootCacheCluster() {
	svc := elasticache.New(nil)

	params := &elasticache.RebootCacheClusterInput{
		CacheClusterId: aws.String("String"), // Required
		CacheNodeIdsToReboot: []*string{ // Required
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.RebootCacheCluster(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:marcosvm,项目名称:aws-sdk-go,代码行数:22,代码来源:examples_test.go


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