Documentation ¶
Overview ¶
Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS).
Index ¶
- Constants
- Variables
- func AccelnetSupported() error
- func AclSupportForProtocol252Supported() error
- func AddNamespaceEndpoint(namespaceID string, endpointID string) error
- func CheckErrorWithCode(err error, code ErrorCode) bool
- func DSRSupported() error
- func DisableHostPortSupported() error
- func GetNamespaceContainerIds(namespaceID string) ([]string, error)
- func GetNamespaceEndpointIds(namespaceID string) ([]string, error)
- func HostRouteSupported() error
- func IPv6DualStackSupported() error
- func IsElementNotFoundError(err error) bool
- func IsNotFoundError(err error) bool
- func IsNotImplemented(err error) bool
- func IsPortAlreadyExistsError(err error) bool
- func L4WfpProxyPolicySupported() error
- func L4proxyPolicySupported() error
- func ModifyEndpointSettings(endpointID string, request *ModifyEndpointSettingRequest) error
- func ModifyLoadbalancerSupported() error
- func ModifyNamespaceSettings(namespaceID string, request *ModifyNamespaceSettingRequest) error
- func NestedIpSetSupported() error
- func NetworkACLPolicySupported() error
- func RemoteSubnetSupported() error
- func RemoveNamespaceEndpoint(namespaceID string, endpointID string) error
- func SessionAffinitySupported() error
- func SetCurrentThreadCompartmentId(compartmentId uint32) (hr error)
- func SetPolicySupported() error
- func Slash32EndpointPrefixesSupported() error
- func TierAclPolicySupported() error
- func V2ApiSupported() error
- func VxlanPortSupported() error
- type AclFeatures
- type AclPolicySetting
- type ActionType
- type ApiSupport
- type AutomaticDNSNetworkPolicySetting
- type DirectionType
- type Dns
- type DrMacAddressNetworkPolicySetting
- type EncapOverheadEndpointPolicySetting
- type EndpointFlags
- type EndpointNotFoundError
- type EndpointPolicy
- type EndpointPolicyType
- type EndpointResourceType
- type ErrorCode
- type ExtraParams
- type FiveTuple
- type Globals
- type HcnError
- type Health
- type HostComputeEndpoint
- func GetEndpointByID(endpointID string) (*HostComputeEndpoint, error)
- func GetEndpointByName(endpointName string) (*HostComputeEndpoint, error)
- func ListEndpoints() ([]HostComputeEndpoint, error)
- func ListEndpointsOfNetwork(networkID string) ([]HostComputeEndpoint, error)
- func ListEndpointsQuery(query HostComputeQuery) ([]HostComputeEndpoint, error)
- func (endpoint *HostComputeEndpoint) ApplyPolicy(requestType RequestType, endpointPolicy PolicyEndpointRequest) error
- func (endpoint *HostComputeEndpoint) Create() (*HostComputeEndpoint, error)
- func (endpoint *HostComputeEndpoint) Delete() error
- func (endpoint *HostComputeEndpoint) NamespaceAttach(namespaceID string) error
- func (endpoint *HostComputeEndpoint) NamespaceDetach(namespaceID string) error
- type HostComputeLoadBalancer
- func AddLoadBalancer(endpoints []HostComputeEndpoint, flags LoadBalancerFlags, ...) (*HostComputeLoadBalancer, error)
- func GetLoadBalancerByID(loadBalancerID string) (*HostComputeLoadBalancer, error)
- func ListLoadBalancers() ([]HostComputeLoadBalancer, error)
- func ListLoadBalancersQuery(query HostComputeQuery) ([]HostComputeLoadBalancer, error)
- func (loadBalancer *HostComputeLoadBalancer) AddEndpoint(endpoint *HostComputeEndpoint) (*HostComputeLoadBalancer, error)
- func (loadBalancer *HostComputeLoadBalancer) Create() (*HostComputeLoadBalancer, error)
- func (loadBalancer *HostComputeLoadBalancer) Delete() error
- func (loadBalancer *HostComputeLoadBalancer) RemoveEndpoint(endpoint *HostComputeEndpoint) (*HostComputeLoadBalancer, error)
- func (loadBalancer *HostComputeLoadBalancer) Update(hnsLoadbalancerID string) (*HostComputeLoadBalancer, error)
- type HostComputeNamespace
- type HostComputeNetwork
- func (network *HostComputeNetwork) AddPolicy(networkPolicy PolicyNetworkRequest) error
- func (network *HostComputeNetwork) Create() (*HostComputeNetwork, error)
- func (network *HostComputeNetwork) CreateEndpoint(endpoint *HostComputeEndpoint) (*HostComputeEndpoint, error)
- func (network *HostComputeNetwork) CreateRemoteEndpoint(endpoint *HostComputeEndpoint) (*HostComputeEndpoint, error)
- func (network *HostComputeNetwork) Delete() error
- func (network *HostComputeNetwork) ModifyNetworkSettings(request *ModifyNetworkSettingRequest) error
- func (network *HostComputeNetwork) RemovePolicy(networkPolicy PolicyNetworkRequest) error
- type HostComputeQuery
- type HostComputeQueryFlags
- type HostComputeRoute
- func AddRoute(endpoints []HostComputeEndpoint, destinationPrefix string, nextHop string, ...) (*HostComputeRoute, error)
- func GetRouteByID(routeID string) (*HostComputeRoute, error)
- func ListRoutes() ([]HostComputeRoute, error)
- func ListRoutesQuery(query HostComputeQuery) ([]HostComputeRoute, error)
- func (route *HostComputeRoute) AddEndpoint(endpoint *HostComputeEndpoint) (*HostComputeRoute, error)
- func (route *HostComputeRoute) Create() (*HostComputeRoute, error)
- func (route *HostComputeRoute) Delete() error
- func (route *HostComputeRoute) RemoveEndpoint(endpoint *HostComputeEndpoint) (*HostComputeRoute, error)
- type InterfaceConstraintPolicySetting
- type IovPolicySetting
- type IpConfig
- type Ipam
- type L4ProxyPolicySetting
- type L4WfpProxyPolicySetting
- type LayerConstraintNetworkPolicySetting
- type LoadBalancerDistribution
- type LoadBalancerFlags
- type LoadBalancerNotFoundError
- type LoadBalancerPortMapping
- type LoadBalancerPortMappingFlags
- type MacPool
- type MacRange
- type ModifyEndpointSettingRequest
- type ModifyNamespaceSettingRequest
- type ModifyNetworkSettingRequest
- type NamespaceNotFoundError
- type NamespaceResource
- type NamespaceResourceContainer
- type NamespaceResourceEndpoint
- type NamespaceResourceType
- type NamespaceType
- type NatFlags
- type NetAdapterNameNetworkPolicySetting
- type NetworkACLPolicySetting
- type NetworkFlags
- type NetworkNotFoundError
- type NetworkPolicy
- type NetworkPolicyType
- type NetworkResourceType
- type NetworkType
- type OutboundNatPolicySetting
- type PolicyEndpointRequest
- type PolicyNetworkRequest
- type PortMappingPolicySetting
- type PortnameEndpointPolicySetting
- type ProtocolType
- type ProviderAddressEndpointPolicySetting
- type ProxyExceptions
- type QosPolicySetting
- type RemoteSubnetRoutePolicySetting
- type RequestType
- type Route
- type RouteNotFoundError
- type RuleType
- type SDNRoutePolicySetting
- type SchemaVersion
- type SetPolicySetting
- type SetPolicyType
- type SourceMacAddressNetworkPolicySetting
- type Subnet
- type SubnetPolicy
- type SubnetPolicyType
- type SupportedFeatures
- type TierAclPolicySetting
- type TierAclRule
- type VSwitchExtensionNetworkPolicySetting
- type Version
- type VersionRange
- type VersionRanges
- type VlanPolicySetting
- type VmEndpointRequest
- type VsidPolicySetting
- type VxlanPortPolicySetting
Constants ¶
const ( // Allow traffic ActionTypeAllow ActionType = "Allow" // Block traffic ActionTypeBlock ActionType = "Block" // Pass traffic ActionTypePass ActionType = "Pass" // In is traffic coming to the Endpoint DirectionTypeIn DirectionType = "In" // Out is traffic leaving the Endpoint DirectionTypeOut DirectionType = "Out" // Host creates WFP (Windows Firewall) rules RuleTypeHost RuleType = "Host" // Switch creates VFP (Virtual Filter Platform) rules RuleTypeSwitch RuleType = "Switch" )
Variables ¶
var ( // HNSVersion1803 added ACL functionality. HNSVersion1803 = VersionRanges{VersionRange{MinVersion: Version{Major: 7, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // V2ApiSupport allows the use of V2 Api calls and V2 Schema. V2ApiSupport = VersionRanges{VersionRange{MinVersion: Version{Major: 9, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // Remote Subnet allows for Remote Subnet policies on Overlay networks RemoteSubnetVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 9, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // A Host Route policy allows for local container to local host communication Overlay networks HostRouteVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 9, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // HNS 9.3 through 10.0 (not included), and 10.2+ allows for Direct Server Return for loadbalancing DSRVersion = VersionRanges{ VersionRange{MinVersion: Version{Major: 9, Minor: 3}, MaxVersion: Version{Major: 9, Minor: math.MaxInt32}}, VersionRange{MinVersion: Version{Major: 10, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}, } // HNS 9.3 through 10.0 (not included) and, 10.4+ provide support for configuring endpoints with /32 prefixes Slash32EndpointPrefixesVersion = VersionRanges{ VersionRange{MinVersion: Version{Major: 9, Minor: 3}, MaxVersion: Version{Major: 9, Minor: math.MaxInt32}}, VersionRange{MinVersion: Version{Major: 10, Minor: 4}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}, } // HNS 9.3 through 10.0 (not included) and, 10.4+ allow for HNS ACL Policies to support protocol 252 for VXLAN AclSupportForProtocol252Version = VersionRanges{ VersionRange{MinVersion: Version{Major: 11, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}, } // HNS 12.0 allows for session affinity for loadbalancing SessionAffinityVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 12, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // HNS 11.10+ supports Ipv6 dual stack. IPv6DualStackVersion = VersionRanges{ VersionRange{MinVersion: Version{Major: 11, Minor: 10}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}, } // HNS 13.0 allows for Set Policy support SetPolicyVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 13, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // HNS 10.3 allows for VXLAN ports VxlanPortVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 10, Minor: 3}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} //HNS 9.5 through 10.0(not included), 10.5 through 11.0(not included), 11.11 through 12.0(not included), 12.1 through 13.0(not included), 13.1+ allows for Network L4Proxy Policy support L4ProxyPolicyVersion = VersionRanges{ VersionRange{MinVersion: Version{Major: 9, Minor: 5}, MaxVersion: Version{Major: 9, Minor: math.MaxInt32}}, VersionRange{MinVersion: Version{Major: 10, Minor: 5}, MaxVersion: Version{Major: 10, Minor: math.MaxInt32}}, VersionRange{MinVersion: Version{Major: 11, Minor: 11}, MaxVersion: Version{Major: 11, Minor: math.MaxInt32}}, VersionRange{MinVersion: Version{Major: 12, Minor: 1}, MaxVersion: Version{Major: 12, Minor: math.MaxInt32}}, VersionRange{MinVersion: Version{Major: 13, Minor: 1}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}, } //HNS 13.2 allows for L4WfpProxy Policy support L4WfpProxyPolicyVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 13, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} //HNS 14.0 allows for TierAcl Policy support TierAclPolicyVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 14, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} //HNS 15.0 allows for NetworkACL Policy support NetworkACLPolicyVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 15, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} //HNS 15.0 allows for NestedIpSet support NestedIpSetVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 15, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} //HNS 15.1 allows support for DisableHostPort flag. DisableHostPortVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 15, Minor: 1}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // HNS 15.4 allows for Modify Loadbalancer support ModifyLoadbalancerVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 15, Minor: 4}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} // HNS 15.4 allows for Accelnet support AccelnetVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 15, Minor: 4}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}} )
Functions ¶
func AccelnetSupported ¶ added in v0.12.5
func AccelnetSupported() error
AccelnetSupported returns an error if the HCN version does not support Accelnet Feature.
func AclSupportForProtocol252Supported ¶ added in v0.8.7
func AclSupportForProtocol252Supported() error
AclSupportForProtocol252Supported returns an error if the HCN version does not support HNS ACL Policies to support protocol 252 for VXLAN.
func AddNamespaceEndpoint ¶
AddNamespaceEndpoint adds an endpoint to a Namespace.
func CheckErrorWithCode ¶ added in v0.8.8
func DSRSupported ¶ added in v0.8.4
func DSRSupported() error
DSRSupported returns an error if the HCN version does not support Direct Server Return.
func DisableHostPortSupported ¶ added in v0.12.0
func DisableHostPortSupported() error
DisableHostPortSupported returns an error if the HCN version does not support DisableHostPort flag
func GetNamespaceContainerIds ¶
GetNamespaceContainerIds returns the containers of the Namespace specified by Id.
func GetNamespaceEndpointIds ¶
GetNamespaceEndpointIds returns the endpoints of the Namespace specified by Id.
func HostRouteSupported ¶ added in v0.8.4
func HostRouteSupported() error
HostRouteSupported returns an error if the HCN version does not support Host Route policies.
func IPv6DualStackSupported ¶ added in v0.8.9
func IPv6DualStackSupported() error
IPv6DualStackSupported returns an error if the HCN version does not support IPv6DualStack.
func IsElementNotFoundError ¶ added in v0.8.8
func IsNotFoundError ¶ added in v0.7.5
IsNotFoundError returns a boolean indicating whether the error was caused by a resource not being found.
func IsNotImplemented ¶ added in v0.8.26
func IsPortAlreadyExistsError ¶ added in v0.8.8
func L4WfpProxyPolicySupported ¶ added in v0.8.10
func L4WfpProxyPolicySupported() error
L4WfpProxySupported returns an error if the HCN version does not support L4WfpProxy
func L4proxyPolicySupported ¶ added in v0.8.10
func L4proxyPolicySupported() error
L4proxySupported returns an error if the HCN version does not support L4Proxy
func ModifyEndpointSettings ¶
func ModifyEndpointSettings(endpointID string, request *ModifyEndpointSettingRequest) error
ModifyEndpointSettings updates the Port/Policy of an Endpoint.
func ModifyLoadbalancerSupported ¶ added in v0.8.26
func ModifyLoadbalancerSupported() error
ModifyLoadbalancerSupported returns an error if the HCN version does not support ModifyLoadbalancer.
func ModifyNamespaceSettings ¶
func ModifyNamespaceSettings(namespaceID string, request *ModifyNamespaceSettingRequest) error
ModifyNamespaceSettings updates the Endpoints/Containers of a Namespace.
func NestedIpSetSupported ¶ added in v0.9.0
func NestedIpSetSupported() error
NestedIpSetSupported returns an error if the HCN version does not support NestedIpSet
func NetworkACLPolicySupported ¶ added in v0.9.0
func NetworkACLPolicySupported() error
NetworkACLPolicySupported returns an error if the HCN version does not support NetworkACLPolicy
func RemoteSubnetSupported ¶ added in v0.8.4
func RemoteSubnetSupported() error
RemoteSubnetSupported returns an error if the HCN version does not support Remote Subnet policies.
func RemoveNamespaceEndpoint ¶
RemoveNamespaceEndpoint removes an endpoint from a Namespace.
func SessionAffinitySupported ¶ added in v0.8.7
func SessionAffinitySupported() error
SessionAffinitySupported returns an error if the HCN version does not support Session Affinity.
func SetPolicySupported ¶ added in v0.8.10
func SetPolicySupported() error
SetPolicySupported returns an error if the HCN version does not support SetPolicy.
func Slash32EndpointPrefixesSupported ¶ added in v0.8.7
func Slash32EndpointPrefixesSupported() error
Slash32EndpointPrefixesSupported returns an error if the HCN version does not support configuring endpoints with /32 prefixes.
func TierAclPolicySupported ¶ added in v0.8.17
func TierAclPolicySupported() error
TierAclPolicySupported returns an error if the HCN version does not support configuring the TierAcl.
func V2ApiSupported ¶
func V2ApiSupported() error
V2ApiSupported returns an error if the HCN version does not support the V2 Apis.
func VxlanPortSupported ¶ added in v0.8.10
func VxlanPortSupported() error
VxlanPortSupported returns an error if the HCN version does not support configuring the VXLAN TCP port.
Types ¶
type AclFeatures ¶
type AclFeatures struct { AclAddressLists bool `json:"AclAddressLists"` AclNoHostRulePriority bool `json:"AclHostRulePriority"` AclPortRanges bool `json:"AclPortRanges"` AclRuleId bool `json:"AclRuleId"` }
AclFeatures are the supported ACL possibilities.
type AclPolicySetting ¶
type AclPolicySetting struct { Protocols string `json:",omitempty"` // EX: 6 (TCP), 17 (UDP), 1 (ICMPv4), 58 (ICMPv6), 2 (IGMP) Action ActionType `json:","` Direction DirectionType `json:","` LocalAddresses string `json:",omitempty"` RemoteAddresses string `json:",omitempty"` LocalPorts string `json:",omitempty"` RemotePorts string `json:",omitempty"` RuleType RuleType `json:",omitempty"` Priority uint16 `json:",omitempty"` }
AclPolicySetting creates firewall rules on an endpoint
type ActionType ¶
type ActionType string
ActionType associated with ACLs. Value is either Allow or Block.
type ApiSupport ¶
ApiSupport lists the supported API versions.
type AutomaticDNSNetworkPolicySetting ¶
type AutomaticDNSNetworkPolicySetting struct {
Enable bool `json:",omitempty"`
}
AutomaticDNSNetworkPolicySetting enables/disables automatic DNS on a network.
type DirectionType ¶
type DirectionType string
DirectionType associated with ACLs. Value is either In or Out.
type Dns ¶
type Dns struct { Domain string `json:",omitempty"` Search []string `json:",omitempty"` ServerList []string `json:",omitempty"` Options []string `json:",omitempty"` }
Dns (Domain Name System is associated with a network).
type DrMacAddressNetworkPolicySetting ¶
type DrMacAddressNetworkPolicySetting struct {
Address string `json:",omitempty"`
}
DrMacAddressNetworkPolicySetting sets the DR MAC for a network.
type EncapOverheadEndpointPolicySetting ¶
type EncapOverheadEndpointPolicySetting struct {
Overhead uint16 `json:",omitempty"`
}
EncapOverheadEndpointPolicySetting sets the encap overhead for an endpoint.
type EndpointFlags ¶
type EndpointFlags uint32
EndpointFlags are special settings on an endpoint.
var ( // EndpointFlagsNone is the default. EndpointFlagsNone EndpointFlags // EndpointFlagsRemoteEndpoint means that an endpoint is on another host. EndpointFlagsRemoteEndpoint EndpointFlags = 1 )
type EndpointNotFoundError ¶ added in v0.7.5
EndpointNotFoundError results from a failed search for an endpoint by Id or Name
func (EndpointNotFoundError) Error ¶ added in v0.7.5
func (e EndpointNotFoundError) Error() string
type EndpointPolicy ¶
type EndpointPolicy struct { Type EndpointPolicyType `json:""` Settings json.RawMessage `json:",omitempty"` }
EndpointPolicy is a collection of Policy settings for an Endpoint.
type EndpointPolicyType ¶
type EndpointPolicyType string
EndpointPolicyType are the potential Policies that apply to Endpoints.
const ( PortMapping EndpointPolicyType = "PortMapping" ACL EndpointPolicyType = "ACL" QOS EndpointPolicyType = "QOS" L2Driver EndpointPolicyType = "L2Driver" OutBoundNAT EndpointPolicyType = "OutBoundNAT" SDNRoute EndpointPolicyType = "SDNRoute" L4Proxy EndpointPolicyType = "L4Proxy" L4WFPPROXY EndpointPolicyType = "L4WFPPROXY" PortName EndpointPolicyType = "PortName" EncapOverhead EndpointPolicyType = "EncapOverhead" IOV EndpointPolicyType = "Iov" // Endpoint and Network have InterfaceConstraint and ProviderAddress NetworkProviderAddress EndpointPolicyType = "ProviderAddress" NetworkInterfaceConstraint EndpointPolicyType = "InterfaceConstraint" TierAcl EndpointPolicyType = "TierAcl" )
EndpointPolicyType const
type EndpointResourceType ¶
type EndpointResourceType string
EndpointResourceType are the two different Endpoint settings resources.
var ( // EndpointResourceTypePolicy is for Endpoint Policies. Ex: ACL, NAT EndpointResourceTypePolicy EndpointResourceType = "Policy" // EndpointResourceTypePort is for Endpoint Port settings. EndpointResourceTypePort EndpointResourceType = "Port" )
type ExtraParams ¶ added in v0.8.16
type FiveTuple ¶ added in v0.8.7
type FiveTuple struct { Protocols string `json:",omitempty"` LocalAddresses string `json:",omitempty"` RemoteAddresses string `json:",omitempty"` LocalPorts string `json:",omitempty"` RemotePorts string `json:",omitempty"` Priority uint16 `json:",omitempty"` }
FiveTuple is nested in L4ProxyPolicySetting for WFP support.
type Globals ¶
type Globals struct {
Version Version `json:"Version"`
}
Globals are all global properties of the HCN Service.
func GetGlobals ¶
GetGlobals returns the global properties of the HCN Service.
type Health ¶ added in v0.8.16
type Health struct { Data interface{} `json:",omitempty"` Extra ExtraParams `json:",omitempty"` }
type HostComputeEndpoint ¶
type HostComputeEndpoint struct { Id string `json:"ID,omitempty"` Name string `json:",omitempty"` HostComputeNetwork string `json:",omitempty"` // GUID HostComputeNamespace string `json:",omitempty"` // GUID Policies []EndpointPolicy `json:",omitempty"` IpConfigurations []IpConfig `json:",omitempty"` Dns Dns `json:",omitempty"` Routes []Route `json:",omitempty"` MacAddress string `json:",omitempty"` Flags EndpointFlags `json:",omitempty"` Health Health `json:",omitempty"` SchemaVersion SchemaVersion `json:",omitempty"` }
HostComputeEndpoint represents a network endpoint
func GetEndpointByID ¶
func GetEndpointByID(endpointID string) (*HostComputeEndpoint, error)
GetEndpointByID returns an endpoint specified by Id
func GetEndpointByName ¶
func GetEndpointByName(endpointName string) (*HostComputeEndpoint, error)
GetEndpointByName returns an endpoint specified by Name
func ListEndpoints ¶
func ListEndpoints() ([]HostComputeEndpoint, error)
ListEndpoints makes a call to list all available endpoints.
func ListEndpointsOfNetwork ¶
func ListEndpointsOfNetwork(networkID string) ([]HostComputeEndpoint, error)
ListEndpointsOfNetwork queries the list of endpoints on a network.
func ListEndpointsQuery ¶
func ListEndpointsQuery(query HostComputeQuery) ([]HostComputeEndpoint, error)
ListEndpointsQuery makes a call to query the list of available endpoints.
func (*HostComputeEndpoint) ApplyPolicy ¶
func (endpoint *HostComputeEndpoint) ApplyPolicy(requestType RequestType, endpointPolicy PolicyEndpointRequest) error
ApplyPolicy applies a Policy (ex: ACL) on the Endpoint.
func (*HostComputeEndpoint) Create ¶
func (endpoint *HostComputeEndpoint) Create() (*HostComputeEndpoint, error)
Create Endpoint.
func (*HostComputeEndpoint) Delete ¶
func (endpoint *HostComputeEndpoint) Delete() error
Delete Endpoint.
func (*HostComputeEndpoint) NamespaceAttach ¶
func (endpoint *HostComputeEndpoint) NamespaceAttach(namespaceID string) error
NamespaceAttach modifies a Namespace to add an endpoint.
func (*HostComputeEndpoint) NamespaceDetach ¶
func (endpoint *HostComputeEndpoint) NamespaceDetach(namespaceID string) error
NamespaceDetach modifies a Namespace to remove an endpoint.
type HostComputeLoadBalancer ¶
type HostComputeLoadBalancer struct { Id string `json:"ID,omitempty"` HostComputeEndpoints []string `json:",omitempty"` SourceVIP string `json:",omitempty"` FrontendVIPs []string `json:",omitempty"` PortMappings []LoadBalancerPortMapping `json:",omitempty"` SchemaVersion SchemaVersion `json:",omitempty"` Flags LoadBalancerFlags `json:",omitempty"` // 0: None, 1: EnableDirectServerReturn }
HostComputeLoadBalancer represents software load balancer.
func AddLoadBalancer ¶
func AddLoadBalancer(endpoints []HostComputeEndpoint, flags LoadBalancerFlags, portMappingFlags LoadBalancerPortMappingFlags, sourceVIP string, frontendVIPs []string, protocol uint16, internalPort uint16, externalPort uint16) (*HostComputeLoadBalancer, error)
AddLoadBalancer for the specified endpoints
func GetLoadBalancerByID ¶
func GetLoadBalancerByID(loadBalancerID string) (*HostComputeLoadBalancer, error)
GetLoadBalancerByID returns the LoadBalancer specified by Id.
func ListLoadBalancers ¶
func ListLoadBalancers() ([]HostComputeLoadBalancer, error)
ListLoadBalancers makes a call to list all available loadBalancers.
func ListLoadBalancersQuery ¶
func ListLoadBalancersQuery(query HostComputeQuery) ([]HostComputeLoadBalancer, error)
ListLoadBalancersQuery makes a call to query the list of available loadBalancers.
func (*HostComputeLoadBalancer) AddEndpoint ¶
func (loadBalancer *HostComputeLoadBalancer) AddEndpoint(endpoint *HostComputeEndpoint) (*HostComputeLoadBalancer, error)
AddEndpoint add an endpoint to a LoadBalancer
func (*HostComputeLoadBalancer) Create ¶
func (loadBalancer *HostComputeLoadBalancer) Create() (*HostComputeLoadBalancer, error)
Create LoadBalancer.
func (*HostComputeLoadBalancer) Delete ¶
func (loadBalancer *HostComputeLoadBalancer) Delete() error
Delete LoadBalancer.
func (*HostComputeLoadBalancer) RemoveEndpoint ¶
func (loadBalancer *HostComputeLoadBalancer) RemoveEndpoint(endpoint *HostComputeEndpoint) (*HostComputeLoadBalancer, error)
RemoveEndpoint removes an endpoint from a LoadBalancer
func (*HostComputeLoadBalancer) Update ¶ added in v0.8.26
func (loadBalancer *HostComputeLoadBalancer) Update(hnsLoadbalancerID string) (*HostComputeLoadBalancer, error)
Update Loadbalancer.
type HostComputeNamespace ¶
type HostComputeNamespace struct { Id string `json:"ID,omitempty"` NamespaceId uint32 `json:",omitempty"` Type NamespaceType `json:",omitempty"` // Host, HostDefault, Guest, GuestDefault Resources []NamespaceResource `json:",omitempty"` SchemaVersion SchemaVersion `json:",omitempty"` }
HostComputeNamespace represents a namespace (AKA compartment) in
func GetNamespaceByID ¶
func GetNamespaceByID(namespaceID string) (*HostComputeNamespace, error)
GetNamespaceByID returns the Namespace specified by Id.
func ListNamespaces ¶
func ListNamespaces() ([]HostComputeNamespace, error)
ListNamespaces makes a call to list all available namespaces.
func ListNamespacesQuery ¶
func ListNamespacesQuery(query HostComputeQuery) ([]HostComputeNamespace, error)
ListNamespacesQuery makes a call to query the list of available namespaces.
func NewNamespace ¶ added in v0.7.7
func NewNamespace(nsType NamespaceType) *HostComputeNamespace
NewNamespace creates a new Namespace object
func (*HostComputeNamespace) Create ¶
func (namespace *HostComputeNamespace) Create() (*HostComputeNamespace, error)
Create Namespace.
func (*HostComputeNamespace) Delete ¶
func (namespace *HostComputeNamespace) Delete() error
Delete Namespace.
func (*HostComputeNamespace) Sync ¶ added in v0.7.7
func (namespace *HostComputeNamespace) Sync() error
Sync Namespace endpoints with the appropriate sandbox container holding the network namespace open. If no sandbox container is found for this namespace this method is determined to be a success and will not return an error in this case. If the sandbox container is found and a sync is initiated any failures will be returned via this method.
This call initiates a sync between endpoints and the matching UtilityVM hosting those endpoints. It is safe to call for any `NamespaceType` but `NamespaceTypeGuest` is the only case when a sync will actually occur. For `NamespaceTypeHost` the process container will be automatically synchronized when the the endpoint is added via `AddNamespaceEndpoint`.
Note: This method sync's both additions and removals of endpoints from a `NamespaceTypeGuest` namespace.
type HostComputeNetwork ¶
type HostComputeNetwork struct { Id string `json:"ID,omitempty"` Name string `json:",omitempty"` Type NetworkType `json:",omitempty"` Policies []NetworkPolicy `json:",omitempty"` MacPool MacPool `json:",omitempty"` Dns Dns `json:",omitempty"` Ipams []Ipam `json:",omitempty"` Flags NetworkFlags `json:",omitempty"` // 0: None Health Health `json:",omitempty"` SchemaVersion SchemaVersion `json:",omitempty"` }
HostComputeNetwork represents a network
func GetNetworkByID ¶
func GetNetworkByID(networkID string) (*HostComputeNetwork, error)
GetNetworkByID returns the network specified by Id.
func GetNetworkByName ¶
func GetNetworkByName(networkName string) (*HostComputeNetwork, error)
GetNetworkByName returns the network specified by Name.
func ListNetworks ¶
func ListNetworks() ([]HostComputeNetwork, error)
ListNetworks makes a call to list all available networks.
func ListNetworksQuery ¶
func ListNetworksQuery(query HostComputeQuery) ([]HostComputeNetwork, error)
ListNetworksQuery makes a call to query the list of available networks.
func (*HostComputeNetwork) AddPolicy ¶ added in v0.7.13
func (network *HostComputeNetwork) AddPolicy(networkPolicy PolicyNetworkRequest) error
AddPolicy applies a Policy (ex: RemoteSubnet) on the Network.
func (*HostComputeNetwork) Create ¶
func (network *HostComputeNetwork) Create() (*HostComputeNetwork, error)
Create Network.
func (*HostComputeNetwork) CreateEndpoint ¶
func (network *HostComputeNetwork) CreateEndpoint(endpoint *HostComputeEndpoint) (*HostComputeEndpoint, error)
CreateEndpoint creates an endpoint on the Network.
func (*HostComputeNetwork) CreateRemoteEndpoint ¶
func (network *HostComputeNetwork) CreateRemoteEndpoint(endpoint *HostComputeEndpoint) (*HostComputeEndpoint, error)
CreateRemoteEndpoint creates a remote endpoint on the Network.
func (*HostComputeNetwork) Delete ¶
func (network *HostComputeNetwork) Delete() error
Delete Network.
func (*HostComputeNetwork) ModifyNetworkSettings ¶ added in v0.7.13
func (network *HostComputeNetwork) ModifyNetworkSettings(request *ModifyNetworkSettingRequest) error
ModifyNetworkSettings updates the Policy for a network.
func (*HostComputeNetwork) RemovePolicy ¶ added in v0.7.13
func (network *HostComputeNetwork) RemovePolicy(networkPolicy PolicyNetworkRequest) error
RemovePolicy removes a Policy (ex: RemoteSubnet) from the Network.
type HostComputeQuery ¶
type HostComputeQuery struct { SchemaVersion SchemaVersion `json:""` Flags HostComputeQueryFlags `json:",omitempty"` Filter string `json:",omitempty"` }
HostComputeQuery is the format for HCN queries.
type HostComputeQueryFlags ¶
type HostComputeQueryFlags uint32
HostComputeQueryFlags are passed in to a HostComputeQuery to determine which properties of an object are returned.
var ( // HostComputeQueryFlagsNone returns an object with the standard properties. HostComputeQueryFlagsNone HostComputeQueryFlags // HostComputeQueryFlagsDetailed returns an object with all properties. HostComputeQueryFlagsDetailed HostComputeQueryFlags = 1 )
type HostComputeRoute ¶ added in v0.8.8
type HostComputeRoute struct { ID string `json:"ID,omitempty"` HostComputeEndpoints []string `json:",omitempty"` Setting []SDNRoutePolicySetting `json:",omitempty"` SchemaVersion SchemaVersion `json:",omitempty"` }
HostComputeRoute represents SDN routes.
func AddRoute ¶ added in v0.8.8
func AddRoute(endpoints []HostComputeEndpoint, destinationPrefix string, nextHop string, needEncapsulation bool) (*HostComputeRoute, error)
AddRoute for the specified endpoints and SDN Route setting
func GetRouteByID ¶ added in v0.8.8
func GetRouteByID(routeID string) (*HostComputeRoute, error)
GetRouteByID returns the route specified by Id.
func ListRoutes ¶ added in v0.8.8
func ListRoutes() ([]HostComputeRoute, error)
ListRoutes makes a call to list all available routes.
func ListRoutesQuery ¶ added in v0.8.8
func ListRoutesQuery(query HostComputeQuery) ([]HostComputeRoute, error)
ListRoutesQuery makes a call to query the list of available routes.
func (*HostComputeRoute) AddEndpoint ¶ added in v0.8.8
func (route *HostComputeRoute) AddEndpoint(endpoint *HostComputeEndpoint) (*HostComputeRoute, error)
AddEndpoint add an endpoint to a route Since HCNRoute doesn't implement modify functionality, add operation is essentially delete and add
func (*HostComputeRoute) Create ¶ added in v0.8.8
func (route *HostComputeRoute) Create() (*HostComputeRoute, error)
Create Route.
func (*HostComputeRoute) Delete ¶ added in v0.8.8
func (route *HostComputeRoute) Delete() error
Delete Route.
func (*HostComputeRoute) RemoveEndpoint ¶ added in v0.8.8
func (route *HostComputeRoute) RemoveEndpoint(endpoint *HostComputeEndpoint) (*HostComputeRoute, error)
RemoveEndpoint removes an endpoint from a route Since HCNRoute doesn't implement modify functionality, remove operation is essentially delete and add
type InterfaceConstraintPolicySetting ¶
type InterfaceConstraintPolicySetting struct { InterfaceGuid string `json:",omitempty"` InterfaceLuid uint64 `json:",omitempty"` InterfaceIndex uint32 `json:",omitempty"` InterfaceMediaType uint32 `json:",omitempty"` InterfaceAlias string `json:",omitempty"` InterfaceDescription string `json:",omitempty"` }
InterfaceConstraintPolicySetting limits an Endpoint or Network to a specific Nic.
type IovPolicySetting ¶ added in v0.8.16
type IovPolicySetting struct { IovOffloadWeight uint32 `json:",omitempty"` QueuePairsRequested uint32 `json:",omitempty"` InterruptModeration uint32 `json:",omitempty"` }
IovPolicySetting sets the Iov settings for an endpoint.
type IpConfig ¶
type IpConfig struct { IpAddress string `json:",omitempty"` PrefixLength uint8 `json:",omitempty"` }
IpConfig is associated with an endpoint
type Ipam ¶
type Ipam struct { Type string `json:",omitempty"` // Ex: Static, DHCP Subnets []Subnet `json:",omitempty"` }
Ipam (Internet Protocol Address Management) is associated with a network and represents the address space(s) of a network.
type L4ProxyPolicySetting ¶
type L4ProxyPolicySetting struct { IP string `json:",omitempty"` Port string `json:",omitempty"` Protocol ProtocolType `json:",omitempty"` Exceptions []string `json:",omitempty"` Destination string OutboundNAT bool `json:",omitempty"` }
L4ProxyPolicySetting applies proxy policy on network/endpoint
type L4WfpProxyPolicySetting ¶ added in v0.8.7
type L4WfpProxyPolicySetting struct { InboundProxyPort string `json:",omitempty"` OutboundProxyPort string `json:",omitempty"` FilterTuple FiveTuple `json:",omitempty"` UserSID string `json:",omitempty"` InboundExceptions ProxyExceptions `json:",omitempty"` OutboundExceptions ProxyExceptions `json:",omitempty"` }
L4WfpProxyPolicySetting sets Layer-4 Proxy on an endpoint.
type LayerConstraintNetworkPolicySetting ¶ added in v0.8.16
type LayerConstraintNetworkPolicySetting struct {
LayerId string `json:",omitempty"`
}
type LoadBalancerDistribution ¶ added in v0.8.7
type LoadBalancerDistribution uint32
LoadBalancerDistribution specifies how the loadbalancer distributes traffic.
var ( // LoadBalancerDistributionNone is the default and loadbalances each connection to the same pod. LoadBalancerDistributionNone LoadBalancerDistribution // LoadBalancerDistributionSourceIPProtocol loadbalances all traffic of the same protocol from a client IP to the same pod. LoadBalancerDistributionSourceIPProtocol LoadBalancerDistribution = 1 // LoadBalancerDistributionSourceIP loadbalances all traffic from a client IP to the same pod. LoadBalancerDistributionSourceIP LoadBalancerDistribution = 2 )
type LoadBalancerFlags ¶ added in v0.8.4
type LoadBalancerFlags uint32
LoadBalancerFlags modify settings for a loadbalancer.
var ( // LoadBalancerFlagsNone is the default. LoadBalancerFlagsNone LoadBalancerFlags = 0 // LoadBalancerFlagsDSR enables Direct Server Return (DSR) LoadBalancerFlagsDSR LoadBalancerFlags = 1 LoadBalancerFlagsIPv6 LoadBalancerFlags = 2 )
type LoadBalancerNotFoundError ¶ added in v0.7.5
type LoadBalancerNotFoundError struct {
LoadBalancerId string
}
LoadBalancerNotFoundError results from a failed search for a loadbalancer by Id
func (LoadBalancerNotFoundError) Error ¶ added in v0.7.5
func (e LoadBalancerNotFoundError) Error() string
type LoadBalancerPortMapping ¶
type LoadBalancerPortMapping struct { Protocol uint32 `json:",omitempty"` // EX: TCP = 6, UDP = 17 InternalPort uint16 `json:",omitempty"` ExternalPort uint16 `json:",omitempty"` DistributionType LoadBalancerDistribution `json:",omitempty"` // EX: Distribute per connection = 0, distribute traffic of the same protocol per client IP = 1, distribute per client IP = 2 Flags LoadBalancerPortMappingFlags `json:",omitempty"` }
LoadBalancerPortMapping is associated with HostComputeLoadBalancer
type LoadBalancerPortMappingFlags ¶ added in v0.8.4
type LoadBalancerPortMappingFlags uint32
LoadBalancerPortMappingFlags are special settings on a loadbalancer.
var ( // LoadBalancerPortMappingFlagsNone is the default. LoadBalancerPortMappingFlagsNone LoadBalancerPortMappingFlags // LoadBalancerPortMappingFlagsILB enables internal loadbalancing. LoadBalancerPortMappingFlagsILB LoadBalancerPortMappingFlags = 1 // LoadBalancerPortMappingFlagsLocalRoutedVIP enables VIP access from the host. LoadBalancerPortMappingFlagsLocalRoutedVIP LoadBalancerPortMappingFlags = 2 // LoadBalancerPortMappingFlagsUseMux enables DSR for NodePort access of VIP. LoadBalancerPortMappingFlagsUseMux LoadBalancerPortMappingFlags = 4 // LoadBalancerPortMappingFlagsPreserveDIP delivers packets with destination IP as the VIP. LoadBalancerPortMappingFlagsPreserveDIP LoadBalancerPortMappingFlags = 8 )
type MacPool ¶
type MacPool struct {
Ranges []MacRange `json:",omitempty"`
}
MacPool is associated with a network and represents pool of MacRanges.
type MacRange ¶
type MacRange struct { StartMacAddress string `json:",omitempty"` EndMacAddress string `json:",omitempty"` }
MacRange is associated with MacPool and respresents the start and end addresses.
type ModifyEndpointSettingRequest ¶
type ModifyEndpointSettingRequest struct { ResourceType EndpointResourceType `json:",omitempty"` // Policy, Port RequestType RequestType `json:",omitempty"` // Add, Remove, Update, Refresh Settings json.RawMessage `json:",omitempty"` }
ModifyEndpointSettingRequest is the structure used to send request to modify an endpoint. Used to update policy/port on an endpoint.
type ModifyNamespaceSettingRequest ¶
type ModifyNamespaceSettingRequest struct { ResourceType NamespaceResourceType `json:",omitempty"` // Container, Endpoint RequestType RequestType `json:",omitempty"` // Add, Remove, Update, Refresh Settings json.RawMessage `json:",omitempty"` }
ModifyNamespaceSettingRequest is the structure used to send request to modify a namespace. Used to Add/Remove an endpoints and containers to/from a namespace.
type ModifyNetworkSettingRequest ¶ added in v0.7.13
type ModifyNetworkSettingRequest struct { ResourceType NetworkResourceType `json:",omitempty"` // Policy, DNS, Extension RequestType RequestType `json:",omitempty"` // Add, Remove, Update, Refresh Settings json.RawMessage `json:",omitempty"` }
ModifyNetworkSettingRequest is the structure used to send request to modify an network. Used to update DNS/extension/policy on an network.
type NamespaceNotFoundError ¶ added in v0.7.5
type NamespaceNotFoundError struct {
NamespaceID string
}
NamespaceNotFoundError results from a failed search for a namsepace by Id
func (NamespaceNotFoundError) Error ¶ added in v0.7.5
func (e NamespaceNotFoundError) Error() string
type NamespaceResource ¶
type NamespaceResource struct { Type NamespaceResourceType `json:","` // Container, Endpoint Data json.RawMessage `json:","` }
NamespaceResource is associated with a namespace
type NamespaceResourceContainer ¶
type NamespaceResourceContainer struct {
Id string `json:"ID,"`
}
NamespaceResourceContainer represents a Container attached to a Namespace.
type NamespaceResourceEndpoint ¶
type NamespaceResourceEndpoint struct {
Id string `json:"ID,"`
}
NamespaceResourceEndpoint represents an Endpoint attached to a Namespace.
type NamespaceResourceType ¶
type NamespaceResourceType string
NamespaceResourceType determines whether the Namespace resource is a Container or Endpoint.
var ( // NamespaceResourceTypeContainer are containers associated with a Namespace. NamespaceResourceTypeContainer NamespaceResourceType = "Container" // NamespaceResourceTypeEndpoint are endpoints associated with a Namespace. NamespaceResourceTypeEndpoint NamespaceResourceType = "Endpoint" )
type NamespaceType ¶
type NamespaceType string
NamespaceType determines whether the Namespace is for a Host or Guest
var ( // NamespaceTypeHost are host namespaces. NamespaceTypeHost NamespaceType = "Host" // NamespaceTypeHostDefault are host namespaces in the default compartment. NamespaceTypeHostDefault NamespaceType = "HostDefault" // NamespaceTypeGuest are guest namespaces. NamespaceTypeGuest NamespaceType = "Guest" // NamespaceTypeGuestDefault are guest namespaces in the default compartment. NamespaceTypeGuestDefault NamespaceType = "GuestDefault" )
type NetAdapterNameNetworkPolicySetting ¶
type NetAdapterNameNetworkPolicySetting struct {
NetworkAdapterName string `json:",omitempty"`
}
NetAdapterNameNetworkPolicySetting sets network adapter of a network.
type NetworkACLPolicySetting ¶ added in v0.9.0
type NetworkACLPolicySetting struct { Protocols string `json:",omitempty"` // EX: 6 (TCP), 17 (UDP), 1 (ICMPv4), 58 (ICMPv6), 2 (IGMP) Action ActionType `json:","` Direction DirectionType `json:","` LocalAddresses string `json:",omitempty"` RemoteAddresses string `json:",omitempty"` LocalPorts string `json:",omitempty"` RemotePorts string `json:",omitempty"` RuleType RuleType `json:",omitempty"` Priority uint16 `json:",omitempty"` }
NetworkACLPolicySetting creates ACL rules on a network
type NetworkFlags ¶ added in v0.8.4
type NetworkFlags uint32
NetworkFlags are various network flags.
const ( None NetworkFlags = 0 EnableNonPersistent NetworkFlags = 8 DisableHostPort NetworkFlags = 1024 EnableIov NetworkFlags = 8192 )
NetworkFlags const
type NetworkNotFoundError ¶ added in v0.7.5
NetworkNotFoundError results from a failed search for a network by Id or Name
func (NetworkNotFoundError) Error ¶ added in v0.7.5
func (e NetworkNotFoundError) Error() string
type NetworkPolicy ¶
type NetworkPolicy struct { Type NetworkPolicyType `json:""` Settings json.RawMessage `json:",omitempty"` }
NetworkPolicy is a collection of Policy settings for a Network.
type NetworkPolicyType ¶
type NetworkPolicyType string
NetworkPolicyType are the potential Policies that apply to Networks.
const ( SourceMacAddress NetworkPolicyType = "SourceMacAddress" NetAdapterName NetworkPolicyType = "NetAdapterName" VSwitchExtension NetworkPolicyType = "VSwitchExtension" DrMacAddress NetworkPolicyType = "DrMacAddress" AutomaticDNS NetworkPolicyType = "AutomaticDNS" InterfaceConstraint NetworkPolicyType = "InterfaceConstraint" ProviderAddress NetworkPolicyType = "ProviderAddress" RemoteSubnetRoute NetworkPolicyType = "RemoteSubnetRoute" VxlanPort NetworkPolicyType = "VxlanPort" HostRoute NetworkPolicyType = "HostRoute" SetPolicy NetworkPolicyType = "SetPolicy" NetworkL4Proxy NetworkPolicyType = "L4Proxy" LayerConstraint NetworkPolicyType = "LayerConstraint" NetworkACL NetworkPolicyType = "NetworkACL" )
NetworkPolicyType const
type NetworkResourceType ¶ added in v0.7.13
type NetworkResourceType string
NetworkResourceType are the 3 different Network settings resources.
var ( // NetworkResourceTypePolicy is for Network's policies. Ex: RemoteSubnet NetworkResourceTypePolicy NetworkResourceType = "Policy" // NetworkResourceTypeDNS is for Network's DNS settings. NetworkResourceTypeDNS NetworkResourceType = "DNS" // NetworkResourceTypeExtension is for Network's extension settings. NetworkResourceTypeExtension NetworkResourceType = "Extension" )
type NetworkType ¶ added in v0.7.5
type NetworkType string
NetworkType are various networks.
const ( NAT NetworkType = "NAT" Transparent NetworkType = "Transparent" L2Bridge NetworkType = "L2Bridge" L2Tunnel NetworkType = "L2Tunnel" ICS NetworkType = "ICS" Private NetworkType = "Private" Overlay NetworkType = "Overlay" )
NetworkType const
type OutboundNatPolicySetting ¶
type OutboundNatPolicySetting struct { VirtualIP string `json:",omitempty"` Exceptions []string `json:",omitempty"` Destinations []string `json:",omitempty"` Flags NatFlags `json:",omitempty"` MaxPortPoolUsage uint16 `json:",omitempty"` }
OutboundNatPolicySetting sets outbound Network Address Translation on an Endpoint.
type PolicyEndpointRequest ¶
type PolicyEndpointRequest struct {
Policies []EndpointPolicy `json:",omitempty"`
}
type PolicyNetworkRequest ¶ added in v0.7.13
type PolicyNetworkRequest struct {
Policies []NetworkPolicy `json:",omitempty"`
}
type PortMappingPolicySetting ¶
type PortMappingPolicySetting struct { Protocol uint32 `json:",omitempty"` // EX: TCP = 6, UDP = 17 InternalPort uint16 `json:",omitempty"` ExternalPort uint16 `json:",omitempty"` VIP string `json:",omitempty"` Flags NatFlags `json:",omitempty"` }
PortMappingPolicySetting defines Port Mapping (NAT)
type PortnameEndpointPolicySetting ¶
type PortnameEndpointPolicySetting struct {
Name string `json:",omitempty"`
}
PortnameEndpointPolicySetting sets the port name for an endpoint.
type ProtocolType ¶ added in v0.8.10
type ProtocolType uint32
ProtocolType associated with L4ProxyPolicy
const ( ProtocolTypeUnknown ProtocolType = 0 ProtocolTypeICMPv4 ProtocolType = 1 ProtocolTypeIGMP ProtocolType = 2 ProtocolTypeTCP ProtocolType = 6 ProtocolTypeUDP ProtocolType = 17 ProtocolTypeICMPv6 ProtocolType = 58 )
type ProviderAddressEndpointPolicySetting ¶
type ProviderAddressEndpointPolicySetting struct {
ProviderAddress string `json:",omitempty"`
}
ProviderAddressEndpointPolicySetting sets the PA for an endpoint.
type ProxyExceptions ¶ added in v0.8.17
type ProxyExceptions struct { IpAddressExceptions []string `json:",omitempty"` PortExceptions []string `json:",omitempty"` }
ProxyExceptions exempts traffic to IpAddresses and Ports
type QosPolicySetting ¶
type QosPolicySetting struct {
MaximumOutgoingBandwidthInBytes uint64
}
QosPolicySetting sets Quality of Service bandwidth caps on an Endpoint.
type RemoteSubnetRoutePolicySetting ¶ added in v0.7.13
type RemoteSubnetRoutePolicySetting struct { DestinationPrefix string IsolationId uint16 ProviderAddress string DistributedRouterMacAddress string }
RemoteSubnetRoutePolicySetting creates remote subnet route rules on a network
type RequestType ¶
type RequestType string
RequestType are the different operations performed to settings. Used to update the settings of Endpoint/Namespace objects.
var ( // RequestTypeAdd adds the provided settings object. RequestTypeAdd RequestType = "Add" // RequestTypeRemove removes the provided settings object. RequestTypeRemove RequestType = "Remove" // RequestTypeUpdate replaces settings with the ones provided. RequestTypeUpdate RequestType = "Update" // RequestTypeRefresh refreshes the settings provided. RequestTypeRefresh RequestType = "Refresh" )
type Route ¶
type Route struct { NextHop string `json:",omitempty"` DestinationPrefix string `json:",omitempty"` Metric uint16 `json:",omitempty"` }
Route is associated with a subnet.
type RouteNotFoundError ¶ added in v0.8.8
type RouteNotFoundError struct {
RouteId string
}
RouteNotFoundError results from a failed search for a route by Id
func (RouteNotFoundError) Error ¶ added in v0.8.8
func (e RouteNotFoundError) Error() string
type RuleType ¶
type RuleType string
RuleType associated with ACLs. Value is either Host (WFP) or Switch (VFP).
type SDNRoutePolicySetting ¶
type SDNRoutePolicySetting struct { DestinationPrefix string `json:",omitempty"` NextHop string `json:",omitempty"` NeedEncap bool `json:",omitempty"` }
SDNRoutePolicySetting sets SDN Route on an Endpoint.
type SchemaVersion ¶
type SchemaVersion = Version // hcnglobals.go
SchemaVersion for HCN Objects/Queries.
func V2SchemaVersion ¶ added in v0.7.7
func V2SchemaVersion() SchemaVersion
type SetPolicySetting ¶ added in v0.8.10
type SetPolicySetting struct { Id string Name string Type SetPolicyType `json:"PolicyType"` Values string }
SetPolicySetting creates IPSets on network
type SetPolicyType ¶ added in v0.8.10
type SetPolicyType string
SetPolicyTypes associated with SetPolicy. Value is IPSET.
const ( SetPolicyTypeIpSet SetPolicyType = "IPSET" SetPolicyTypeNestedIpSet SetPolicyType = "NESTEDIPSET" )
type SourceMacAddressNetworkPolicySetting ¶
type SourceMacAddressNetworkPolicySetting struct {
SourceMacAddress string `json:",omitempty"`
}
SourceMacAddressNetworkPolicySetting sets source MAC for a network.
type Subnet ¶
type Subnet struct { IpAddressPrefix string `json:",omitempty"` Policies []json.RawMessage `json:",omitempty"` Routes []Route `json:",omitempty"` }
Subnet is associated with a Ipam.
type SubnetPolicy ¶
type SubnetPolicy struct { Type SubnetPolicyType `json:""` Settings json.RawMessage `json:",omitempty"` }
SubnetPolicy is a collection of Policy settings for a Subnet.
type SubnetPolicyType ¶
type SubnetPolicyType string
SubnetPolicyType are the potential Policies that apply to Subnets.
const ( VLAN SubnetPolicyType = "VLAN" VSID SubnetPolicyType = "VSID" )
SubnetPolicyType const
type SupportedFeatures ¶
type SupportedFeatures struct { Acl AclFeatures `json:"ACL"` Api ApiSupport `json:"API"` RemoteSubnet bool `json:"RemoteSubnet"` HostRoute bool `json:"HostRoute"` DSR bool `json:"DSR"` Slash32EndpointPrefixes bool `json:"Slash32EndpointPrefixes"` AclSupportForProtocol252 bool `json:"AclSupportForProtocol252"` SessionAffinity bool `json:"SessionAffinity"` IPv6DualStack bool `json:"IPv6DualStack"` SetPolicy bool `json:"SetPolicy"` VxlanPort bool `json:"VxlanPort"` L4Proxy bool `json:"L4Proxy"` // network policy that applies VFP rules to all endpoints on the network to redirect traffic L4WfpProxy bool `json:"L4WfpProxy"` // endpoint policy that applies WFP filters to redirect traffic to/from that endpoint TierAcl bool `json:"TierAcl"` NetworkACL bool `json:"NetworkACL"` NestedIpSet bool `json:"NestedIpSet"` DisableHostPort bool `json:"DisableHostPort"` ModifyLoadbalancer bool `json:"ModifyLoadbalancer"` Accelnet bool `json:"Accelnet"` }
SupportedFeatures are the features provided by the Service.
func GetCachedSupportedFeatures ¶ added in v0.8.21
func GetCachedSupportedFeatures() (SupportedFeatures, error)
GetCachedSupportedFeatures returns the features supported by the Service and an error if the query failed. If this has been called before it will return the supported features and error received from the first call. This can be used to optimize if many calls to the various hcn.IsXSupported methods need to be made.
func GetSupportedFeatures
deprecated
func GetSupportedFeatures() SupportedFeatures
GetSupportedFeatures returns the features supported by the Service.
Deprecated: Use GetCachedSupportedFeatures instead.
type TierAclPolicySetting ¶ added in v0.8.17
type TierAclPolicySetting struct { Name string `json:","` Direction DirectionType `json:","` Order uint16 `json:""` TierAclRules []TierAclRule `json:",omitempty"` }
TierAclPolicySetting represents a Tier containing ACLs
type TierAclRule ¶ added in v0.8.17
type TierAclRule struct { Id string `json:",omitempty"` Protocols string `json:",omitempty"` TierAclRuleAction ActionType `json:","` LocalAddresses string `json:",omitempty"` RemoteAddresses string `json:",omitempty"` LocalPorts string `json:",omitempty"` RemotePorts string `json:",omitempty"` Priority uint16 `json:",omitempty"` }
TierAclRule represents an ACL within TierAclPolicySetting
type VSwitchExtensionNetworkPolicySetting ¶
type VSwitchExtensionNetworkPolicySetting struct { ExtensionID string `json:",omitempty"` Enable bool `json:",omitempty"` }
VSwitchExtensionNetworkPolicySetting enables/disabled VSwitch extensions for a network.
type VersionRange ¶ added in v0.8.7
type VersionRanges ¶ added in v0.8.7
type VersionRanges []VersionRange
type VlanPolicySetting ¶
type VlanPolicySetting struct {
IsolationId uint32 `json:","`
}
VlanPolicySetting isolates a subnet with VLAN tagging.
type VmEndpointRequest ¶ added in v0.8.17
type VmEndpointRequest struct { PortId guid.GUID `json:",omitempty"` VirtualNicName string `json:",omitempty"` VirtualMachineId guid.GUID `json:",omitempty"` }
VmEndpointRequest creates a switch port with identifier `PortId`.
type VsidPolicySetting ¶
type VsidPolicySetting struct {
IsolationId uint32 `json:","`
}
VsidPolicySetting isolates a subnet with VSID tagging.
type VxlanPortPolicySetting ¶ added in v0.8.10
type VxlanPortPolicySetting struct {
Port uint16
}
VxlanPortPolicySetting allows configuring the VXLAN TCP port