Documentation
¶
Index ¶
- Variables
- func CreateNTFSVHD(ctx context.Context, vhdPath string, sizeGB uint32) (err error)
- func GetComputeSystems(ctx context.Context, q schema1.ComputeSystemQuery) ([]schema1.ContainerProperties, error)
- func GetServiceProperties(ctx context.Context, q hcsschema.PropertyQuery) (*hcsschema.ServiceProperties, error)
- func IsAccessIsDenied(err error) bool
- func IsAlreadyClosed(err error) bool
- func IsAlreadyStopped(err error) bool
- func IsNotExist(err error) bool
- func IsNotSupported(err error) bool
- func IsOperationInvalidState(err error) bool
- func IsPending(err error) bool
- func IsTimeout(err error) bool
- func ModifyServiceSettings(ctx context.Context, settings hcsschema.ModificationRequest) error
- type ErrorEvent
- type HcsError
- type Process
- func (process *Process) Close() (err error)
- func (process *Process) CloseStderr(ctx context.Context) (err error)
- func (process *Process) CloseStdin(ctx context.Context) error
- func (process *Process) CloseStdout(ctx context.Context) (err error)
- func (process *Process) ExitCode() (int, error)
- func (process *Process) Kill(ctx context.Context) (bool, error)
- func (process *Process) Pid() int
- func (process *Process) ResizeConsole(ctx context.Context, width, height uint16) error
- func (process *Process) Signal(ctx context.Context, options interface{}) (bool, error)
- func (process *Process) Stdio() (stdin io.Writer, stdout, stderr io.Reader)
- func (process *Process) StdioLegacy() (_ io.WriteCloser, _ io.ReadCloser, _ io.ReadCloser, err error)
- func (process *Process) SystemID() string
- func (process *Process) Wait() error
- type ProcessError
- type System
- func (computeSystem *System) Close() (err error)
- func (computeSystem *System) CreateProcess(ctx context.Context, c interface{}) (cow.Process, error)
- func (computeSystem *System) ExitError() error
- func (computeSystem *System) ID() string
- func (computeSystem *System) IsOCI() bool
- func (computeSystem *System) Modify(ctx context.Context, config interface{}) error
- func (computeSystem *System) OS() string
- func (computeSystem *System) OpenProcess(ctx context.Context, pid int) (*Process, error)
- func (computeSystem *System) Pause(ctx context.Context) (err error)
- func (computeSystem *System) Properties(ctx context.Context, types ...schema1.PropertyType) (*schema1.ContainerProperties, error)
- func (computeSystem *System) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error)
- func (computeSystem *System) Resume(ctx context.Context) (err error)
- func (computeSystem *System) Save(ctx context.Context, options interface{}) (err error)
- func (computeSystem *System) Shutdown(ctx context.Context) error
- func (computeSystem *System) Start(ctx context.Context) (err error)
- func (computeSystem *System) Terminate(ctx context.Context) error
- func (computeSystem *System) Wait() error
- type SystemError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrComputeSystemDoesNotExist is an error encountered when the container being operated on no longer exists ErrComputeSystemDoesNotExist = syscall.Errno(0xc037010e) // ErrElementNotFound is an error encountered when the object being referenced does not exist ErrElementNotFound = syscall.Errno(0x490) // ErrElementNotFound is an error encountered when the object being referenced does not exist ErrNotSupported = syscall.Errno(0x32) // ErrInvalidData is an error encountered when the request being sent to hcs is invalid/unsupported // decimal -2147024883 / hex 0x8007000d ErrInvalidData = syscall.Errno(0xd) // ErrHandleClose is an error encountered when the handle generating the notification being waited on has been closed ErrHandleClose = errors.New("hcsshim: the handle generating this notification has been closed") // ErrAlreadyClosed is an error encountered when using a handle that has been closed by the Close method ErrAlreadyClosed = errors.New("hcsshim: the handle has already been closed") // ErrInvalidNotificationType is an error encountered when an invalid notification type is used ErrInvalidNotificationType = errors.New("hcsshim: invalid notification type") // ErrInvalidProcessState is an error encountered when the process is not in a valid state for the requested operation ErrInvalidProcessState = errors.New("the process is in an invalid state for the attempted operation") // ErrTimeout is an error encountered when waiting on a notification times out ErrTimeout = errors.New("hcsshim: timeout waiting for notification") // ErrUnexpectedContainerExit is the error encountered when a container exits while waiting for // a different expected notification ErrUnexpectedContainerExit = errors.New("unexpected container exit") // ErrUnexpectedProcessAbort is the error encountered when communication with the compute service // is lost while waiting for a notification ErrUnexpectedProcessAbort = errors.New("lost communication with compute service") // ErrUnexpectedValue is an error encountered when hcs returns an invalid value ErrUnexpectedValue = errors.New("unexpected value returned from hcs") // ErrVmcomputeAlreadyStopped is an error encountered when a shutdown or terminate request is made on a stopped container ErrVmcomputeAlreadyStopped = syscall.Errno(0xc0370110) // ErrVmcomputeOperationPending is an error encountered when the operation is being completed asynchronously ErrVmcomputeOperationPending = syscall.Errno(0xC0370103) // ErrVmcomputeOperationInvalidState is an error encountered when the compute system is not in a valid state for the requested operation ErrVmcomputeOperationInvalidState = syscall.Errno(0xc0370105) // ErrProcNotFound is an error encountered when a procedure look up fails. ErrProcNotFound = syscall.Errno(0x7f) // 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 = syscall.Errno(0x5) // ErrVmcomputeInvalidJSON is an error encountered when the compute system does not support/understand the messages sent by management ErrVmcomputeInvalidJSON = syscall.Errno(0xc037010d) // ErrVmcomputeUnknownMessage is an error encountered guest compute system doesn't support the message ErrVmcomputeUnknownMessage = syscall.Errno(0xc037010b) // ErrVmcomputeUnexpectedExit is an error encountered when the compute system terminates unexpectedly ErrVmcomputeUnexpectedExit = syscall.Errno(0xC0370106) // ErrNotSupported is an error encountered when hcs doesn't support the request ErrPlatformNotSupported = errors.New("unsupported platform request") )
Functions ¶
func CreateNTFSVHD ¶ added in v0.8.8
CreateNTFSVHD creates a VHD formatted with NTFS of size `sizeGB` at the given `vhdPath`.
func GetComputeSystems ¶
func GetComputeSystems(ctx context.Context, q schema1.ComputeSystemQuery) ([]schema1.ContainerProperties, error)
GetComputeSystems gets a list of the compute systems on the system that match the query
func GetServiceProperties ¶ added in v0.8.10
func GetServiceProperties(ctx context.Context, q hcsschema.PropertyQuery) (*hcsschema.ServiceProperties, error)
GetServiceProperties returns properties of the host compute service.
func IsAccessIsDenied ¶ added in v0.8.15
IsAccessIsDenied returns true when err is caused by `ErrVmcomputeOperationAccessIsDenied`.
func IsAlreadyClosed ¶
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 ¶
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.
func IsNotExist ¶
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.
func IsNotSupported ¶
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 IsOperationInvalidState ¶ added in v0.8.7
IsOperationInvalidState returns true when err is caused by `ErrVmcomputeOperationInvalidState`.
func IsPending ¶
IsPending returns a boolean indicating whether the error is that the requested operation is being completed in the background.
func IsTimeout ¶
IsTimeout returns a boolean indicating whether the error is caused by a timeout waiting for the operation to complete.
func ModifyServiceSettings ¶ added in v0.8.10
func ModifyServiceSettings(ctx context.Context, settings hcsschema.ModificationRequest) error
ModifyServiceSettings modifies settings of the host compute service.
Types ¶
type ErrorEvent ¶
type ErrorEvent struct { Message string `json:"Message,omitempty"` // Fully formated error message StackTrace string `json:"StackTrace,omitempty"` // Stack trace in string form Provider string `json:"Provider,omitempty"` EventID uint16 `json:"EventId,omitempty"` Flags uint32 `json:"Flags,omitempty"` Source string `json:"Source,omitempty"` }
func (*ErrorEvent) String ¶
func (ev *ErrorEvent) String() string
type HcsError ¶
type HcsError struct { Op string Err error Events []ErrorEvent }
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
ContainerError is an error encountered in HCS
func (*Process) Close ¶
Close cleans up any state associated with the process but does not kill or wait on it.
func (*Process) CloseStderr ¶ added in v0.8.17
func (*Process) CloseStdin ¶
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.
func (*Process) CloseStdout ¶ added in v0.8.17
func (*Process) ExitCode ¶
ExitCode returns the exit code of the process. The process must have already terminated.
func (*Process) Kill ¶
Kill signals the process to terminate but does not wait for it to finish terminating.
func (*Process) ResizeConsole ¶
ResizeConsole resizes the console of the process.
func (*Process) Signal ¶ added in v0.7.12
Signal signals the process with `options`.
For LCOW `guestrequest.SignalProcessOptionsLCOW`.
For WCOW `guestrequest.SignalProcessOptionsWCOW`.
func (*Process) Stdio ¶
Stdio returns the stdin, stdout, and stderr pipes, respectively. To close them, close the process handle.
func (*Process) StdioLegacy ¶ added in v0.8.7
func (process *Process) StdioLegacy() (_ io.WriteCloser, _ io.ReadCloser, _ io.ReadCloser, err error)
StdioLegacy returns the stdin, stdout, and stderr pipes, respectively. Closing these pipes does not close the underlying pipes. Once returned, these pipes are the responsibility of the caller to close.
type ProcessError ¶
type ProcessError struct { SystemID string Pid int Op string Err error Events []ErrorEvent }
ProcessError is an error encountered in HCS during an operation on a Process object
func (*ProcessError) Error ¶
func (e *ProcessError) Error() string
func (*ProcessError) Temporary ¶ added in v0.8.7
func (e *ProcessError) Temporary() bool
func (*ProcessError) Timeout ¶ added in v0.8.7
func (e *ProcessError) Timeout() bool
type System ¶
type System struct {
// contains filtered or unexported fields
}
func CreateComputeSystem ¶
func CreateComputeSystem(ctx context.Context, id string, hcsDocumentInterface interface{}) (_ *System, err error)
CreateComputeSystem creates a new compute system with the given configuration but does not start it.
func OpenComputeSystem ¶
OpenComputeSystem opens an existing compute system by ID.
func (*System) Close ¶
Close cleans up any state associated with the compute system but does not terminate or wait for it.
func (*System) CreateProcess ¶
CreateProcess launches a new process within the computeSystem.
func (*System) ExitError ¶ added in v0.8.7
ExitError returns an error describing the reason the compute system terminated.
func (*System) IsOCI ¶ added in v0.8.7
IsOCI returns whether processes in the compute system should be created via OCI.
func (*System) OS ¶ added in v0.8.7
OS returns the operating system of the compute system, "linux" or "windows".
func (*System) OpenProcess ¶
OpenProcess gets an interface to an existing process within the computeSystem.
func (*System) Pause ¶
Pause pauses the execution of the computeSystem. This feature is not enabled in TP5.
func (*System) Properties ¶
func (computeSystem *System) Properties(ctx context.Context, types ...schema1.PropertyType) (*schema1.ContainerProperties, error)
Properties returns the requested container properties targeting a V1 schema container.
func (*System) PropertiesV2 ¶ added in v0.8.7
func (computeSystem *System) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error)
PropertiesV2 returns the requested container properties targeting a V2 schema container.
func (*System) Resume ¶
Resume resumes the execution of the computeSystem. This feature is not enabled in TP5.
type SystemError ¶
type SystemError struct { ID string Op string Err error Events []ErrorEvent }
SystemError is an error encountered in HCS during an operation on a Container object
func (*SystemError) Error ¶
func (e *SystemError) Error() string
func (*SystemError) Temporary ¶ added in v0.8.7
func (e *SystemError) Temporary() bool
func (*SystemError) Timeout ¶ added in v0.8.7
func (e *SystemError) Timeout() bool