Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateRouteRule(args *CreateRouteRuleArgs) (string, error)
- func (c *Client) CreateSubnet(args *CreateSubnetArgs) (string, error)
- func (c *Client) DeleteRoute(routeID string) error
- func (c *Client) DescribeSubnet(subnetId string) (*Subnet, error)
- func (c *Client) GetURL(objectKey string, params map[string]string) string
- func (c *Client) ListRouteTable(args *ListRouteArgs) ([]RouteRule, error)
- func (c *Client) ListSubnet(params map[string]string) ([]*Subnet, error)
- func (c *Client) ListVpc(args *ListVpcArgs) ([]Vpc, error)
- type CreateRouteResponse
- type CreateRouteRuleArgs
- type CreateSubnetArgs
- type CreateSubnetResponse
- type CreateVpcArgs
- type CreateVpcResponse
- type DescribeSubnetResponse
- type ListRouteArgs
- type ListRouteResponse
- type ListSubnetResponse
- type ListVpcArgs
- type ListVpcResponse
- type RouteRule
- type ShowVpc
- type Subnet
- type Vpc
Constants ¶
This section is empty.
Variables ¶
var Endpoint = map[string]string{
"bj": "bcc.bj.baidubce.com",
"gz": "bcc.gz.baidubce.com",
"su": "bcc.su.baidubce.com",
"bd": "bcc.bd.baidubce.com",
"hk": "bcc.hkg.baidubce.com",
}
Endpoint contains all endpoints of Baidu Cloud BCC.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the VPC client implemention for Baidu Cloud VPC API.
func (*Client) CreateRouteRule ¶
func (c *Client) CreateRouteRule(args *CreateRouteRuleArgs) (string, error)
CreateRouteRule create a route rule
func (*Client) CreateSubnet ¶
func (c *Client) CreateSubnet(args *CreateSubnetArgs) (string, error)
CreateSubnet 在VPC中创建子网
func (*Client) DeleteRoute ¶
DeleteRoute delete a route http://gollum.baidu.com/Logical-Network-API#删除路由规则
func (*Client) DescribeSubnet ¶
DescribeSubnet 查询指定子网的详细信息
func (*Client) ListRouteTable ¶
func (c *Client) ListRouteTable(args *ListRouteArgs) ([]RouteRule, error)
ListRouteTable list all routes
func (*Client) ListSubnet ¶
ListSubnet 查询指定VPC的所有子网列表信息
func (*Client) ListVpc ¶
func (c *Client) ListVpc(args *ListVpcArgs) ([]Vpc, error)
ListVpc list all vpcs https://cloud.baidu.com/doc/VPC/API.html#.E6.9F.A5.E8.AF.A2VPC.E5.88.97.E8.A1.A8
type CreateRouteResponse ¶
type CreateRouteResponse struct {
RouteRuleID string `json:"routeRuleId"`
}
CreateRouteResponse define response of creating route
type CreateRouteRuleArgs ¶
type CreateRouteRuleArgs struct { RouteTableID string `json:"routeTableId"` SourceAddress string `json:"sourceAddress"` // 源地址,源地址可以是0.0.0.0/0, // 否则匹配路由表的流量源必须属于该VPC下某子网, // 源地址选择自定义时,自定义网段需在已有子网范围内 DestinationAddress string `json:"destinationAddress"` // 目的地址,目的地址可以是0.0.0.0/0, // 否则目的地址不能与本VPC cidr重叠 // (目的网段或本VPC cidr为0.0.0.0/0时例外) NexthopID string `json:"nexthopId,omitempty"` // 下一跳id,当nexthopType是本地网关类型时, // 该字段可以为空 NexthopType string `json:"nexthopType"` // 路由类型。Bcc类型是"custom"; // VPN类型是"vpn";NAT类型是"nat";本地网关类型是"defaultGateway" Description string `json:"description"` }
CreateRouteRuleArgs define args create route http://gollum.baidu.com/Logical-Network-API#创建路由规则
type CreateSubnetArgs ¶
type CreateSubnetArgs struct { Name string `json:"name"` ZoneName string `json:"zoneName"` Cidr string `json:"cidr"` VpcID string `json:"vpcId"` SubnetType string `json:"subnetType,omitempty"` Description string `json:"description,omitempty"` }
CreateSubnetArgs define args create a subnet
type CreateSubnetResponse ¶
type CreateSubnetResponse struct {
SubnetID string `json:"subnetId"`
}
CreateSubnetResponse define response of creating a subnet
type CreateVpcArgs ¶
type CreateVpcArgs struct { Name string `json:"name"` Description string `json:"description"` Cidr string `json:"cidr"` }
CreateVpcArgs define args for creating vpc
type CreateVpcResponse ¶
type CreateVpcResponse struct {
VpcID string `json:"vpcId"`
}
CreateVpcResponse define response
type DescribeSubnetResponse ¶
type DescribeSubnetResponse struct {
Subnet *Subnet `json:"subnet"`
}
DescribeSubnetResponse json
type ListRouteArgs ¶
ListRouteArgs define listroute args
type ListRouteResponse ¶
type ListRouteResponse struct { RouteTableID string `json:"routeTableId"` VpcID string `json:"vpcId"` RouteRules []RouteRule `json:"routeRules"` }
ListRouteResponse define response of list route
type ListSubnetResponse ¶
type ListSubnetResponse struct { Marker string `json:"marker"` IsTruncated bool `json:"isTruncated"` NextMarker string `json:"nextMarker"` MaxKeys int `json:"maxKeys"` Subnets []*Subnet `json:"subnets"` }
ListSubnetResponse json
type ListVpcResponse ¶
type ListVpcResponse struct {
Vpcs []Vpc `json:"vpcs"`
}
ListVpcResponse define list vpc response
type RouteRule ¶
type RouteRule struct { RouteRuleID string `json:"routeRuleId"` RouteTableID string `json:"routeTableId"` SourceAddress string `json:"sourceAddress"` DestinationAddress string `json:"destinationAddress"` NexthopID string `json:"nexthopId"` NexthopType string `json:"nexthopType"` Description string `json:"description"` }
RouteRule define route
type ShowVpc ¶
type ShowVpc struct { VpcID string `json:"vpcId"` Name string `json:"name"` CIDR string `json:"cidr"` Description string `json:"description"` IsDefault bool `json:"isDefault"` Subnets []Subnet `json:"subnets"` }
ShowVpc define ShowVpcModel