snapshot add name tag

This commit is contained in:
TangBin
2018-10-27 17:58:59 +08:00
parent 2dae75ca49
commit d015c5ec4e
+5
View File
@@ -163,6 +163,11 @@ func (self *SRegion) CreateSnapshot(diskId, name, desc string) (string, error) {
if len(name) <= 0 {
return "", fmt.Errorf("name length should great than 0")
} else {
tagspec := TagSpec{ResourceType:"snapshot"}
tagspec.SetNameTag(name)
ec2Tag, _ := tagspec.GetTagSpecifications()
params.SetTagSpecifications([]*ec2.TagSpecification{ec2Tag})
}
params.SetDescription(desc)