wireserver

package
v1.15.22 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoPrimaryInterface indicates the wireserver response does not have a primary interface indicated.
	ErrNoPrimaryInterface = errors.New("no primary interface found")
	// ErrNoSecondaryInterface indicates the wireserver response does not have secondary interface on the node
	ErrNoSecondaryInterface = errors.New("no secondary interface found")
	// ErrInsufficientAddressSpace indicates that the CIDR space is too small to include a gateway IP; it is 1 IP.
	ErrInsufficientAddressSpace = errors.New("insufficient address space to generate gateway IP")
)

Functions

This section is empty.

Types

type Address

type Address struct {
	Address   string `xml:"Address,attr"`
	IsPrimary bool   `xml:"IsPrimary,attr"`
}

type Client

type Client struct {
	HostPort string

	HTTPClient do
	Logger     interface {
		Printf(string, ...any)
	}
}

func (*Client) GetInterfaces

func (c *Client) GetInterfaces(ctx context.Context) (*GetInterfacesResult, error)

GetInterfaces queries interfaces from the wireserver.

type GetInterfacesResult

type GetInterfacesResult struct {
	Interface []Interface
}

GetInterfacesResult is the xml mapped response of the getInterfacesQuery

type GetNetworkContainerOpts

type GetNetworkContainerOpts struct {
	NetworkContainerID string
	PrimaryAddress     string
	AuthToken          string
	APIVersion         string
}

type Interface

type Interface struct {
	MacAddress string `xml:"MacAddress,attr"`
	IsPrimary  bool   `xml:"IsPrimary,attr"`
	IPSubnet   []Subnet
}

type InterfaceInfo

type InterfaceInfo struct {
	Subnet       string
	Gateway      string
	IsPrimary    bool
	PrimaryIP    string
	SecondaryIPs []string
}

InterfaceInfo specifies the information about an interface as returned by Host Agent.

func GetPrimaryInterfaceFromResult

func GetPrimaryInterfaceFromResult(res *GetInterfacesResult) (*InterfaceInfo, error)

func GetSecondaryInterfaceFromResult added in v1.5.22

func GetSecondaryInterfaceFromResult(res *GetInterfacesResult, macAddress string) (*InterfaceInfo, error)

Gets secondary interface details for swiftv2 secondary nics scenario

type Proxy

type Proxy struct {
	Host       string
	HTTPClient do
}

func (*Proxy) JoinNetwork

func (p *Proxy) JoinNetwork(ctx context.Context, vnetID string) (*http.Response, error)

func (*Proxy) PublishNC

func (p *Proxy) PublishNC(ctx context.Context, ncParams cns.NetworkContainerParameters, payload []byte) (*http.Response, error)

func (*Proxy) UnpublishNC

func (p *Proxy) UnpublishNC(ctx context.Context, ncParams cns.NetworkContainerParameters, payload []byte) (*http.Response, error)

type Subnet

type Subnet struct {
	Prefix    string `xml:"Prefix,attr"`
	IPAddress []Address
}

Jump to

Keyboard shortcuts

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