| 1 |
package ecs |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/denverdino/aliyungo/common" |
| 5 |
"github.com/denverdino/aliyungo/util" |
| 6 |
) |
| 7 |
|
| 8 |
type DescribeVRoutersArgs struct { |
| 9 |
VRouterId string |
| 10 |
RegionId common.Region |
| 11 |
common.Pagination |
| 12 |
} |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
type VRouterSetType struct { |
| 17 |
VRouterId string |
| 18 |
RegionId common.Region |
| 19 |
VpcId string |
| 20 |
RouteTableIds struct { |
| 21 |
RouteTableId []string |
| 22 |
} |
| 23 |
VRouterName string |
| 24 |
Description string |
| 25 |
CreationTime util.ISO6801Time |
| 26 |
} |
| 27 |
|
| 28 |
type DescribeVRoutersResponse struct { |
| 29 |
common.Response |
| 30 |
common.PaginationResult |
| 31 |
VRouters struct { |
| 32 |
VRouter []VRouterSetType |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
func (client *Client) DescribeVRouters(args *DescribeVRoutersArgs) (vrouters []VRouterSetType, pagination *common.PaginationResult, err error) { |
| 40 |
response, err := client.DescribeVRoutersWithRaw(args) |
| 41 |
if err == nil { |
| 42 |
return response.VRouters.VRouter, &response.PaginationResult, nil |
| 43 |
} |
| 44 |
|
| 45 |
return nil, nil, err |
| 46 |
} |
| 47 |
|
| 48 |
func (client *Client) DescribeVRoutersWithRaw(args *DescribeVRoutersArgs) (response *DescribeVRoutersResponse, err error) { |
| 49 |
args.Validate() |
| 50 |
response = &DescribeVRoutersResponse{} |
| 51 |
|
| 52 |
err = client.Invoke("DescribeVRouters", args, response) |
| 53 |
|
| 54 |
if err == nil { |
| 55 |
return response, nil |
| 56 |
} |
| 57 |
|
| 58 |
return nil, err |
| 59 |
} |
| 60 |
|
| 61 |
type ModifyVRouterAttributeArgs struct { |
| 62 |
VRouterId string |
| 63 |
VRouterName string |
| 64 |
Description string |
| 65 |
} |
| 66 |
|
| 67 |
type ModifyVRouterAttributeResponse struct { |
| 68 |
common.Response |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
func (client *Client) ModifyVRouterAttribute(args *ModifyVRouterAttributeArgs) error { |
| 75 |
response := ModifyVRouterAttributeResponse{} |
| 76 |
return client.Invoke("ModifyVRouterAttribute", args, &response) |
| 77 |
} |