interfaces

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, interfaceId string) error

Delete is a method used to remove an existing virtual interface using its ID.

Types

type CreateOpts

type CreateOpts struct {
	// The type of the virtual interface.
	Type string `json:"type" required:"true"`
	// The VLAN for constom side.
	Vlan int `json:"vlan" required:"true"`
	// The ingress bandwidth size of the virtual interface.
	Bandwidth int `json:"bandwidth" required:"true"`
	// The ID of the virtual gateway to which the virtual interface is connected.
	VgwId string `json:"vgw_id" required:"true"`
	// The route mode of the virtual interface.
	RouteMode string `json:"route_mode" required:"true"`
	// The CIDR list of remote subnets.
	RemoteEpGroup []string `json:"remote_ep_group" required:"true"`
	// The CIDR list of subnets in service side.
	ServiceEpGroup []string `json:"service_ep_group,omitempty"`
	// Specifies the name of the virtual interface.
	// The valid length is limited from 1 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 ID of the direct connection associated with the virtual interface.
	DirectConnectId string `json:"direct_connect_id,omitempty"`
	// The service type of the virtual interface.
	ServiceType string `json:"service_type,omitempty"`
	// The IPv4 address of the virtual interface in cloud side.
	LocalGatewayV4Ip string `json:"local_gateway_v4_ip,omitempty"`
	// The IPv4 address of the virtual interface in client side.
	RemoteGatewayV4Ip string `json:"remote_gateway_v4_ip,omitempty"`
	// The address family type.
	AddressFamily string `json:"address_family,omitempty"`
	// The IPv6 address of the virtual interface in cloud side.
	LocalGatewayV6Ip string `json:"local_gateway_v6_ip,omitempty"`
	// The IPv6 address of the virtual interface in client side.
	RemoteGatewayV6Ip string `json:"remote_gateway_v6_ip,omitempty"`
	// The local BGP ASN in client side.
	BgpAsn int `json:"bgp_asn,omitempty"`
	// The (MD5) password for the local BGP.
	BgpMd5 string `json:"bgp_md5,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 ID of the link aggregation group (LAG) associated with the virtual interface.
	LagId string `json:"lag_id,omitempty"`
	// The ID of the target tenant ID, which is used for cross tenant virtual interface creation.
	ResourceTenantId string `json:"resource_tenant_id,omitempty"`
	// The enterprise project ID to which the virtual interface belongs.
	EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`
}

CreateOpts is the structure used to create a virtual interface.

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"`
}

UpdateOpts is the structure used to update an existing virtual interface.

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 receive time interval for detection.
	MinRxInterval string `json:"min_rx_interval"`
	// The 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"`
}

VifExtendAttribute is the structure that represents the reliability detection information of BFD/NQA.

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"`
	// 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"`
	// Attributed Device ID.
	BgpRouteLimit int `json:"bgp_route_limit"`
	// Attributed Device ID.
	BgpStatus string `json:"bgp_status"`
	// The virtual interface ID corresponding to the VIF peer.
	VifId string `json:"vif_id"`
}

VifPeer is the structure that represents the related information of each peer.

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_peer"`
	// 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(client *golangsdk.ServiceClient, opts CreateOpts) (*VirtualInterface, error)

Create is a method used to create a virtual interface using given parameters.

func Get

func Get(client *golangsdk.ServiceClient, interfaceId string) (*VirtualInterface, error)

Get is a method used to obtain the details of the virtual interface using its ID.

func Update

func Update(client *golangsdk.ServiceClient, interfaceId string, opts UpdateOpts) (*VirtualInterface, error)

Update is a method used to update the specified virtual interface using given parameters.

Jump to

Keyboard shortcuts

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