| 1 |
package slb |
| 2 |
|
| 3 |
import "github.com/denverdino/aliyungo/common" |
| 4 |
|
| 5 |
type TagItem struct { |
| 6 |
TagKey string |
| 7 |
TagValue string |
| 8 |
} |
| 9 |
|
| 10 |
type AddTagsArgs struct { |
| 11 |
RegionId common.Region |
| 12 |
LoadBalancerID string |
| 13 |
Tags string |
| 14 |
} |
| 15 |
|
| 16 |
type AddTagsResponse struct { |
| 17 |
common.Response |
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
func (client *Client) AddTags(args *AddTagsArgs) error { |
| 24 |
response := AddTagsResponse{} |
| 25 |
err := client.Invoke("AddTags", args, &response) |
| 26 |
if err != nil { |
| 27 |
return err |
| 28 |
} |
| 29 |
return err |
| 30 |
} |
| 31 |
|
| 32 |
type RemoveTagsArgs struct { |
| 33 |
RegionId common.Region |
| 34 |
LoadBalancerID string |
| 35 |
Tags string |
| 36 |
} |
| 37 |
|
| 38 |
type RemoveTagsResponse struct { |
| 39 |
common.Response |
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
func (client *Client) RemoveTags(args *RemoveTagsArgs) error { |
| 46 |
response := RemoveTagsResponse{} |
| 47 |
err := client.Invoke("RemoveTags", args, &response) |
| 48 |
if err != nil { |
| 49 |
return err |
| 50 |
} |
| 51 |
return err |
| 52 |
} |
| 53 |
|
| 54 |
type TagItemType struct { |
| 55 |
TagItem |
| 56 |
InstanceCount int |
| 57 |
} |
| 58 |
|
| 59 |
type DescribeTagsArgs struct { |
| 60 |
RegionId common.Region |
| 61 |
LoadBalancerID string |
| 62 |
Tags string |
| 63 |
common.Pagination |
| 64 |
} |
| 65 |
|
| 66 |
type DescribeTagsResponse struct { |
| 67 |
common.Response |
| 68 |
common.PaginationResult |
| 69 |
TagSets struct { |
| 70 |
TagSet []TagItemType |
| 71 |
} |
| 72 |
} |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
func (client *Client) DescribeTags(args *DescribeTagsArgs) (tags []TagItemType, pagination *common.PaginationResult, err error) { |
| 78 |
args.Validate() |
| 79 |
response := DescribeTagsResponse{} |
| 80 |
err = client.Invoke("DescribeTags", args, &response) |
| 81 |
if err != nil { |
| 82 |
return nil, nil, err |
| 83 |
} |
| 84 |
return response.TagSets.TagSet, &response.PaginationResult, nil |
| 85 |
} |