Documentation ¶
Index ¶
- Variables
- func GetComputeSystems(q schema1.ComputeSystemQuery) (_ []schema1.ContainerProperties, err 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
- type ErrorEvent
- type HcsError
- type Process
- func (process *Process) Close() (err error)
- func (process *Process) CloseStdin() (err error)
- func (process *Process) ExitCode() (_ int, err error)
- func (process *Process) Kill() (err error)
- func (process *Process) Pid() int
- func (process *Process) Properties() (_ *ProcessStatus, err error)
- func (process *Process) ResizeConsole(width, height uint16) (err error)
- func (process *Process) Signal(options guestrequest.SignalProcessOptions) (err error)
- func (process *Process) Stdio() (_ io.WriteCloser, _ io.ReadCloser, _ io.ReadCloser, err error)
- func (process *Process) SystemID() string
- func (process *Process) Wait() (err error)
- func (process *Process) WaitTimeout(timeout time.Duration) (err error)
- type ProcessError
- type ProcessStatus
- type System
- func (computeSystem *System) Close() (err error)
- func (computeSystem *System) CreateProcess(c interface{}) (_ *Process, err error)
- func (computeSystem *System) ID() string
- func (computeSystem *System) Modify(config interface{}) (err error)
- func (computeSystem *System) OpenProcess(pid int) (_ *Process, err error)
- func (computeSystem *System) Pause() (err error)
- func (computeSystem *System) Properties(types ...schema1.PropertyType) (_ *schema1.ContainerProperties, err error)
- func (computeSystem *System) Resume() (err error)
- func (computeSystem *System) Shutdown() (err error)
- func (computeSystem *System) Start() (err error)
- func (computeSystem *System) Terminate() (err error)
- func (computeSystem *System) Wait() (err error)
- func (computeSystem *System) WaitExpectedError(expected error) (err error)
- func (computeSystem *System) WaitTimeout(timeout time.Duration) (err 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 the the process cannot be found 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 GetComputeSystems ¶
func GetComputeSystems(q schema1.ComputeSystemQuery) (_ []schema1.ContainerProperties, err error)
GetComputeSystems gets a list of the compute systems on the system that match the query
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 or ErrProcNotFound.
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 or ErrProcNotFound.
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
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) 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) 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) Properties ¶
func (process *Process) Properties() (_ *ProcessStatus, err error)
func (*Process) ResizeConsole ¶
ResizeConsole resizes the console of the process.
func (*Process) Signal ¶ added in v0.7.12
func (process *Process) Signal(options guestrequest.SignalProcessOptions) (err error)
Signal signals the process with `options`.
func (*Process) Stdio ¶
func (process *Process) Stdio() (_ io.WriteCloser, _ io.ReadCloser, _ io.ReadCloser, err 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.
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
type ProcessStatus ¶
type System ¶
type System struct {
// contains filtered or unexported fields
}
func CreateComputeSystem ¶
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) 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(types ...schema1.PropertyType) (_ *schema1.ContainerProperties, err error)
func (*System) Resume ¶
Resume resumes the execution of the computeSystem. This feature is not enabled in TP5.
func (*System) Shutdown ¶
Shutdown requests a compute system shutdown, if IsPending() on the error returned is true, it may not actually be shut down until Wait() succeeds.
func (*System) Terminate ¶
Terminate requests a compute system terminate, if IsPending() on the error returned is true, it may not actually be shut down until Wait() succeeds.
func (*System) WaitExpectedError ¶ added in v0.8.4
WaitExpectedError synchronously waits for the compute system to shutdown or terminate, and ignores the passed error if it occurs.
type SystemError ¶
type SystemError struct { ID string Op string Err error Extra string Events []ErrorEvent }
SystemError is an error encountered in HCS during an operation on a Container object
func (*SystemError) Error ¶
func (e *SystemError) Error() string