vpn

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: 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 BatchCreateSslVpnUserArgs added in v0.9.134

type BatchCreateSslVpnUserArgs struct {
	ClientToken string       `json:"-"`
	VpnId       string       `json:"vpnId"`
	SslVpnUsers []SslVpnUser `json:"sslVpnUsers"`
}

BatchCreateSslVpnUserArgs defines the structure of the input parameters for the CreateSslVpnUser api

type BatchCreateSslVpnUserResult added in v0.9.134

type BatchCreateSslVpnUserResult struct {
	SslVpnUserIds []string `json:"sslVpnUserIds"`
}

BatchCreateSslVpnUserResult defines the structure of the output parameters for the BatchCreateSslVpnUser api

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) BatchCreateSslVpnUser added in v0.9.134

func (c *Client) BatchCreateSslVpnUser(args *BatchCreateSslVpnUserArgs) (*BatchCreateSslVpnUserResult, error)

BatchCreateSslVpnUser - batch create ssl-vpn user with the specific parameters

PARAMS:

  • args: the arguments to create ssl-vpn users

RETURNS:

  • error: nil if success otherwise the specific 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) CreateSslVpnServer added in v0.9.134

func (c *Client) CreateSslVpnServer(args *CreateSslVpnServerArgs) (*CreateSslVpnServerResult, error)

CreateSslVpnServer - create ssl-vpn server with the specific parameters

PARAMS:

  • args: the arguments to create ssl-vpn server

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) DeleteSslVpnServer added in v0.9.134

func (c *Client) DeleteSslVpnServer(vpnId, sslVpnServerId, clientToken string) error

DeleteSslVpnServer - delete ssl-vpn server with the specific vpnId

PARAMS:

  • vpnId: the id of the specific vpn gateway
  • sslVpnServerId: the id of the specific ssl-vpn server
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteSslVpnUser added in v0.9.134

func (c *Client) DeleteSslVpnUser(vpnId, userId, clientToken string) error

DeleteSslVpnUser - delete ssl-vpn user with the specific vpnId and userId

PARAMS:

  • vpnId: the id of the specific vpn gateway
  • userId: the id of the specific ssl-vpn user
  • clientToken: the idempotent token

RETURNS:

  • error: nil if success otherwise the specific 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) GetSslVpnServer added in v0.9.134

func (c *Client) GetSslVpnServer(vpnId, clientToken string) (*SslVpnServer, error)

GetSslVpnServer - get details of the specific ssl-vpn server

PARAMS:

  • vpnId: the id of the specified vpn

RETURNS:

  • *SslVpnServer: the result of the specific ssl-vpn server details
  • 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) ListSslVpnUser added in v0.9.134

func (c *Client) ListSslVpnUser(args *ListSslVpnUserArgs) (*ListSslVpnUserResult, error)

ListSslVpnUser - list ssl-vpn user with the specific vpnId

PARAMS:

  • args: the arguments to list ssl-vpn users

RETURNS:

  • *ListSslVpnUserResult: the result of vpn ssl-vpn user list contains page infos
  • 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) UpdateSslVpnServer added in v0.9.134

func (c *Client) UpdateSslVpnServer(args *UpdateSslVpnServerArgs) error

UpdateSslVpnServer - update ssl-vpn server with the specific parameters

PARAMS:

  • args: the arguments to update ssl ssl-vpn server

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateSslVpnUser added in v0.9.134

func (c *Client) UpdateSslVpnUser(args *UpdateSslVpnUserArgs) error

UpdateSslVpnUser - update ssl-vpn user with the specific parameters

PARAMS:

  • args: the arguments to update the specific ssl-vpn user

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 CreateSslVpnServerArgs added in v0.9.134

type CreateSslVpnServerArgs struct {
	ClientToken      string   `json:"-"`
	VpnId            string   `json:"vpnId"`
	SslVpnServerName string   `json:"sslVpnServerName"`
	InterfaceType    *string  `json:"interfaceType,omitempty"`
	LocalSubnets     []string `json:"localSubnets"`
	RemoteSubnet     string   `json:"remoteSubnet"`
	ClientDns        *string  `json:"clientDns,omitempty"`
}

CreateSslVpnServerArgs defines the structure of the input parameters for the CreateSslVpnServer api

type CreateSslVpnServerResult added in v0.9.134

type CreateSslVpnServerResult struct {
	SslVpnServerId string `json:"sslVpnServerId"`
}

CreateSslVpnServerResult defines the structure of the output parameters for the CreateSslVpnServer api

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 ListSslVpnServerResult added in v0.9.134

type ListSslVpnServerResult struct {
	SslVpnServers []SslVpnServer `json:"sslVpnServers"`
}

ListSslVpnServerResult defines the structure of output parameters for the ListSslVpnServer api

type ListSslVpnUserArgs added in v0.9.134

type ListSslVpnUserArgs struct {
	Marker   string `json:"marker"`
	MaxKeys  int    `json:"maxKeys"`
	VpnId    string `json:"vpnId"`
	UserName string `json:"username"`
}

ListSslVpnUserArgs defines the structure of input parameters for the ListSslVpnUser api

type ListSslVpnUserResult added in v0.9.134

type ListSslVpnUserResult struct {
	Marker      string             `json:"marker"`
	IsTruncated bool               `json:"isTruncated"`
	NextMarker  string             `json:"nextMarker"`
	MaxKeys     int                `json:"maxKeys"`
	SslVpnUsers []SelectSslVpnUser `json:"sslVpnUsers"`
}

ListSslVpnUserResult defines the structure of output parameters for the ListSslVpnUser api

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 SelectSslVpnUser added in v0.9.134

type SelectSslVpnUser struct {
	UserId      string `json:"userId"`
	UserName    string `json:"userName"`
	Description string `json:"description"`
}

type SslVpnServer added in v0.9.134

type SslVpnServer struct {
	VpnId            string   `json:"vpnId"`
	SslVpnServerId   string   `json:"sslVpnServerId"`
	SslVpnServerName string   `json:"sslVpnServerName"`
	InterfaceType    string   `json:"interfaceType"`
	Status           string   `json:"status"`
	LocalSubnets     []string `json:"localSubnets"`
	RemoteSubnet     string   `json:"remoteSubnet"`
	ClientDns        string   `json:"clientDns"`
	MaxConnection    int      `json:"maxConnection"`
}

SslVpnServer defines the structure of the output parameters for the GetSslVpnServer api

type SslVpnUser added in v0.9.134

type SslVpnUser struct {
	UserName    string  `json:"userName"`
	Password    string  `json:"password"`
	Description *string `json:"description,omitempty"`
}

type UpdateSslVpnServer added in v0.9.134

type UpdateSslVpnServer struct {
	SslVpnServerName string   `json:"sslVpnServerName,omitempty"`
	LocalSubnets     []string `json:"localSubnets,omitempty"`
	RemoteSubnet     string   `json:"remoteSubnet,omitempty"`
	ClientDns        *string  `json:"clientDns,omitempty"`
}

UpdateSslVpnServer defines part of the structure of the input parameters for the UpdateSslVpnServer api

type UpdateSslVpnServerArgs added in v0.9.134

type UpdateSslVpnServerArgs struct {
	ClientToken        string              `json:"-"`
	VpnId              string              `json:"VpnId"`
	SslVpnServerId     string              `json:"sslVpnServerId"`
	UpdateSslVpnServer *UpdateSslVpnServer `json:"updateSslVpnServer"`
}

UpdateSslVpnServerArgs defines the structure of input parameters for the UpdateSslVpnServer api

type UpdateSslVpnUser added in v0.9.134

type UpdateSslVpnUser struct {
	Password    string  `json:"password,omitempty"`
	Description *string `json:"description,omitempty"`
}

type UpdateSslVpnUserArgs added in v0.9.134

type UpdateSslVpnUserArgs struct {
	ClientToken string            `json:"-"`
	VpnId       string            `json:"vpnId"`
	UserId      string            `json:"userId"`
	SslVpnUser  *UpdateSslVpnUser `json:"sslVpnUser"`
}

UpdateSslVpnUserArgs defines the structure of input parameters for the UpdateSslVpnUser api

type UpdateVpnConnArgs

type UpdateVpnConnArgs struct {
	VpnConnId     string             `json:"vpnConnId"`
	UpdateVpnconn *CreateVpnConnArgs `json:"updateVpnconn"`
}

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