...

Source file src/github.com/Microsoft/hcsshim/internal/protocol/guestrequest/types.go

Documentation: github.com/Microsoft/hcsshim/internal/protocol/guestrequest

     1  package guestrequest
     2  
     3  // These are constants for v2 schema modify requests.
     4  
     5  type RequestType string
     6  type ResourceType string
     7  
     8  // RequestType const
     9  const (
    10  	RequestTypeAdd    RequestType = "Add"
    11  	RequestTypeRemove RequestType = "Remove"
    12  	RequestTypePreAdd RequestType = "PreAdd" // For networking
    13  	RequestTypeUpdate RequestType = "Update"
    14  )
    15  
    16  type SignalValueWCOW string
    17  
    18  const (
    19  	SignalValueWCOWCtrlC        SignalValueWCOW = "CtrlC"
    20  	SignalValueWCOWCtrlBreak    SignalValueWCOW = "CtrlBreak"
    21  	SignalValueWCOWCtrlClose    SignalValueWCOW = "CtrlClose"
    22  	SignalValueWCOWCtrlLogOff   SignalValueWCOW = "CtrlLogOff"
    23  	SignalValueWCOWCtrlShutdown SignalValueWCOW = "CtrlShutdown"
    24  )
    25  
    26  // ModificationRequest is for modify commands passed to the guest.
    27  type ModificationRequest struct {
    28  	RequestType  RequestType  `json:"RequestType,omitempty"`
    29  	ResourceType ResourceType `json:"ResourceType,omitempty"`
    30  	Settings     interface{}  `json:"Settings,omitempty"`
    31  }
    32  
    33  type NetworkModifyRequest struct {
    34  	AdapterId   string      `json:"AdapterId,omitempty"` //nolint:stylecheck
    35  	RequestType RequestType `json:"RequestType,omitempty"`
    36  	Settings    interface{} `json:"Settings,omitempty"`
    37  }
    38  
    39  type RS4NetworkModifyRequest struct {
    40  	AdapterInstanceId string      `json:"AdapterInstanceId,omitempty"` //nolint:stylecheck
    41  	RequestType       RequestType `json:"RequestType,omitempty"`
    42  	Settings          interface{} `json:"Settings,omitempty"`
    43  }
    44  
    45  var (
    46  	// V5 GUIDs for SCSI controllers
    47  	// These GUIDs are created with namespace GUID "d422512d-2bf2-4752-809d-7b82b5fcb1b4"
    48  	// and index as names. For example, first GUID is created like this:
    49  	// guid.NewV5("d422512d-2bf2-4752-809d-7b82b5fcb1b4", []byte("0"))
    50  	ScsiControllerGuids = []string{
    51  		"df6d0690-79e5-55b6-a5ec-c1e2f77f580a",
    52  		"0110f83b-de10-5172-a266-78bca56bf50a",
    53  		"b5d2d8d4-3a75-51bf-945b-3444dc6b8579",
    54  		"305891a9-b251-5dfe-91a2-c25d9212275b",
    55  	}
    56  )
    57  

View as plain text