本文整理汇总了Golang中github.com/datacratic/aws-sdk-go/service/opsworks.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}
示例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))
}