Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Commit

Permalink
add DeleteTags function
Browse files Browse the repository at this point in the history
  • Loading branch information
deoxxa committed Aug 10, 2014
1 parent 593841f commit 4d641bd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ec2/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,26 @@ func (ec2 *EC2) CreateTags(resourceIds []string, tags []Tag) (resp *SimpleResp,
return resp, nil
}

func (ec2 *EC2) DeleteTags(resourceIds []string, tags []Tag) (resp *SimpleResp, err error) {
params := makeParams("DeleteTags")
addParamsList(params, "ResourceId", resourceIds)

for j, tag := range tags {
params["Tag."+strconv.Itoa(j+1)+".Key"] = tag.Key

if tag.Value != "" {
params["Tag."+strconv.Itoa(j+1)+".Value"] = tag.Value
}
}

resp = &SimpleResp{}
if err = ec2.query(params, resp); err != nil {
return nil, err
}

return resp, nil
}

// Response to a StartInstances request.
//
// See http://goo.gl/awKeF for more details.
Expand Down

0 comments on commit 4d641bd

Please sign in to comment.