435c0d9fc8
This PR switches the Nomad repository from using govendor to Go modules for managing dependencies. Aspects of the Nomad workflow remain pretty much the same. The usual Makefile targets should continue to work as they always did. The API submodule simply defers to the parent Nomad version on the repository, keeping the semantics of API versioning that currently exists.
35 lines
766 B
Go
35 lines
766 B
Go
package ecs
|
|
|
|
import "github.com/denverdino/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/ecs/open-api/region&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
|
|
}
|