open-nomad/vendor/github.com/denverdino/aliyungo/ecs/regions.go
Seth Hoenig 435c0d9fc8 deps: Switch to Go modules for dependency management
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.
2020-06-02 14:30:36 -05:00

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&regiontype
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
}