cns

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SetOrchestratorType                      = "/network/setorchestratortype"
	CreateOrUpdateNetworkContainer           = "/network/createorupdatenetworkcontainer"
	DeleteNetworkContainer                   = "/network/deletenetworkcontainer"
	GetNetworkContainerStatus                = "/network/getnetworkcontainerstatus"
	GetInterfaceForContainer                 = "/network/getinterfaceforcontainer"
	GetNetworkContainerByOrchestratorContext = "/network/getnetworkcontainerbyorchestratorcontext"
	AttachContainerToNetwork                 = "/network/attachcontainertonetwork"
	DetachContainerFromNetwork               = "/network/detachcontainerfromnetwork"
)

Container Network Service DNC Contract

View Source
const (
	AzureContainerInstance = "AzureContainerInstance"
	WebApps                = "WebApps"
	ClearContainer         = "ClearContainer"
	Docker                 = "Docker"
	Basic                  = "Basic"
)

NetworkContainer Types

View Source
const (
	Kubernetes      = "Kubernetes"
	ServiceFabric   = "ServiceFabric"
	Batch           = "Batch"
	DBforPostgreSQL = "DBforPostgreSQL"
	AzureFirstParty = "AzureFirstParty"
)

Orchestrator Types

View Source
const (
	Vlan  = "Vlan"
	Vxlan = "Vxlan"
)

Encap Types

View Source
const (
	SetEnvironmentPath          = "/network/environment"
	CreateNetworkPath           = "/network/create"
	DeleteNetworkPath           = "/network/delete"
	CreateHnsNetworkPath        = "/network/hns/create"
	DeleteHnsNetworkPath        = "/network/hns/delete"
	ReserveIPAddressPath        = "/network/ip/reserve"
	ReleaseIPAddressPath        = "/network/ip/release"
	GetHostLocalIPPath          = "/network/ip/hostlocal"
	GetIPAddressUtilizationPath = "/network/ip/utilization"
	GetUnhealthyIPAddressesPath = "/network/ipaddresses/unhealthy"
	GetHealthReportPath         = "/network/health"
	V1Prefix                    = "/v0.1"
	V2Prefix                    = "/v0.2"
)

Container Network Service remote API Contract

View Source
const (
	SwiftPrefix = "Swift_"
)

NetworkContainer Prefixes

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachContainerToNetworkResponse added in v1.0.18

type AttachContainerToNetworkResponse struct {
	Response Response
}

AttachContainerToNetworkResponse specifies response of attaching network container to network.

type ConfigureContainerNetworkingRequest added in v1.0.18

type ConfigureContainerNetworkingRequest struct {
	Containerid        string
	NetworkContainerid string
}

ConfigureContainerNetworkingRequest - specifies request to attach/detach container to network.

type CreateHnsNetworkRequest added in v1.0.19

type CreateHnsNetworkRequest struct {
	NetworkName          string
	NetworkType          string
	NetworkAdapterName   string            `json:",omitempty"`
	SourceMac            string            `json:",omitempty"`
	Policies             []json.RawMessage `json:",omitempty"`
	MacPools             []MacPool         `json:",omitempty"`
	Subnets              []SubnetInfo
	DNSSuffix            string `json:",omitempty"`
	DNSServerList        string `json:",omitempty"`
	DNSServerCompartment uint32 `json:",omitempty"`
	ManagementIP         string `json:",omitempty"`
	AutomaticDNS         bool   `json:",omitempty"`
}

CreateHnsNetworkRequest describes request to create the HNS network.

type CreateNetworkContainerRequest added in v1.0.4

type CreateNetworkContainerRequest struct {
	Version                    string
	NetworkContainerType       string
	NetworkContainerid         string // Mandatory input.
	PrimaryInterfaceIdentifier string // Primary CA.
	AuthorizationToken         string
	LocalIPConfiguration       IPConfiguration
	OrchestratorContext        json.RawMessage
	IPConfiguration            IPConfiguration
	MultiTenancyInfo           MultiTenancyInfo
	CnetAddressSpace           []IPSubnet // To setup SNAT (should include service endpoint vips).
	Routes                     []Route
}

CreateNetworkContainerRequest specifies request to create a network container or network isolation boundary.

type CreateNetworkContainerResponse added in v1.0.4

type CreateNetworkContainerResponse struct {
	Response Response
}

CreateNetworkContainerResponse specifies response of creating a network container.

type CreateNetworkRequest

type CreateNetworkRequest struct {
	NetworkName          string
	OverlayConfiguration OverlayConfiguration
	Options              map[string]interface{}
}

CreateNetworkRequest describes request to create the network.

type DeleteHnsNetworkRequest added in v1.0.19

type DeleteHnsNetworkRequest struct {
	NetworkName string
}

DeleteHnsNetworkRequest describes request to delete the HNS network.

type DeleteNetworkContainerRequest added in v1.0.4

type DeleteNetworkContainerRequest struct {
	NetworkContainerid string
}

DeleteNetworkContainerRequest specifies the details about the request to delete a specifc network container.

type DeleteNetworkContainerResponse added in v1.0.4

type DeleteNetworkContainerResponse struct {
	Response Response
}

DeleteNetworkContainerResponse describes the response to delete a specifc network container.

type DeleteNetworkRequest

type DeleteNetworkRequest struct {
	NetworkName string
}

DeleteNetworkRequest describes request to delete the network.

type DetachContainerFromNetworkResponse added in v1.0.18

type DetachContainerFromNetworkResponse struct {
	Response Response
}

DetachNetworkContainerToNetworkResponse specifies response of detaching network container from network.

type GetIPAddressesResponse

type GetIPAddressesResponse struct {
	Response    Response
	IPAddresses []string
}

GetIPAddressesResponse describes response containing requested ip addresses.

type GetInterfaceForContainerRequest added in v1.0.4

type GetInterfaceForContainerRequest struct {
	NetworkContainerID string
}

GetInterfaceForContainerRequest specifies the container ID for which interface needs to be identified.

type GetInterfaceForContainerResponse added in v1.0.4

type GetInterfaceForContainerResponse struct {
	NetworkContainerVersion string
	NetworkInterface        NetworkInterface
	CnetAddressSpace        []IPSubnet
	DNSServers              []string
	Response                Response
}

GetInterfaceForContainerResponse specifies the interface for a given container ID.

type GetNetworkContainerRequest added in v1.0.4

type GetNetworkContainerRequest struct {
	NetworkContainerid  string
	OrchestratorContext json.RawMessage
}

GetNetworkContainerRequest specifies the details about the request to retrieve a specifc network container.

type GetNetworkContainerResponse added in v1.0.4

type GetNetworkContainerResponse struct {
	IPConfiguration            IPConfiguration
	Routes                     []Route
	CnetAddressSpace           []IPSubnet
	MultiTenancyInfo           MultiTenancyInfo
	PrimaryInterfaceIdentifier string
	LocalIPConfiguration       IPConfiguration
	Response                   Response
}

GetNetworkContainerResponse describes the response to retrieve a specifc network container.

type GetNetworkContainerStatusRequest added in v1.0.4

type GetNetworkContainerStatusRequest struct {
	NetworkContainerid string
}

GetNetworkContainerStatusRequest specifies the details about the request to retrieve status of a specifc network container.

type GetNetworkContainerStatusResponse added in v1.0.4

type GetNetworkContainerStatusResponse struct {
	NetworkContainerid string
	Version            string
	AzureHostVersion   string
	Response           Response
}

GetNetworkContainerStatusResponse specifies response of retriving a network container status.

type HostLocalIPAddressResponse

type HostLocalIPAddressResponse struct {
	Response  Response
	IPAddress string
}

HostLocalIPAddressResponse describes reponse that returns the host local IP Address.

type IPAddressesUtilizationResponse

type IPAddressesUtilizationResponse struct {
	Response  Response
	Available int
	Reserved  int
	Unhealthy int
}

IPAddressesUtilizationResponse describes response for ip address utilization.

type IPConfiguration added in v1.0.4

type IPConfiguration struct {
	IPSubnet         IPSubnet
	DNSServers       []string
	GatewayIPAddress string
}

IPConfiguration contains details about ip config to provision in the VM.

type IPSubnet added in v1.0.4

type IPSubnet struct {
	IPAddress    string
	PrefixLength uint8
}

IPSubnet contains ip subnet.

type KubernetesPodInfo added in v1.0.4

type KubernetesPodInfo struct {
	PodName      string
	PodNamespace string
}

KubernetesPodInfo is an OrchestratorContext that holds PodName and PodNamespace.

type MacPool added in v1.0.19

type MacPool struct {
	StartMacAddress string
	EndMacAddress   string
}

MacPool is assoicated with HNS network and represents a list of macaddresses available to the network

type MultiTenancyInfo added in v1.0.4

type MultiTenancyInfo struct {
	EncapType string
	ID        int // This can be vlanid, vxlanid, gre-key etc. (depends on EnacapType).
}

MultiTenancyInfo contains encap type and id.

type NetworkInterface added in v1.0.4

type NetworkInterface struct {
	Name      string
	IPAddress string
}

NetworkInterface specifies the information that can be used to unquely identify an interface.

type NodeConfiguration

type NodeConfiguration struct {
	NodeIP     string
	NodeID     string
	NodeSubnet Subnet
}

NodeConfiguration describes confguration for a node in overlay network.

type OptionMap

type OptionMap map[string]interface{}

OptionMap describes generic options that can be passed to CNS.

type OverlayConfiguration

type OverlayConfiguration struct {
	NodeCount     int
	LocalNodeIP   string
	OverlaySubent Subnet
	NodeConfig    []NodeConfiguration
}

OverlayConfiguration describes configuration for all the nodes that are part of overlay.

type ReleaseIPAddressRequest

type ReleaseIPAddressRequest struct {
	ReservationID string
}

ReleaseIPAddressRequest describes request to release an IP Address.

type ReserveIPAddressRequest

type ReserveIPAddressRequest struct {
	ReservationID string
}

ReserveIPAddressRequest describes request to reserve an IP Address

type ReserveIPAddressResponse

type ReserveIPAddressResponse struct {
	Response  Response
	IPAddress string
}

ReserveIPAddressResponse describes response to reserve an IP address.

type Response

type Response struct {
	ReturnCode int
	Message    string
}

Response describes generic response from CNS.

type Route added in v1.0.4

type Route struct {
	IPAddress        string
	GatewayIPAddress string
	InterfaceToUse   string
}

Route describes an entry in routing table.

type Service

type Service struct {
	*common.Service
	EndpointType string
	Listener     *acn.Listener
}

Service defines Container Networking Service.

func NewService

func NewService(name, version string, store store.KeyValueStore) (*Service, error)

NewService creates a new Service object.

func (*Service) Initialize

func (service *Service) Initialize(config *common.ServiceConfig) error

Initialize initializes the service and starts the listener.

func (*Service) ParseOptions

func (service *Service) ParseOptions(options OptionMap) OptionMap

ParseOptions returns generic options from a libnetwork request.

func (*Service) SendErrorResponse

func (service *Service) SendErrorResponse(w http.ResponseWriter, errMsg error)

SendErrorResponse sends and logs an error response.

func (*Service) Uninitialize

func (service *Service) Uninitialize()

Uninitialize cleans up the plugin.

type SetEnvironmentRequest

type SetEnvironmentRequest struct {
	Location    string
	NetworkType string
}

SetEnvironmentRequest describes the Request to set the environment in CNS.

type SetOrchestratorTypeRequest added in v1.0.8

type SetOrchestratorTypeRequest struct {
	OrchestratorType string
	DncPartitionKey  string
}

SetOrchestratorTypeRequest specifies the orchestrator type for the node.

type Subnet

type Subnet struct {
	IPAddress    string
	PrefixLength int
}

Subnet contains the ip address and the number of bits in prefix.

type SubnetInfo added in v1.0.19

type SubnetInfo struct {
	AddressPrefix  string
	GatewayAddress string
	Policies       []json.RawMessage `json:",omitempty"`
}

SubnetInfo is assoicated with HNS network and represents a list of subnets available to the network

Jump to

Keyboard shortcuts

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