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

Golang opsworks.New函数代码示例

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

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



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

示例1: ExampleOpsWorks_RegisterInstance

func ExampleOpsWorks_RegisterInstance() {
	svc := opsworks.New(nil)

	params := &opsworks.RegisterInstanceInput{
		StackId:  aws.String("String"), // Required
		Hostname: aws.String("String"),
		InstanceIdentity: &opsworks.InstanceIdentity{
			Document:  aws.String("String"),
			Signature: aws.String("String"),
		},
		PrivateIp:               aws.String("String"),
		PublicIp:                aws.String("String"),
		RsaPublicKey:            aws.String("String"),
		RsaPublicKeyFingerprint: aws.String("String"),
	}
	resp, err := svc.RegisterInstance(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,代码行数:27,代码来源:examples_test.go


示例2: ExampleOpsWorks_UpdateInstance

func ExampleOpsWorks_UpdateInstance() {
	svc := opsworks.New(nil)

	params := &opsworks.UpdateInstanceInput{
		InstanceId:           aws.String("String"), // Required
		AgentVersion:         aws.String("String"),
		AmiId:                aws.String("String"),
		Architecture:         aws.String("Architecture"),
		AutoScalingType:      aws.String("AutoScalingType"),
		EbsOptimized:         aws.Bool(true),
		Hostname:             aws.String("String"),
		InstallUpdatesOnBoot: aws.Bool(true),
		InstanceType:         aws.String("String"),
		LayerIds: []*string{
			aws.String("String"), // Required
			// More values...
		},
		Os:         aws.String("String"),
		SshKeyName: aws.String("String"),
	}
	resp, err := svc.UpdateInstance(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,代码行数:32,代码来源:examples_test.go


示例3: ExampleOpsWorks_CreateApp

func ExampleOpsWorks_CreateApp() {
	svc := opsworks.New(nil)

	params := &opsworks.CreateAppInput{
		Name:    aws.String("String"),  // Required
		StackId: aws.String("String"),  // Required
		Type:    aws.String("AppType"), // Required
		AppSource: &opsworks.Source{
			Password: aws.String("String"),
			Revision: aws.String("String"),
			SshKey:   aws.String("String"),
			Type:     aws.String("SourceType"),
			Url:      aws.String("String"),
			Username: aws.String("String"),
		},
		Attributes: map[string]*string{
			"Key": aws.String("String"), // Required
			// More values...
		},
		DataSources: []*opsworks.DataSource{
			{ // Required
				Arn:          aws.String("String"),
				DatabaseName: aws.String("String"),
				Type:         aws.String("String"),
			},
			// More values...
		},
		Description: aws.String("String"),
		Domains: []*string{
			aws.String("String"), // Required
			// More values...
		},
		EnableSsl: aws.Bool(true),
		Environment: []*opsworks.EnvironmentVariable{
			{ // Required
				Key:    aws.String("String"), // Required
				Value:  aws.String("String"), // Required
				Secure: aws.Bool(true),
			},
			// More values...
		},
		Shortname: aws.String("String"),
		SslConfiguration: &opsworks.SslConfiguration{
			Certificate: aws.String("String"), // Required
			PrivateKey:  aws.String("String"), // Required
			Chain:       aws.String("String"),
		},
	}
	resp, err := svc.CreateApp(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,代码行数:60,代码来源:examples_test.go


示例4: ExampleOpsWorks_CreateDeployment

func ExampleOpsWorks_CreateDeployment() {
	svc := opsworks.New(nil)

	params := &opsworks.CreateDeploymentInput{
		Command: &opsworks.DeploymentCommand{ // Required
			Name: aws.String("DeploymentCommandName"), // Required
			Args: map[string][]*string{
				"Key": { // Required
					aws.String("String"), // Required
					// More values...
				},
				// More values...
			},
		},
		StackId:    aws.String("String"), // Required
		AppId:      aws.String("String"),
		Comment:    aws.String("String"),
		CustomJson: aws.String("String"),
		InstanceIds: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.CreateDeployment(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,代码行数:35,代码来源:examples_test.go


示例5: ExampleOpsWorks_CloneStack

func ExampleOpsWorks_CloneStack() {
	svc := opsworks.New(nil)

	params := &opsworks.CloneStackInput{
		ServiceRoleArn: aws.String("String"), // Required
		SourceStackId:  aws.String("String"), // Required
		AgentVersion:   aws.String("String"),
		Attributes: map[string]*string{
			"Key": aws.String("String"), // Required
			// More values...
		},
		ChefConfiguration: &opsworks.ChefConfiguration{
			BerkshelfVersion: aws.String("String"),
			ManageBerkshelf:  aws.Bool(true),
		},
		CloneAppIds: []*string{
			aws.String("String"), // Required
			// More values...
		},
		ClonePermissions: aws.Bool(true),
		ConfigurationManager: &opsworks.StackConfigurationManager{
			Name:    aws.String("String"),
			Version: aws.String("String"),
		},
		CustomCookbooksSource: &opsworks.Source{
			Password: aws.String("String"),
			Revision: aws.String("String"),
			SshKey:   aws.String("String"),
			Type:     aws.String("SourceType"),
			Url:      aws.String("String"),
			Username: aws.String("String"),
		},
		CustomJson:                aws.String("String"),
		DefaultAvailabilityZone:   aws.String("String"),
		DefaultInstanceProfileArn: aws.String("String"),
		DefaultOs:                 aws.String("String"),
		DefaultRootDeviceType:     aws.String("RootDeviceType"),
		DefaultSshKeyName:         aws.String("String"),
		DefaultSubnetId:           aws.String("String"),
		HostnameTheme:             aws.String("String"),
		Name:                      aws.String("String"),
		Region:                    aws.String("String"),
		UseCustomCookbooks:        aws.Bool(true),
		UseOpsworksSecurityGroups: aws.Bool(true),
		VpcId: aws.String("String"),
	}
	resp, err := svc.CloneStack(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,代码行数:58,代码来源:examples_test.go


示例6: ExampleOpsWorks_CreateInstance

func ExampleOpsWorks_CreateInstance() {
	svc := opsworks.New(nil)

	params := &opsworks.CreateInstanceInput{
		InstanceType: aws.String("String"), // Required
		LayerIds: []*string{ // Required
			aws.String("String"), // Required
			// More values...
		},
		StackId:          aws.String("String"), // Required
		AgentVersion:     aws.String("String"),
		AmiId:            aws.String("String"),
		Architecture:     aws.String("Architecture"),
		AutoScalingType:  aws.String("AutoScalingType"),
		AvailabilityZone: aws.String("String"),
		BlockDeviceMappings: []*opsworks.BlockDeviceMapping{
			{ // Required
				DeviceName: aws.String("String"),
				Ebs: &opsworks.EbsBlockDevice{
					DeleteOnTermination: aws.Bool(true),
					Iops:                aws.Int64(1),
					SnapshotId:          aws.String("String"),
					VolumeSize:          aws.Int64(1),
					VolumeType:          aws.String("VolumeType"),
				},
				NoDevice:    aws.String("String"),
				VirtualName: aws.String("String"),
			},
			// More values...
		},
		EbsOptimized:         aws.Bool(true),
		Hostname:             aws.String("String"),
		InstallUpdatesOnBoot: aws.Bool(true),
		Os:                   aws.String("String"),
		RootDeviceType:       aws.String("RootDeviceType"),
		SshKeyName:           aws.String("String"),
		SubnetId:             aws.String("String"),
		VirtualizationType:   aws.String("String"),
	}
	resp, err := svc.CreateInstance(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,代码行数:51,代码来源:examples_test.go


示例7: ExampleOpsWorks_SetTimeBasedAutoScaling

func ExampleOpsWorks_SetTimeBasedAutoScaling() {
	svc := opsworks.New(nil)

	params := &opsworks.SetTimeBasedAutoScalingInput{
		InstanceId: aws.String("String"), // Required
		AutoScalingSchedule: &opsworks.WeeklyAutoScalingSchedule{
			Friday: map[string]*string{
				"Key": aws.String("Switch"), // Required
				// More values...
			},
			Monday: map[string]*string{
				"Key": aws.String("Switch"), // Required
				// More values...
			},
			Saturday: map[string]*string{
				"Key": aws.String("Switch"), // Required
				// More values...
			},
			Sunday: map[string]*string{
				"Key": aws.String("Switch"), // Required
				// More values...
			},
			Thursday: map[string]*string{
				"Key": aws.String("Switch"), // Required
				// More values...
			},
			Tuesday: map[string]*string{
				"Key": aws.String("Switch"), // Required
				// More values...
			},
			Wednesday: map[string]*string{
				"Key": aws.String("Switch"), // Required
				// More values...
			},
		},
	}
	resp, err := svc.SetTimeBasedAutoScaling(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,代码行数:48,代码来源:examples_test.go


示例8: ExampleOpsWorks_DescribeMyUserProfile

func ExampleOpsWorks_DescribeMyUserProfile() {
	svc := opsworks.New(nil)

	var params *opsworks.DescribeMyUserProfileInput
	resp, err := svc.DescribeMyUserProfile(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,代码行数:16,代码来源:examples_test.go


示例9: ExampleOpsWorks_DeregisterVolume

func ExampleOpsWorks_DeregisterVolume() {
	svc := opsworks.New(nil)

	params := &opsworks.DeregisterVolumeInput{
		VolumeId: aws.String("String"), // Required
	}
	resp, err := svc.DeregisterVolume(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


示例10: ExampleOpsWorks_DescribeStackProvisioningParameters

func ExampleOpsWorks_DescribeStackProvisioningParameters() {
	svc := opsworks.New(nil)

	params := &opsworks.DescribeStackProvisioningParametersInput{
		StackId: aws.String("String"), // Required
	}
	resp, err := svc.DescribeStackProvisioningParameters(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


示例11: ExampleOpsWorks_GetHostnameSuggestion

func ExampleOpsWorks_GetHostnameSuggestion() {
	svc := opsworks.New(nil)

	params := &opsworks.GetHostnameSuggestionInput{
		LayerId: aws.String("String"), // Required
	}
	resp, err := svc.GetHostnameSuggestion(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


示例12: ExampleOpsWorks_UpdateMyUserProfile

func ExampleOpsWorks_UpdateMyUserProfile() {
	svc := opsworks.New(nil)

	params := &opsworks.UpdateMyUserProfileInput{
		SshPublicKey: aws.String("String"),
	}
	resp, err := svc.UpdateMyUserProfile(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


示例13: ExampleOpsWorks_DescribePermissions

func ExampleOpsWorks_DescribePermissions() {
	svc := opsworks.New(nil)

	params := &opsworks.DescribePermissionsInput{
		IamUserArn: aws.String("String"),
		StackId:    aws.String("String"),
	}
	resp, err := svc.DescribePermissions(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


示例14: ExampleOpsWorks_GrantAccess

func ExampleOpsWorks_GrantAccess() {
	svc := opsworks.New(nil)

	params := &opsworks.GrantAccessInput{
		InstanceId:        aws.String("String"), // Required
		ValidForInMinutes: aws.Int64(1),
	}
	resp, err := svc.GrantAccess(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


示例15: ExampleOpsWorks_SetLoadBasedAutoScaling

func ExampleOpsWorks_SetLoadBasedAutoScaling() {
	svc := opsworks.New(nil)

	params := &opsworks.SetLoadBasedAutoScalingInput{
		LayerId: aws.String("String"), // Required
		DownScaling: &opsworks.AutoScalingThresholds{
			Alarms: []*string{
				aws.String("String"), // Required
				// More values...
			},
			CpuThreshold:       aws.Float64(1.0),
			IgnoreMetricsTime:  aws.Int64(1),
			InstanceCount:      aws.Int64(1),
			LoadThreshold:      aws.Float64(1.0),
			MemoryThreshold:    aws.Float64(1.0),
			ThresholdsWaitTime: aws.Int64(1),
		},
		Enable: aws.Bool(true),
		UpScaling: &opsworks.AutoScalingThresholds{
			Alarms: []*string{
				aws.String("String"), // Required
				// More values...
			},
			CpuThreshold:       aws.Float64(1.0),
			IgnoreMetricsTime:  aws.Int64(1),
			InstanceCount:      aws.Int64(1),
			LoadThreshold:      aws.Float64(1.0),
			MemoryThreshold:    aws.Float64(1.0),
			ThresholdsWaitTime: aws.Int64(1),
		},
	}
	resp, err := svc.SetLoadBasedAutoScaling(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,代码行数:43,代码来源:examples_test.go


示例16: ExampleOpsWorks_AssociateElasticIp

func ExampleOpsWorks_AssociateElasticIp() {
	svc := opsworks.New(nil)

	params := &opsworks.AssociateElasticIpInput{
		ElasticIp:  aws.String("String"), // Required
		InstanceId: aws.String("String"),
	}
	resp, err := svc.AssociateElasticIp(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


示例17: ExampleOpsWorks_AttachElasticLoadBalancer

func ExampleOpsWorks_AttachElasticLoadBalancer() {
	svc := opsworks.New(nil)

	params := &opsworks.AttachElasticLoadBalancerInput{
		ElasticLoadBalancerName: aws.String("String"), // Required
		LayerId:                 aws.String("String"), // Required
	}
	resp, err := svc.AttachElasticLoadBalancer(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


示例18: ExampleOpsWorks_UpdateRdsDbInstance

func ExampleOpsWorks_UpdateRdsDbInstance() {
	svc := opsworks.New(nil)

	params := &opsworks.UpdateRdsDbInstanceInput{
		RdsDbInstanceArn: aws.String("String"), // Required
		DbPassword:       aws.String("String"),
		DbUser:           aws.String("String"),
	}
	resp, err := svc.UpdateRdsDbInstance(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


示例19: ExampleOpsWorks_DeleteInstance

func ExampleOpsWorks_DeleteInstance() {
	svc := opsworks.New(nil)

	params := &opsworks.DeleteInstanceInput{
		InstanceId:      aws.String("String"), // Required
		DeleteElasticIp: aws.Bool(true),
		DeleteVolumes:   aws.Bool(true),
	}
	resp, err := svc.DeleteInstance(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


示例20: ExampleOpsWorks_DescribeUserProfiles

func ExampleOpsWorks_DescribeUserProfiles() {
	svc := opsworks.New(nil)

	params := &opsworks.DescribeUserProfilesInput{
		IamUserArns: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeUserProfiles(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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Golang redshift.New函数代码示例发布时间:2022-05-23
下一篇:
Golang machinelearning.New函数代码示例发布时间: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