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


Golang opsworks.New函数代码示例

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


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

示例1: ExampleOpsWorks_CreateApp

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

	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:somathor,项目名称:aws-sdk-go,代码行数:60,代码来源:examples_test.go

示例2: ExampleOpsWorks_RegisterInstance

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

	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:somathor,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go

示例3: ExampleOpsWorks_UpdateInstance

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

	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:somathor,项目名称:aws-sdk-go,代码行数:32,代码来源:examples_test.go

示例4: ExampleOpsWorks_CreateDeployment

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

	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:somathor,项目名称:aws-sdk-go,代码行数:35,代码来源:examples_test.go

示例5: ExampleOpsWorks_CloneStack

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

	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:somathor,项目名称:aws-sdk-go,代码行数:58,代码来源:examples_test.go

示例6: ExampleOpsWorks_CreateInstance

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

	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:somathor,项目名称:aws-sdk-go,代码行数:51,代码来源:examples_test.go

示例7: ExampleOpsWorks_SetTimeBasedAutoScaling

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

	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:somathor,项目名称:aws-sdk-go,代码行数:48,代码来源:examples_test.go

示例8: ExampleOpsWorks_DescribeMyUserProfile

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

	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:somathor,项目名称:aws-sdk-go,代码行数:16,代码来源:examples_test.go

示例9: ExampleOpsWorks_DisassociateElasticIp

func ExampleOpsWorks_DisassociateElasticIp() {
	svc := opsworks.New(session.New())

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

示例10: ExampleOpsWorks_UpdateMyUserProfile

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

	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:somathor,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go

示例11: ExampleOpsWorks_DeregisterRdsDbInstance

func ExampleOpsWorks_DeregisterRdsDbInstance() {
	svc := opsworks.New(session.New())

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

示例12: ExampleOpsWorks_GetHostnameSuggestion

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

	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:somathor,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go

示例13: ExampleOpsWorks_UnassignVolume

func ExampleOpsWorks_UnassignVolume() {
	svc := opsworks.New(session.New())

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

示例14: ExampleOpsWorks_DescribeStackProvisioningParameters

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

	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:somathor,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go

示例15: ExampleOpsWorks_GrantAccess

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

	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:somathor,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go


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