1
2
3 package schema1
4
5 import (
6 "encoding/json"
7 "time"
8
9 "github.com/Microsoft/go-winio/pkg/guid"
10 hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2"
11 )
12
13
14
15 type ProcessConfig struct {
16 ApplicationName string `json:",omitempty"`
17 CommandLine string `json:",omitempty"`
18 CommandArgs []string `json:",omitempty"`
19 User string `json:",omitempty"`
20 WorkingDirectory string `json:",omitempty"`
21 Environment map[string]string `json:",omitempty"`
22 EmulateConsole bool `json:",omitempty"`
23 CreateStdInPipe bool `json:",omitempty"`
24 CreateStdOutPipe bool `json:",omitempty"`
25 CreateStdErrPipe bool `json:",omitempty"`
26 ConsoleSize [2]uint `json:",omitempty"`
27 CreateInUtilityVm bool `json:",omitempty"`
28 OCISpecification *json.RawMessage `json:",omitempty"`
29 }
30
31 type Layer struct {
32 ID string
33 Path string
34 }
35
36 type MappedDir struct {
37 HostPath string
38 ContainerPath string
39 ReadOnly bool
40 BandwidthMaximum uint64
41 IOPSMaximum uint64
42 CreateInUtilityVM bool
43
44 LinuxMetadata bool `json:",omitempty"`
45 }
46
47 type MappedPipe struct {
48 HostPath string
49 ContainerPipeName string
50 }
51
52 type HvRuntime struct {
53 ImagePath string `json:",omitempty"`
54 SkipTemplate bool `json:",omitempty"`
55 LinuxInitrdFile string `json:",omitempty"`
56 LinuxKernelFile string `json:",omitempty"`
57 LinuxBootParameters string `json:",omitempty"`
58 BootSource string `json:",omitempty"`
59 WritableBootSource bool `json:",omitempty"`
60 }
61
62 type MappedVirtualDisk struct {
63 HostPath string `json:",omitempty"`
64 ContainerPath string
65 CreateInUtilityVM bool `json:",omitempty"`
66 ReadOnly bool `json:",omitempty"`
67 Cache string `json:",omitempty"`
68 AttachOnly bool `json:",omitempty"`
69 }
70
71
72
73
74 type AssignedDevice struct {
75
76 InterfaceClassGUID string `json:"InterfaceClassGuid,omitempty"`
77 }
78
79
80
81 type ContainerConfig struct {
82 SystemType string
83 Name string
84 Owner string `json:",omitempty"`
85 VolumePath string `json:",omitempty"`
86 IgnoreFlushesDuringBoot bool `json:",omitempty"`
87 LayerFolderPath string `json:",omitempty"`
88 Layers []Layer
89 Credentials string `json:",omitempty"`
90 ProcessorCount uint32 `json:",omitempty"`
91 ProcessorWeight uint64 `json:",omitempty"`
92 ProcessorMaximum int64 `json:",omitempty"`
93 StorageIOPSMaximum uint64 `json:",omitempty"`
94 StorageBandwidthMaximum uint64 `json:",omitempty"`
95 StorageSandboxSize uint64 `json:",omitempty"`
96 MemoryMaximumInMB int64 `json:",omitempty"`
97 HostName string `json:",omitempty"`
98 MappedDirectories []MappedDir `json:",omitempty"`
99 MappedPipes []MappedPipe `json:",omitempty"`
100 HvPartition bool
101 NetworkSharedContainerName string `json:",omitempty"`
102 EndpointList []string `json:",omitempty"`
103 HvRuntime *HvRuntime `json:",omitempty"`
104 Servicing bool `json:",omitempty"`
105 AllowUnqualifiedDNSQuery bool `json:",omitempty"`
106 DNSSearchList string `json:",omitempty"`
107 ContainerType string `json:",omitempty"`
108 TerminateOnLastHandleClosed bool `json:",omitempty"`
109 MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"`
110 AssignedDevices []AssignedDevice `json:",omitempty"`
111 }
112
113 type ComputeSystemQuery struct {
114 IDs []string `json:"Ids,omitempty"`
115 Types []string `json:",omitempty"`
116 Names []string `json:",omitempty"`
117 Owners []string `json:",omitempty"`
118 }
119
120 type PropertyType string
121
122 const (
123 PropertyTypeStatistics PropertyType = "Statistics"
124 PropertyTypeProcessList PropertyType = "ProcessList"
125 PropertyTypeMappedVirtualDisk PropertyType = "MappedVirtualDisk"
126 PropertyTypeGuestConnection PropertyType = "GuestConnection"
127 )
128
129 type PropertyQuery struct {
130 PropertyTypes []PropertyType `json:",omitempty"`
131 }
132
133
134 type ContainerProperties struct {
135 ID string `json:"Id"`
136 State string
137 Name string
138 SystemType string
139 RuntimeOSType string `json:"RuntimeOsType,omitempty"`
140 Owner string
141 SiloGUID string `json:"SiloGuid,omitempty"`
142 RuntimeID guid.GUID `json:"RuntimeId,omitempty"`
143 IsRuntimeTemplate bool `json:",omitempty"`
144 RuntimeImagePath string `json:",omitempty"`
145 Stopped bool `json:",omitempty"`
146 ExitType string `json:",omitempty"`
147 AreUpdatesPending bool `json:",omitempty"`
148 ObRoot string `json:",omitempty"`
149 Statistics Statistics `json:",omitempty"`
150 ProcessList []ProcessListItem `json:",omitempty"`
151 MappedVirtualDiskControllers map[int]MappedVirtualDiskController `json:",omitempty"`
152 GuestConnectionInfo GuestConnectionInfo `json:",omitempty"`
153 }
154
155
156 type MemoryStats struct {
157 UsageCommitBytes uint64 `json:"MemoryUsageCommitBytes,omitempty"`
158 UsageCommitPeakBytes uint64 `json:"MemoryUsageCommitPeakBytes,omitempty"`
159 UsagePrivateWorkingSetBytes uint64 `json:"MemoryUsagePrivateWorkingSetBytes,omitempty"`
160 }
161
162
163 type ProcessorStats struct {
164 TotalRuntime100ns uint64 `json:",omitempty"`
165 RuntimeUser100ns uint64 `json:",omitempty"`
166 RuntimeKernel100ns uint64 `json:",omitempty"`
167 }
168
169
170 type StorageStats struct {
171 ReadCountNormalized uint64 `json:",omitempty"`
172 ReadSizeBytes uint64 `json:",omitempty"`
173 WriteCountNormalized uint64 `json:",omitempty"`
174 WriteSizeBytes uint64 `json:",omitempty"`
175 }
176
177
178 type NetworkStats struct {
179 BytesReceived uint64 `json:",omitempty"`
180 BytesSent uint64 `json:",omitempty"`
181 PacketsReceived uint64 `json:",omitempty"`
182 PacketsSent uint64 `json:",omitempty"`
183 DroppedPacketsIncoming uint64 `json:",omitempty"`
184 DroppedPacketsOutgoing uint64 `json:",omitempty"`
185 EndpointId string `json:",omitempty"`
186 InstanceId string `json:",omitempty"`
187 }
188
189
190 type Statistics struct {
191 Timestamp time.Time `json:",omitempty"`
192 ContainerStartTime time.Time `json:",omitempty"`
193 Uptime100ns uint64 `json:",omitempty"`
194 Memory MemoryStats `json:",omitempty"`
195 Processor ProcessorStats `json:",omitempty"`
196 Storage StorageStats `json:",omitempty"`
197 Network []NetworkStats `json:",omitempty"`
198 }
199
200
201 type ProcessListItem struct {
202 CreateTimestamp time.Time `json:",omitempty"`
203 ImageName string `json:",omitempty"`
204 KernelTime100ns uint64 `json:",omitempty"`
205 MemoryCommitBytes uint64 `json:",omitempty"`
206 MemoryWorkingSetPrivateBytes uint64 `json:",omitempty"`
207 MemoryWorkingSetSharedBytes uint64 `json:",omitempty"`
208 ProcessId uint32 `json:",omitempty"`
209 UserTime100ns uint64 `json:",omitempty"`
210 }
211
212
213 type MappedVirtualDiskController struct {
214 MappedVirtualDisks map[int]MappedVirtualDisk `json:",omitempty"`
215 }
216
217
218 type GuestDefinedCapabilities struct {
219 NamespaceAddRequestSupported bool `json:",omitempty"`
220 SignalProcessSupported bool `json:",omitempty"`
221 DumpStacksSupported bool `json:",omitempty"`
222 DeleteContainerStateSupported bool `json:",omitempty"`
223 UpdateContainerSupported bool `json:",omitempty"`
224 }
225
226
227 type GuestConnectionInfo struct {
228 SupportedSchemaVersions []hcsschema.Version `json:",omitempty"`
229 ProtocolVersion uint32 `json:",omitempty"`
230 GuestDefinedCapabilities GuestDefinedCapabilities `json:",omitempty"`
231 }
232
233
234 type RequestType string
235
236
237 type ResourceType string
238
239
240 const (
241 Add RequestType = "Add"
242 Remove RequestType = "Remove"
243 Network ResourceType = "Network"
244 )
245
246
247
248 type ResourceModificationRequestResponse struct {
249 Resource ResourceType `json:"ResourceType"`
250 Data interface{} `json:"Settings"`
251 Request RequestType `json:"RequestType,omitempty"`
252 }
253
View as plain text