forked from denverdino/aliyungo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregions.go
33 lines (26 loc) · 785 Bytes
/
regions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package slb
import "github.com/reedchan7/aliyungo/common"
type DescribeRegionsArgs struct {
}
// You can read doc at http://docs.aliyun.com/#/pub/ecs/open-api/datatype®iontype
type RegionType struct {
RegionId common.Region
LocalName string
}
type DescribeRegionsResponse struct {
common.Response
Regions struct {
Region []RegionType
}
}
// DescribeRegions describes regions
//
// You can read doc at http://docs.aliyun.com/#/pub/slb/api-reference/api-related-loadbalancer&DescribeRegions
func (client *Client) DescribeRegions() (regions []RegionType, err error) {
response := DescribeRegionsResponse{}
err = client.Invoke("DescribeRegions", &DescribeRegionsArgs{}, &response)
if err != nil {
return []RegionType{}, err
}
return response.Regions.Region, nil
}