Documentation
¶
Index ¶
- func Delete(c *golangsdk.ServiceClient, id string) (err error)
- func DeletePeer(c *golangsdk.ServiceClient, id string) (err error)
- type CreateOpts
- type CreatePeerOpts
- type ListOpts
- type UpdateOpts
- type UpdatePeerOpts
- type VifExtendAttribute
- type VifPeer
- type VirtualInterface
- func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*VirtualInterface, error)
- func Get(client *golangsdk.ServiceClient, id string) (*VirtualInterface, error)
- func List(client *golangsdk.ServiceClient, opts ListOpts) ([]VirtualInterface, error)
- func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (*VirtualInterface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeletePeer ¶
func DeletePeer(c *golangsdk.ServiceClient, id string) (err error)
Types ¶
type CreateOpts ¶
type CreateOpts struct {
// Specifies the project ID of another tenant, which is used to create virtual interfaces across tenants.
ResourceTenantID string `json:"resource_tenant_id,omitempty"`
// Specifies the virtual interface name.
Name string `json:"name,omitempty"`
// Provides supplementary information about the virtual interface.
Description string `json:"description,omitempty"`
// Specifies the ID of the connection associated with the virtual interface.
// When creating a virtual interface, you need to specify direct_connect_id or lag_id.
// This parameter is mandatory when LAG is not supported at the site.
DirectConnectID string `json:"direct_connect_id,omitempty"`
// Specifies the type of the virtual interface. The value is private.
Type string `json:"type" required:"true"`
// Specifies the type of the access gateway. You do not need to set this parameter.
ServiceType string `json:"service_type,omitempty"`
// Specifies the customer VLAN to be connected.
// If you select a hosted connection, the VLAN must be the same as that of the hosted connection.
VLAN int `json:"vlan" required:"true"`
// Specifies the virtual interface bandwidth.
Bandwidth int `json:"bandwidth" required:"true"`
// Specifies the IPv4 interface address of the gateway used on the cloud.
// This parameter is mandatory if address_family is set to an IPv4 address.
LocalGatewayV4IP string `json:"local_gateway_v4_ip,omitempty"`
// Specifies the IPv4 interface address of the gateway on the on-premises network.
// This parameter is mandatory if address_family is set to an IPv4 address.
RemoteGatewayV4IP string `json:"remote_gateway_v4_ip,omitempty"`
// Specifies the address family of the virtual interface.
// The value can be IPv4 or IPv6.
AddressFamily string `json:"address_family,omitempty"`
// Specifies the IPv6 interface address of the gateway used on the cloud.
// This parameter is mandatory if address_family is set to an IPv6 address.
LocalGatewayV6IP string `json:"local_gateway_v6_ip,omitempty"`
// Specifies the IPv6 interface address of the gateway on the on-premises network.
// This parameter is mandatory if address_family is set to an IPv6 address.
RemoteGatewayV6IP string `json:"remote_gateway_v6_ip,omitempty"`
// Specifies the ID of the virtual gateway connected by the virtual interface.
VgwId string `json:"vgw_id,omitempty" required:"true"`
// Specifies the routing mode. The value can be static or bgp.
RouteMode string `json:"route_mode" required:"true"`
// Specifies the ASN of the BGP peer on the customer side.
BGPASN int `json:"bgp_asn,omitempty"`
// Specifies the MD5 password of the BGP peer.
BGPMD5 string `json:"bgp_md5,omitempty"`
// Specifies the remote subnet list, which records the CIDR blocks used in the on-premises data center.
RemoteEpGroup []string `json:"remote_ep_group" required:"true"`
// Specifies the subnets that access Internet services through a connection.
ServiceEpGroup []string `json:"service_ep_group,omitempty"`
// Specifies whether to enable BFD.
EnableBfd bool `json:"enable_bfd,omitempty"`
// Specifies whether to enable NQA.
EnableNqa bool `json:"enable_nqa,omitempty"`
// Specifies the ID of the LAG associated with the virtual interface.
LagId string `json:"lag_id,omitempty"`
}
type CreatePeerOpts ¶
type CreatePeerOpts struct {
// Specifies the name of the virtual interface peer.
Name string `json:"name" required:"true"`
// Provides supplementary information about the virtual interface peer.
Description string `json:"description,omitempty"`
// Specifies the gateway address of the virtual interface peer used on the cloud.
LocalGatewayIP string `json:"local_gateway_ip" required:"true"`
// Specifies the IPv4 interface address of the gateway on the on-premises network.
// This parameter is mandatory if address_family is set to an IPv4 address.
RemoteGatewayIP string `json:"remote_gateway_ip" required:"true"`
// Specifies the address family of the virtual interface.
// The value can be IPv4 or IPv6.
AddressFamily string `json:"address_family" required:"true"`
// Specifies the routing mode. The value can be static or bgp.
RouteMode string `json:"route_mode" required:"true"`
// Specifies the ASN of the BGP peer on the customer side.
BGPASN int `json:"bgp_asn,omitempty"`
// Specifies the MD5 password of the BGP peer.
BGPMD5 string `json:"bgp_md5,omitempty"`
// Specifies the remote subnet list, which records the CIDR blocks used in the on-premises data center.
RemoteEpGroup []string `json:"remote_ep_group,omitempty"`
// Specifies the ID of the virtual interface corresponding to the virtual interface peer.
VifId string `json:"vif_id" required:"true"`
}
type UpdateOpts ¶
type UpdateOpts struct {
// Specifies the name of the virtual interface.
// The valid length is limited from 0 to 64, only chinese and english letters, digits, hyphens (-), underscores (_)
// and dots (.) are allowed.
// The name must start with a chinese or english letter, and the Chinese characters must be in **UTF-8** or
// **Unicode** format.
Name string `json:"name,omitempty"`
// Specifies the description of the virtual interface.
// The description contain a maximum of 128 characters and the angle brackets (< and >) are not allowed.
// Chinese characters must be in **UTF-8** or **Unicode** format.
Description *string `json:"description,omitempty"`
// The ingress bandwidth size of the virtual interface.
Bandwidth int `json:"bandwidth,omitempty"`
// The CIDR list of remote subnets.
RemoteEpGroup []string `json:"remote_ep_group,omitempty"`
// The CIDR list of subnets in service side.
ServiceEpGroup []string `json:"service_ep_group,omitempty"`
// Whether to enable the Bidirectional Forwarding Detection (BFD) function.
EnableBfd *bool `json:"enable_bfd,omitempty"`
// Whether to enable the Network Quality Analysis (NQA) function.
EnableNqa *bool `json:"enable_nqa,omitempty"`
// The status of the virtual interface to be changed.
Status string `json:"status,omitempty"`
}
type UpdatePeerOpts ¶
type UpdatePeerOpts struct {
// Specifies the name of the virtual interface peer.
Name string `json:"name" required:"true"`
// Provides supplementary information about the virtual interface peer.
Description string `json:"description,omitempty"`
// Specifies the remote subnet list, which records the CIDR blocks used in the on-premises data center.
RemoteEpGroup []string `json:"remote_ep_group,omitempty"`
}
type VifExtendAttribute ¶
type VifExtendAttribute struct {
// The availability detection types for virtual interface.
// + nqa
// + bfd
HaType string `json:"ha_type"`
// The specific configuration mode detected for virtual interface.
// + auto_single
// + auto_multi
// + static_single
// + static_multi
// + enhance_nqa
HaMode string `json:"ha_mode"`
// The detection retries.
DetectMultiplier string `json:"detect_multiplier"`
// The reception time interval for detection.
MinRxInterval string `json:"min_rx_interval"`
// To transmit time interval for detection.
MinTxInterval string `json:"min_tx_interval"`
// The identifier of the detected remote side, used for static BFD.
RemoteDisclaim string `json:"remote_disclaim"`
// The identifier of the detected local side, used for static BFD.
LocalDisclaim string `json:"local_disclaim"`
}
type VifPeer ¶
type VifPeer struct {
// Resource ID.
ID string `json:"id"`
// The ID of the target tenant ID, which is used for cross tenant virtual interface creation.
TenantId string `json:"tenant_id"`
// Specifies the name of the VIF peer.
// The valid length is limited from 0 to 64, only chinese and english letters, digits, hyphens (-), underscores (_)
// and dots (.) are allowed.
// The name must start with a chinese or english letter, and the Chinese characters must be in **UTF-8** or
// **Unicode** format.
Name string `json:"name"`
// Specifies the description of the virtual interface.
// The description contain a maximum of 128 characters and the angle brackets (< and >) are not allowed.
// Chinese characters must be in **UTF-8** or **Unicode** format.
Description string `json:"description"`
// The address family type.
AddressFamily string `json:"address_family"`
// Local gateway IP.
LocalGatewayIp string `json:"local_gateway_ip"`
// Remote gateway IP.
RemoteGatewayIp string `json:"remote_gateway_ip"`
// The routing mode, which can be static or bgp.
RouteMode string `json:"route_mode"`
// BGP ASN.
BgpAsn int `json:"bgp_asn"`
// BGP MD5 password.
BgpMd5 string `json:"bgp_md5"`
// The CIDR list of remote subnets.
RemoteEpGroup []string `json:"remote_ep_group"`
// The CIDR list of subnets in service side.
ServiceEpGroup []string `json:"service_ep_group"`
// Attributed Device ID.
DeviceId string `json:"device_id"`
// Whether to enable BFD.
EnableBfd bool `json:"enable_bfd"`
// Whether to enable NQA.
EnableNqa bool `json:"enable_nqa"`
// Attributed Device ID.
BgpRouteLimit int `json:"bgp_route_limit"`
// Attributed Device ID.
BgpStatus string `json:"bgp_status"`
// The status of the virtual interface peer.
Status string `json:"status"`
// The virtual interface ID corresponding to the VIF peer.
VifId string `json:"vif_id"`
// The number of received BGP routes if BGP routing is used.
ReceiveRouteNum int `json:"receive_route_num"`
}
func CreatePeer ¶
func CreatePeer(c *golangsdk.ServiceClient, opts CreatePeerOpts) (*VifPeer, error)
func UpdatePeer ¶
func UpdatePeer(c *golangsdk.ServiceClient, id string, opts UpdatePeerOpts) (*VifPeer, error)
type VirtualInterface ¶
type VirtualInterface struct {
// The ID of the virtual interface.
ID string `json:"id"`
// Specifies the name of the virtual interface.
// The valid length is limited from 0 to 64, only chinese and english letters, digits, hyphens (-), underscores (_)
// and dots (.) are allowed.
// The name must start with a chinese or english letter, and the Chinese characters must be in **UTF-8** or
// **Unicode** format.
Name string `json:"name"`
// Manage status.
// The valid values are 'true' and 'false'.
AdminStateUp bool `json:"admin_state_up"`
// The ingress bandwidth size of the virtual interface.
Bandwidth int `json:"bandwidth"`
// The creation time of the virtual interface.
CreatedAt string `json:"create_time"`
// The latest update time of the virtual interface.
UpdatedAt string `json:"update_time"`
// Specifies the description of the virtual interface.
// The description contain a maximum of 128 characters and the angle brackets (< and >) are not allowed.
// Chinese characters must be in **UTF-8** or **Unicode** format.
Description string `json:"description"`
// The ID of the direct connection associated with the virtual interface.
DirectConnectId string `json:"direct_connect_id"`
// The service type of the virtual interface.
ServiceType string `json:"service_type"`
// The current status of the virtual interface.
// The valid values are as follows:
// + ACTIVE
// + DOWN
// + BUILD
// + ERROR
// + PENDING_CREATE
// + PENDING_UPDATE
// + PENDING_DELETE
// + DELETED
// + AUTHORIZATION
// + REJECTED
Status string `json:"status"`
// The ID of the target tenant ID, which is used for cross tenant virtual interface creation.
TenantId string `json:"tenant_id"`
// The type of the virtual interface.
Type string `json:"type"`
// The ID of the virtual gateway to which the virtual interface is connected.
VgwId string `json:"vgw_id"`
// The VLAN for constom side.
Vlan int `json:"vlan"`
// The route specification of the remote VIF network.
RouteLimit int `json:"route_limit"`
// Whether to enable the Bidirectional Forwarding Detection (BFD) function.
EnableBfd bool `json:"enable_bfd"`
// Whether to enable the Network Quality Analysis (NQA) function.
EnableNqa bool `json:"enable_nqa"`
// The ID of the Intelligent EdgeSite (IES) associated with the virtual interface.
IesId string `json:"ies_id"`
// The ID of the link aggregation group (LAG) associated with the virtual interface.
LagId string `json:"lag_id"`
// The ID of the local gateway (LGW) associated with the virtual interface.
LgwId string `json:"lgw_id"`
// The local BGP ASN in client side.
BgpAsn int `json:"bgp_asn"`
// The (MD5) password for the local BGP.
BgpMd5 string `json:"bgp_md5"`
// The attributed Device ID.
DeviceId string `json:"device_id"`
// The IPv4 address of the virtual interface in cloud side.
LocalGatewayV4Ip string `json:"local_gateway_v4_ip"`
// The IPv4 address of the virtual interface in client side.
RemoteGatewayV4Ip string `json:"remote_gateway_v4_ip"`
// The address family type.
AddressFamily string `json:"address_family"`
// The IPv6 address of the virtual interface in cloud side.
LocalGatewayV6Ip string `json:"local_gateway_v6_ip"`
// The IPv6 address of the virtual interface in client side.
RemoteGatewayV6Ip string `json:"remote_gateway_v6_ip"`
// The CIDR list of remote subnets.
RemoteEpGroup []string `json:"remote_ep_group"`
// The CIDR list of subnets in service side.
ServiceEpGroup []string `json:"service_ep_group"`
// The route mode of the virtual interface.
RouteMode string `json:"route_mode"`
// Whether limit rate.
RateLimit bool `json:"rate_limit"`
// The VLAN for constom side.
VifPeers []VifPeer `json:"vif_peers"`
// The Peer details of the VIF.
ExtendAttribute VifExtendAttribute `json:"extend_attribute"`
// The enterprise project ID to which the virtual interface belongs.
EnterpriseProjectId string `json:"enterprise_project_id"`
// The key/value pairs to associate with the virtual interface.
Tags []tags.ResourceTag `json:"tags"`
}
VirtualInterface is the structure that represents the details of the virtual interface.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*VirtualInterface, error)
func Get ¶
func Get(client *golangsdk.ServiceClient, id string) (*VirtualInterface, error)
Get retrieves a particular virtual gateway based on its unique ID.
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOpts) ([]VirtualInterface, error)
func Update ¶
func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (*VirtualInterface, error)
Update is an operation which modifies the attributes of the specified
Click to show internal directories.
Click to hide internal directories.