vpn

package
v0.9.49 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package vpn defines the vpn 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_VPN_URL = "/vpn"
)
View Source
const (
	PAYMENT_TIMING_PREPAID  PaymentTimingType = "Prepaid"
	PAYMENT_TIMING_POSTPAID PaymentTimingType = "Postpaid"

	VPN_STATUS_BUILDING     VpnStatusType = "building"
	VPN_STATUS_UNCONFIGURED VpnStatusType = "unconfigured"
	VPN_STATUS_CONFIGURING  VpnStatusType = "configuring"
	VPN_STATUS_ACTIVE       VpnStatusType = "active"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Billing

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

type BindEipArgs

type BindEipArgs struct {
	ClientToken string `json:"-"`
	Eip         string `json:"eip"`
}

BindEipArgs defines the structure of the input parameters for the BindEip 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) BindEip

func (c *Client) BindEip(vpnId string, args *BindEipArgs) error

BindEip - bind eip for the specific vpn gateway

PARAMS:

  • vpnId: the id of the specific vpn gateway
  • args: the arguments to bind eip

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateVpnConn

func (c *Client) CreateVpnConn(args *CreateVpnConnArgs) (*CreateVpnConnResult, error)

CreateVpnConn - create vpnconn with the specific parameters

PARAMS:

  • vpnId: the id of the specific vpn gateway
  • args: the arguments to create vpnconn

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateVpnGateway

func (c *Client) CreateVpnGateway(args *CreateVpnGatewayArgs) (*CreateVpnGatewayResult, error)

func (*Client) DeleteVpn

func (c *Client) DeleteVpn(vpnId, clientToken string) error

func (*Client) DeleteVpnConn

func (c *Client) DeleteVpnConn(vpnConnId, clientToken string) error

DeleteVpnConn - delete the specific vpnconn

PARAMS:

  • vpnConnId: the id of the specific vpnconn
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteVpnGateway

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

DeleteVpnGateway - delete the specific vpn gateway

PARAMS:

  • vpnId: the id of the specific vpn gateway
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetVpnGatewayDetail

func (c *Client) GetVpnGatewayDetail(vpnId string) (*VPN, error)

GetVpnGatewayDetail - get details of the specific vpn gateway

PARAMS:

  • vpnId: the id of the specified vpn

RETURNS:

  • *VPN: the result of the specific vpn gateway details
  • error: nil if success otherwise the specific error

func (*Client) ListVpnConn

func (c *Client) ListVpnConn(vpnId string) (*ListVpnConnResult, error)

ListVpnConn - list vpnconn with the specific vpnId

PARAMS:

  • vpnId:the id you want to list vpnconn

RETURNS:

  • *ListVpnConnResult: the result of vpn gateway'conn list
  • error: nil if success otherwise the specific error

func (*Client) ListVpnGateway

func (c *Client) ListVpnGateway(args *ListVpnGatewayArgs) (*ListVpnGatewayResult, error)

func (*Client) RenewVpnGateway

func (c *Client) RenewVpnGateway(vpnId string, args *RenewVpnGatewayArgs) error

RenewVpnGateway - renew vpn gateway with the specific parameters

PARAMS:

  • vpnId: the id of the specific vpn gateway
  • args: the arguments to renew vpn gateway

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnBindEip

func (c *Client) UnBindEip(vpnId, clientToken string) error

UnBindEips - unbind eip for the specific vpn gateway

PARAMS:

  • vpnId: the id of the specific vpn gateway

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateVpnConn

func (c *Client) UpdateVpnConn(args *UpdateVpnConnArgs) error

UpdateVpnConn - create vpnconn with the specific parameters

PARAMS:

  • args: the arguments to update vpnconn

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateVpnGateway

func (c *Client) UpdateVpnGateway(vpnId string, args *UpdateVpnGatewayArgs) error

UpdateVpnGateway - update the specified vpn gateway

PARAMS:

  • vpnId: the id of the specific vpn gateway
  • args: the arguments to update vpn gateway

RETURNS:

  • error: nil if success otherwise the specific error

type CreateIkeConfig

type CreateIkeConfig struct {
	IkeVersion  string `json:"ikeVersion"`
	IkeMode     string `json:"ikeMode"`
	IkeEncAlg   string `json:"ikeEncAlg"`
	IkeAuthAlg  string `json:"ikeAuthAlg"`
	IkePfs      string `json:"ikePfs"`
	IkeLifeTime int    `json:"ikeLifeTime"`
}

type CreateIpsecConfig

type CreateIpsecConfig struct {
	IpsecEncAlg   string `json:"ipsecEncAlg"`
	IpsecAuthAlg  string `json:"ipsecAuthAlg"`
	IpsecPfs      string `json:"ipsecPfs"`
	IpsecLifetime int    `json:"ipsecLifetime"`
}

type CreateVpnConnArgs

type CreateVpnConnArgs struct {
	ClientToken       string             `json:"-"`
	VpnId             string             `json:"vpnId"`
	VpnConnName       string             `json:"vpnConnName"`
	LocalIp           string             `json:"localIp"`
	SecretKey         string             `json:"secretKey"`
	LocalSubnets      []string           `json:"localSubnets"`
	RemoteIp          string             `json:"remoteIp"`
	RemoteSubnets     []string           `json:"remoteSubnets"`
	Description       string             `json:"description,omitempty"`
	CreateIkeConfig   *CreateIkeConfig   `json:"ikeConfig"`
	CreateIpsecConfig *CreateIpsecConfig `json:"ipsecConfig"`
}

CreateVpnConnArgs defines the structure of the input parameters for the CreateVpnGatewayConn api

type CreateVpnConnResult

type CreateVpnConnResult struct {
	VpnConnId string `json:"vpnConnId"`
}

CreateVpnConnResult defines the structure of the output parameters for the CreateVpnConn api

type CreateVpnGatewayArgs

type CreateVpnGatewayArgs struct {
	ClientToken string   `json:"-"`
	VpnName     string   `json:"vpnName"`
	VpcId       string   `json:"vpcId"`
	Description string   `json:"description,omitempty"`
	Eip         string   `json:"eip,omitempty"`
	Billing     *Billing `json:"billing"`
}

CreateVpnGatewayArgs defines the structure of the input parameters for the CreateVpnGateway api

type CreateVpnGatewayResult

type CreateVpnGatewayResult struct {
	VpnId string `json:"vpnId"`
}

CreateVpnGatewayResult defines the structure of the output parameters for the CreateVpnGateway api

type IkeConfig

type IkeConfig struct {
	IkeVersion  string `json:"ikeVersion"`
	IkeMode     string `json:"ikeMode"`
	IkeEncAlg   string `json:"ikeEncAlg"`
	IkeAuthAlg  string `json:"ikeAuthAlg"`
	IkePfs      string `json:"ikePfs"`
	IkeLifeTime string `json:"ikeLifeTime"`
}

type IpsecConfig

type IpsecConfig struct {
	IpsecEncAlg   string `json:"ipsecEncAlg"`
	IpsecAuthAlg  string `json:"ipsecAuthAlg"`
	IpsecPfs      string `json:"ipsecPfs"`
	IpsecLifetime string `json:"ipsecLifetime"`
}

type ListVpnConnResult

type ListVpnConnResult struct {
	VpnConns []VpnConn `json:"vpnConns"`
}

ListVpnConnResult defines the structure of output parameters for the ListVpnConn api

type ListVpnGatewayArgs

type ListVpnGatewayArgs struct {
	VpcId   string
	Eip     string
	Marker  string
	MaxKeys int
}

ListVpnGatewayArgs defines the structure of the input parameters for the ListVpnGateway api

type ListVpnGatewayResult

type ListVpnGatewayResult struct {
	Vpns        []VPN  `json:"vpns"`
	Marker      string `json:"marker"`
	IsTruncated bool   `json:"isTruncated"`
	NextMarker  string `json:"nextMarker"`
	MaxKeys     int    `json:"maxKeys"`
}

ListVpnGatewayResult defines the structure of the output parameters for the ListVpnGateway api

type PaymentTimingType

type PaymentTimingType string

type PeerConnRoleType

type PeerConnRoleType string

type RenewVpnGatewayArgs

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

RenewVpnGatewayArgs defines the structure of the input parameters for the RenewVpnGateway api

type Reservation

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

type UpdateVpnConnArgs

type UpdateVpnConnArgs struct {
	// contains filtered or unexported fields
}

UpdateVpnConnArgs defines the structure of input parameters for the UpdateVpnConn api

type UpdateVpnGatewayArgs

type UpdateVpnGatewayArgs struct {
	ClientToken string `json:"-"`
	Name        string `json:"vpnName"`
}

UpdateVpnGatewayArgs defines the structure of the input parameters for the UpdateVpnGateway api

type VPN

type VPN struct {
	Status          VpnStatusType `json:"status"`
	Eip             string        `json:"eip"`
	VpnId           string        `json:"vpnId"`
	VpcId           string        `json:"vpcId"`
	Description     string        `json:"description"`
	ExpiredTime     string        `json:"expiredTime"`
	ProductType     string        `json:"paymentTiming"`
	VpnConnNum      int           `json:"vpnConnNum"`
	BandwidthInMbps int           `json:"bandwidthInMbps"`
	VpnConns        []VpnConn     `json:"vpnConns"`
	Name            string        `json:"vpnName"`
}

VPN is the result for getVpnDetail api.

type VpnConn

type VpnConn struct {
	VpnId         string      `json:"vpnId"`
	VpnConnId     string      `json:"vpnConnId"`
	VpnConnName   string      `json:"vpnConnName"`
	LocalIp       string      `json:"localIp"`
	SecretKey     string      `json:"secretKey"`
	LocalSubnets  []string    `json:"localSubnets"`
	RemoteIp      string      `json:"remoteIp"`
	RemoteSubnets []string    `json:"remoteSubnets"`
	Description   string      `json:"description"`
	Status        string      `json:"status"`
	CreatedTime   string      `json:"createdTime"`
	HealthStatus  string      `json:"healthStatus"`
	IkeConfig     IkeConfig   `json:"ikeConfig"`
	IpsecConfig   IpsecConfig `json:"ipsecConfig"`
}

type VpnStatusType

type VpnStatusType string

Jump to

Keyboard shortcuts

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