Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateLayer(info DriverInfo, id string) error
- func CreateLayer(info DriverInfo, id, parent string) error
- func CreateSandboxLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error
- func CreateScratchLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error
- func DeactivateLayer(info DriverInfo, id string) error
- func DestroyLayer(info DriverInfo, id string) error
- func ExpandSandboxSize(info DriverInfo, layerId string, size uint64) error
- func ExpandScratchSize(info DriverInfo, layerId string, size uint64) error
- func ExportLayer(info DriverInfo, layerId string, exportFolderPath string, ...) error
- func GetLayerMountPath(info DriverInfo, id string) (string, error)
- func GetSharedBaseImages() (imageData string, err error)
- func HotAttachEndpoint(containerID string, endpointID string) error
- func HotDetachEndpoint(containerID string, endpointID string) error
- func ImportLayer(info DriverInfo, layerID string, importFolderPath string, ...) error
- func IsAlreadyClosed(err error) bool
- func IsAlreadyStopped(err error) bool
- func IsNotExist(err error) bool
- func IsNotSupported(err error) bool
- func IsPending(err error) bool
- func IsTimeout(err error) bool
- func LayerExists(info DriverInfo, id string) (bool, error)
- func PrepareLayer(info DriverInfo, layerId string, parentLayerPaths []string) error
- func ProcessBaseLayer(path string) error
- func ProcessUtilityVMImage(path string) error
- func UnprepareLayer(info DriverInfo, layerId string) error
- type ACLPolicy
- type ActionType
- type AssignedDevice
- type ComputeSystemQuery
- type Container
- type ContainerConfig
- type ContainerError
- type ContainerProperties
- type DirectionType
- type DriverInfo
- type ELBPolicy
- type EndpointAttachDetachRequest
- type EndpointNotFoundError
- type EndpointResquestResponse
- type GUID
- type HNSAclFeatures
- type HNSEndpoint
- type HNSGlobals
- type HNSNetwork
- type HNSSupportedFeatures
- type HNSVersion
- type HcsError
- type HvRuntime
- type IsolationPolicy
- type LBPolicy
- type Layer
- type LayerReader
- type LayerWriter
- type MacPool
- type MappedDir
- type MappedPipe
- type MappedVirtualDisk
- type MappedVirtualDiskController
- type MemoryStats
- type Namespace
- type NatPolicy
- type NetworkNotFoundError
- type NetworkStats
- type OutboundNatPolicy
- type PaPolicy
- type Policy
- type PolicyList
- func AddLoadBalancer(endpoints []HNSEndpoint, isILB bool, sourceVIP, vip string, protocol uint16, ...) (*PolicyList, error)
- func AddRoute(endpoints []HNSEndpoint, destinationPrefix string, nextHop string, ...) (*PolicyList, error)
- func GetPolicyListByID(policyListID string) (*PolicyList, error)
- func HNSListPolicyListRequest() ([]PolicyList, error)
- func HNSPolicyListRequest(method, path, request string) (*PolicyList, error)
- func PolicyListRequest(method, path, request string) (*PolicyList, error)
- type PolicyType
- type Process
- type ProcessConfig
- type ProcessError
- type ProcessListItem
- type ProcessorStats
- type QosPolicy
- type RequestType
- type ResourceModificationRequestResponse
- type ResourceType
- type RoutePolicy
- type RuleType
- type Statistics
- type StorageStats
- type Subnet
- type SystemType
- type VlanPolicy
- type VsidPolicy
- type WC_LAYER_DESCRIPTOR
Constants ¶
RequestType const
const ( // Specific user-visible exit codes WaitErrExecFailed = 32767 ERROR_GEN_FAILURE = hcserror.ERROR_GEN_FAILURE ERROR_SHUTDOWN_IN_PROGRESS = syscall.Errno(1115) WSAEINVAL = syscall.Errno(10022) // Timeout on wait calls TimeoutInfinite = 0xFFFFFFFF )
const ( Nat = hns.Nat ACL = hns.ACL PA = hns.PA VLAN = hns.VLAN VSID = hns.VSID VNet = hns.VNet L2Driver = hns.L2Driver Isolation = hns.Isolation QOS = hns.QOS OutboundNat = hns.OutboundNat ExternalLoadBalancer = hns.ExternalLoadBalancer Route = hns.Route )
RequestType const
Variables ¶
var ( // ErrComputeSystemDoesNotExist is an error encountered when the container being operated on no longer exists = hcs.exist ErrComputeSystemDoesNotExist = hcs.ErrComputeSystemDoesNotExist // ErrElementNotFound is an error encountered when the object being referenced does not exist ErrElementNotFound = hcs.ErrElementNotFound // ErrElementNotFound is an error encountered when the object being referenced does not exist ErrNotSupported = hcs.ErrNotSupported // ErrInvalidData is an error encountered when the request being sent to hcs is invalid/unsupported // decimal -2147024883 / hex 0x8007000d ErrInvalidData = hcs.ErrInvalidData // ErrHandleClose is an error encountered when the handle generating the notification being waited on has been closed ErrHandleClose = hcs.ErrHandleClose // ErrAlreadyClosed is an error encountered when using a handle that has been closed by the Close method ErrAlreadyClosed = hcs.ErrAlreadyClosed // ErrInvalidNotificationType is an error encountered when an invalid notification type is used ErrInvalidNotificationType = hcs.ErrInvalidNotificationType // ErrInvalidProcessState is an error encountered when the process is not in a valid state for the requested operation ErrInvalidProcessState = hcs.ErrInvalidProcessState // ErrTimeout is an error encountered when waiting on a notification times out ErrTimeout = hcs.ErrTimeout // ErrUnexpectedContainerExit is the error encountered when a container exits while waiting for // a different expected notification ErrUnexpectedContainerExit = hcs.ErrUnexpectedContainerExit // ErrUnexpectedProcessAbort is the error encountered when communication with the compute service // is lost while waiting for a notification ErrUnexpectedProcessAbort = hcs.ErrUnexpectedProcessAbort // ErrUnexpectedValue is an error encountered when hcs returns an invalid value ErrUnexpectedValue = hcs.ErrUnexpectedValue // ErrVmcomputeAlreadyStopped is an error encountered when a shutdown or terminate request is made on a stopped container ErrVmcomputeAlreadyStopped = hcs.ErrVmcomputeAlreadyStopped // ErrVmcomputeOperationPending is an error encountered when the operation is being completed asynchronously ErrVmcomputeOperationPending = hcs.ErrVmcomputeOperationPending // ErrVmcomputeOperationInvalidState is an error encountered when the compute system is not in a valid state for the requested operation ErrVmcomputeOperationInvalidState = hcs.ErrVmcomputeOperationInvalidState // ErrProcNotFound is an error encountered when the the process cannot be found ErrProcNotFound = hcs.ErrProcNotFound // ErrVmcomputeOperationAccessIsDenied is an error which can be encountered when enumerating compute systems in RS1/RS2 // builds when the underlying silo might be in the process of terminating. HCS was fixed in RS3. ErrVmcomputeOperationAccessIsDenied = hcs.ErrVmcomputeOperationAccessIsDenied // ErrVmcomputeInvalidJSON is an error encountered when the compute system does not support/understand the messages sent by management ErrVmcomputeInvalidJSON = hcs.ErrVmcomputeInvalidJSON // ErrVmcomputeUnknownMessage is an error encountered guest compute system doesn't support the message ErrVmcomputeUnknownMessage = hcs.ErrVmcomputeUnknownMessage // ErrNotSupported is an error encountered when hcs doesn't support the request ErrPlatformNotSupported = hcs.ErrPlatformNotSupported )
var (
HNSVersion1803 = hns.HNSVersion1803
)
Functions ¶
func ActivateLayer ¶
func ActivateLayer(info DriverInfo, id string) error
func CreateLayer ¶
func CreateLayer(info DriverInfo, id, parent string) error
func CreateSandboxLayer ¶
func CreateSandboxLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error
New clients should use CreateScratchLayer instead. Kept in to preserve API compatibility.
func CreateScratchLayer ¶ added in v0.7.0
func CreateScratchLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error
func DeactivateLayer ¶
func DeactivateLayer(info DriverInfo, id string) error
func DestroyLayer ¶
func DestroyLayer(info DriverInfo, id string) error
func ExpandSandboxSize ¶ added in v0.3.2
func ExpandSandboxSize(info DriverInfo, layerId string, size uint64) error
New clients should use ExpandScratchSize instead. Kept in to preserve API compatibility.
func ExpandScratchSize ¶ added in v0.7.0
func ExpandScratchSize(info DriverInfo, layerId string, size uint64) error
func ExportLayer ¶
func ExportLayer(info DriverInfo, layerId string, exportFolderPath string, parentLayerPaths []string) error
func GetLayerMountPath ¶
func GetLayerMountPath(info DriverInfo, id string) (string, error)
func GetSharedBaseImages ¶
func HotAttachEndpoint ¶ added in v0.5.15
HotAttachEndpoint makes a HCS Call to attach the endpoint to the container
func HotDetachEndpoint ¶ added in v0.5.15
HotDetachEndpoint makes a HCS Call to detach the endpoint from the container
func ImportLayer ¶
func ImportLayer(info DriverInfo, layerID string, importFolderPath string, parentLayerPaths []string) error
func IsAlreadyClosed ¶ added in v0.5.3
IsAlreadyClosed checks if an error is caused by the Container or Process having been already closed by a call to the Close() method.
func IsAlreadyStopped ¶ added in v0.4.0
IsAlreadyStopped returns a boolean indicating whether the error is caused by a Container or Process being already stopped. Note: Currently, ErrElementNotFound can mean that a Process has either already exited, or does not exist. Both IsAlreadyStopped and IsNotExist will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
func IsNotExist ¶ added in v0.4.0
IsNotExist checks if an error is caused by the Container or Process not existing. Note: Currently, ErrElementNotFound can mean that a Process has either already exited, or does not exist. Both IsAlreadyStopped and IsNotExist will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
func IsNotSupported ¶ added in v0.5.15
IsNotSupported returns a boolean indicating whether the error is caused by unsupported platform requests Note: Currently Unsupported platform requests can be mean either ErrVmcomputeInvalidJSON, ErrInvalidData, ErrNotSupported or ErrVmcomputeUnknownMessage is thrown from the Platform
func IsPending ¶ added in v0.4.0
IsPending returns a boolean indicating whether the error is that the requested operation is being completed in the background.
func IsTimeout ¶ added in v0.4.0
IsTimeout returns a boolean indicating whether the error is caused by a timeout waiting for the operation to complete.
func LayerExists ¶
func LayerExists(info DriverInfo, id string) (bool, error)
func PrepareLayer ¶
func PrepareLayer(info DriverInfo, layerId string, parentLayerPaths []string) error
func ProcessBaseLayer ¶
func ProcessUtilityVMImage ¶
func UnprepareLayer ¶
func UnprepareLayer(info DriverInfo, layerId string) error
Types ¶
type ActionType ¶ added in v0.5.27
type ActionType = hns.ActionType
type AssignedDevice ¶ added in v0.6.12
type AssignedDevice = schema1.AssignedDevice
AssignedDevice represents a device that has been directly assigned to a container
NOTE: Support added in RS5
type ComputeSystemQuery ¶ added in v0.5.3
type ComputeSystemQuery = schema1.ComputeSystemQuery
type Container ¶ added in v0.3.0
type Container interface { // Start synchronously starts the container. Start() error // Shutdown requests a container shutdown, but it may not actually be shutdown until Wait() succeeds. Shutdown() error // Terminate requests a container terminate, but it may not actually be terminated until Wait() succeeds. Terminate() error // Waits synchronously waits for the container to shutdown or terminate. Wait() error // WaitTimeout synchronously waits for the container to terminate or the duration to elapse. It // returns false if timeout occurs. WaitTimeout(time.Duration) error // Pause pauses the execution of a container. Pause() error // Resume resumes the execution of a container. Resume() error // HasPendingUpdates returns true if the container has updates pending to install. HasPendingUpdates() (bool, error) // Statistics returns statistics for a container. Statistics() (Statistics, error) // ProcessList returns details for the processes in a container. ProcessList() ([]ProcessListItem, error) // MappedVirtualDisks returns virtual disks mapped to a utility VM, indexed by controller MappedVirtualDisks() (map[int]MappedVirtualDiskController, error) // CreateProcess launches a new process within the container. CreateProcess(c *ProcessConfig) (Process, error) // OpenProcess gets an interface to an existing process within the container. OpenProcess(pid int) (Process, error) // Close cleans up any state associated with the container but does not terminate or wait for it. Close() error // Modify the System Modify(config *ResourceModificationRequestResponse) error }
Container represents a created (but not necessarily running) container.
func CreateContainer ¶ added in v0.3.0
func CreateContainer(id string, c *ContainerConfig) (Container, error)
CreateContainer creates a new container with the given configuration but does not start it.
func OpenContainer ¶ added in v0.3.0
OpenContainer opens an existing container by ID.
type ContainerConfig ¶ added in v0.3.0
type ContainerConfig = schema1.ContainerConfig
ContainerConfig is used as both the input of CreateContainer and to convert the parameters to JSON for passing onto the HCS
type ContainerError ¶ added in v0.3.0
type ContainerError struct { Container *container Operation string ExtraInfo string Err error Events []hcs.ErrorEvent }
ContainerError is an error encountered in HCS during an operation on a Container object
func (*ContainerError) Error ¶ added in v0.3.0
func (e *ContainerError) Error() string
type ContainerProperties ¶ added in v0.5.3
type ContainerProperties = schema1.ContainerProperties
ContainerProperties holds the properties for a container and the processes running in that container
func GetContainers ¶ added in v0.5.3
func GetContainers(q ComputeSystemQuery) ([]ContainerProperties, error)
GetContainers gets a list of the containers on the system that match the query
type DirectionType ¶ added in v0.5.27
type DirectionType = hns.DirectionType
type DriverInfo ¶
type ELBPolicy ¶ added in v0.5.27
ELBPolicy is a structure defining schema for ELB LoadBalancing based Policy
type EndpointAttachDetachRequest ¶ added in v0.6.2
type EndpointAttachDetachRequest = hns.EndpointAttachDetachRequest
EndpointAttachDetachRequest is the structure used to send request to the container to modify the system Supported resource types are Network and Request Types are Add/Remove
type EndpointNotFoundError ¶ added in v0.6.7
type EndpointNotFoundError = hns.EndpointNotFoundError
type EndpointResquestResponse ¶ added in v0.6.2
type EndpointResquestResponse = hns.EndpointResquestResponse
EndpointResquestResponse is object to get the endpoint request response
type HNSAclFeatures ¶ added in v0.7.0
type HNSAclFeatures = hns.HNSAclFeatures
type HNSEndpoint ¶
type HNSEndpoint = hns.HNSEndpoint
HNSEndpoint represents a network endpoint in HNS
func GetHNSEndpointByID ¶ added in v0.5.15
func GetHNSEndpointByID(endpointID string) (*HNSEndpoint, error)
GetHNSEndpointByID get the Endpoint by ID
func GetHNSEndpointByName ¶ added in v0.5.15
func GetHNSEndpointByName(endpointName string) (*HNSEndpoint, error)
GetHNSEndpointByName gets the endpoint filtered by Name
func HNSEndpointRequest ¶
func HNSEndpointRequest(method, path, request string) (*HNSEndpoint, error)
HNSEndpointRequest makes a HNS call to modify/query a network endpoint
func HNSListEndpointRequest ¶ added in v0.5.15
func HNSListEndpointRequest() ([]HNSEndpoint, error)
HNSListEndpointRequest makes a HNS call to query the list of available endpoints
type HNSGlobals ¶ added in v0.7.0
type HNSGlobals = hns.HNSGlobals
func GetHNSGlobals ¶ added in v0.7.0
func GetHNSGlobals() (*HNSGlobals, error)
type HNSNetwork ¶
type HNSNetwork = hns.HNSNetwork
HNSNetwork represents a network in HNS
func GetHNSNetworkByID ¶ added in v0.5.15
func GetHNSNetworkByID(networkID string) (*HNSNetwork, error)
GetHNSNetworkByID
func GetHNSNetworkByName ¶ added in v0.5.15
func GetHNSNetworkByName(networkName string) (*HNSNetwork, error)
GetHNSNetworkName filtered by Name
func HNSListNetworkRequest ¶
func HNSListNetworkRequest(method, path, request string) ([]HNSNetwork, error)
HNSListNetworkRequest makes a HNS call to query the list of available networks
func HNSNetworkRequest ¶
func HNSNetworkRequest(method, path, request string) (*HNSNetwork, error)
HNSNetworkRequest makes a call into HNS to update/query a single network
type HNSSupportedFeatures ¶ added in v0.7.0
type HNSSupportedFeatures = hns.HNSSupportedFeatures
func GetHNSSupportedFeatures ¶ added in v0.7.0
func GetHNSSupportedFeatures() HNSSupportedFeatures
type HNSVersion ¶ added in v0.7.0
type HNSVersion = hns.HNSVersion
type IsolationPolicy ¶ added in v0.5.27
type IsolationPolicy = hns.IsolationPolicy
type LBPolicy ¶ added in v0.5.27
LBPolicy is a structure defining schema for LoadBalancing based Policy
type LayerReader ¶
type LayerReader = wclayer.LayerReader
func NewLayerReader ¶
func NewLayerReader(info DriverInfo, layerID string, parentLayerPaths []string) (LayerReader, error)
type LayerWriter ¶
type LayerWriter = wclayer.LayerWriter
func NewLayerWriter ¶
func NewLayerWriter(info DriverInfo, layerID string, parentLayerPaths []string) (LayerWriter, error)
type MacPool ¶
MacPool is assoicated with a network and represents a list of macaddresses available to the network
type MappedPipe ¶ added in v0.5.26
type MappedPipe = schema1.MappedPipe
type MappedVirtualDisk ¶ added in v0.5.21
type MappedVirtualDisk = schema1.MappedVirtualDisk
type MappedVirtualDiskController ¶ added in v0.5.28
type MappedVirtualDiskController = schema1.MappedVirtualDiskController
MappedVirtualDiskController is the structure of an item returned by a MappedVirtualDiskList call on a container
type MemoryStats ¶ added in v0.4.0
type MemoryStats = schema1.MemoryStats
MemoryStats holds the memory statistics for a container
type NetworkNotFoundError ¶ added in v0.6.7
type NetworkNotFoundError = hns.NetworkNotFoundError
type NetworkStats ¶ added in v0.4.0
type NetworkStats = schema1.NetworkStats
NetworkStats holds the network statistics for a container
type OutboundNatPolicy ¶ added in v0.5.27
type OutboundNatPolicy = hns.OutboundNatPolicy
type PolicyList ¶ added in v0.5.27
type PolicyList = hns.PolicyList
PolicyList is a structure defining schema for Policy list request
func AddLoadBalancer ¶ added in v0.5.27
func AddLoadBalancer(endpoints []HNSEndpoint, isILB bool, sourceVIP, vip string, protocol uint16, internalPort uint16, externalPort uint16) (*PolicyList, error)
AddLoadBalancer policy list for the specified endpoints
func AddRoute ¶ added in v0.5.27
func AddRoute(endpoints []HNSEndpoint, destinationPrefix string, nextHop string, encapEnabled bool) (*PolicyList, error)
AddRoute adds route policy list for the specified endpoints
func GetPolicyListByID ¶ added in v0.6.2
func GetPolicyListByID(policyListID string) (*PolicyList, error)
GetPolicyListByID get the policy list by ID
func HNSListPolicyListRequest ¶ added in v0.5.27
func HNSListPolicyListRequest() ([]PolicyList, error)
HNSListPolicyListRequest gets all the policy list
func HNSPolicyListRequest ¶ added in v0.5.27
func HNSPolicyListRequest(method, path, request string) (*PolicyList, error)
HNSPolicyListRequest makes a call into HNS to update/query a single network
func PolicyListRequest ¶ added in v0.5.27
func PolicyListRequest(method, path, request string) (*PolicyList, error)
PolicyListRequest makes a HNS call to modify/query a network policy list
type PolicyType ¶ added in v0.5.27
type PolicyType = hns.PolicyType
Type of Request Support in ModifySystem
type Process ¶ added in v0.3.0
type Process interface { // Pid returns the process ID of the process within the container. Pid() int // Kill signals the process to terminate but does not wait for it to finish terminating. Kill() error // Wait waits for the process to exit. Wait() error // WaitTimeout waits for the process to exit or the duration to elapse. It returns // false if timeout occurs. WaitTimeout(time.Duration) error // ExitCode returns the exit code of the process. The process must have // already terminated. ExitCode() (int, error) // ResizeConsole resizes the console of the process. ResizeConsole(width, height uint16) error // Stdio returns the stdin, stdout, and stderr pipes, respectively. Closing // these pipes does not close the underlying pipes; it should be possible to // call this multiple times to get multiple interfaces. Stdio() (io.WriteCloser, io.ReadCloser, io.ReadCloser, error) // CloseStdin closes the write side of the stdin pipe so that the process is // notified on the read side that there is no more data in stdin. CloseStdin() error // Close cleans up any state associated with the process but does not kill // or wait on it. Close() error }
Process represents a running or exited process.
type ProcessConfig ¶ added in v0.3.0
type ProcessConfig = schema1.ProcessConfig
ProcessConfig is used as both the input of Container.CreateProcess and to convert the parameters to JSON for passing onto the HCS
type ProcessError ¶ added in v0.3.0
type ProcessError struct { Process *process Operation string ExtraInfo string Err error Events []hcs.ErrorEvent }
ProcessError is an error encountered in HCS during an operation on a Process object
func (*ProcessError) Error ¶ added in v0.3.0
func (e *ProcessError) Error() string
type ProcessListItem ¶ added in v0.4.2
type ProcessListItem = schema1.ProcessListItem
ProcessList is the structure of an item returned by a ProcessList call on a container
type ProcessorStats ¶ added in v0.4.0
type ProcessorStats = schema1.ProcessorStats
ProcessorStats holds the processor statistics for a container
type RequestType ¶ added in v0.5.15
type RequestType = schema1.RequestType
Type of Request Support in ModifySystem
type ResourceModificationRequestResponse ¶ added in v0.5.15
type ResourceModificationRequestResponse = schema1.ResourceModificationRequestResponse
ResourceModificationRequestResponse is the structure used to send request to the container to modify the system Supported resource types are Network and Request Types are Add/Remove
type ResourceType ¶ added in v0.5.15
type ResourceType = schema1.ResourceType
Type of Resource Support in ModifySystem
type RoutePolicy ¶ added in v0.5.27
type RoutePolicy = hns.RoutePolicy
RoutePolicy is a structure defining schema for Route based Policy
type Statistics ¶ added in v0.4.0
type Statistics = schema1.Statistics
Statistics is the structure returned by a statistics call on a container
type StorageStats ¶ added in v0.4.0
type StorageStats = schema1.StorageStats
StorageStats holds the storage statistics for a container
type Subnet ¶
Subnet is assoicated with a network and represents a list of subnets available to the network
type SystemType ¶ added in v0.6.2
type SystemType string
SystemType represents the type of the system on which actions are done
const ( ContainerType SystemType = "Container" VirtualMachineType SystemType = "VirtualMachine" HostType SystemType = "Host" )
SystemType const
type VlanPolicy ¶ added in v0.3.2
type VlanPolicy = hns.VlanPolicy
type VsidPolicy ¶ added in v0.3.2
type VsidPolicy = hns.VsidPolicy
type WC_LAYER_DESCRIPTOR ¶
type WC_LAYER_DESCRIPTOR = wclayer.WC_LAYER_DESCRIPTOR
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
ext4
|
|
Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server containers and Hyper-V containers.
|
Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server containers and Hyper-V containers. |
internal
|
|
appargs
Package appargs provides argument validation routines for use with github.com/urfave/cli.
|
Package appargs provides argument validation routines for use with github.com/urfave/cli. |
ociwclayer
Package ociwclayer provides functions for importing and exporting Windows container layers from and to their OCI tar representation.
|
Package ociwclayer provides functions for importing and exporting Windows container layers from and to their OCI tar representation. |
pkg
|
|
test
|
|
tools
|
|