Categorygithub.com/kevpar/hcsshim
modulepackage
0.8.2
Repository: https://github.com/kevpar/hcsshim.git
Documentation: pkg.go.dev

# README

hcsshim

Build status

This package contains the Golang interface for using the Windows Host Compute Service (HCS) to launch and manage Windows Containers. It also contains other helpers and functions for managing Windows Containers such as the Golang interface for the Host Network Service (HNS).

It is primarily used in the Moby Project, but it can be freely used by other projects as well.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Dependencies

This project requires Golang 1.9 or newer to build.

For system requirements to run this project, see the Microsoft docs on Windows Container requirements.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

For additional details, see Report a Computer Security Vulnerability on Technet


Copyright (c) 2018 Microsoft Corp. All rights reserved.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server containers and Hyper-V containers.
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
AddLoadBalancer policy list for the specified endpoints.
AddRoute adds route policy list for the specified endpoints.
CreateContainer creates a new container with the given configuration but does not start it.
No description provided by the author
New clients should use CreateScratchLayer instead.
No description provided by the author
No description provided by the author
No description provided by the author
New clients should use ExpandScratchSize instead.
No description provided by the author
No description provided by the author
GetContainers gets a list of the containers on the system that match the query.
GetHNSEndpointByID get the Endpoint by ID.
GetHNSEndpointByName gets the endpoint filtered by Name.
No description provided by the author
GetHNSNetworkByID.
GetHNSNetworkName filtered by Name.
No description provided by the author
No description provided by the author
GetPolicyListByID get the policy list by ID.
No description provided by the author
HNSEndpointRequest makes a HNS call to modify/query a network endpoint.
HNSListEndpointRequest makes a HNS call to query the list of available endpoints.
HNSListNetworkRequest makes a HNS call to query the list of available networks.
HNSListPolicyListRequest gets all the policy list.
HNSNetworkRequest makes a call into HNS to update/query a single network.
HNSPolicyListRequest makes a call into HNS to update/query a single network.
HotAttachEndpoint makes a HCS Call to attach the endpoint to the container.
HotDetachEndpoint makes a HCS Call to detach the endpoint from the container.
No description provided by the author
IsAlreadyClosed checks if an error is caused by the Container or Process having been already closed by a call to the Close() method.
IsAlreadyStopped returns a boolean indicating whether the error is caused by a Container or Process being already stopped.
IsNotExist checks if an error is caused by the Container or Process not existing.
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.
IsPending returns a boolean indicating whether the error is that the requested operation is being completed in the background.
IsTimeout returns a boolean indicating whether the error is caused by a timeout waiting for the operation to complete.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OpenContainer opens an existing container by ID.
PolicyListRequest makes a HNS call to modify/query a network policy list.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

RequestType const.
RequestType const.
No description provided by the author
No description provided by the author
SystemType const.
No description provided by the author
No description provided by the author
RequestType const.
No description provided by the author
SystemType const.
No description provided by the author
RequestType const.
RequestType const.
RequestType const.
RequestType const.
No description provided by the author
RequestType const.
RequestType const.
RequestType const.
RequestType const.
RequestType const.
No description provided by the author
Timeout on wait calls.
SystemType const.
RequestType const.
RequestType const.
RequestType const.
Specific user-visible exit codes.
No description provided by the author

# Variables

ErrAlreadyClosed is an error encountered when using a handle that has been closed by the Close method.
ErrComputeSystemDoesNotExist is an error encountered when the container being operated on no longer exists = hcs.exist.
ErrElementNotFound is an error encountered when the object being referenced does not exist.
ErrHandleClose is an error encountered when the handle generating the notification being waited on has been closed.
ErrInvalidData is an error encountered when the request being sent to hcs is invalid/unsupported decimal -2147024883 / hex 0x8007000d.
ErrInvalidNotificationType is an error encountered when an invalid notification type is used.
ErrInvalidProcessState is an error encountered when the process is not in a valid state for the requested operation.
ErrElementNotFound is an error encountered when the object being referenced does not exist.
ErrNotSupported is an error encountered when hcs doesn't support the request.
ErrProcNotFound is an error encountered when the the process cannot be found.
ErrTimeout is an error encountered when waiting on a notification times out.
ErrUnexpectedContainerExit is the error encountered when a container exits while waiting for a different expected notification.
ErrUnexpectedProcessAbort is the error encountered when communication with the compute service is lost while waiting for a notification.
ErrUnexpectedValue is an error encountered when hcs returns an invalid value.
ErrVmcomputeAlreadyStopped is an error encountered when a shutdown or terminate request is made on a stopped container.
ErrVmcomputeInvalidJSON is an error encountered when the compute system does not support/understand the messages sent by management.
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.
ErrVmcomputeOperationInvalidState is an error encountered when the compute system is not in a valid state for the requested operation.
ErrVmcomputeOperationPending is an error encountered when the operation is being completed asynchronously.
ErrVmcomputeUnknownMessage is an error encountered guest compute system doesn't support the message.
No description provided by the author

# Structs

ContainerError is an error encountered in HCS during an operation on a Container object.
No description provided by the author
ProcessError is an error encountered in HCS during an operation on a Process object.

# Interfaces

Container represents a created (but not necessarily running) container.
Process represents a running or exited process.

# Type aliases

No description provided by the author
No description provided by the author
AssignedDevice represents a device that has been directly assigned to a container NOTE: Support added in RS5.
No description provided by the author
ContainerConfig is used as both the input of CreateContainer and to convert the parameters to JSON for passing onto the HCS.
ContainerProperties holds the properties for a container and the processes running in that container.
No description provided by the author
ELBPolicy is a structure defining schema for ELB LoadBalancing based Policy.
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.
No description provided by the author
EndpointResquestResponse is object to get the endpoint request response.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
HNSEndpoint represents a network endpoint in HNS.
No description provided by the author
HNSNetwork represents a network in HNS.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LBPolicy is a structure defining schema for LoadBalancing based Policy.
MacPool is assoicated with a network and represents a list of macaddresses available to the network.
No description provided by the author
No description provided by the author
No description provided by the author
MappedVirtualDiskController is the structure of an item returned by a MappedVirtualDiskList call on a container.
MemoryStats holds the memory statistics for a container.
Namespace represents a Compartment.
No description provided by the author
No description provided by the author
NetworkStats holds the network statistics for a container.
No description provided by the author
No description provided by the author
No description provided by the author
PolicyList is a structure defining schema for Policy list request.
Type of Request Support in ModifySystem.
ProcessConfig is used as both the input of Container.CreateProcess and to convert the parameters to JSON for passing onto the HCS.
ProcessList is the structure of an item returned by a ProcessList call on a container.
ProcessorStats holds the processor statistics for a container.
No description provided by the author
Type of Request Support in ModifySystem.
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 of Resource Support in ModifySystem.
RoutePolicy is a structure defining schema for Route based Policy.
No description provided by the author
Statistics is the structure returned by a statistics call on a container.
StorageStats holds the storage statistics for a container.
Subnet is assoicated with a network and represents a list of subnets available to the network.
SystemType represents the type of the system on which actions are done.
No description provided by the author
No description provided by the author
No description provided by the author