endia 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +34 -2
  3. package/dist/archives/archive-file.d.ts +36 -0
  4. package/dist/archives/archive-file.js +71 -0
  5. package/dist/archives/build-context.d.ts +63 -0
  6. package/dist/archives/build-context.js +132 -0
  7. package/dist/archives/docker-ignore.d.ts +57 -0
  8. package/dist/archives/docker-ignore.js +250 -0
  9. package/dist/archives/fleet-archive.d.ts +33 -0
  10. package/dist/archives/fleet-archive.js +134 -0
  11. package/dist/compose-model.d.ts +32 -0
  12. package/dist/compose-model.js +39 -0
  13. package/dist/contract/archives.d.ts +14 -0
  14. package/dist/contract/archives.js +1 -0
  15. package/dist/contract/bases.d.ts +48 -0
  16. package/dist/contract/bases.js +1 -0
  17. package/dist/contract/clients.d.ts +29 -0
  18. package/dist/contract/clients.js +1 -0
  19. package/dist/contract/common.d.ts +30 -0
  20. package/dist/contract/common.js +1 -0
  21. package/dist/contract/compose.d.ts +27 -0
  22. package/dist/contract/compose.js +1 -0
  23. package/dist/contract/desktop.d.ts +269 -0
  24. package/dist/contract/desktop.js +1 -0
  25. package/dist/contract/execs.d.ts +61 -0
  26. package/dist/contract/execs.js +1 -0
  27. package/dist/contract/fleets.d.ts +136 -0
  28. package/dist/contract/fleets.js +1 -0
  29. package/dist/contract/images.d.ts +130 -0
  30. package/dist/contract/images.js +1 -0
  31. package/dist/contract/machines.d.ts +199 -0
  32. package/dist/contract/machines.js +1 -0
  33. package/dist/contract/operations.d.ts +28 -0
  34. package/dist/contract/operations.js +1 -0
  35. package/dist/contract/processes.d.ts +75 -0
  36. package/dist/contract/processes.js +1 -0
  37. package/dist/contract/purposes.d.ts +62 -0
  38. package/dist/contract/purposes.js +1 -0
  39. package/dist/contract/space.d.ts +114 -0
  40. package/dist/contract/space.js +1 -0
  41. package/dist/contract/stats.d.ts +58 -0
  42. package/dist/contract/stats.js +1 -0
  43. package/dist/contract/status.d.ts +151 -0
  44. package/dist/contract/status.js +1 -0
  45. package/dist/contract/volumes.d.ts +22 -0
  46. package/dist/contract/volumes.js +1 -0
  47. package/dist/eastindia-client.d.ts +118 -0
  48. package/dist/eastindia-client.js +142 -0
  49. package/dist/environment.d.ts +52 -0
  50. package/dist/environment.js +133 -0
  51. package/dist/errors.d.ts +81 -0
  52. package/dist/errors.js +108 -0
  53. package/dist/exec/exec-frame.d.ts +38 -0
  54. package/dist/exec/exec-frame.js +50 -0
  55. package/dist/exec/exec-session.d.ts +64 -0
  56. package/dist/exec/exec-session.js +117 -0
  57. package/dist/groups/archives.d.ts +78 -0
  58. package/dist/groups/archives.js +117 -0
  59. package/dist/groups/bases.d.ts +28 -0
  60. package/dist/groups/bases.js +39 -0
  61. package/dist/groups/certificates.d.ts +32 -0
  62. package/dist/groups/certificates.js +43 -0
  63. package/dist/groups/desktop.d.ts +143 -0
  64. package/dist/groups/desktop.js +182 -0
  65. package/dist/groups/execs.d.ts +110 -0
  66. package/dist/groups/execs.js +119 -0
  67. package/dist/groups/fleets.d.ts +206 -0
  68. package/dist/groups/fleets.js +255 -0
  69. package/dist/groups/images.d.ts +130 -0
  70. package/dist/groups/images.js +109 -0
  71. package/dist/groups/machines.d.ts +124 -0
  72. package/dist/groups/machines.js +127 -0
  73. package/dist/groups/operations.d.ts +127 -0
  74. package/dist/groups/operations.js +174 -0
  75. package/dist/groups/processes.d.ts +77 -0
  76. package/dist/groups/processes.js +75 -0
  77. package/dist/groups/stats.d.ts +29 -0
  78. package/dist/groups/stats.js +33 -0
  79. package/dist/groups/system.d.ts +33 -0
  80. package/dist/groups/system.js +40 -0
  81. package/dist/groups/volumes.d.ts +36 -0
  82. package/dist/groups/volumes.js +40 -0
  83. package/dist/index.d.ts +37 -0
  84. package/dist/index.js +20 -0
  85. package/dist/purposes.d.ts +17 -0
  86. package/dist/purposes.js +21 -0
  87. package/dist/routes.d.ts +71 -0
  88. package/dist/routes.js +73 -0
  89. package/dist/transport/api-connection.d.ts +185 -0
  90. package/dist/transport/api-connection.js +396 -0
  91. package/dist/transport/connection-failures.d.ts +14 -0
  92. package/dist/transport/connection-failures.js +57 -0
  93. package/dist/transport/json-lines.d.ts +10 -0
  94. package/dist/transport/json-lines.js +23 -0
  95. package/dist/transport/query-text.d.ts +49 -0
  96. package/dist/transport/query-text.js +62 -0
  97. package/dist/transport/service-address.d.ts +30 -0
  98. package/dist/transport/service-address.js +37 -0
  99. package/dist/transport/tls-files.d.ts +9 -0
  100. package/dist/transport/tls-files.js +1 -0
  101. package/package.json +44 -5
@@ -0,0 +1,199 @@
1
+ import type { ApiError, Timestamp } from "./common.js";
2
+ import type { PurposeDetail, PurposeSource, PurposeSummary } from "./purposes.js";
3
+ /** One machine as `endia ps` and `endia compose ps` list it: what it is, which fleet and service it belongs to, what it runs, and its state, readiness and health as Hyper-V and its record give them now. */
4
+ export interface MachineSummary {
5
+ /** The machine ID: the Hyper-V ID of its virtual machine, as a lower-case GUID with hyphens. */
6
+ readonly id: string;
7
+ /** The machine name, for example `classroom-server-1`. */
8
+ readonly name: string;
9
+ /** The name of the fleet the machine belongs to. */
10
+ readonly fleet: string;
11
+ /** The Compose service the machine runs. */
12
+ readonly service: string;
13
+ /** The machine's number among the replicas of its service, from 1. */
14
+ readonly index: number;
15
+ /** The image as the service names it, for example `lab/dotnet:10`. */
16
+ readonly image: string;
17
+ /** The digest of the image the machine was made from. */
18
+ readonly imageDigest: string;
19
+ /** The main process's command line, its words joined by spaces; empty when the machine has no main process. */
20
+ readonly command: string;
21
+ /** When the machine was created. */
22
+ readonly created: Timestamp;
23
+ /** The machine's state: `created`, `running`, `restarting`, `exited` or `removing`. */
24
+ readonly state: string;
25
+ /** The state in Docker's words, such as `Up 3 minutes (healthy)`, as `MachineStatusText` words it. */
26
+ readonly status: string;
27
+ /** The exit code of the machine's last stop, or null when none is recorded. */
28
+ readonly exitCode: number | null;
29
+ /** Whether the machine is ready: its virtual machine runs, it was configured in this boot, and nothing has failed since. */
30
+ readonly ready: boolean;
31
+ /** The machine's health: `none`, `starting`, `healthy` or `unhealthy`. */
32
+ readonly health: string;
33
+ /** The machine's ports published on the host. */
34
+ readonly ports: readonly PortBinding[];
35
+ /** What the machine is being used for: its own purpose, else its fleet's, else null. */
36
+ readonly purpose: PurposeSummary | null;
37
+ /** Where `purpose` comes from, or null when there is none. */
38
+ readonly purposeSource: PurposeSource | null;
39
+ }
40
+ /** One port of a machine published on the host: a program on the host that connects to `HostIp` and `Published` reaches `Target` inside the machine. */
41
+ export interface PortBinding {
42
+ /** The host address the port listens on: `127.0.0.1`. */
43
+ readonly hostIp: string;
44
+ /** The port on the host. */
45
+ readonly published: number;
46
+ /** The TCP port inside the machine. */
47
+ readonly target: number;
48
+ }
49
+ /** One machine in full, as `endia inspect` prints it: the machine's record with what was created for it and what has happened to it since, and what its virtual machine and guest service report now: its addresses, its boot, and its desktop user. */
50
+ export interface MachineDetail {
51
+ /** The machine ID: the Hyper-V ID of its virtual machine, as a lower-case GUID with hyphens. */
52
+ readonly id: string;
53
+ /** The machine name. */
54
+ readonly name: string;
55
+ /** The name of the fleet the machine belongs to. */
56
+ readonly fleet: string;
57
+ /** The Compose service the machine runs. */
58
+ readonly service: string;
59
+ /** The machine's number among the replicas of its service, from 1. */
60
+ readonly index: number;
61
+ /** The image as the service names it. */
62
+ readonly image: string;
63
+ /** The digest of the image the machine was made from. */
64
+ readonly imageDigest: string;
65
+ /** The service's resolved definition the machine was created with, as `compose config --format json` prints a service. */
66
+ readonly definition: unknown;
67
+ /** When the machine was created. */
68
+ readonly created: Timestamp;
69
+ /** The Windows computer name inside the machine. */
70
+ readonly computerName: string;
71
+ /** The most memory the machine may grow to, in bytes: its service's memory limit, or the configured ceiling when the service sets none. */
72
+ readonly memoryBytes: number;
73
+ /** The memory the machine starts with, in bytes. A machine whose record was written when machines had static memory starts with all of `memoryBytes`, and gives that figure here. */
74
+ readonly startupMemoryBytes: number;
75
+ /** The machine's number of virtual processors. */
76
+ readonly processors: number;
77
+ /** The machine's network cards. */
78
+ readonly cards: readonly MachineCardDetail[];
79
+ /** The named volumes attached to the machine. */
80
+ readonly volumes: readonly MachineVolumeDetail[];
81
+ /** The machine's ports published on the host. */
82
+ readonly ports: readonly PortBinding[];
83
+ /** The machine's state: `created`, `running`, `restarting`, `exited` or `removing`. */
84
+ readonly state: string;
85
+ /** Whether the machine is ready, as `MachineSummary.ready` says. When its image signs a user in by itself, ready also means that user was signed in with the desktop helper ready. */
86
+ readonly ready: boolean;
87
+ /** Whether a user stopped the machine, which the restart policy `unless-stopped` respects. */
88
+ readonly stoppedByUser: boolean;
89
+ /** How many times EastIndia has started the machine again under its restart policy. */
90
+ readonly restartCount: number;
91
+ /** When the machine last started, or null when it never has. */
92
+ readonly started: Timestamp | null;
93
+ /** When the machine last stopped, or null when it never has. */
94
+ readonly exited: Timestamp | null;
95
+ /** The exit code of the machine's last stop, or null when none is recorded. */
96
+ readonly exitCode: number | null;
97
+ /** The guest service's boot ID: from the guest service while the machine runs and answers, otherwise the one last recorded, or null. */
98
+ readonly bootId: string | null;
99
+ /** The boot ID of the boot in which the machine was last made ready, or null when it never was. The machine is ready while it runs, has no last error, and this ID equals the boot ID recorded for its current boot. */
100
+ readonly readyBootId: string | null;
101
+ /** The machine's main process as last recorded, or null when it has none or it has not started. */
102
+ readonly mainProcess: MainProcessDetail | null;
103
+ /** The machine's health checks: their status, failing streak and last results. */
104
+ readonly health: MachineHealthDetail;
105
+ /** The error that last stopped the machine or kept it from starting, or null. */
106
+ readonly lastError: ApiError | null;
107
+ /** The machine's IPv4 addresses by network: each fleet network's static address under the network's name, and the address Hyper-V reports for the `internet` card under `internet` while the machine runs. */
108
+ readonly addresses: Readonly<Record<string, string>>;
109
+ /** The account signed in on the machine's desktop, or null when none is or the guest service does not answer. */
110
+ readonly desktopUser: string | null;
111
+ /** Whether the desktop helper in that account's session has reported ready. */
112
+ readonly desktopReady: boolean;
113
+ /** Whether the elevation prompt can be automated, which is when `PromptOnSecureDesktop` is 0 in the machine; null while the guest service does not report that value. */
114
+ readonly uacPromptAutomation: boolean | null;
115
+ /** What the machine is being used for, in full: its own purpose, else its fleet's, else null. */
116
+ readonly purpose: PurposeDetail | null;
117
+ /** Where `purpose` comes from, or null when there is none. */
118
+ readonly purposeSource: PurposeSource | null;
119
+ }
120
+ /** One network card of a machine: the network and switch it is on, and the addresses it was given. */
121
+ export interface MachineCardDetail {
122
+ /** The name of the fleet network the card is on, or `internet` for the card on the host's internet switch. */
123
+ readonly network: string;
124
+ /** The name of the Hyper-V switch the card is connected to. */
125
+ readonly switchName: string;
126
+ /** The card's MAC address. */
127
+ readonly macAddress: string;
128
+ /** The card's static IPv4 address on a fleet network, or null for the `internet` card, which takes its address by DHCP. */
129
+ readonly ipv4Address: string | null;
130
+ }
131
+ /** One named volume attached to a machine: where its disk is attached and where the guest service mounts it. */
132
+ export interface MachineVolumeDetail {
133
+ /** The volume's name. */
134
+ readonly name: string;
135
+ /** The folder inside the machine where the volume is mounted, for example `C:\data`. */
136
+ readonly target: string;
137
+ /** Whether the volume is mounted read-only. */
138
+ readonly readOnly: boolean;
139
+ /** The location on SCSI controller 0 where the volume's disk is attached: 1 for the first volume, 2 for the next, and so on. */
140
+ readonly scsiLocation: number;
141
+ }
142
+ /** A machine's main process as last recorded: its process ID and start time, and once it has exited, its exit code and exit time. */
143
+ export interface MainProcessDetail {
144
+ /** The process ID inside the machine. */
145
+ readonly pid: number;
146
+ /** When the process started. */
147
+ readonly started: Timestamp;
148
+ /** The process's exit code, or null while it runs. */
149
+ readonly exitCode: number | null;
150
+ /** When the process exited, or null while it runs. */
151
+ readonly exited: Timestamp | null;
152
+ }
153
+ /** A machine's health checks as `endia inspect` shows them: the status they have given it, how many have failed in a row, and the last results, so that a caller can see why a machine is unhealthy. */
154
+ export interface MachineHealthDetail {
155
+ /** The status: `none`, `starting`, `healthy` or `unhealthy`. */
156
+ readonly status: string;
157
+ /** How many checks in a row have failed since the last success. */
158
+ readonly failingStreak: number;
159
+ /** The last five results at most, oldest first. */
160
+ readonly log: readonly HealthCheckRunDetail[];
161
+ }
162
+ /** One run of a machine's health check: when it ran, how it exited and what it printed. */
163
+ export interface HealthCheckRunDetail {
164
+ /** When the check started. */
165
+ readonly start: Timestamp;
166
+ /** When the check ended. */
167
+ readonly end: Timestamp;
168
+ /** The check's exit code; 0 is a success. */
169
+ readonly exitCode: number;
170
+ /** What the check printed, cut to 4096 bytes. */
171
+ readonly output: string;
172
+ }
173
+ /** One line of a machine's main process output, as the log routes stream it, one JSON object per line of `application/x-ndjson`. A fleet's log route names the machine of each line; a machine's own log route does not. */
174
+ export interface MachineLogLine {
175
+ /** The machine that wrote the line; present only in a fleet's log. */
176
+ readonly machine?: string | null;
177
+ /** When the line was written. */
178
+ readonly time: Timestamp;
179
+ /** The output the line came from: `stdout` or `stderr`. */
180
+ readonly stream: string;
181
+ /** The text of the line, without its line ending. */
182
+ readonly line: string;
183
+ }
184
+ /** The result of `endia start` and `endia stop`: the machines the operation acted on. */
185
+ export interface MachinesResult {
186
+ /** The names of the machines started or stopped. */
187
+ readonly machines: readonly string[];
188
+ }
189
+ /** The result of `endia restart` for one machine: the boot it left, the boot it reached, and whether its virtual machine had to be turned off. */
190
+ export interface MachineRestartResult {
191
+ /** The machine's name. */
192
+ readonly name: string;
193
+ /** The guest service's boot ID before the restart, or null when the machine was not running. */
194
+ readonly previousBootId: string | null;
195
+ /** The guest service's boot ID after the restart, which a restart that succeeds always has. */
196
+ readonly bootId: string;
197
+ /** Whether the virtual machine was turned off rather than Windows restarting in an orderly way. */
198
+ readonly turnedOff: boolean;
199
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { ApiError, Timestamp } from "./common.js";
2
+ /**
3
+ * Work the service carries out in the background because it takes seconds to hours and must survive the caller disconnecting:
4
+ * a build, an import, a fleet or machine change, or a prune.
5
+ *
6
+ * @typeParam TResult - The result the operation's kind gives when it succeeds.
7
+ */
8
+ export interface Operation<TResult = unknown> {
9
+ /** 32 lower-case hexadecimal digits. */
10
+ readonly id: string;
11
+ /** What the operation does: `import`, `basePrepare`, `build`, `prune`, `fleetUp`, `fleetDown`, `fleetStop`, `fleetStart`, `fleetRestart`, `machineStart`, `machineStop` or `machineRestart`. */
12
+ readonly kind: string;
13
+ /** The image reference, fleet or machine the operation works on. */
14
+ readonly target: string;
15
+ /** `queued`, `running`, `cancelling`, or one of the final states `succeeded`, `failed`, `cancelled` and `interrupted`. */
16
+ readonly state: string;
17
+ /** The step the operation is on, such as `Step 2/5 : RUN setup.cmd`, or null. */
18
+ readonly step?: string | null;
19
+ readonly created: Timestamp;
20
+ readonly started?: Timestamp | null;
21
+ readonly finished?: Timestamp | null;
22
+ /** The name of the client certificate that started the operation. */
23
+ readonly caller: string;
24
+ /** The result, once the operation has succeeded; otherwise null. */
25
+ readonly result?: TResult | null;
26
+ /** Why the operation failed, was cancelled or was interrupted; otherwise null. */
27
+ readonly error?: ApiError | null;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,75 @@
1
+ import type { Timestamp, WindowBounds } from "./common.js";
2
+ /** One process running in a machine, as `endia process ls` lists it, as `docker top` lists a container's processes. */
3
+ export interface ProcessSummary {
4
+ /** The process ID. */
5
+ readonly processId: number;
6
+ /** The ID of the process that started it; that process may have ended since. */
7
+ readonly parentProcessId: number;
8
+ /** The Windows session it runs in: 0 for the background session, greater than 0 for the desktop user's. */
9
+ readonly sessionId: number;
10
+ /** The account it runs as, as `DOMAIN\name`, or null when Windows does not say. */
11
+ readonly user: string | null;
12
+ /** When it started, which `--started` takes to name it safely, or null when Windows does not say. */
13
+ readonly started: Timestamp | null;
14
+ /** The program's file name, for example `notepad.exe`. */
15
+ readonly name: string;
16
+ }
17
+ /** One process in full, as `endia process inspect` prints it: what it runs, as whom, whether it still runs, and its windows. A process that has ended is known only when EastIndia started it on the machine's current boot, and then only what EastIndia recorded when it started it: a member that is no longer known is null. */
18
+ export interface ProcessDetail {
19
+ /** The process ID. */
20
+ readonly processId: number;
21
+ /** The ID of the process that started it, or null when it is not known. */
22
+ readonly parentProcessId: number | null;
23
+ /** The program's file name, or null when it is not known. */
24
+ readonly name: string | null;
25
+ /** The program's full path, or null when it is not known. */
26
+ readonly executablePath: string | null;
27
+ /** The command line, or null when it is not known. */
28
+ readonly commandLine: string | null;
29
+ /** When it started; `--started` takes this value to name the process safely. */
30
+ readonly started: Timestamp;
31
+ /** The Windows session it runs in: 0 for the background session, greater than 0 for the desktop user's. */
32
+ readonly sessionId: number;
33
+ /** The account it runs as, as `DOMAIN\name`, or null when it is not known. */
34
+ readonly user: string | null;
35
+ /** The integrity level of its token: `low`, `medium`, `high` or `system`; null when it is not known. */
36
+ readonly integrityLevel: string | null;
37
+ /** Whether it still runs. */
38
+ readonly running: boolean;
39
+ /** Its exit code once it has ended, when EastIndia started it on the current boot; otherwise null. */
40
+ readonly exitCode: number | null;
41
+ /** Its top-level windows; empty in the background session and once it has ended. */
42
+ readonly windows: readonly ProcessWindow[];
43
+ }
44
+ /** One top-level window of a process on the desktop user's screen. */
45
+ export interface ProcessWindow {
46
+ /** The window handle as hexadecimal text, for example `0x2a0b4c`, which `desktop inspect --window` takes. */
47
+ readonly handle: string;
48
+ /** The title bar text; empty when the window has none. */
49
+ readonly title: string;
50
+ /** The window class name. */
51
+ readonly className: string;
52
+ /** Whether the window is shown. */
53
+ readonly visible: boolean;
54
+ /** Where the window is, in physical pixels from the top-left corner of the screen. */
55
+ readonly bounds: WindowBounds;
56
+ }
57
+ /** The answer to `endia process wait` once the process has ended, as `docker wait` answers. */
58
+ export interface ProcessWaitResult {
59
+ /** The process's exit code, or null when Windows could not give it, as for a protected process. */
60
+ readonly exitCode: number | null;
61
+ }
62
+ /** The answer to `endia process stop`: how the process ended and its exit code. */
63
+ export interface ProcessStopResult {
64
+ /** The process's exit code, or null when Windows could not give it. */
65
+ readonly exitCode: number | null;
66
+ /** How it ended: `closed`, `ended` or `alreadyExited`. */
67
+ readonly how: string;
68
+ }
69
+ /** One line of what a process started by `endia exec -d` wrote, as `process logs` streams it, one JSON object per line of `application/x-ndjson`. */
70
+ export interface ProcessLogLine {
71
+ /** The output the line came from: `stdout` or `stderr`. */
72
+ readonly stream: string;
73
+ /** The text of the line, without its line ending. */
74
+ readonly line: string;
75
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,62 @@
1
+ import type { Timestamp } from "./common.js";
2
+ /** Where the purpose in effect for a machine comes from: `machine`, its own purpose, or `fleet`, the purpose of its fleet because it has none of its own. */
3
+ export type PurposeSource = "machine" | "fleet";
4
+ /** A purpose without its detail, as the lists of fleets and machines carry it. */
5
+ export interface PurposeSummary {
6
+ /** What the fleet or machine is being used for, in one line. */
7
+ readonly title: string;
8
+ /** The caller who stored the purpose: the client certificate's name over HTTPS, or `npipe:` followed by the Windows account. */
9
+ readonly setBy: string;
10
+ /** When the service stored the purpose. */
11
+ readonly set: Timestamp;
12
+ }
13
+ /** A whole purpose: what a caller said a fleet or machine is being used for, with the caller's notes. EastIndia stores and shows it and does nothing else with it. */
14
+ export interface PurposeDetail extends PurposeSummary {
15
+ /** The caller's notes in Markdown, exactly as received, or null for none. A sandbox agent may have written them, so a program that renders them should fetch no remote image, open a link only when a person clicks it, and show raw HTML as text. */
16
+ readonly detail: string | null;
17
+ }
18
+ /** One change to the purpose of a fleet or machine. */
19
+ export interface PurposeHistoryEntry {
20
+ /** When the service made the change. */
21
+ readonly time: Timestamp;
22
+ /** What the change did: `set`, when a caller stored a purpose whether or not one was stored before, or `cleared`, when a caller removed the purpose that was stored. */
23
+ readonly action: "set" | "cleared";
24
+ /** The title that was set, or null for a clearing. */
25
+ readonly title: string | null;
26
+ /** The detail that was set, or null for a clearing or a purpose set without detail. */
27
+ readonly detail: string | null;
28
+ /** The caller who made the change, named as `PurposeSummary.setBy` names callers. */
29
+ readonly setBy: string;
30
+ }
31
+ /** A fleet's purpose with every change to it while the fleet has existed: `endia purpose show`. */
32
+ export interface FleetPurpose {
33
+ /** The fleet's purpose, or null when none is set. */
34
+ readonly purpose: PurposeDetail | null;
35
+ /** The changes, oldest first. */
36
+ readonly history: readonly PurposeHistoryEntry[];
37
+ }
38
+ /** A fleet's purpose once a change is stored. */
39
+ export interface FleetPurposeResult {
40
+ /** The purpose just set, or null after a clearing. */
41
+ readonly purpose: PurposeDetail | null;
42
+ }
43
+ /** A machine's own purpose with every change to it, and the purpose in effect for the machine: `endia purpose show`. */
44
+ export interface MachinePurpose {
45
+ /** The machine's own purpose, or null when it has none. */
46
+ readonly purpose: PurposeDetail | null;
47
+ /** The changes to the machine's own purpose, oldest first. Changes to its fleet's purpose are in the fleet's history. */
48
+ readonly history: readonly PurposeHistoryEntry[];
49
+ /** The machine's own purpose, else its fleet's, else null. */
50
+ readonly effective: PurposeDetail | null;
51
+ /** Where `effective` comes from, or null when no purpose is in effect. */
52
+ readonly purposeSource: PurposeSource | null;
53
+ }
54
+ /** A machine's own purpose once a change is stored, and the purpose in effect then. */
55
+ export interface MachinePurposeResult {
56
+ /** The machine's own purpose just set, or null after a clearing. */
57
+ readonly purpose: PurposeDetail | null;
58
+ /** The machine's own purpose, else its fleet's, else null; after a clearing it is the fleet's. */
59
+ readonly effective: PurposeDetail | null;
60
+ /** Where `effective` comes from, or null when no purpose is in effect. */
61
+ readonly purposeSource: PurposeSource | null;
62
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,114 @@
1
+ import type { Timestamp } from "./common.js";
2
+ /** The answer to `endia system df`, as `docker system df` answers: what the images, machines, named volumes and build cache hold on disk, which of it is in use and which `system prune` would delete, and how much room the image folder's volume has left. */
3
+ export interface DiskUsage {
4
+ /** Every image. */
5
+ readonly images: readonly ImageUsage[];
6
+ /** Every machine. */
7
+ readonly machines: readonly MachineUsage[];
8
+ /** Every named volume. */
9
+ readonly volumes: readonly VolumeUsage[];
10
+ /** Every build-cache entry. A service older than multi-stage builds leaves it out. */
11
+ readonly buildCache?: readonly BuildCacheUsage[];
12
+ /** The image folder's volume: its free space, its capacity and the space EastIndia keeps free on it. */
13
+ readonly imageFolder: ImageFolderSpace;
14
+ /** The storage root: what its records take and the free space on its volume. */
15
+ readonly storageRoot: StorageRootSpace;
16
+ }
17
+ /** One image as `system df` counts it. */
18
+ export interface ImageUsage {
19
+ /** The image's digest. */
20
+ readonly id: string;
21
+ /** The tags that name the image; empty for an image without tags. */
22
+ readonly repoTags: readonly string[];
23
+ /** The digest of the image this image is built on, or null for an imported image, which has no parent. */
24
+ readonly parentId: string | null;
25
+ /** When the image was recorded. */
26
+ readonly created: Timestamp;
27
+ /** The size on disk of the image's own disk file, without its parents'. */
28
+ readonly sizeBytes: number;
29
+ /** The number of machines made from the image. */
30
+ readonly machines: number;
31
+ /** The number of images built on the image. */
32
+ readonly children: number;
33
+ /** Whether `system prune --all` would delete the image: no machine that a prune keeps uses it, nor is any image built on it. */
34
+ readonly reclaimable: boolean;
35
+ }
36
+ /** One machine as `system df` counts it: its writable disk, which holds what the machine changed since it was made from its image. */
37
+ export interface MachineUsage {
38
+ /** The machine name. */
39
+ readonly name: string;
40
+ /** The machine's state; `system prune` deletes the machines in state `exited` or `created`. */
41
+ readonly state: string;
42
+ /** The size on disk of the machine's writable disk file; 0 when the file does not exist. */
43
+ readonly sizeBytes: number;
44
+ }
45
+ /** One named volume as `system df` counts it. */
46
+ export interface VolumeUsage {
47
+ /** The volume name. */
48
+ readonly name: string;
49
+ /** The size on disk of the volume's disk file; 0 when the file does not exist. */
50
+ readonly sizeBytes: number;
51
+ /** The machine the volume is attached to, or null. */
52
+ readonly attachedTo: string | null;
53
+ }
54
+ /** One build-cache entry as `system df` counts it: the committed result of a recipe's stage that a build made below its target. It is not an image; a later build whose stage has the same build key reuses it. */
55
+ export interface BuildCacheUsage {
56
+ /** The entry's digest. */
57
+ readonly id: string;
58
+ /** The digest of the image or build-cache entry the entry is built on. */
59
+ readonly parentId: string | null;
60
+ /** When a build made the entry. */
61
+ readonly created: Timestamp;
62
+ /** When a build last made or found the entry. */
63
+ readonly lastUsed: Timestamp;
64
+ /** The size on disk of the entry's own disk file. */
65
+ readonly sizeBytes: number;
66
+ /** Whether an image, machine or other entry is built on the entry, or a running build has made or found it. `system df` counts such entries as active. */
67
+ readonly inUse: boolean;
68
+ /** Whether `builder prune` would delete the entry. */
69
+ readonly reclaimable: boolean;
70
+ }
71
+ /** The room left on the image folder's volume, where every disk lives. */
72
+ export interface ImageFolderSpace {
73
+ /** The image folder's full path. */
74
+ readonly path: string;
75
+ /** The free space on its volume. */
76
+ readonly freeBytes: number;
77
+ /** The capacity of its volume. */
78
+ readonly capacityBytes: number;
79
+ /** The space EastIndia keeps free on the volume: `minFreeDiskGiB`; a disk that would leave less is refused. */
80
+ readonly reserveBytes: number;
81
+ }
82
+ /** What the storage root takes and the room left on its volume. */
83
+ export interface StorageRootSpace {
84
+ /** The storage root's full path. */
85
+ readonly path: string;
86
+ /** The size of the files under the storage root, leaving out the image folder when it lies there, whose disks the other rows count. */
87
+ readonly sizeBytes: number;
88
+ /** The free space on its volume. */
89
+ readonly freeBytes: number;
90
+ }
91
+ /** The result of a `system prune` operation: what it deleted and the space that freed. */
92
+ export interface PruneResult {
93
+ /** The stopped machines deleted, by name; the next `compose up` of their fleets creates them again. */
94
+ readonly deletedMachines: readonly string[];
95
+ /** The images deleted, by digest. */
96
+ readonly deletedImages: readonly string[];
97
+ /** The build-cache entries deleted, by digest: the results of recipe stages below a build's target that nothing used. A service older than multi-stage builds leaves it out. */
98
+ readonly deletedBuildCache?: readonly string[];
99
+ /** The named volumes deleted, by name. */
100
+ readonly deletedVolumes: readonly string[];
101
+ /** The number of finished operations deleted, those older than `operationRetentionDays`. */
102
+ readonly deletedOperations: number;
103
+ /** The owned objects deleted whose owner no longer existed, each as its kind and name. */
104
+ readonly deletedOrphans: readonly string[];
105
+ /** The size of the files deleted. */
106
+ readonly reclaimedBytes: number;
107
+ }
108
+ /** The result of a `builder prune` operation: the build-cache entries it deleted and the space that freed. */
109
+ export interface BuilderPruneResult {
110
+ /** The build-cache entries deleted, by digest, in the order deleted. */
111
+ readonly deletedBuildCache: readonly string[];
112
+ /** The size of the disk files deleted. */
113
+ readonly reclaimedBytes: number;
114
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,58 @@
1
+ import type { Timestamp } from "./common.js";
2
+ /** One reading of the host, as `endia stats --host` shows it above the machines: its processor use, its memory, the memory EastIndia keeps free and the memory the running machines hold, so that one command shows how much room is left. */
3
+ export interface HostStats {
4
+ /** When the reading was taken. */
5
+ readonly read: Timestamp;
6
+ /** The host's number of logical processors. */
7
+ readonly logicalProcessors: number;
8
+ /** The share of all the host's logical processors in use during the last interval, from 0 to 100; null when not taken. */
9
+ readonly cpuPercent: number | null;
10
+ /** The host's physical memory; null when not taken. */
11
+ readonly memoryTotalBytes: number | null;
12
+ /** The host's available memory; null when not taken. */
13
+ readonly memoryAvailableBytes: number | null;
14
+ /** The memory that must remain free after a virtual machine starts: `hostReserveMiB`. */
15
+ readonly memoryReserveBytes: number;
16
+ /** The memory that every running virtual machine EastIndia owns started with. */
17
+ readonly machinesMemoryBytes: number;
18
+ /** Each reading that is null, with the reason. */
19
+ readonly unavailable: readonly UnavailableReading[];
20
+ }
21
+ /** One reading of a machine, as `endia stats` shows it in a row, as `docker stats` shows a container's: processor use, memory, network and disk traffic and the number of processes. The hypervisor measures the processors, the cards and the disks from outside; the guest service reports memory in use and the processes from inside. */
22
+ export interface MachineStats {
23
+ /** When the reading was taken. */
24
+ readonly read: Timestamp;
25
+ /** The machine ID. */
26
+ readonly id: string;
27
+ /** The machine name. */
28
+ readonly name: string;
29
+ /** The machine's state, as `endia ps` shows it. */
30
+ readonly state: string;
31
+ /** The machine's number of virtual processors. */
32
+ readonly processors: number;
33
+ /** The processor time the machine's virtual processors used during the last interval, as a percentage of one host logical processor, so that a machine keeping two processors busy shows 200, as Docker shows it on Linux; null when not taken. */
34
+ readonly cpuPercent: number | null;
35
+ /** The memory in use inside Windows (physical memory less available memory, as Task Manager counts it); null when not taken. */
36
+ readonly memoryUsageBytes: number | null;
37
+ /** The most memory the machine may grow to. */
38
+ readonly memoryLimitBytes: number;
39
+ /** The bytes all the machine's cards received since its virtual machine started; null when not taken. */
40
+ readonly networkReceivedBytes: number | null;
41
+ /** The bytes all the machine's cards sent since its virtual machine started; null when not taken. */
42
+ readonly networkSentBytes: number | null;
43
+ /** The bytes read from all the machine's disks since its virtual machine started; null when not taken. */
44
+ readonly diskReadBytes: number | null;
45
+ /** The bytes written to all the machine's disks since its virtual machine started; null when not taken. */
46
+ readonly diskWrittenBytes: number | null;
47
+ /** The number of processes in Windows; null when not taken. */
48
+ readonly processes: number | null;
49
+ /** Each reading that is null, with the reason. */
50
+ readonly unavailable: readonly UnavailableReading[];
51
+ }
52
+ /** A reading that could not be taken, and why. A reading is never shown as zero when it was not taken: its member is null and an entry of this kind names it. */
53
+ export interface UnavailableReading {
54
+ /** The member that is null, for example `cpuPercent`. */
55
+ readonly reading: string;
56
+ /** Why, for example `A rate needs two samples; this is the first.` */
57
+ readonly reason: string;
58
+ }
@@ -0,0 +1 @@
1
+ export {};