vpc

package
v0.9.160 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 20

Documentation

Overview

Package vpc defines the VPC services of BCE. The supported APIs are all defined in different files.

Index

Constants

View Source
const (
	URI_PREFIX = bce.URI_PREFIX + "v1"

	DEFAULT_ENDPOINT = "bcc." + bce.DEFAULT_REGION + ".baidubce.com"

	REQUEST_VPC_URL              = "/vpc"
	REQUEST_SUBNET_URL           = "/subnet"
	REQUEST_ROUTE_URL            = "/route"
	REQUEST_RULE_URL             = "/rule"
	REQUEST_ACL_URL              = "/acl"
	REQUEST_NAT_URL              = "/nat"
	REQUEST_PEERCONN_URL         = "/peerconn"
	REQUEST_NETWORK_TOPOLOGY_URL = "/topology"
)
View Source
const (
	SUBNET_TYPE_BCC    SubnetType = "BCC"
	SUBNET_TYPE_BCCNAT SubnetType = "BCC_NAT"
	SUBNET_TYPE_BBC    SubnetType = "BBC"

	NEXTHOP_TYPE_CUSTOM      NexthopType = "custom"
	NEXTHOP_TYPE_VPN         NexthopType = "vpn"
	NEXTHOP_TYPE_NAT         NexthopType = "nat"
	NEXTHOP_TYPE_ETGATEWAY   NexthopType = "dcGateway"
	NEXTHOP_TYPE_PEERCONN    NexthopType = "peerConn"
	NEXTHOP_TYPE_IPV6GATEWAY NexthopType = "ipv6gateway"
	NEXTHOP_TYPE_ENIC        NexthopType = "enic"
	NEXTHOP_TYPE_HAVIP       NexthopType = "havip"

	ACL_RULE_PROTOCOL_TCP  AclRuleProtocolType = "tcp"
	ACL_RULE_PROTOCOL_UDP  AclRuleProtocolType = "udp"
	ACL_RULE_PROTOCOL_ICMP AclRuleProtocolType = "icmp"

	ACL_RULE_DIRECTION_INGRESS AclRuleDirectionType = "ingress"
	ACL_RULE_DIRECTION_EGRESS  AclRuleDirectionType = "egress"

	ACL_RULE_ACTION_ALLOW AclRuleActionType = "allow"
	ACL_RULE_ACTION_DENY  AclRuleActionType = "deny"

	ACL_RULE_PORT_ALL AclRulePortType = "all"

	NAT_GATEWAY_SPEC_SMALL  NatGatewaySpecType = "small"
	NAT_GATEWAY_SPEC_MEDIUM NatGatewaySpecType = "medium"
	NAT_GATEWAY_SPEC_LARGE  NatGatewaySpecType = "large"

	PAYMENT_TIMING_PREPAID  PaymentTimingType = "Prepaid"
	PAYMENT_TIMING_POSTPAID PaymentTimingType = "Postpaid"

	PEERCONN_ROLE_INITIATOR PeerConnRoleType = "initiator"
	PEERCONN_ROLE_ACCEPTOR  PeerConnRoleType = "acceptor"

	NAT_STATUS_BUILDING     NatStatusType = "building"
	NAT_STATUS_UNCONFIGURED NatStatusType = "unconfigured"
	NAT_STATUS_CONFIGURING  NatStatusType = "configuring"
	NAT_STATUS_ACTIVE       NatStatusType = "active"
	NAT_STATUS_STOPPING     NatStatusType = "stopping"
	NAT_STATUS_DOWN         NatStatusType = "down"
	NAT_STATUS_STARTING     NatStatusType = "starting"
	NAT_STATUS_DELETING     NatStatusType = "deleting"
	NAT_STATUS_DELETED      NatStatusType = "deleted"

	PEERCONN_STATUS_CREATING       PeerConnStatusType = "creating"
	PEERCONN_STATUS_CONSULTING     PeerConnStatusType = "consulting"
	PEERCONN_STATUS_CONSULT_FAILED PeerConnStatusType = "consult_failed"
	PEERCONN_STATUS_ACTIVE         PeerConnStatusType = "active"
	PEERCONN_STATUS_DOWN           PeerConnStatusType = "down"
	PEERCONN_STATUS_STARTING       PeerConnStatusType = "starting"
	PEERCONN_STATUS_STOPPING       PeerConnStatusType = "stopping"
	PEERCONN_STATUS_DELETING       PeerConnStatusType = "deleting"
	PEERCONN_STATUS_DELETED        PeerConnStatusType = "deleted"
	PEERCONN_STATUS_EXPIRED        PeerConnStatusType = "expired"
	PEERCONN_STATUS_ERROR          PeerConnStatusType = "error"
	PEERCONN_STATUS_UPDATING       PeerConnStatusType = "updating"

	DNS_STATUS_CLOSE   DnsStatusType = "close"
	DNS_STATUS_WAIT    DnsStatusType = "wait"
	DNS_STATUS_SYNCING DnsStatusType = "syncing"
	DNS_STATUS_OPEN    DnsStatusType = "open"
	DNS_STATUS_CLOSING DnsStatusType = "closing"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AclEntry

type AclEntry struct {
	SubnetId   string    `json:"subnetId"`
	SubnetName string    `json:"subnetName"`
	SubnetCidr string    `json:"subnetCidr"`
	AclRules   []AclRule `json:"aclRules"`
}

type AclRule

type AclRule struct {
	Id                   string               `json:"id"`
	SubnetId             string               `json:"subnetId"`
	Description          string               `json:"description"`
	Protocol             AclRuleProtocolType  `json:"protocol"`
	SourceIpAddress      string               `json:"sourceIpAddress"`
	DestinationIpAddress string               `json:"destinationIpAddress"`
	SourcePort           string               `json:"sourcePort"`
	DestinationPort      string               `json:"destinationPort"`
	Position             int                  `json:"position"`
	Direction            AclRuleDirectionType `json:"direction"`
	Action               AclRuleActionType    `json:"action"`
}

type AclRuleActionType

type AclRuleActionType string

type AclRuleDirectionType

type AclRuleDirectionType string

type AclRulePortType

type AclRulePortType string

type AclRuleProtocolType

type AclRuleProtocolType string

type AclRuleRequest

type AclRuleRequest struct {
	SubnetId             string               `json:"subnetId"`
	Description          string               `json:"description,omitempty"`
	Protocol             AclRuleProtocolType  `json:"protocol"`
	SourceIpAddress      string               `json:"sourceIpAddress"`
	DestinationIpAddress string               `json:"destinationIpAddress"`
	SourcePort           string               `json:"sourcePort"`
	DestinationPort      string               `json:"destinationPort"`
	Position             int                  `json:"position"`
	Direction            AclRuleDirectionType `json:"direction"`
	Action               AclRuleActionType    `json:"action"`
}

type BatchCreateNatGatewayDnatRuleArgs added in v0.9.118

type BatchCreateNatGatewayDnatRuleArgs struct {
	ClientToken string         `json:"-"`
	Rules       []DnatRuleArgs `json:"rules"`
}

type BatchCreateNatGatewayDnatRuleResult added in v0.9.118

type BatchCreateNatGatewayDnatRuleResult struct {
	RuleIds []string `json:"ruleIds"`
}

type BatchCreateNatGatewaySnatRuleArgs added in v0.9.118

type BatchCreateNatGatewaySnatRuleArgs struct {
	ClientToken string         `json:"-"`
	NatId       string         `json:"natId"`
	SnatRules   []SnatRuleArgs `json:"snatRules"`
}

type BatchCreateNatGatewaySnatRuleResult added in v0.9.118

type BatchCreateNatGatewaySnatRuleResult struct {
	SnatRuleIds []string `json:"snatRuleIds"`
}

type Billing

type Billing struct {
	PaymentTiming PaymentTimingType `json:"paymentTiming,omitempty"`
	Reservation   *Reservation      `json:"reservation,omitempty"`
}

type BindDnatEipsArgs added in v0.9.134

type BindDnatEipsArgs struct {
	ClientToken string   `json:"-"`
	DnatEips    []string `json:"dnatEips"`
}

BindDnatEipsArgs defines the structure of the input parameters for the BindDnatEips api

type BindEipsArgs

type BindEipsArgs struct {
	ClientToken string   `json:"-"`
	Eips        []string `json:"eips"`
}

BindEipsArgs defines the structure of the input parameters for the BindEips api

type Client

type Client struct {
	*bce.BceClient
}

Client of VPC service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) AcceptPeerConnApply

func (c *Client) AcceptPeerConnApply(peerConnId, clientToken string) error

AcceptPeerConnApply - accept the specific peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) BatchCreateNatGatewayDnatRule added in v0.9.118

func (c *Client) BatchCreateNatGatewayDnatRule(natId string, args *BatchCreateNatGatewayDnatRuleArgs) (*BatchCreateNatGatewayDnatRuleResult, error)

func (*Client) BatchCreateNatGatewaySnatRule added in v0.9.118

func (c *Client) BatchCreateNatGatewaySnatRule(args *BatchCreateNatGatewaySnatRuleArgs) (*BatchCreateNatGatewaySnatRuleResult, error)

func (*Client) BindDnatEips added in v0.9.134

func (c *Client) BindDnatEips(natId string, args *BindDnatEipsArgs) error

BindDnatEips - bind dnatEips for the specific nat gateway

PARAMS:

  • natId: the id of the specific nat gateway
  • args: the arguments to bind dnatEips

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) BindEips

func (c *Client) BindEips(natId string, args *BindEipsArgs) error

BindEips - bind eips for the specific nat gateway

PARAMS:

  • natId: the id of the specific nat gateway
  • args: the arguments to bind eips

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ClosePeerConnSyncDNS

func (c *Client) ClosePeerConnSyncDNS(peerConnId string, args *PeerConnSyncDNSArgs) error

ClosePeerConnSyncDNS - close the dns synchronization for the given peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • args: the arguments to close dns synchronization

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateAclRule

func (c *Client) CreateAclRule(args *CreateAclRuleArgs) error

CreateAclRule - create a new acl rule with the specific parameters

PARAMS:

  • args: the arguments to create acl rule

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateNatGateway

func (c *Client) CreateNatGateway(args *CreateNatGatewayArgs) (*CreateNatGatewayResult, error)

CreateNatGateway - create a new nat gateway

PARAMS:

  • args: the arguments to create nat gateway

RETURNS:

  • *CreateNatGatewayResult: the id of the nat gateway newly created
  • error: nil if success otherwise the specific error

func (*Client) CreateNatGatewayDnatRule added in v0.9.118

func (c *Client) CreateNatGatewayDnatRule(natId string, args *CreateNatGatewayDnatRuleArgs) (*CreateNatGatewayDnatRuleResult, error)

func (*Client) CreateNatGatewaySnatRule added in v0.9.118

func (c *Client) CreateNatGatewaySnatRule(natId string, args *CreateNatGatewaySnatRuleArgs) (*CreateNatGatewaySnatRuleResult, error)

func (*Client) CreatePeerConn

func (c *Client) CreatePeerConn(args *CreatePeerConnArgs) (*CreatePeerConnResult, error)

CreatePeerConn - create a new peer connection with the specific parameters

PARAMS:

  • args: the arguments to create peer connection

RETURNS:

  • *CreatePeerConnResult: the id of peer connection newly created
  • error: nil if success otherwise the specific error

func (*Client) CreateRouteRule

func (c *Client) CreateRouteRule(args *CreateRouteRuleArgs) (*CreateRouteRuleResult, error)

CreateRouteRule - create a new route rule with the given parameters

PARAMS:

  • args: the arguments to create route rule

RETURNS:

  • *CreateRouteRuleResult: the id of the route rule newly created
  • error: nil if success otherwise the specific error

func (*Client) CreateSubnet

func (c *Client) CreateSubnet(args *CreateSubnetArgs) (*CreateSubnetResult, error)

CreateSubnet - create a new subnet with the specified parameters

PARAMS:

  • args: the arguments to create subnet

RETURNS:

  • *CreateSubnetResult: the ID of the subnet newly created
  • error: nil if success otherwise the specific error

func (*Client) CreateVPC

func (c *Client) CreateVPC(args *CreateVPCArgs) (*CreateVPCResult, error)

CreateVPC - create a new VPC with the specified parameters

PARAMS:

  • args: the arguments to create VPC

RETURNS:

  • *CreateVPCResult: the id of the VPC newly created
  • error: nil if success otherwise the specific error

func (*Client) DeleteAclRule

func (c *Client) DeleteAclRule(aclRuleId, clientToken string) error

DeleteAclRule - delete the specific acl rule

PARAMS:

  • aclRuleId: the id of the specific acl rule
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteNatGateway

func (c *Client) DeleteNatGateway(natId, clientToken string) error

DeleteNatGateway - delete the specific nat gateway

PARAMS:

  • natId: the id of the specific nat gateway
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteNatGatewayDnatRule added in v0.9.118

func (c *Client) DeleteNatGatewayDnatRule(natId string, dnatRuleId string, clientToken string) error

func (*Client) DeleteNatGatewaySnatRule added in v0.9.118

func (c *Client) DeleteNatGatewaySnatRule(natId string, snatRuleId string, clientToken string) error

func (*Client) DeletePeerConn

func (c *Client) DeletePeerConn(peerConnId, clientToken string) error

DeletePeerConn - delete the specific peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteRouteRule

func (c *Client) DeleteRouteRule(routeRuleId, clientToken string) error

DeleteRouteRule - delete the given routing rule

PARAMS:

  • routeRuleId: the id of the specific routing rule
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteSubnet

func (c *Client) DeleteSubnet(subnetId string, clientToken string) error

DeleteSubnet - delete the given subnet

PARAMS:

  • subnetId: the id of the specified subnet
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteVPC

func (c *Client) DeleteVPC(vpcId, clientToken string) error

DeleteVPC - delete a specified VPC

PARAMS:

  • vpcId: the VPC id to be deleted
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetNatGatewayDetail

func (c *Client) GetNatGatewayDetail(natId string) (*NAT, error)

GetNatGatewayDetail - get details of the specific nat gateway

PARAMS:

  • natId: the id of the specified nat

RETURNS:

  • *NAT: the result of the specific nat gateway details
  • error: nil if success otherwise the specific error

func (*Client) GetNetworkTopologyInfo added in v0.9.89

func (c *Client) GetNetworkTopologyInfo(args *GetNetworkTopologyArgs) (*NetworkTopologyResult, error)

GetNetworkTopologyInfo - get the network topology info

PARAMS:

  • getNetworkTopologyArgs: the arguments to GetNetworkTopologyInfo

RETURNS:

  • *NetworkTopologyResult: the network topologies info obtained based on host ip or host id
  • error: nil if success otherwise the specific error

func (*Client) GetPeerConnDetail

func (c *Client) GetPeerConnDetail(peerConnId string, role PeerConnRoleType) (*PeerConn, error)

GetPeerConnDetail - get details for the specific peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • role: the role of the specific peer connection, which can be initiator or acceptor

RETURNS:

  • *PeerConn: the result of the specfic peer connection details
  • error: nil if success otherwise the specific error

func (*Client) GetPrivateIpAddressesInfo added in v0.9.36

func (c *Client) GetPrivateIpAddressesInfo(args *GetVpcPrivateIpArgs) (*VpcPrivateIpAddressesResult, error)

GetPrivateIpAddressesInfo - get the privateIpAddressesInfo from vpc

PARAMS:

  • getVpcPrivateIpArgs: the arguments to GetPrivateIpAddressInfo

RETURNS:

  • *VpcPrivateIpAddressesResult: the privateIpAddresses info of the specified privateIps in specified vpc
  • error: nil if success otherwise the specific error

func (*Client) GetRouteTableDetail

func (c *Client) GetRouteTableDetail(routeTableId, vpcId string) (*GetRouteTableResult, error)

GetRouteTableDetail - get details of the given routeTableId or vpcId

PARAMS:

  • routeTableId: the id of the specific route table
  • vpcId: the id of the specific VPC

RETURNS:

  • *GetRouteTableResult: the result of route table details
  • error: nil if success otherwise the specific error

func (*Client) GetSubnetDetail

func (c *Client) GetSubnetDetail(subnetId string) (*GetSubnetDetailResult, error)

GetSubnetDetail - get details of the given subnet

PARAMS:

  • subnetId: the id of the specified subnet

RETURNS:

  • *GetSubnetDetailResult: the result of the given subnet details
  • error: nil if success otherwise the specific error

func (*Client) GetVPCDetail

func (c *Client) GetVPCDetail(vpcId string) (*GetVPCDetailResult, error)

GetVPCDetail - get details of the specified VPC

PARAMS:

  • vpcId: the VPC id

RETURNS:

  • *GetVPCDetailResult: the details of the specified VPC
  • error: nil if success otherwise the specific error

func (*Client) ListAclEntrys

func (c *Client) ListAclEntrys(vpcId string) (*ListAclEntrysResult, error)

ListAclEntrys - list all acl entrys of the given VPC

PARAMS:

  • vpcId: the id of the specific VPC

RETURNS:

  • *ListAclEntrysResult: the result of all acl entrys
  • error: nil if success otherwise the specific error

func (*Client) ListAclRules

func (c *Client) ListAclRules(args *ListAclRulesArgs) (*ListAclRulesResult, error)

ListAclRules - list all acl rules with the specific parameters

PARAMS:

  • args: the arguments to list all acl rules

RETURNS:

  • *ListAclRulesResult: the result of all acl rules
  • error: nil if success otherwise the specific error

func (*Client) ListNatGateway

func (c *Client) ListNatGateway(args *ListNatGatewayArgs) (*ListNatGatewayResult, error)

ListNatGateway - list all nat gateways with the specific parameters

PARAMS:

  • args: the arguments to list nat gateways

RETURNS:

  • *ListNatGatewayResult: the result of nat gateway list
  • error: nil if success otherwise the specific error

func (*Client) ListNatGatewayDnatRules added in v0.9.118

func (c *Client) ListNatGatewayDnatRules(natId string, args *ListNatGatewaDnatRuleArgs) (*ListNatGatewayDnatRulesResult, error)

func (*Client) ListNatGatewaySnatRules added in v0.9.118

func (c *Client) ListNatGatewaySnatRules(args *ListNatGatewaySnatRuleArgs) (*ListNatGatewaySnatRulesResult, error)

func (*Client) ListPeerConn

func (c *Client) ListPeerConn(args *ListPeerConnsArgs) (*ListPeerConnsResult, error)

ListPeerConn - list all peer connections with the specific parameters

PARAMS:

  • args: the arguments to list peer connections

RETURNS:

  • *ListPeerConnsResult: the result of the peer connection list
  • error: nil if success otherwise the specific error

func (*Client) ListSubnets

func (c *Client) ListSubnets(args *ListSubnetArgs) (*ListSubnetResult, error)

ListSubnets - list all subnets with the specified parameters

PARAMS:

  • args: the arguments to list subnets
  • :

RETURNS:

  • *ListSubnetResult: the result of all subnets
  • error: nil if success otherwise the specific error

func (*Client) ListVPC

func (c *Client) ListVPC(args *ListVPCArgs) (*ListVPCResult, error)

ListVPC - list all VPCs with the specified parameters

PARAMS:

  • args: the arguments to list VPCs

RETURNS:

  • *ListVPCResult: the result of all VPCs
  • error: nil if success otherwise the specific error

func (*Client) OpenPeerConnSyncDNS

func (c *Client) OpenPeerConnSyncDNS(peerConnId string, args *PeerConnSyncDNSArgs) error

OpenPeerConnSyncDNS - open the dns synchronization for the given peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • args: the arguments to open dns synchronization

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RejectPeerConnApply

func (c *Client) RejectPeerConnApply(peerConnId, clientToken string) error

RejectPeerConnApply - reject the specific peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RenewNatGateway

func (c *Client) RenewNatGateway(natId string, args *RenewNatGatewayArgs) error

RenewNatGateway - renew nat gateway with the specific parameters

PARAMS:

  • natId: the id of the specific nat gateway
  • args: the arguments to renew nat gateway

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RenewPeerConn

func (c *Client) RenewPeerConn(peerConnId string, args *RenewPeerConnArgs) error

RenewPeerConn - renew the specific peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • args: the arguments to renew the peer connection

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ResizeNatGateway added in v0.9.138

func (c *Client) ResizeNatGateway(natId string, args *ResizeNatGatewayArgs) error

func (*Client) ResizePeerConn

func (c *Client) ResizePeerConn(peerConnId string, args *ResizePeerConnArgs) error

ResizePeerConn - resize the specific peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • args: the arguments to resize the peer connection

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnBindDnatEips added in v0.9.134

func (c *Client) UnBindDnatEips(natId string, args *UnBindDnatEipsArgs) error

UnBindDnatEips - unbind dnatEips for the specific nat gateway

PARAMS:

  • natId: the id of the specific nat gateway
  • args: the arguments to unbind dnatEips

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnBindEips

func (c *Client) UnBindEips(natId string, args *UnBindEipsArgs) error

UnBindEips - unbind eips for the specific nat gateway

PARAMS:

  • natId: the id of the specific nat gateway
  • args: the arguments to unbind eips

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateAclRule

func (c *Client) UpdateAclRule(aclRuleId string, args *UpdateAclRuleArgs) error

UpdateAclRule - udpate acl rule with the specific parameters

PARAMS:

  • aclRuleId: the id of the specific acl rule
  • args: the arguments to update acl rule

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateNatGateway

func (c *Client) UpdateNatGateway(natId string, args *UpdateNatGatewayArgs) error

UpdateNatGateway - update the specified nat gateway

PARAMS:

  • natId: the id of the specific nat gateway
  • args: the arguments to update nat gateway

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateNatGatewayDnatRule added in v0.9.118

func (c *Client) UpdateNatGatewayDnatRule(natId string, dnatRuleId string, args *UpdateNatGatewayDnatRuleArgs) error

func (*Client) UpdateNatGatewaySnatRule added in v0.9.118

func (c *Client) UpdateNatGatewaySnatRule(natId string, snatRuleId string, args *UpdateNatGatewaySnatRuleArgs) error

func (*Client) UpdatePeerConn

func (c *Client) UpdatePeerConn(peerConnId string, args *UpdatePeerConnArgs) error

UpdatePeerConn - update the specific peer connection

PARAMS:

  • peerConnId: the id of the specific peer connection
  • args: the arguments to update the specific peer connection

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateSubnet

func (c *Client) UpdateSubnet(subnetId string, args *UpdateSubnetArgs) error

UpdateSubnet - update the given subnet

PARAMS:

  • subnetId: the id of the given subnet
  • args: the arguments to update subnet

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateVPC

func (c *Client) UpdateVPC(vpcId string, updateVPCArgs *UpdateVPCArgs) error

UpdateVPC - update a specified VPC

PARAMS:

  • vpcId: the id of the specified VPC
  • updateVPCArgs: the arguments to udpate VPC

RETURNS:

  • error: nil if success otherwise the specific error

type CreateAclRuleArgs

type CreateAclRuleArgs struct {
	ClientToken string           `json:"-"`
	AclRules    []AclRuleRequest `json:"aclRules"`
}

CreateAclRuleArgs defines the structure of the input parameters for the CreateAclRule api

type CreateNatGatewayArgs

type CreateNatGatewayArgs struct {
	ClientToken string             `json:"-"`
	Name        string             `json:"name"`
	VpcId       string             `json:"vpcId"`
	Spec        NatGatewaySpecType `json:"spec"`
	CuNum       string             `json:"cuNum,omitempty"`
	Eips        []string           `json:"eips,omitempty"`
	Billing     *Billing           `json:"billing"`
	Tags        []model.TagModel   `json:"tags,omitempty"`
}

CreateNatGatewayArgs defines the structure of the input parameters for the CreateNatGateway api

type CreateNatGatewayDnatRuleArgs added in v0.9.118

type CreateNatGatewayDnatRuleArgs struct {
	ClientToken      string `json:"-"`
	RuleName         string `json:"ruleName,omitempty"`
	PublicIpAddress  string `json:"publicIpAddress,omitempty"`
	PrivateIpAddress string `json:"privateIpAddress,omitempty"`
	Protocol         string `json:"protocol,omitempty"`
	PublicPort       string `json:"publicPort,omitempty"`
	PrivatePort      string `json:"privatePort,omitempty"`
}

type CreateNatGatewayDnatRuleResult added in v0.9.118

type CreateNatGatewayDnatRuleResult struct {
	RuleId string `json:"ruleId"`
}

type CreateNatGatewayResult

type CreateNatGatewayResult struct {
	NatId string `json:"natId"`
}

CreateNatGatewayResult defines the structure of the output parameters for the CreateNatGateway api

type CreateNatGatewaySnatRuleArgs added in v0.9.118

type CreateNatGatewaySnatRuleArgs struct {
	ClientToken       string   `json:"-"`
	RuleName          string   `json:"ruleName,omitempty"`
	SourceCIDR        string   `json:"sourceCIDR,omitempty"`
	PublicIpAddresses []string `json:"publicIpsAddress,omitempty"`
}

type CreateNatGatewaySnatRuleResult added in v0.9.118

type CreateNatGatewaySnatRuleResult struct {
	RuleId string `json:"ruleId"`
}

type CreatePeerConnArgs

type CreatePeerConnArgs struct {
	ClientToken     string           `json:"-"`
	BandwidthInMbps int              `json:"bandwidthInMbps"`
	Description     string           `json:"description,omitempty"`
	LocalIfName     string           `json:"localIfName,omitempty"`
	LocalVpcId      string           `json:"localVpcId"`
	PeerAccountId   string           `json:"peerAccountId,omitempty"`
	PeerVpcId       string           `json:"peerVpcId"`
	PeerRegion      string           `json:"peerRegion"`
	PeerIfName      string           `json:"peerIfName,omitempty"`
	Billing         *Billing         `json:"billing"`
	Tags            []model.TagModel `json:"tags,omitempty"`
}

CreatePeerConnArgs defines the structure of the input parameters for the CreatePeerConn api

type CreatePeerConnResult

type CreatePeerConnResult struct {
	PeerConnId string `json:"peerConnId"`
}

CreatePeerConnResult defines the structure of the output parameters for the CreatePeerConn api

type CreateRouteRuleArgs

type CreateRouteRuleArgs struct {
	ClientToken        string      `json:"-"`
	RouteTableId       string      `json:"routeTableId"`
	SourceAddress      string      `json:"sourceAddress"`
	DestinationAddress string      `json:"destinationAddress"`
	NexthopId          string      `json:"nexthopId,omitempty"`
	IpVersion          string      `json:"ipVersion,omitempty"`
	NexthopType        NexthopType `json:"nexthopType"`
	NextHopList        []NextHop   `json:"nextHopList,omitempty"`
	Description        string      `json:"description,omitempty"`
}

CreateRouteRuleArgs defines the structure of the input parameters for the CreateRouteRule api

type CreateRouteRuleResult

type CreateRouteRuleResult struct {
	RouteRuleId  string   `json:"routeRuleId"`
	RouteRuleIds []string `json:"routeRuleIds,omitempty"`
}

CreateRouteRuleResult defines the structure of the output parameters for the CreateRouteRule api

type CreateSubnetArgs

type CreateSubnetArgs struct {
	ClientToken      string           `json:"-"`
	Name             string           `json:"name"`
	ZoneName         string           `json:"zoneName"`
	Cidr             string           `json:"cidr"`
	VpcId            string           `json:"vpcId"`
	VpcSecondaryCidr string           `json:"vpcSecondaryCidr,omitempty"`
	SubnetType       SubnetType       `json:"subnetType,omitempty"`
	Description      string           `json:"description,omitempty"`
	EnableIpv6       bool             `json:"enableIpv6,omitempty"`
	Tags             []model.TagModel `json:"tags,omitempty"`
}

CreateSubnetArgs defines the structure of the input parameters for the CreateSubnet api

type CreateSubnetResult

type CreateSubnetResult struct {
	SubnetId string `json:"subnetId"`
}

CreateSubnetResult defines the structure of the output parameters for the CreateSubnet api

type CreateVPCArgs

type CreateVPCArgs struct {
	ClientToken string           `json:"-"`
	Name        string           `json:"name"`
	Description string           `json:"description,omitempty"`
	Cidr        string           `json:"cidr"`
	Tags        []model.TagModel `json:"tags,omitempty"`
}

CreateVPCArgs defines the structure of the input parameters for the CreateVPC api

type CreateVPCResult

type CreateVPCResult struct {
	VPCID string `json:"vpcId"`
}

CreateVPCResult defines the structure of the output parameters for the CreateVPC api

type DnatRule added in v0.9.118

type DnatRule struct {
	RuleId           string `json:"ruleId"`
	RuleName         string `json:"ruleName"`
	PublicIpAddress  string `json:"publicIpAddress"`
	PrivateIpAddress string `json:"privateIpAddress"`
	Protocol         string `json:"protocol"`
	PublicPort       int    `json:"publicPort"`
	PrivatePort      int    `json:"privatePort"`
	Status           string `json:"status"`
}

type DnatRuleArgs added in v0.9.118

type DnatRuleArgs struct {
	RuleName         string `json:"ruleName,omitempty"`
	PublicIpAddress  string `json:"publicIpAddress,omitempty"`
	PrivateIpAddress string `json:"privateIpAddress,omitempty"`
	Protocol         string `json:"protocol,omitempty"`
	PublicPort       string `json:"publicPort,omitempty"`
	PrivatePort      string `json:"privatePort,omitempty"`
}

type DnsStatusType

type DnsStatusType string

type GetNetworkTopologyArgs added in v0.9.89

type GetNetworkTopologyArgs struct {
	HostIp string `json:"hostIp,omitempty"`
	HostId string `json:"hostId,omitempty"`
}

Get NetworkTopologyInfo args

HostIp:the host ip of the network topology to be queried
HostId:the host id of the network topology to be queried
If both HostIp and HostId are passed in, the HostIp will effect (only need to pass in one of the two)

type GetRouteTableResult

type GetRouteTableResult struct {
	RouteTableId string      `json:"routeTableId"`
	VpcId        string      `json:"vpcId"`
	RouteRules   []RouteRule `json:"routeRules"`
}

GetRouteTableResult defines the structure of the output parameters for the GetRouteTableDetail api

type GetSubnetDetailResult

type GetSubnetDetailResult struct {
	Subnet Subnet `json:"subnet"`
}

GetSubnetDetailResult defines the structure of the output parameters for the GetSubnetDetail api

type GetVPCDetailResult

type GetVPCDetailResult struct {
	VPC ShowVPCModel `json:"vpc"`
}

GetVPCDetailResult defines the structure of the output parameters for the GetVPCDetail api

type GetVpcPrivateIpArgs added in v0.9.36

type GetVpcPrivateIpArgs struct {
	VpcId              string   `json:"vpcId"`
	PrivateIpAddresses []string `json:"privateIpAddresses",omitempty`
	PrivateIpRange     string   `json:"privateIpRange,omitempty"`
}

Get VpcPrivateIpAddressedInfo args

VpcId:the vpc you want to query ips
PrivateIpAddresses:the privateIp list you want to query
PrivateIpRange:the range of privateIp .ex:"192.168.0.1-192.168.0.5"
pay attention that the size of PrivateIpAddresses and PrivateIpRange must less than 100
if both PrivateIpAddresses and PrivateIpRange ,the PrivateIpRange will effect

type ListAclEntrysResult

type ListAclEntrysResult struct {
	VpcId     string     `json:"vpcId"`
	VpcName   string     `json:"vpcName"`
	VpcCidr   string     `json:"vpcCidr"`
	AclEntrys []AclEntry `json:"aclEntrys"`
}

ListAclEntrysResult defines the structure of the output parameters for the ListAclEntrys api

type ListAclRulesArgs

type ListAclRulesArgs struct {
	Marker   string `json:"marker"`
	MaxKeys  int    `json:"maxKeys"`
	SubnetId string `json:"subnetId"`
}

ListAclRulesArgs defines the structure of the input parameters for the ListAclRules api

type ListAclRulesResult

type ListAclRulesResult struct {
	Marker      string    `json:"marker"`
	IsTruncated bool      `json:"isTruncated"`
	NextMarker  string    `json:"nextMarker"`
	MaxKeys     int       `json:"maxKeys"`
	AclRules    []AclRule `json:"aclRules"`
}

ListAclRulesResult defines the structure of the output parameters for the ListAclRules api

type ListNatGatewaDnatRuleArgs added in v0.9.118

type ListNatGatewaDnatRuleArgs struct {
	Marker  string `json:"marker"`
	MaxKeys int    `json:"maxKeys"`
}

type ListNatGatewayArgs

type ListNatGatewayArgs struct {
	VpcId   string
	NatId   string
	Name    string
	Ip      string
	Marker  string
	MaxKeys int
}

ListNatGatewayArgs defines the structure of the input parameters for the ListNatGateway api

type ListNatGatewayDnatRulesResult added in v0.9.118

type ListNatGatewayDnatRulesResult struct {
	Rules       []DnatRule `json:"rules"`
	Marker      string     `json:"marker"`
	IsTruncated bool       `json:"isTruncated"`
	NextMarker  string     `json:"nextMarker"`
	MaxKeys     int        `json:"maxKeys"`
}

type ListNatGatewayResult

type ListNatGatewayResult struct {
	Nats        []NAT  `json:"nats"`
	Marker      string `json:"marker"`
	IsTruncated bool   `json:"isTruncated"`
	NextMarker  string `json:"nextMarker"`
	MaxKeys     int    `json:"maxKeys"`
}

ListNatGatewayResult defines the structure of the output parameters for the ListNatGateway api

type ListNatGatewaySnatRuleArgs added in v0.9.118

type ListNatGatewaySnatRuleArgs struct {
	NatId   string `json:"natId"`
	Marker  string `json:"marker"`
	MaxKeys int    `json:"maxKeys"`
}

type ListNatGatewaySnatRulesResult added in v0.9.118

type ListNatGatewaySnatRulesResult struct {
	Rules       []SnatRule `json:"rules"`
	Marker      string     `json:"marker"`
	IsTruncated bool       `json:"isTruncated"`
	NextMarker  string     `json:"nextMarker"`
	MaxKeys     int        `json:"maxKeys"`
}

type ListPeerConnsArgs

type ListPeerConnsArgs struct {
	VpcId   string
	Marker  string
	MaxKeys int
}

ListPeerConnsArgs defines the structure of the input parameters for the ListPeerConns api

type ListPeerConnsResult

type ListPeerConnsResult struct {
	PeerConns   []PeerConn `json:"peerConns"`
	Marker      string     `json:"marker"`
	IsTruncated bool       `json:"isTruncated"`
	NextMarker  string     `json:"nextMarker"`
	MaxKeys     int        `json:"maxKeys"`
}

ListPeerConnsResult defines the structure of the output parameters for the ListPeerConns api

type ListSubnetArgs

type ListSubnetArgs struct {
	Marker     string
	MaxKeys    int
	VpcId      string
	ZoneName   string
	SubnetType SubnetType
}

ListSubnetArgs defines the structure of the input parameters for the ListSubnet api

type ListSubnetResult

type ListSubnetResult struct {
	Marker      string   `json:"marker"`
	IsTruncated bool     `json:"isTruncated"`
	NextMarker  string   `json:"nextMarker"`
	MaxKeys     int      `json:"maxKeys"`
	Subnets     []Subnet `json:"subnets"`
}

ListSubnetResult defines the structure of the output parameters for the ListSubnet api

type ListVPCArgs

type ListVPCArgs struct {
	Marker  string
	MaxKeys int

	// IsDefault is a string type,
	// so we can identify if it has been setted when the value is false.
	// NOTE: it can be only true or false.
	IsDefault string
}

ListVPCArgs defines the structure of the input parameters for the ListVPC api

type ListVPCResult

type ListVPCResult struct {
	Marker      string `json:"marker"`
	IsTruncated bool   `json:"isTruncated"`
	NextMarker  string `json:"nextMarker"`
	MaxKeys     int    `json:"maxKeys"`
	VPCs        []VPC  `json:"vpcs"`
}

ListVPCResult defines the structure of the output parameters for the ListVPC api

type NAT

type NAT struct {
	Id            string           `json:"id"`
	Name          string           `json:"name"`
	VpcId         string           `json:"vpcId"`
	Spec          string           `json:"spec,omitempty"`
	CuNum         int              `json:"cuNum,omitempty"`
	Status        NatStatusType    `json:"status"`
	Eips          []string         `json:"eips"`
	PaymentTiming string           `json:"paymentTiming"`
	ExpiredTime   string           `json:"expiredTime"`
	Tags          []model.TagModel `json:"tags"`
}

NAT is the result for getNatGatewayDetail api.

type NatGatewaySpecType

type NatGatewaySpecType string

type NatStatusType

type NatStatusType string

type NetworkTopology added in v0.9.89

type NetworkTopology struct {
	ClusterName string `json:"clusterName"`
	HostId      string `json:"hostId"`
	SwitchId    string `json:"switchId"`
	HostIp      string `json:"hostIp"`
	PodName     string `json:"podName"`
}

type NetworkTopologyResult added in v0.9.89

type NetworkTopologyResult struct {
	NetworkTopologies []NetworkTopology `json:"networkTopologies"`
}

NetworkTopologyResult defines the structure of the output parameters for the GetNetworkTopologyInfo api

type NextHop added in v0.9.147

type NextHop struct {
	NexthopId   string      `json:"nexthopId"`
	NexthopType NexthopType `json:"nexthopType"`
	PathType    string      `json:"pathType"`
}

type NexthopType

type NexthopType string

type PaymentTimingType

type PaymentTimingType string

type PeerConn

type PeerConn struct {
	PeerConnId      string             `json:"peerConnId"`
	Role            PeerConnRoleType   `json:"role"`
	Status          PeerConnStatusType `json:"status"`
	BandwidthInMbps int                `json:"bandwidthInMbps"`
	Description     string             `json:"description"`
	LocalIfId       string             `json:"localIfId"`
	LocalIfName     string             `json:"localIfName"`
	LocalVpcId      string             `json:"localVpcId"`
	LocalRegion     string             `json:"localRegion"`
	PeerVpcId       string             `json:"peerVpcId"`
	PeerRegion      string             `json:"peerRegion"`
	PeerAccountId   string             `json:"peerAccountId"`
	PaymentTiming   string             `json:"paymentTiming"`
	DnsStatus       DnsStatusType      `json:"dnsStatus"`
	CreatedTime     string             `json:"createdTime"`
	ExpiredTime     string             `json:"expiredTime"`
	Tags            []model.TagModel   `json:"tags"`
}

type PeerConnRoleType

type PeerConnRoleType string

type PeerConnStatusType

type PeerConnStatusType string

type PeerConnSyncDNSArgs

type PeerConnSyncDNSArgs struct {
	Role        PeerConnRoleType `json:"role"`
	ClientToken string           `json:"-"`
}

PeerConnSyncDNSArgs defines the structure of the input parameters for the PeerConnSyncDNS api

type RenewNatGatewayArgs

type RenewNatGatewayArgs struct {
	ClientToken string   `json:"-"`
	Billing     *Billing `json:"billing"`
}

RenewNatGatewayArgs defines the structure of the input parameters for the RenewNatGateway api

type RenewPeerConnArgs

type RenewPeerConnArgs struct {
	Billing     *Billing `json:"billing"`
	ClientToken string   `json:"-"`
}

RenewPeerConnArgs defines the structure of the input parameters for the RenewPeerConn api

type Reservation

type Reservation struct {
	ReservationLength   int    `json:"reservationLength"`
	ReservationTimeUnit string `json:"reservationTimeUnit"`
}

type ResizeNatGatewayArgs added in v0.9.138

type ResizeNatGatewayArgs struct {
	ClientToken string `json:"-"`
	CuNum       int    `json:"cuNum"`
}

type ResizePeerConnArgs

type ResizePeerConnArgs struct {
	NewBandwidthInMbps int    `json:"newBandwidthInMbps"`
	ClientToken        string `json:"-"`
}

ResizePeerConnArgs defines the structure of the input parameters for the ResizePeerConn api

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        NexthopType `json:"nexthopType"`
	Description        string      `json:"description"`
	PathType           string      `json:"pathType"`
}

type ShowVPCModel

type ShowVPCModel struct {
	VPCId         string           `json:"vpcId"`
	Name          string           `json:"name"`
	Cidr          string           `json:"cidr"`
	CreatedTime   string           `json:"createdTime"`
	Description   string           `json:"description"`
	IsDefault     bool             `json:"isDefault"`
	Subnets       []Subnet         `json:"subnets"`
	SecondaryCidr []string         `json:"secondaryCidr"`
	Tags          []model.TagModel `json:"tags"`
}

type SnatRule added in v0.9.118

type SnatRule struct {
	RuleId            string   `json:"ruleId"`
	RuleName          string   `json:"ruleName"`
	PublicIpAddresses []string `json:"publicIpsAddress"`
	SourceCIDR        string   `json:"sourceCIDR"`
	Status            string   `json:"status"`
}

type SnatRuleArgs added in v0.9.118

type SnatRuleArgs struct {
	RuleName          string   `json:"ruleName,omitempty"`
	SourceCIDR        string   `json:"sourceCIDR,omitempty"`
	PublicIpAddresses []string `json:"publicIpsAddress,omitempty"`
}

type Subnet

type Subnet struct {
	SubnetId    string           `json:"subnetId"`
	Name        string           `json:"name"`
	ZoneName    string           `json:"zoneName"`
	Cidr        string           `json:"cidr"`
	Ipv6Cidr    string           `json:"ipv6Cidr"`
	VPCId       string           `json:"vpcId"`
	SubnetType  SubnetType       `json:"subnetType"`
	Description string           `json:"description"`
	CreatedTime string           `json:"createdTime"`
	AvailableIp int              `json:"availableIp"`
	Tags        []model.TagModel `json:"tags"`
}

type SubnetType

type SubnetType string

type UnBindDnatEipsArgs added in v0.9.134

type UnBindDnatEipsArgs struct {
	ClientToken string   `json:"-"`
	DnatEips    []string `json:"dnatEips"`
}

UnBindDnatEipsArgs defines the structure of the input parameters for the UnBindDnatEips api

type UnBindEipsArgs

type UnBindEipsArgs struct {
	ClientToken string   `json:"-"`
	Eips        []string `json:"eips"`
}

UnBindEipsArgs defines the structure of the input parameters for the UnBindEips api

type UpdateAclRuleArgs

type UpdateAclRuleArgs struct {
	ClientToken          string              `json:"-"`
	Description          string              `json:"description,omitempty"`
	Protocol             AclRuleProtocolType `json:"protocol,omitempty"`
	SourceIpAddress      string              `json:"sourceIpAddress,omitempty"`
	DestinationIpAddress string              `json:"destinationIpAddress,omitempty"`
	SourcePort           string              `json:"sourcePort,omitempty"`
	DestinationPort      string              `json:"destinationPort,omitempty"`
	Position             int                 `json:"position,omitempty"`
	Action               AclRuleActionType   `json:"action,omitempty"`
}

UpdateAclRuleArgs defines the structure of the input parameters for the UpdateAclRule api

type UpdateNatGatewayArgs

type UpdateNatGatewayArgs struct {
	ClientToken string `json:"-"`
	Name        string `json:"name"`
}

UpdateNatGatewayArgs defines the structure of the input parameters for the UpdateNatGateway api

type UpdateNatGatewayDnatRuleArgs added in v0.9.118

type UpdateNatGatewayDnatRuleArgs struct {
	ClientToken      string `json:"-"`
	RuleName         string `json:"ruleName,omitempty"`
	PublicIpAddress  string `json:"publicIpAddress,omitempty"`
	PrivateIpAddress string `json:"privateIpAddress,omitempty"`
	Protocol         string `json:"protocol,omitempty"`
	PublicPort       string `json:"publicPort,omitempty"`
	PrivatePort      string `json:"privatePort,omitempty"`
}

type UpdateNatGatewaySnatRuleArgs added in v0.9.118

type UpdateNatGatewaySnatRuleArgs struct {
	ClientToken       string   `json:"-"`
	RuleName          string   `json:"ruleName,omitempty"`
	SourceCIDR        string   `json:"sourceCIDR,omitempty"`
	PublicIpAddresses []string `json:"publicIpsAddress,omitempty"`
}

type UpdatePeerConnArgs

type UpdatePeerConnArgs struct {
	LocalIfId   string `json:"localIfId"`
	Description string `json:"description,omitempty"`
	LocalIfName string `json:"localIfName,omitempty"`
}

UpdatePeerConnArgs defines the structure of the input parameters for the UpdatePeerConn api

type UpdateSubnetArgs

type UpdateSubnetArgs struct {
	ClientToken string `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	EnableIpv6  bool   `json:"enableIpv6"`
}

UpdateSubnetArgs defines the structure of the input parameters for the UpdateSubnet api

type UpdateVPCArgs

type UpdateVPCArgs struct {
	ClientToken string `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

UpdateVPCArgs defines the structure of the input parameters for the UpdateVPC api

type VPC

type VPC struct {
	VPCID         string           `json:"vpcId"`
	Name          string           `json:"name"`
	Cidr          string           `json:"cidr"`
	CreatedTime   string           `json:"createdTime"`
	Description   string           `json:"description"`
	IsDefault     bool             `json:"isDefault"`
	SecondaryCidr []string         `json:"secondaryCidr"`
	Tags          []model.TagModel `json:"tags"`
}

type VpcPrivateIpAddress added in v0.9.36

type VpcPrivateIpAddress struct {
	PrivateIpAddress     string `json:"privateIpAddress"`
	Cidr                 string `json:"cidr"`
	PrivateIpAddressType string `json:"privateIpAddressType`
	CreatedTime          string `json:"createdTime"`
}

type VpcPrivateIpAddressesResult added in v0.9.36

type VpcPrivateIpAddressesResult struct {
	VpcPrivateIpAddresses []VpcPrivateIpAddress `json:"vpcPrivateIpAddresses"`
}

VpcPrivateIpAddressesResult defines the structure of the output parameters for the GetPrivateIpAddressInfo api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL