-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModels.cs
More file actions
963 lines (880 loc) · 38.9 KB
/
Models.cs
File metadata and controls
963 lines (880 loc) · 38.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
// Generated by Sterling SDK Generator
// Orchestrator Control Plane API v0.1.0
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace VersSdk
{
/// <summary>Response body for GET /env_vars and PUT /env_vars.</summary>
public class EnvVarsResponse
{
/// <summary>All environment variables currently set for the authenticated user.</summary>
[JsonPropertyName("vars")]
public Dictionary<string, object> Vars { get; set; } = default!;
}
/// <summary>Response body for POST /api/v1/repositories</summary>
public class CreateRepositoryResponse
{
/// <summary>The name of the repository</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = default!;
/// <summary>The ID of the newly created repository</summary>
[JsonPropertyName("repo_id")]
public string RepoId { get; set; } = default!;
}
/// <summary>Public repository information (includes owner org name for namespacing)</summary>
public class PublicRepositoryInfo
{
/// <summary>When the repository was created</summary>
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
/// <summary>Optional description</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>Full reference: org_name/repo_name</summary>
[JsonPropertyName("full_name")]
public string FullName { get; set; } = default!;
/// <summary>The repository name</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = default!;
/// <summary>The owning organization's name (namespace)</summary>
[JsonPropertyName("org_name")]
public string OrgName { get; set; } = default!;
/// <summary>The repository's unique identifier</summary>
[JsonPropertyName("repo_id")]
public string RepoId { get; set; } = default!;
}
/// <summary>Response body for GET /api/v1/commit_tags</summary>
public class ListTagsResponse
{
/// <summary>List of all tags in the user's organization</summary>
[JsonPropertyName("tags")]
public List<TagInfo> Tags { get; set; } = default!;
}
/// <summary>Request body for creating a tag within a repository: POST /api/v1/repositories/{repo_name}/tags</summary>
public class CreateRepoTagRequest
{
/// <summary>The commit ID this tag should point to</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
/// <summary>Optional description of what this tag represents</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>The tag name (e.g. 'latest', 'v1.0')</summary>
[JsonPropertyName("tag_name")]
public string TagName { get; set; } = default!;
}
/// <summary>Response struct for GET api/v1/system/version</summary>
public class OrchestratorVersion
{
/// <summary>Executable identifier; should be 'orchestrator'</summary>
[JsonPropertyName("executable_name")]
public string ExecutableName { get; set; } = default!;
/// <summary>Current git hash used for the build</summary>
[JsonPropertyName("git_hash")]
public string GitHash { get; set; } = default!;
/// <summary>Current workspace version</summary>
[JsonPropertyName("workspace_version")]
public string WorkspaceVersion { get; set; } = default!;
}
/// <summary></summary>
public class ListCommitsResponse
{
[JsonPropertyName("commits")]
public List<CommitInfo> Commits { get; set; } = default!;
[JsonPropertyName("limit")]
public long Limit { get; set; } = default!;
[JsonPropertyName("offset")]
public long Offset { get; set; } = default!;
[JsonPropertyName("total")]
public long Total { get; set; } = default!;
}
/// <summary>Response body for `POST /api/v1/deploy`.</summary>
public class DeployResponse
{
[JsonPropertyName("project_id")]
public string ProjectId { get; set; } = default!;
[JsonPropertyName("status")]
public string Status { get; set; } = default!;
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary>Response body for GET /api/v1/repositories/{repo_name}/tags</summary>
public class ListRepoTagsResponse
{
/// <summary>The repository name</summary>
[JsonPropertyName("repository")]
public string Repository { get; set; } = default!;
/// <summary>List of tags in this repository</summary>
[JsonPropertyName("tags")]
public List<RepoTagInfo> Tags { get; set; } = default!;
}
/// <summary></summary>
public class BaseImageInfo
{
[JsonPropertyName("base_image_id")]
public string BaseImageId { get; set; } = default!;
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
[JsonPropertyName("description")]
public object? Description { get; set; }
[JsonPropertyName("image_name")]
public string ImageName { get; set; } = default!;
[JsonPropertyName("is_public")]
public bool IsPublic { get; set; } = default!;
[JsonPropertyName("owner_id")]
public string OwnerId { get; set; } = default!;
[JsonPropertyName("size_mib")]
public int SizeMib { get; set; } = default!;
[JsonPropertyName("source_type")]
public string SourceType { get; set; } = default!;
}
/// <summary>Response body for POST /api/vm/{vm_id}/exec</summary>
public class VmExecResponse
{
/// <summary>Exec identifier associated with this run.</summary>
[JsonPropertyName("exec_id")]
public object? ExecId { get; set; }
/// <summary>Exit code returned by the command.</summary>
[JsonPropertyName("exit_code")]
public int ExitCode { get; set; } = default!;
/// <summary>UTF-8 decoded stderr (lossy).</summary>
[JsonPropertyName("stderr")]
public string Stderr { get; set; } = default!;
/// <summary>UTF-8 decoded stdout (lossy).</summary>
[JsonPropertyName("stdout")]
public string Stdout { get; set; } = default!;
}
/// <summary></summary>
public class CreateBaseImageResponse
{
[JsonPropertyName("image_name")]
public string ImageName { get; set; } = default!;
[JsonPropertyName("job_id")]
public string JobId { get; set; } = default!;
[JsonPropertyName("status")]
public string Status { get; set; } = default!;
}
/// <summary>Request body for POST /api/vm/{vm_id}/exec</summary>
public class VmExecRequest
{
/// <summary>Command and arguments to execute.</summary>
[JsonPropertyName("command")]
public List<string> Command { get; set; } = default!;
/// <summary>Optional environment variables to set for the process.</summary>
[JsonPropertyName("env")]
public object? Env { get; set; }
/// <summary>Optional exec identifier for tracking.</summary>
[JsonPropertyName("exec_id")]
public object? ExecId { get; set; }
/// <summary>Optional stdin payload passed to the command.</summary>
[JsonPropertyName("stdin")]
public object? Stdin { get; set; }
/// <summary>Timeout in seconds (0 = no timeout).</summary>
[JsonPropertyName("timeout_secs")]
public object? TimeoutSecs { get; set; }
/// <summary>Optional working directory for the command.</summary>
[JsonPropertyName("working_dir")]
public object? WorkingDir { get; set; }
}
/// <summary></summary>
public class NewVmsResponse
{
[JsonPropertyName("vms")]
public List<NewVmResponse> Vms { get; set; } = default!;
}
/// <summary>Request body for POST /api/vm/{vm_id}/exec/stream/attach</summary>
public class VmExecStreamAttachRequest
{
/// <summary>Optional cursor to resume from (exclusive). If omitted, the full retained backlog is replayed.</summary>
[JsonPropertyName("cursor")]
public object? Cursor { get; set; }
/// <summary>Identifier of the exec stream session to reattach to.</summary>
[JsonPropertyName("exec_id")]
public string ExecId { get; set; } = default!;
/// <summary>Start streaming after the latest retained chunk (ignores cursor).</summary>
[JsonPropertyName("from_latest")]
public object? FromLatest { get; set; }
}
/// <summary>Request body for PATCH /api/vm/{vm_id}/state</summary>
public class VmUpdateStateRequest
{
/// <summary>The requested state for the VM</summary>
[JsonPropertyName("state")]
public VmUpdateStateEnum State { get; set; } = default!;
}
/// <summary></summary>
public class DeleteBaseImageResponse
{
[JsonPropertyName("base_image_id")]
public string BaseImageId { get; set; } = default!;
[JsonPropertyName("deleted")]
public bool Deleted { get; set; } = default!;
}
/// <summary>Response body for GET /api/v1/public/repositories</summary>
public class ListPublicRepositoriesResponse
{
[JsonPropertyName("repositories")]
public List<PublicRepositoryInfo> Repositories { get; set; } = default!;
}
/// <summary>Request body for POST /api/v1/commit_tags</summary>
public class CreateTagRequest
{
/// <summary>The commit ID this tag should point to</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
/// <summary>Optional description of what this tag represents</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>The name of the tag (alphanumeric, hyphens, underscores, dots, 1-64 chars)</summary>
[JsonPropertyName("tag_name")]
public string TagName { get; set; } = default!;
}
/// <summary>Response body for GET /api/v1/repositories</summary>
public class ListRepositoriesResponse
{
/// <summary>List of all repositories in the user's organization</summary>
[JsonPropertyName("repositories")]
public List<RepositoryInfo> Repositories { get; set; } = default!;
}
/// <summary>Response body for POST /api/v1/repositories/{repo_name}/tags</summary>
public class CreateRepoTagResponse
{
/// <summary>The commit ID this tag points to</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
/// <summary>Full reference in image_name:tag format</summary>
[JsonPropertyName("reference")]
public string Reference { get; set; } = default!;
/// <summary>The ID of the newly created tag</summary>
[JsonPropertyName("tag_id")]
public string TagId { get; set; } = default!;
}
/// <summary></summary>
public class CommitInfo
{
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
[JsonPropertyName("description")]
public object? Description { get; set; }
[JsonPropertyName("grandparent_commit_id")]
public object? GrandparentCommitId { get; set; }
[JsonPropertyName("is_public")]
public bool IsPublic { get; set; } = default!;
[JsonPropertyName("name")]
public string Name { get; set; } = default!;
[JsonPropertyName("owner_id")]
public string OwnerId { get; set; } = default!;
[JsonPropertyName("parent_vm_id")]
public object? ParentVmId { get; set; }
}
/// <summary>Response body for DELETE /api/v1/domains/{domain_id}</summary>
public class DeleteDomainResponse
{
[JsonPropertyName("domain_id")]
public string DomainId { get; set; } = default!;
}
/// <summary>Repository information returned in list and get operations</summary>
public class RepositoryInfo
{
/// <summary>When the repository was created</summary>
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
/// <summary>Optional description</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>Whether this repository is publicly visible</summary>
[JsonPropertyName("is_public")]
public bool IsPublic { get; set; } = default!;
/// <summary>The repository name</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = default!;
/// <summary>The repository's unique identifier</summary>
[JsonPropertyName("repo_id")]
public string RepoId { get; set; } = default!;
}
/// <summary>Response body for POST /api/keys/validate</summary>
public class ValidateKeyResponse
{
[JsonPropertyName("message")]
public string Message { get; set; } = default!;
[JsonPropertyName("valid")]
public bool Valid { get; set; } = default!;
}
/// <summary>Response body for GET /api/vm/{vm_id}/ssh_key</summary>
public class VmSshKeyResponse
{
/// <summary>The SSH port that will be DNAT'd to the VM's netns (and, in turn, to its TAP device)</summary>
[JsonPropertyName("ssh_port")]
public int SshPort { get; set; } = default!;
/// <summary>Private SSH key in stringified OpenSSH format</summary>
[JsonPropertyName("ssh_private_key")]
public string SshPrivateKey { get; set; } = default!;
}
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum VmState
{
Booting,
Running,
Paused,
Sleeping,
Dead
}
/// <summary>Response body for GET /api/vm/{vm_id}/files</summary>
public class VmReadFileResponse
{
/// <summary>File contents, base64-encoded.</summary>
[JsonPropertyName("content_b64")]
public string ContentB64 { get; set; } = default!;
}
/// <summary>Request body for PUT /env_vars — sets (upserts) one or more environment variables. # Lifecycle model Environment variables are written to `/etc/environment` inside a VM **once at boot time** via a vsock `WriteFile` request. They are **not** live-synced to running VMs. This is intentional: VMs are ephemeral (create → use → destroy/branch), so env var changes naturally take effect on the next VM. The `replace` flag exists so callers can atomically express 'I want exactly these variables and nothing else' without having to DELETE each stale key individually. Without it, the only way to remove a variable from future VMs is a separate `DELETE /env_vars/{key}` call per key.</summary>
public class SetEnvVarsRequest
{
/// <summary>If true, delete all existing variables before writing the new set. This gives 'set exactly these vars' semantics. Default: false (upsert).</summary>
[JsonPropertyName("replace")]
public bool? Replace { get; set; }
/// <summary>Key-value pairs to set. Keys must be valid shell identifiers (`^[A-Za-z_][A-Za-z0-9_]*$`, max 256 chars). Values max 8192 chars. When `replace` is false (default): existing keys are overwritten, keys not mentioned are left untouched (upsert semantics). When `replace` is true: all existing variables are deleted first, then only the provided vars are stored (replace-all semantics).</summary>
[JsonPropertyName("vars")]
public Dictionary<string, object> Vars { get; set; } = default!;
}
/// <summary>The response body for POST /api/vm/{vm_id}/commit</summary>
public class VmCommitResponse
{
/// <summary>The UUID of the newly-created commit</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
}
/// <summary>Response body for POST /api/v1/repositories/fork</summary>
public class ForkRepositoryResponse
{
/// <summary>The new commit in your org (snapshot of the forked VM)</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
/// <summary>Full reference: repo_name:tag_name</summary>
[JsonPropertyName("reference")]
public string Reference { get; set; } = default!;
/// <summary>The new repository name in your org</summary>
[JsonPropertyName("repo_name")]
public string RepoName { get; set; } = default!;
/// <summary>The tag name pointing to the forked commit</summary>
[JsonPropertyName("tag_name")]
public string TagName { get; set; } = default!;
/// <summary>The new VM that was created from the fork</summary>
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary> (union type — exactly one field should be set)</summary>
public class ImageSourceRequest
{
[JsonPropertyName("image_ref")]
public string? ImageRef { get; set; }
[JsonPropertyName("type")]
public string? Type { get; set; }
[JsonPropertyName("bucket")]
public string? Bucket { get; set; }
[JsonPropertyName("key")]
public string? Key { get; set; }
}
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum VmUpdateStateEnum
{
Paused,
Running
}
/// <summary></summary>
public class ErrorResponse
{
/// <summary>Reason of error</summary>
[JsonPropertyName("error")]
public string? Error { get; set; }
/// <summary>Is always: false</summary>
[JsonPropertyName("success")]
public bool? Success { get; set; }
}
/// <summary>Request body for PATCH /commits/{commit_id}</summary>
public class UpdateCommitRequest
{
/// <summary>Optional description for the commit.</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
[JsonPropertyName("is_public")]
public bool IsPublic { get; set; } = default!;
/// <summary>Optional human-readable name for the commit.</summary>
[JsonPropertyName("name")]
public object? Name { get; set; }
}
/// <summary>Request body for POST /api/v1/repositories</summary>
public class CreateRepositoryRequest
{
/// <summary>Optional description of the repository</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>The name of the repository (alphanumeric, hyphens, underscores, dots, 1-64 chars)</summary>
[JsonPropertyName("name")]
public string Name { get; set; } = default!;
}
/// <summary>Response type for domain operations.</summary>
public class DomainResponse
{
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
[JsonPropertyName("domain")]
public string Domain { get; set; } = default!;
[JsonPropertyName("domain_id")]
public string DomainId { get; set; } = default!;
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary>The request body for POST /api/vm/{vm_id}/commit</summary>
public class VmCommitRequest
{
/// <summary>If provided, chelsea will use the requested commit UUID. Otherwise, it will generate a UUID itself.</summary>
[JsonPropertyName("commit_id")]
public object? CommitId { get; set; }
/// <summary>Optional description for the commit.</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>Optional human-readable name for the commit. Defaults to auto-generated name if not provided.</summary>
[JsonPropertyName("name")]
public object? Name { get; set; }
}
/// <summary>Settings for the deploy build pipeline.</summary>
public class DeploySettings
{
[JsonPropertyName("build_command")]
public object? BuildCommand { get; set; }
[JsonPropertyName("install_command")]
public object? InstallCommand { get; set; }
[JsonPropertyName("run_command")]
public object? RunCommand { get; set; }
[JsonPropertyName("working_directory")]
public object? WorkingDirectory { get; set; }
}
/// <summary></summary>
public class CreateBaseImageRequest
{
[JsonPropertyName("description")]
public object? Description { get; set; }
[JsonPropertyName("image_name")]
public string ImageName { get; set; } = default!;
/// <summary>Additional capacity in MiB beyond the actual filesystem size (defaults to 256). The final image size = calculated rootfs size + this value. Set to 0 for minimum possible image size, or higher for more free space.</summary>
[JsonPropertyName("size_mib")]
public int? SizeMib { get; set; }
[JsonPropertyName("source")]
public ImageSourceRequest Source { get; set; } = default!;
}
/// <summary>Request body for POST /api/v1/repositories/fork</summary>
public class ForkRepositoryRequest
{
/// <summary>Name for the new repository in your org (defaults to source_repo if omitted)</summary>
[JsonPropertyName("repo_name")]
public object? RepoName { get; set; }
/// <summary>The organization that owns the source public repository</summary>
[JsonPropertyName("source_org")]
public string SourceOrg { get; set; } = default!;
/// <summary>The source repository name</summary>
[JsonPropertyName("source_repo")]
public string SourceRepo { get; set; } = default!;
/// <summary>The tag to fork (e.g. 'latest', 'v1.0')</summary>
[JsonPropertyName("source_tag")]
public string SourceTag { get; set; } = default!;
/// <summary>Tag name in the new repo (defaults to source_tag if omitted)</summary>
[JsonPropertyName("tag_name")]
public object? TagName { get; set; }
}
/// <summary></summary>
public class VmCommitEntity
{
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>The commit that this commit's parent VM was started from, if any. Intended to optimize traversing the commit tree.</summary>
[JsonPropertyName("grandparent_commit_id")]
public object? GrandparentCommitId { get; set; }
[JsonPropertyName("id")]
public string Id { get; set; } = default!;
/// <summary>Whether this commit is publicly accessible (readable/restorable by anyone).</summary>
[JsonPropertyName("is_public")]
public bool IsPublic { get; set; } = default!;
[JsonPropertyName("name")]
public string Name { get; set; } = default!;
/// <summary>api key id.</summary>
[JsonPropertyName("owner_id")]
public string OwnerId { get; set; } = default!;
/// <summary>The VM that this commit was created from, if any.</summary>
[JsonPropertyName("parent_vm_id")]
public object? ParentVmId { get; set; }
}
/// <summary>Tag information returned in list and get operations</summary>
public class TagInfo
{
/// <summary>The commit ID this tag currently points to</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
/// <summary>When the tag was created</summary>
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
/// <summary>Optional description of what this tag represents</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>The tag's unique identifier</summary>
[JsonPropertyName("tag_id")]
public string TagId { get; set; } = default!;
/// <summary>The name of the tag</summary>
[JsonPropertyName("tag_name")]
public string TagName { get; set; } = default!;
/// <summary>When the tag was last updated (moved to different commit or description changed)</summary>
[JsonPropertyName("updated_at")]
public string UpdatedAt { get; set; } = default!;
}
/// <summary>Request body for PUT /api/vm/{vm_id}/files</summary>
public class VmWriteFileRequest
{
/// <summary>File contents, base64-encoded.</summary>
[JsonPropertyName("content_b64")]
public string ContentB64 { get; set; } = default!;
/// <summary>Create parent directories if they don't exist.</summary>
[JsonPropertyName("create_dirs")]
public bool? CreateDirs { get; set; }
/// <summary>File mode (e.g. 0644). Defaults to 0644 if omitted.</summary>
[JsonPropertyName("mode")]
public int? Mode { get; set; }
/// <summary>Destination path on the VM.</summary>
[JsonPropertyName("path")]
public string Path { get; set; } = default!;
}
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum VmExecLogStream
{
Stdout,
Stderr
}
/// <summary>Individual log entry describing emitted stdout/stderr chunk.</summary>
public class VmExecLogEntry
{
/// <summary>Base64-encoded bytes from stdout/stderr chunk.</summary>
[JsonPropertyName("data_b64")]
public string DataB64 { get; set; } = default!;
[JsonPropertyName("exec_id")]
public object? ExecId { get; set; }
[JsonPropertyName("stream")]
public VmExecLogStream Stream { get; set; } = default!;
[JsonPropertyName("timestamp")]
public string Timestamp { get; set; } = default!;
}
/// <summary></summary>
public class LabelVmRequest
{
[JsonPropertyName("labels")]
public object? Labels { get; set; }
}
/// <summary>Response for GET /api/v1/vm/{vm_id}/metadata</summary>
public class VmMetadataResponse
{
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
[JsonPropertyName("deleted_at")]
public object? DeletedAt { get; set; }
[JsonPropertyName("grandparent_vm_id")]
public object? GrandparentVmId { get; set; }
[JsonPropertyName("ip")]
public string Ip { get; set; } = default!;
[JsonPropertyName("owner_id")]
public string OwnerId { get; set; } = default!;
[JsonPropertyName("parent_commit_id")]
public object? ParentCommitId { get; set; }
[JsonPropertyName("state")]
public VmState State { get; set; } = default!;
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary>Request body for PATCH /api/v1/repositories/{repo_name}/visibility</summary>
public class SetRepositoryVisibilityRequest
{
/// <summary>Whether the repository should be publicly visible</summary>
[JsonPropertyName("is_public")]
public bool IsPublic { get; set; } = default!;
}
/// <summary>Request body for PATCH /api/v1/repositories/{repo_name}/tags/{tag_name}</summary>
public class UpdateRepoTagRequest
{
/// <summary>Optional new commit ID to move the tag to</summary>
[JsonPropertyName("commit_id")]
public object? CommitId { get; set; }
/// <summary>Optional new description for the tag. Send `null` to clear.</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
}
/// <summary>Struct representing configuration options common to all VMs</summary>
public class VmCreateVmConfig
{
/// <summary>The disk size, in MiB.</summary>
[JsonPropertyName("fs_size_mib")]
public object? FsSizeMib { get; set; }
/// <summary>The filesystem base image name. Currently, must be 'default'</summary>
[JsonPropertyName("image_name")]
public object? ImageName { get; set; }
/// <summary>The kernel name. Currently, must be 'default.bin'</summary>
[JsonPropertyName("kernel_name")]
public object? KernelName { get; set; }
[JsonPropertyName("labels")]
public object? Labels { get; set; }
/// <summary>The RAM size, in MiB.</summary>
[JsonPropertyName("mem_size_mib")]
public object? MemSizeMib { get; set; }
/// <summary>How many vCPUs to allocate to this VM (and its children)</summary>
[JsonPropertyName("vcpu_count")]
public object? VcpuCount { get; set; }
}
/// <summary>Response body for new VM requests (new_root, from_commit, branch)</summary>
public class NewVmResponse
{
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary>Request body for POST /api/v1/vm/from_commit (union type — exactly one field should be set)</summary>
public class FromCommitVmRequest
{
[JsonPropertyName("commit_id")]
public string? CommitId { get; set; }
[JsonPropertyName("tag_name")]
public string? TagName { get; set; }
[JsonPropertyName("ref")]
public string? Ref { get; set; }
}
/// <summary></summary>
public class VM
{
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
[JsonPropertyName("labels")]
public object? Labels { get; set; }
[JsonPropertyName("owner_id")]
public string OwnerId { get; set; } = default!;
[JsonPropertyName("state")]
public VmState State { get; set; } = default!;
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary>Request body for POST /api/v1/domains</summary>
public class CreateDomainRequest
{
[JsonPropertyName("domain")]
public string Domain { get; set; } = default!;
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary>Request body for PATCH /api/v1/commit_tags/{tag_name} For `description`: - Field absent from JSON → don't change the description - Field present as `null` → clear the description - Field present as `'text'` → set the description to 'text'</summary>
public class UpdateTagRequest
{
/// <summary>Optional new commit ID to move the tag to</summary>
[JsonPropertyName("commit_id")]
public object? CommitId { get; set; }
/// <summary>Optional new description for the tag. Send `null` to clear an existing description.</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
}
/// <summary></summary>
public class UploadBaseImageResponse
{
[JsonPropertyName("image_name")]
public string ImageName { get; set; } = default!;
[JsonPropertyName("job_id")]
public string JobId { get; set; } = default!;
[JsonPropertyName("status")]
public string Status { get; set; } = default!;
}
/// <summary></summary>
public class BaseImageStatusResponse
{
[JsonPropertyName("error_message")]
public object? ErrorMessage { get; set; }
[JsonPropertyName("image_name")]
public string ImageName { get; set; } = default!;
[JsonPropertyName("size_mib")]
public int SizeMib { get; set; } = default!;
[JsonPropertyName("status")]
public string Status { get; set; } = default!;
}
/// <summary></summary>
public class ListBaseImagesResponse
{
[JsonPropertyName("images")]
public List<BaseImageInfo> Images { get; set; } = default!;
[JsonPropertyName("limit")]
public long Limit { get; set; } = default!;
[JsonPropertyName("offset")]
public long Offset { get; set; } = default!;
[JsonPropertyName("total")]
public long Total { get; set; } = default!;
}
/// <summary></summary>
public class NewRootRequest
{
[JsonPropertyName("vm_config")]
public VmCreateVmConfig VmConfig { get; set; } = default!;
}
/// <summary>Request body for PATCH /api/vm/{vm_id}/disk</summary>
public class VmResizeDiskRequest
{
/// <summary>The new disk size in MiB. Must be strictly greater than the current size.</summary>
[JsonPropertyName("fs_size_mib")]
public int FsSizeMib { get; set; } = default!;
}
/// <summary>Response body for DELETE /api/vm/{vm_id}</summary>
public class VmDeleteResponse
{
[JsonPropertyName("vm_id")]
public string VmId { get; set; } = default!;
}
/// <summary>Response body for POST /api/v1/commit_tags</summary>
public class CreateTagResponse
{
/// <summary>The commit ID this tag points to</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
/// <summary>The ID of the newly created tag</summary>
[JsonPropertyName("tag_id")]
public string TagId { get; set; } = default!;
/// <summary>The name of the tag</summary>
[JsonPropertyName("tag_name")]
public string TagName { get; set; } = default!;
}
/// <summary>Request body for `POST /api/v1/deploy`.</summary>
public class DeployRequest
{
/// <summary>Git branch to clone (defaults to repo default branch).</summary>
[JsonPropertyName("branch")]
public object? Branch { get; set; }
/// <summary>Optional project name (defaults to repo name).</summary>
[JsonPropertyName("name")]
public object? Name { get; set; }
/// <summary>GitHub repository in `owner/repo` format.</summary>
[JsonPropertyName("repo")]
public string Repo { get; set; } = default!;
[JsonPropertyName("settings")]
public object? Settings { get; set; }
}
/// <summary>Tag information within a repository context</summary>
public class RepoTagInfo
{
/// <summary>The commit ID this tag currently points to</summary>
[JsonPropertyName("commit_id")]
public string CommitId { get; set; } = default!;
/// <summary>When the tag was created</summary>
[JsonPropertyName("created_at")]
public string CreatedAt { get; set; } = default!;
/// <summary>Optional description</summary>
[JsonPropertyName("description")]
public object? Description { get; set; }
/// <summary>Full reference in image_name:tag format</summary>
[JsonPropertyName("reference")]
public string Reference { get; set; } = default!;
/// <summary>The tag's unique identifier</summary>
[JsonPropertyName("tag_id")]
public string TagId { get; set; } = default!;
/// <summary>The tag name</summary>
[JsonPropertyName("tag_name")]
public string TagName { get; set; } = default!;
/// <summary>When the tag was last updated</summary>
[JsonPropertyName("updated_at")]
public string UpdatedAt { get; set; } = default!;
}
/// <summary>Response for exec log tail requests.</summary>
public class VmExecLogResponse
{
/// <summary>Returned log entries.</summary>
[JsonPropertyName("entries")]
public List<VmExecLogEntry> Entries { get; set; } = default!;
/// <summary>True when the end of file was reached.</summary>
[JsonPropertyName("eof")]
public bool Eof { get; set; } = default!;
/// <summary>Next byte offset to continue from.</summary>
[JsonPropertyName("next_offset")]
public long NextOffset { get; set; } = default!;
}
// ── Params types for operations with query parameters ───────────────
public class ResizeVmDiskParams
{
/// <summary>If true, return an error immediately if the VM is still booting. Default: false</summary>
public bool? SkipWaitBoot { get; set; }
}
public class CreateNewRootVmParams
{
/// <summary>If true, wait for the newly-created VM to finish booting before returning. Default: false.</summary>
public bool? WaitBoot { get; set; }
}
public class VmLogsParams
{
/// <summary>Byte offset into the log file (default: 0)</summary>
public long? Offset { get; set; }
/// <summary>Maximum number of log entries to return</summary>
public long? MaxEntries { get; set; }
/// <summary>Filter by 'stdout' or 'stderr'</summary>
public string? Stream { get; set; }
}
public class BranchByRefParams
{
/// <summary>Number of VMs to branch (optional; default 1)</summary>
public long? Count { get; set; }
}
public class BranchByTagParams
{
/// <summary>Number of VMs to branch (optional; default 1)</summary>
public long? Count { get; set; }
}
public class BranchVmParams
{
/// <summary>If true, keep VM paused after commit. Only applicable when branching a VM ID.</summary>
public bool? KeepPaused { get; set; }
/// <summary>If true, immediately return an error if VM is booting instead of waiting. Only applicable when branching a VM ID.</summary>
public bool? SkipWaitBoot { get; set; }
/// <summary>Number of VMs to branch (optional; default 1)</summary>
public long? Count { get; set; }
}
public class UpdateVmStateParams
{
/// <summary>If true, error immediately if the VM is not finished booting. Defaults to false</summary>
public bool? SkipWaitBoot { get; set; }
}
public class DeleteVmParams
{
/// <summary>If true, return an error immediately if the VM is still booting. Default: false</summary>
public bool? SkipWaitBoot { get; set; }
}
public class BranchByVmParams
{
/// <summary>If true, keep VM paused after commit</summary>
public bool? KeepPaused { get; set; }
/// <summary>If true, immediately return an error if VM is booting instead of waiting</summary>
public bool? SkipWaitBoot { get; set; }
/// <summary>Number of VMs to branch (optional; default 1)</summary>
public long? Count { get; set; }
}
public class CommitVmParams
{
/// <summary>If true, keep VM paused after commit</summary>
public bool? KeepPaused { get; set; }
/// <summary>If true, return an error immediately if the VM is still booting. Default: false</summary>
public bool? SkipWaitBoot { get; set; }
}
public class ListDomainsParams
{
/// <summary>Filter by VM ID</summary>
public string? VmId { get; set; }
}
public class ReadFileVmParams
{
/// <summary>Absolute path of the file to read</summary>
public string? Path { get; set; }
}
public class BranchByCommitParams
{
/// <summary>Number of VMs to branch (optional; default 1)</summary>
public long? Count { get; set; }
}
}