本文整理汇总了Golang中github.com/datacratic/aws-sdk-go/service/opsworks.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: ExampleOpsWorks_UpdateApp
func ExampleOpsWorks_UpdateApp() {
svc := opsworks.New(nil)
params := &opsworks.UpdateAppInput{
AppID: aws.String("String"), // 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{
&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.Boolean(true),
Environment: []*opsworks.EnvironmentVariable{
&opsworks.EnvironmentVariable{ // Required
Key: aws.String("String"), // Required
Value: aws.String("String"), // Required
Secure: aws.Boolean(true),
},
// More values...
},
Name: aws.String("String"),
SSLConfiguration: &opsworks.SSLConfiguration{
Certificate: aws.String("String"), // Required
PrivateKey: aws.String("String"), // Required
Chain: aws.String("String"),
},
Type: aws.String("AppType"),
}
resp, err := svc.UpdateApp(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,代码行数:60,代码来源:examples_test.go
示例2: ExampleOpsWorks_UpdateInstance
func ExampleOpsWorks_UpdateInstance() {
svc := opsworks.New(nil)
params := &opsworks.UpdateInstanceInput{
InstanceID: aws.String("String"), // Required
AMIID: aws.String("String"),
Architecture: aws.String("Architecture"),
AutoScalingType: aws.String("AutoScalingType"),
EBSOptimized: aws.Boolean(true),
Hostname: aws.String("String"),
InstallUpdatesOnBoot: aws.Boolean(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 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,代码行数:32,代码来源:examples_test.go
示例3: ExampleOpsWorks_DescribeVolumes
func ExampleOpsWorks_DescribeVolumes() {
svc := opsworks.New(nil)
params := &opsworks.DescribeVolumesInput{
InstanceID: aws.String("String"),
RAIDArrayID: aws.String("String"),
StackID: aws.String("String"),
VolumeIDs: []*string{
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.DescribeVolumes(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
示例4: 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 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,代码行数:28,代码来源: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
Attributes: &map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
ChefConfiguration: &opsworks.ChefConfiguration{
BerkshelfVersion: aws.String("String"),
ManageBerkshelf: aws.Boolean(true),
},
CloneAppIDs: []*string{
aws.String("String"), // Required
// More values...
},
ClonePermissions: aws.Boolean(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.Boolean(true),
UseOpsWorksSecurityGroups: aws.Boolean(true),
VPCID: aws.String("String"),
}
resp, err := svc.CloneStack(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,代码行数:58,代码来源:examples_test.go
示例6: 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 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,代码行数:49,代码来源:examples_test.go
示例7: ExampleOpsWorks_DescribeMyUserProfile
func ExampleOpsWorks_DescribeMyUserProfile() {
svc := opsworks.New(nil)
var params *opsworks.DescribeMyUserProfileInput
resp, err := svc.DescribeMyUserProfile(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,代码行数:17,代码来源:examples_test.go
示例8: ExampleOpsWorks_GetHostnameSuggestion
func ExampleOpsWorks_GetHostnameSuggestion() {
svc := opsworks.New(nil)
params := &opsworks.GetHostnameSuggestionInput{
LayerID: aws.String("String"), // Required
}
resp, err := svc.GetHostnameSuggestion(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
示例9: ExampleOpsWorks_UpdateMyUserProfile
func ExampleOpsWorks_UpdateMyUserProfile() {
svc := opsworks.New(nil)
params := &opsworks.UpdateMyUserProfileInput{
SSHPublicKey: aws.String("String"),
}
resp, err := svc.UpdateMyUserProfile(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
示例10: ExampleOpsWorks_DescribeStackSummary
func ExampleOpsWorks_DescribeStackSummary() {
svc := opsworks.New(nil)
params := &opsworks.DescribeStackSummaryInput{
StackID: aws.String("String"), // Required
}
resp, err := svc.DescribeStackSummary(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: 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 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
示例12: 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 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
示例13: 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 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,代码行数:21,代码来源:examples_test.go
示例14: ExampleOpsWorks_UpdateVolume
func ExampleOpsWorks_UpdateVolume() {
svc := opsworks.New(nil)
params := &opsworks.UpdateVolumeInput{
VolumeID: aws.String("String"), // Required
MountPoint: aws.String("String"),
Name: aws.String("String"),
}
resp, err := svc.UpdateVolume(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,代码行数:21,代码来源:examples_test.go
示例15: ExampleOpsWorks_DescribeLoadBasedAutoScaling
func ExampleOpsWorks_DescribeLoadBasedAutoScaling() {
svc := opsworks.New(nil)
params := &opsworks.DescribeLoadBasedAutoScalingInput{
LayerIDs: []*string{ // Required
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.DescribeLoadBasedAutoScaling(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,代码行数:22,代码来源:examples_test.go
示例16: ExampleOpsWorks_CreateUserProfile
func ExampleOpsWorks_CreateUserProfile() {
svc := opsworks.New(nil)
params := &opsworks.CreateUserProfileInput{
IAMUserARN: aws.String("String"), // Required
AllowSelfManagement: aws.Boolean(true),
SSHPublicKey: aws.String("String"),
SSHUsername: aws.String("String"),
}
resp, err := svc.CreateUserProfile(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,代码行数:22,代码来源:examples_test.go
示例17: ExampleOpsWorks_SetPermission
func ExampleOpsWorks_SetPermission() {
svc := opsworks.New(nil)
params := &opsworks.SetPermissionInput{
IAMUserARN: aws.String("String"), // Required
StackID: aws.String("String"), // Required
AllowSSH: aws.Boolean(true),
AllowSudo: aws.Boolean(true),
Level: aws.String("String"),
}
resp, err := svc.SetPermission(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,代码行数:23,代码来源:examples_test.go
示例18: ExampleOpsWorks_SetLoadBasedAutoScaling
func ExampleOpsWorks_SetLoadBasedAutoScaling() {
svc := opsworks.New(nil)
params := &opsworks.SetLoadBasedAutoScalingInput{
LayerID: aws.String("String"), // Required
DownScaling: &opsworks.AutoScalingThresholds{
CPUThreshold: aws.Double(1.0),
IgnoreMetricsTime: aws.Long(1),
InstanceCount: aws.Long(1),
LoadThreshold: aws.Double(1.0),
MemoryThreshold: aws.Double(1.0),
ThresholdsWaitTime: aws.Long(1),
},
Enable: aws.Boolean(true),
UpScaling: &opsworks.AutoScalingThresholds{
CPUThreshold: aws.Double(1.0),
IgnoreMetricsTime: aws.Long(1),
InstanceCount: aws.Long(1),
LoadThreshold: aws.Double(1.0),
MemoryThreshold: aws.Double(1.0),
ThresholdsWaitTime: aws.Long(1),
},
}
resp, err := svc.SetLoadBasedAutoScaling(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,代码行数:36,代码来源:examples_test.go
示例19: 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": []*string{ // 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 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,代码行数:36,代码来源:examples_test.go
示例20: ExampleOpsWorks_CreateLayer
func ExampleOpsWorks_CreateLayer() {
svc := opsworks.New(nil)
params := &opsworks.CreateLayerInput{
Name: aws.String("String"), // Required
Shortname: aws.String("String"), // Required
StackID: aws.String("String"), // Required
Type: aws.String("LayerType"), // Required
Attributes: &map[string]*string{
"Key": aws.String("String"), // Required
// More values...
},
AutoAssignElasticIPs: aws.Boolean(true),
AutoAssignPublicIPs: aws.Boolean(true),
CustomInstanceProfileARN: aws.String("String"),
CustomRecipes: &opsworks.Recipes{
Configure: []*string{
aws.String("String"), // Required
// More values...
},
Deploy: []*string{
aws.String("String"), // Required
// More values...
},
Setup: []*string{
aws.String("String"), // Required
// More values...
},
Shutdown: []*string{
aws.String("String"), // Required
// More values...
},
Undeploy: []*string{
aws.String("String"), // Required
// More values...
},
},
CustomSecurityGroupIDs: []*string{
aws.String("String"), // Required
// More values...
},
EnableAutoHealing: aws.Boolean(true),
InstallUpdatesOnBoot: aws.Boolean(true),
LifecycleEventConfiguration: &opsworks.LifecycleEventConfiguration{
Shutdown: &opsworks.ShutdownEventConfiguration{
DelayUntilELBConnectionsDrained: aws.Boolean(true),
ExecutionTimeout: aws.Long(1),
},
},
Packages: []*string{
aws.String("String"), // Required
// More values...
},
UseEBSOptimizedInstances: aws.Boolean(true),
VolumeConfigurations: []*opsworks.VolumeConfiguration{
&opsworks.VolumeConfiguration{ // Required
MountPoint: aws.String("String"), // Required
NumberOfDisks: aws.Long(1), // Required
Size: aws.Long(1), // Required
IOPS: aws.Long(1),
RAIDLevel: aws.Long(1),
VolumeType: aws.String("String"),
},
// More values...
},
}
resp, err := svc.CreateLayer(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,代码行数:79,代码来源:examples_test.go
注:本文中的github.com/datacratic/aws-sdk-go/service/opsworks.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论