nmagent

package
v1.4.24 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GetNmAgentSupportedApiURLFmt Api endpoint to get supported Apis of NMAgent
	GetNmAgentSupportedApiURLFmt       = "http://%s/machine/plugins/?comp=nmagent&type=GetSupportedApis"
	GetNetworkContainerVersionURLFmt   = "" /* 142-byte string literal not displayed */
	GetNcVersionListWithOutTokenURLFmt = "http://%s/machine/plugins/?comp=nmagent&type=NetworkManagement/interfaces/api-version/%s"
	JoinNetworkURLFmt                  = "NetworkManagement/joinedVirtualNetworks/%s/api-version/1"
	PutNetworkValueFmt                 = "NetworkManagement/interfaces/%s/networkContainers/%s/authenticationToken/%s/api-version/1"
	DeleteNetworkContainerURLFmt       = "NetworkManagement/interfaces/%s/networkContainers/%s/authenticationToken/%s/api-version/1/method/DELETE"
)

Variables

View Source
var (
	WireserverIP     = "168.63.129.16"
	WireServerPath   = "machine/plugins"
	WireServerScheme = "http"
)

WireServerIP - wire server ip

Functions

func GetNetworkContainerVersion added in v1.4.15

func GetNetworkContainerVersion(networkContainerID, getNetworkContainerVersionURL string) (*http.Response, error)

GetNetworkContainerVersion :- Retrieves NC version from NMAgent

func GetNmAgentSupportedApis added in v1.4.15

func GetNmAgentSupportedApis(httpc *http.Client, getNmAgentSupportedApisURL string) ([]string, error)

GetNmAgentSupportedApis :- Retrieves Supported Apis from NMAgent

func JoinNetwork added in v1.4.15

func JoinNetwork(networkID string) (*http.Response, error)

JoinNetwork joins the given network

func PublishNetworkContainer added in v1.4.15

func PublishNetworkContainer(networkContainerID, associatedInterfaceID, accessToken string, requestBodyData []byte) (*http.Response, error)

PublishNetworkContainer publishes given network container

func UnpublishNetworkContainer added in v1.4.15

func UnpublishNetworkContainer(networkContainerID, associatedInterfaceID, accessToken string) (*http.Response, error)

UnpublishNetworkContainer unpublishes given network container

Types

type Client added in v1.4.15

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

Client is client to handle queries to nmagent

func NewClient added in v1.4.15

func NewClient(url string) (*Client, error)

NewClient create a new nmagent client.

func (*Client) GetNCVersionList added in v1.4.15

func (c *Client) GetNCVersionList(ctx context.Context) (*NetworkContainerListResponse, error)

GetNCVersionList query nmagent for programmed container versions.

type ContainerInfo

type ContainerInfo struct {
	NetworkContainerID string `json:"networkContainerId"`
	Version            string `json:"version"`
}

type NetworkContainerListResponse

type NetworkContainerListResponse struct {
	ResponseCode string          `json:"httpStatusCode"`
	Containers   []ContainerInfo `json:"networkContainers"`
}

type NetworkContainerResponse

type NetworkContainerResponse struct {
	ResponseCode       string `json:"httpStatusCode"`
	NetworkContainerID string `json:"networkContainerId"`
	Version            string `json:"version"`
}

NetworkContainerResponse - NMAgent response.

type SupportedAPIsResponseXML added in v1.4.15

type SupportedAPIsResponseXML struct {
	SupportedApis []string `xml:"type"`
}

Jump to

Keyboard shortcuts

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