本文整理匯總了Golang中github.com/awslabs/aws-sdk-go/service/elasticbeanstalk.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了New函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ExampleElasticBeanstalk_UpdateApplicationVersion
func ExampleElasticBeanstalk_UpdateApplicationVersion() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.UpdateApplicationVersionInput{
ApplicationName: aws.String("ApplicationName"), // Required
VersionLabel: aws.String("VersionLabel"), // Required
Description: aws.String("Description"),
}
resp, err := svc.UpdateApplicationVersion(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例2: ExampleElasticBeanstalk_CheckDNSAvailability
func ExampleElasticBeanstalk_CheckDNSAvailability() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.CheckDNSAvailabilityInput{
CNAMEPrefix: aws.String("DNSCnamePrefix"), // Required
}
resp, err := svc.CheckDNSAvailability(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例3: ExampleElasticBeanstalk_TerminateEnvironment
func ExampleElasticBeanstalk_TerminateEnvironment() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.TerminateEnvironmentInput{
EnvironmentID: aws.String("EnvironmentId"),
EnvironmentName: aws.String("EnvironmentName"),
TerminateResources: aws.Boolean(true),
}
resp, err := svc.TerminateEnvironment(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例4: ExampleElasticBeanstalk_CreateEnvironment
func ExampleElasticBeanstalk_CreateEnvironment() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.CreateEnvironmentInput{
ApplicationName: aws.String("ApplicationName"), // Required
EnvironmentName: aws.String("EnvironmentName"), // Required
CNAMEPrefix: aws.String("DNSCnamePrefix"),
Description: aws.String("Description"),
OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{
&elasticbeanstalk.ConfigurationOptionSetting{ // Required
Namespace: aws.String("OptionNamespace"),
OptionName: aws.String("ConfigurationOptionName"),
Value: aws.String("ConfigurationOptionValue"),
},
// More values...
},
OptionsToRemove: []*elasticbeanstalk.OptionSpecification{
&elasticbeanstalk.OptionSpecification{ // Required
Namespace: aws.String("OptionNamespace"),
OptionName: aws.String("ConfigurationOptionName"),
},
// More values...
},
SolutionStackName: aws.String("SolutionStackName"),
Tags: []*elasticbeanstalk.Tag{
&elasticbeanstalk.Tag{ // Required
Key: aws.String("TagKey"),
Value: aws.String("TagValue"),
},
// More values...
},
TemplateName: aws.String("ConfigurationTemplateName"),
Tier: &elasticbeanstalk.EnvironmentTier{
Name: aws.String("String"),
Type: aws.String("String"),
Version: aws.String("String"),
},
VersionLabel: aws.String("VersionLabel"),
}
resp, err := svc.CreateEnvironment(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例5: ExampleElasticBeanstalk_UpdateConfigurationTemplate
func ExampleElasticBeanstalk_UpdateConfigurationTemplate() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.UpdateConfigurationTemplateInput{
ApplicationName: aws.String("ApplicationName"), // Required
TemplateName: aws.String("ConfigurationTemplateName"), // Required
Description: aws.String("Description"),
OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{
&elasticbeanstalk.ConfigurationOptionSetting{ // Required
Namespace: aws.String("OptionNamespace"),
OptionName: aws.String("ConfigurationOptionName"),
Value: aws.String("ConfigurationOptionValue"),
},
// More values...
},
OptionsToRemove: []*elasticbeanstalk.OptionSpecification{
&elasticbeanstalk.OptionSpecification{ // Required
Namespace: aws.String("OptionNamespace"),
OptionName: aws.String("ConfigurationOptionName"),
},
// More values...
},
}
resp, err := svc.UpdateConfigurationTemplate(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例6: ExampleElasticBeanstalk_DescribeEnvironments
func ExampleElasticBeanstalk_DescribeEnvironments() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.DescribeEnvironmentsInput{
ApplicationName: aws.String("ApplicationName"),
EnvironmentIDs: []*string{
aws.String("EnvironmentId"), // Required
// More values...
},
EnvironmentNames: []*string{
aws.String("EnvironmentName"), // Required
// More values...
},
IncludeDeleted: aws.Boolean(true),
IncludedDeletedBackTo: aws.Time(time.Now()),
VersionLabel: aws.String("VersionLabel"),
}
resp, err := svc.DescribeEnvironments(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例7: ExampleElasticBeanstalk_ListAvailableSolutionStacks
func ExampleElasticBeanstalk_ListAvailableSolutionStacks() {
svc := elasticbeanstalk.New(nil)
var params *elasticbeanstalk.ListAvailableSolutionStacksInput
resp, err := svc.ListAvailableSolutionStacks(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例8: ExampleElasticBeanstalk_DescribeEvents
func ExampleElasticBeanstalk_DescribeEvents() {
svc := elasticbeanstalk.New(nil)
params := &elasticbeanstalk.DescribeEventsInput{
ApplicationName: aws.String("ApplicationName"),
EndTime: aws.Time(time.Now()),
EnvironmentID: aws.String("EnvironmentId"),
EnvironmentName: aws.String("EnvironmentName"),
MaxRecords: aws.Long(1),
NextToken: aws.String("Token"),
RequestID: aws.String("RequestId"),
Severity: aws.String("EventSeverity"),
StartTime: aws.Time(time.Now()),
TemplateName: aws.String("ConfigurationTemplateName"),
VersionLabel: aws.String("VersionLabel"),
}
resp, err := svc.DescribeEvents(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例9: TestInterface
func TestInterface(t *testing.T) {
assert.Implements(t, (*elasticbeanstalkiface.ElasticBeanstalkAPI)(nil), elasticbeanstalk.New(nil))
}
示例10: init
func init() {
Before("@elasticbeanstalk", func() {
World["client"] = elasticbeanstalk.New(nil)
})
}