本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/elasticbeanstalk.ElasticBeanstalk.DeleteApplicationVersion方法的典型用法代码示例。如果您正苦于以下问题:Golang ElasticBeanstalk.DeleteApplicationVersion方法的具体用法?Golang ElasticBeanstalk.DeleteApplicationVersion怎么用?Golang ElasticBeanstalk.DeleteApplicationVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/aws/aws-sdk-go/service/elasticbeanstalk.ElasticBeanstalk
的用法示例。
在下文中一共展示了ElasticBeanstalk.DeleteApplicationVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: clean
//clean up all Application Version inside "versions" slice
func clean(eb *elasticbeanstalk.ElasticBeanstalk, appName string, versions []*elasticbeanstalk.ApplicationVersionDescription, deleteSourceBundle bool) {
for _, version := range versions {
var buffer bytes.Buffer
buffer.WriteString(fmt.Sprintf("Deleting version %s .......... ", *version.VersionLabel))
_, err := eb.DeleteApplicationVersion(&elasticbeanstalk.DeleteApplicationVersionInput{
ApplicationName: &appName,
DeleteSourceBundle: &deleteSourceBundle,
VersionLabel: version.VersionLabel,
})
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
log.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
buffer.WriteString("Error")
if reqErr, ok := err.(awserr.RequestFailure); ok {
log.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
buffer.WriteString("Error")
}
} else {
log.Println(err.Error())
buffer.WriteString("Error")
}
} else {
buffer.WriteString("OK")
}
fmt.Println(buffer.String())
}
}