Documentation
¶
Index ¶
- Constants
- type AttachContainerToNetworkResponse
- type ConfigureContainerNetworkingRequest
- type CreateHnsNetworkRequest
- type CreateHostNCApipaEndpointRequest
- type CreateHostNCApipaEndpointResponse
- type CreateNetworkContainerRequest
- type CreateNetworkContainerResponse
- type CreateNetworkRequest
- type DeleteHnsNetworkRequest
- type DeleteHostNCApipaEndpointRequest
- type DeleteHostNCApipaEndpointResponse
- type DeleteNetworkContainerRequest
- type DeleteNetworkContainerResponse
- type DeleteNetworkRequest
- type DetachContainerFromNetworkResponse
- type GetIPAddressesResponse
- type GetInterfaceForContainerRequest
- type GetInterfaceForContainerResponse
- type GetNetworkContainerRequest
- type GetNetworkContainerResponse
- type GetNetworkContainerStatusRequest
- type GetNetworkContainerStatusResponse
- type HostLocalIPAddressResponse
- type IPAddressesUtilizationResponse
- type IPConfiguration
- type IPSubnet
- type KubernetesPodInfo
- type MacPool
- type MultiTenancyInfo
- type NetworkContainerRequestPolicies
- type NetworkInterface
- type NodeConfiguration
- type NumOfCPUCoresResponse
- type OptionMap
- type OverlayConfiguration
- type PublishNetworkContainerRequest
- type PublishNetworkContainerResponse
- type ReleaseIPAddressRequest
- type ReserveIPAddressRequest
- type ReserveIPAddressResponse
- type Response
- type Route
- type Service
- type SetEnvironmentRequest
- type SetOrchestratorTypeRequest
- type Subnet
- type SubnetInfo
- type UnpublishNetworkContainerRequest
- type UnpublishNetworkContainerResponse
- type ValidAclPolicySetting
Constants ¶
const ( SetOrchestratorType = "/network/setorchestratortype" CreateOrUpdateNetworkContainer = "/network/createorupdatenetworkcontainer" DeleteNetworkContainer = "/network/deletenetworkcontainer" GetNetworkContainerStatus = "/network/getnetworkcontainerstatus" PublishNetworkContainer = "/network/publishnetworkcontainer" UnpublishNetworkContainer = "/network/unpublishnetworkcontainer" GetInterfaceForContainer = "/network/getinterfaceforcontainer" GetNetworkContainerByOrchestratorContext = "/network/getnetworkcontainerbyorchestratorcontext" AttachContainerToNetwork = "/network/attachcontainertonetwork" DetachContainerFromNetwork = "/network/detachcontainerfromnetwork" )
Container Network Service DNC Contract
const ( AzureContainerInstance = "AzureContainerInstance" WebApps = "WebApps" Docker = "Docker" Basic = "Basic" JobObject = "JobObject" COW = "COW" // Container on Windows )
NetworkContainer Types
const ( Kubernetes = "Kubernetes" ServiceFabric = "ServiceFabric" Batch = "Batch" DBforPostgreSQL = "DBforPostgreSQL" AzureFirstParty = "AzureFirstParty" )
Orchestrator Types
const ( Vlan = "Vlan" Vxlan = "Vxlan" )
Encap Types
const ( ActionTypeAllow string = "Allow" ActionTypeBlock string = "Block" DirectionTypeIn string = "In" DirectionTypeOut string = "Out" )
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" NumberOfCPUCoresPath = "/hostcpucores" CreateHostNCApipaEndpointPath = "/network/createhostncapipaendpoint" DeleteHostNCApipaEndpointPath = "/network/deletehostncapipaendpoint" V1Prefix = "/v0.1" V2Prefix = "/v0.2" )
Container Network Service remote API Contract
const (
SwiftPrefix = "Swift_"
)
NetworkContainer Prefixes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachContainerToNetworkResponse ¶
type AttachContainerToNetworkResponse struct {
Response Response
}
AttachContainerToNetworkResponse specifies response of attaching network container to network.
type ConfigureContainerNetworkingRequest ¶
ConfigureContainerNetworkingRequest - specifies request to attach/detach container to network.
type CreateHnsNetworkRequest ¶
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 CreateHostNCApipaEndpointRequest ¶
type CreateHostNCApipaEndpointRequest struct {
NetworkContainerID string
}
CreateHostNCApipaEndpointRequest describes request for create apipa endpoint for host container connectivity for the given network container
type CreateHostNCApipaEndpointResponse ¶
CreateHostNCApipaEndpointResponse describes response for create apipa endpoint request for host container connectivity.
type CreateNetworkContainerRequest ¶
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
AllowHostToNCCommunication bool
AllowNCToHostCommunication bool
EndpointPolicies []NetworkContainerRequestPolicies
}
CreateNetworkContainerRequest specifies request to create a network container or network isolation boundary.
type CreateNetworkContainerResponse ¶
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 ¶
type DeleteHnsNetworkRequest struct {
NetworkName string
}
DeleteHnsNetworkRequest describes request to delete the HNS network.
type DeleteHostNCApipaEndpointRequest ¶
type DeleteHostNCApipaEndpointRequest struct {
NetworkContainerID string
}
DeleteHostNCApipaEndpointRequest describes request for deleting apipa endpoint created for host NC connectivity.
type DeleteHostNCApipaEndpointResponse ¶
type DeleteHostNCApipaEndpointResponse struct {
Response Response
}
DeleteHostNCApipaEndpointResponse describes response for delete host NC apipa endpoint request.
type DeleteNetworkContainerRequest ¶
type DeleteNetworkContainerRequest struct {
NetworkContainerid string
}
DeleteNetworkContainerRequest specifies the details about the request to delete a specifc network container.
type DeleteNetworkContainerResponse ¶
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 ¶
type DetachContainerFromNetworkResponse struct {
Response Response
}
DetachContainerFromNetworkResponse specifies response of detaching network container from network.
type GetIPAddressesResponse ¶
GetIPAddressesResponse describes response containing requested ip addresses.
type GetInterfaceForContainerRequest ¶
type GetInterfaceForContainerRequest struct {
NetworkContainerID string
}
GetInterfaceForContainerRequest specifies the container ID for which interface needs to be identified.
type GetInterfaceForContainerResponse ¶
type GetInterfaceForContainerResponse struct {
NetworkContainerVersion string
NetworkInterface NetworkInterface
CnetAddressSpace []IPSubnet
DNSServers []string
Response Response
}
GetInterfaceForContainerResponse specifies the interface for a given container ID.
type GetNetworkContainerRequest ¶
type GetNetworkContainerRequest struct {
NetworkContainerid string
OrchestratorContext json.RawMessage
}
GetNetworkContainerRequest specifies the details about the request to retrieve a specifc network container.
type GetNetworkContainerResponse ¶
type GetNetworkContainerResponse struct {
NetworkContainerID string
IPConfiguration IPConfiguration
Routes []Route
CnetAddressSpace []IPSubnet
MultiTenancyInfo MultiTenancyInfo
PrimaryInterfaceIdentifier string
LocalIPConfiguration IPConfiguration
Response Response
AllowHostToNCCommunication bool
AllowNCToHostCommunication bool
}
GetNetworkContainerResponse describes the response to retrieve a specifc network container.
type GetNetworkContainerStatusRequest ¶
type GetNetworkContainerStatusRequest struct {
NetworkContainerid string
}
GetNetworkContainerStatusRequest specifies the details about the request to retrieve status of a specifc network container.
type GetNetworkContainerStatusResponse ¶
type GetNetworkContainerStatusResponse struct {
NetworkContainerid string
Version string
AzureHostVersion string
Response Response
}
GetNetworkContainerStatusResponse specifies response of retriving a network container status.
type HostLocalIPAddressResponse ¶
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 ¶
IPConfiguration contains details about ip config to provision in the VM.
type KubernetesPodInfo ¶
KubernetesPodInfo is an OrchestratorContext that holds PodName and PodNamespace.
type MacPool ¶
MacPool is assoicated with HNS network and represents a list of macaddresses available to the network
type MultiTenancyInfo ¶
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 NetworkContainerRequestPolicies ¶
type NetworkContainerRequestPolicies struct {
Type string
EndpointType string
Settings json.RawMessage
}
NetworkContainerRequestPolicies - specifies policies associated with create network request
func (*NetworkContainerRequestPolicies) Validate ¶
func (networkContainerRequestPolicy *NetworkContainerRequestPolicies) Validate() error
Validate - Validates network container request policies
type NetworkInterface ¶
NetworkInterface specifies the information that can be used to unquely identify an interface.
type NodeConfiguration ¶
NodeConfiguration describes confguration for a node in overlay network.
type NumOfCPUCoresResponse ¶
NumOfCPUCoresResponse describes num of cpu cores present on host.
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 PublishNetworkContainerRequest ¶
type PublishNetworkContainerRequest struct {
NetworkID string
NetworkContainerID string
JoinNetworkURL string
CreateNetworkContainerURL string
CreateNetworkContainerRequestBody []byte
}
PublishNetworkContainerRequest specifies request to publish network container via NMAgent.
type PublishNetworkContainerResponse ¶
type PublishNetworkContainerResponse struct {
Response Response
PublishErrorStr string
PublishStatusCode int
PublishResponseBody []byte
}
PublishNetworkContainerResponse specifies the response to publish network container request.
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 ¶
ReserveIPAddressResponse describes response to reserve an IP address.
type Service ¶
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 ¶
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 ¶
SetEnvironmentRequest describes the Request to set the environment in CNS.
type SetOrchestratorTypeRequest ¶
type SetOrchestratorTypeRequest struct {
OrchestratorType string
DncPartitionKey string
NodeID string
}
SetOrchestratorTypeRequest specifies the orchestrator type for the node.
type SubnetInfo ¶
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
type UnpublishNetworkContainerRequest ¶
type UnpublishNetworkContainerRequest struct {
NetworkID string
NetworkContainerID string
JoinNetworkURL string
DeleteNetworkContainerURL string
}
UnpublishNetworkContainerRequest specifies request to unpublish network container via NMAgent.
type UnpublishNetworkContainerResponse ¶
type UnpublishNetworkContainerResponse struct {
Response Response
UnpublishErrorStr string
UnpublishStatusCode int
UnpublishResponseBody []byte
}
UnpublishNetworkContainerResponse specifies the response to unpublish network container request.
type ValidAclPolicySetting ¶
type ValidAclPolicySetting struct {
Protocols string `json:","`
Action string `json:","`
Direction string `json:","`
LocalAddresses string `json:","`
RemoteAddresses string `json:","`
LocalPorts string `json:","`
RemotePorts string `json:","`
RuleType string `json:","`
Priority uint16 `json:","`
}
ValidAclPolicySetting - Used to validate ACL policy