-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
1706 lines (1690 loc) · 50.4 KB
/
openapi.yaml
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
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
components:
responses: {}
schemas:
Response:
properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
PreviewTokenListResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
sandbox_id:
type: string
tokens:
items:
$ref: '#/components/schemas/PreviewToken'
type: array
required:
- tokens
- sandbox_id
type: object
type: object
title: PreviewTokenListResponse
type: object
VMUpdateHibernationTimeoutRequest:
properties:
hibernation_timeout_seconds:
description: |
The new hibernation timeout in seconds.
Must be greater than 0 and less than or equal to 86400 (24 hours).
example: 300
maximum: 86400
minimum: 1
type: integer
required:
- hibernation_timeout_seconds
title: VMUpdateHibernationTimeoutRequest
type: object
PreviewToken:
properties:
expires_at:
nullable: true
type: string
last_used_at:
nullable: true
type: string
token_id:
type: string
token_prefix:
type: string
required:
- expires_at
- last_used_at
- token_id
- token_prefix
title: PreviewToken
type: object
VMShutdownResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties: {}
type: object
type: object
title: VMShutdownResponse
type: object
PreviewTokenRevokeAllResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties: {}
type: object
type: object
title: PreviewTokenRevokeAllResponse
type: object
Sandbox:
properties:
created_at:
format: date-time
type: string
x-go-type: Time
description:
nullable: true
type: string
id:
type: string
is_frozen:
type: boolean
privacy:
type: integer
tags:
items:
type: string
type: array
title:
nullable: true
type: string
updated_at:
format: date-time
type: string
x-go-type: Time
required:
- id
- privacy
- is_frozen
- created_at
- updated_at
- tags
title: Sandbox
type: object
SandboxStartOptions:
description: Optional VM start configuration. If provided, the sandbox VM will be started immediately after creation.
properties:
hibernation_timeout_seconds:
description: |
The time in seconds after which the VM will hibernate due to inactivity.
Must be a positive integer between 1 and 86400 (24 hours).
Defaults to 300 seconds (5 minutes) if not specified.
example: 300
maximum: 86400
minimum: 1
type: integer
ipcountry:
description: This determines in which cluster, closest to the given country the VM will be started in. The format is ISO-3166-1 alpha-2. If not set, the VM will be started closest to the caller of this API. This will only be applied when a VM is run for the first time, and will only serve as a hint (e.g. if the template of this sandbox runs in EU cluster, this sandbox will also run in the EU cluster).
example: NL
pattern: ^[A-Z]{2}$
type: string
tier:
description: |
Determines which specs to start the VM with. If not specified, the VM will start with the default specs for the workspace.
You can only specify a VM tier when starting a VM that is inside your workspace. Specifying a VM tier for someone else's sandbox will return an error.
Not all tiers will be available depending on the workspace subscription status, and higher tiers incur higher costs. Please see codesandbox.io/pricing for details on specs and costs.
enum:
- Pico
- Nano
- Micro
- Small
- Medium
- Large
- XLarge
example: Micro
type: object
Error:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
VMHibernateRequest:
properties: {}
title: VMHibernateRequest
PreviewTokenCreateRequest:
properties:
expires_at:
description: UTC Timestamp until when this token is valid. Omitting this field will create a token without an expiry.
format: date-time
nullable: true
type: string
title: PreviewTokenCreateRequest
type: object
SandboxGetResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
$ref: '#/components/schemas/Sandbox'
type: object
title: SandboxGetResponse
type: object
SandboxForkRequest:
properties:
description:
default: '[Original description]'
description: Sandbox description. Maximum 255 characters. Defaults to description of original sandbox.
maxLength: 255
type: string
is_frozen:
default: false
description: Sandbox frozen status. When true, edits to the sandbox are restricted. Defaults to frozen status of the original sandbox.
type: boolean
path:
default: /
description: Path to the collection where the new sandbox should be stored. Defaults to "/". If no collection exists at the given path, it will be created.
type: string
privacy:
default: 0
description: Sandbox privacy. 0 for public, 1 for unlisted, and 2 for private. Subject to the minimum privacy restrictions of the workspace. Defaults to the privacy of the original sandbox.
type: integer
start_options:
$ref: "#/components/schemas/SandboxStartOptions"
tags:
default: []
description: Tags to set on the new sandbox, if any. Will not inherit tags from the source sandbox.
items:
type: string
type: array
title:
default: '[Original title]'
description: Sandbox title. Maximum 255 characters. Defaults to title of original sandbox with (forked).
maxLength: 255
type: string
title: SandboxForkRequest
type: object
SandboxListResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
pagination:
properties:
current_page:
type: integer
next_page:
description: The number of the next page, if any. If `null`, the current page is the last page of records.
nullable: true
type: integer
total_records:
type: integer
required:
- total_records
- current_page
- next_page
type: object
sandboxes:
items:
$ref: '#/components/schemas/Sandbox'
type: array
required:
- sandboxes
- pagination
type: object
type: object
title: SandboxListResponse
type: object
MetaInformation:
properties:
api:
description: Meta information about the CodeSandbox API
properties:
latest_version:
type: string
name:
type: string
required:
- name
- latest_version
type: object
auth:
description: Meta information about the current authentication context
properties:
scopes:
items:
type: string
type: array
team:
format: uuid
nullable: true
type: string
version:
type: string
required:
- scopes
- team
- version
type: object
required:
- api
title: MetaInformation
type: object
TokenUpdateRequest:
description: Updateable fields for API Tokens. Omitting a field will not update it; explicitly passing null or an empty list will clear the value.
properties:
default_version:
description: API Version to use, formatted as YYYY-MM-DD
format: date
nullable: true
type: string
description:
description: Description of this token, for instance where it will be used.
maxLength: 255
nullable: true
type: string
expires_at:
description: Expiry time of this token. Cannot be set in the past, and cannot be changed for tokens that have already expired. Pass null to make this token never expire.
format: date-time
nullable: true
type: string
scopes:
description: Which scopes to grant this token. The given scopes will replace the current scopes, revoking any that are no longer present in the list.
items:
enum:
- sandbox_create
- sandbox_edit_code
- sandbox_read
- vm_manage
type: array
title: TokenUpdateRequest
type: object
VMHibernateResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties: {}
type: object
type: object
title: VMHibernateResponse
type: object
PreviewTokenUpdateResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
sandbox_id:
type: string
token:
$ref: '#/components/schemas/PreviewToken'
required:
- sandbox_id
- token
type: object
type: object
title: PreviewTokenUpdateResponse
type: object
SandboxCreateResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
alias:
type: string
id:
type: string
title:
nullable: true
type: string
required:
- alias
- id
- title
type: object
type: object
title: SandboxCreateResponse
type: object
VMStartRequest:
properties:
hibernation_timeout_seconds:
description: |
The time in seconds after which the VM will hibernate due to inactivity.
Must be a positive integer between 1 and 86400 (24 hours).
Defaults to 300 seconds (5 minutes) if not specified.
example: 300
maximum: 86400
minimum: 1
type: integer
ipcountry:
description: This determines in which cluster, closest to the given country the VM will be started in. The format is ISO-3166-1 alpha-2. If not set, the VM will be started closest to the caller of this API. This will only be applied when a VM is run for the first time, and will only serve as a hint (e.g. if the template of this sandbox runs in EU cluster, this sandbox will also run in the EU cluster).
example: NL
pattern: ^[A-Z]{2}$
type: string
tier:
description: |
Determines which specs to start the VM with. If not specified, the VM will start with the default specs for the workspace.
You can only specify a VM tier when starting a VM that is inside your workspace. Specifying a VM tier for someone else's sandbox will return an error.
Not all tiers will be available depending on the workspace subscription status, and higher tiers incur higher costs. Please see codesandbox.io/pricing for details on specs and costs.
enum:
- Pico
- Nano
- Micro
- Small
- Medium
- Large
- XLarge
example: Micro
title: VMStartRequest
type: object
PreviewTokenUpdateRequest:
properties:
expires_at:
description: UTC Timestamp until when this token is valid. Omitting this field will create a token without an expiry.
format: date-time
nullable: true
type: string
title: PreviewTokenUpdateRequest
type: object
VMShutdownRequest:
properties: {}
title: VMShutdownRequest
VMUpdateSpecsRequest:
properties:
tier:
description: |
Determines which specs to update the VM with.
Not all tiers will be available depending on the workspace subscription status, and higher tiers incur higher costs. Please see codesandbox.io/pricing for details on specs and costs.
enum:
- Pico
- Nano
- Micro
- Small
- Medium
- Large
- XLarge
example: Micro
required:
- tier
title: VMUpdateSpecsRequest
type: object
WorkspaceCreateRequest:
properties:
name:
description: Name for the new workspace. Maximum length 64 characters.
maxLength: 64
type: string
required:
- name
title: WorkspaceCreateRequest
type: object
VMStartData:
properties:
bootup_type:
type: string
cluster:
type: string
id:
type: string
latest_pitcher_version:
type: string
pitcher_manager_version:
type: string
pitcher_token:
type: string
pitcher_url:
type: string
pitcher_version:
type: string
reconnect_token:
type: string
user_workspace_path:
type: string
workspace_path:
type: string
required:
- bootup_type
- cluster
- id
- latest_pitcher_version
- pitcher_manager_version
- pitcher_token
- pitcher_url
- pitcher_version
- reconnect_token
- user_workspace_path
- workspace_path
type: object
VMStartResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
$ref: '#/components/schemas/VMStartData'
type: object
title: VMStartResponse
type: object
VMUpdateSpecsResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
id:
type: string
tier:
type: string
required:
- id
- tier
type: object
type: object
title: VMUpdateSpecsResponse
type: object
SandboxCreateRequest:
properties:
description:
description: Optional text description of the sandbox. Defaults to no description.
type: string
entry:
description: Filename of the entrypoint of the sandbox.
type: string
external_resources:
description: Array of strings with external resources to load.
items:
type: string
type: array
files:
additionalProperties:
properties:
binary_content:
description: If the file has binary (non plain-text) contents, place the base-64 encoded contents in this key. Should be empty or missing if `is_binary` is `false`.
type: string
code:
description: If the file is non-binary in nature, place the (escaped) plain text contents in this key. Should be empty or missing if `is_binary` is `true`.
type: string
is_binary:
default: false
description: Whether the file contains binary contents.
type: boolean
type: object
description: Map of `path => file` where each file is a map.
type: object
is_frozen:
default: false
description: Whether changes to the sandbox are disallowed. Defaults to `false`.
type: boolean
npm_dependencies:
additionalProperties:
type: string
description: Map of dependencies and their version specifications.
type: object
path:
default: /
description: Path to the collection where the new sandbox should be stored. Defaults to "/". If no collection exists at the given path, it will be created.
type: string
privacy:
default: 0
description: 0 for public, 1 for unlisted, and 2 for private. Privacy is subject to certain restrictions (team minimum setting, drafts must be private, etc.). Defaults to public.
maximum: 2
minimum: 0
type: integer
runtime:
default: browser
description: Runtime to use for the sandbox. Defaults to `"browser"`.
enum:
- browser
- vm
type: string
tags:
default: []
description: List of string tags to apply to the sandbox. Only the first ten will be used. Defaults to no tags.
items:
type: string
type: array
template:
description: Name of the template from which the sandbox is derived (for example, `"static"`).
type: string
title:
default: ''
description: Sandbox title. Maximum 255 characters. Defaults to no title.
maxLength: 255
type: string
required:
- files
title: SandboxCreateRequest
TokenUpdateResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
description:
nullable: true
type: string
expires_at:
format: date-time
nullable: true
type: string
scopes:
items:
type: string
type: array
team_id:
type: string
token_id:
type: string
required:
- description
- scopes
- team_id
- token_id
type: object
type: object
title: TokenUpdateResponse
type: object
TokenCreateResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
description:
nullable: true
type: string
expires_at:
nullable: true
type: string
scopes:
items:
type: string
type: array
team_id:
type: string
token:
type: string
token_id:
type: string
required:
- description
- expires_at
- scopes
- team_id
- token
- token_id
type: object
type: object
title: TokenCreateResponse
type: object
TokenCreateRequest:
properties:
default_version:
description: API Version to use, formatted as YYYY-MM-DD. Defaults to the latest version at time of creation.
format: date
nullable: true
type: string
description:
description: Description of this token, for instance where it will be used.
maxLength: 255
type: string
expires_at:
description: UTC Timestamp until when this token is valid. Omitting this field will create a token without an expiry.
format: date-time
nullable: true
type: string
scopes:
description: Which scopes to grant this token. The given scopes will replace the current scopes, revoking any that are no longer present in the list.
items:
enum:
- sandbox_create
- sandbox_edit_code
- sandbox_read
- vm_manage
type: array
title: TokenCreateRequest
type: object
VMCreateSessionRequest:
properties:
permission:
description: Permission level for the session
enum:
- read
- write
example: write
type: string
session_id:
description: Unique identifier for the session
example: my-session-1
pattern: ^[a-zA-Z0-9_-]+$
type: string
required:
- session_id
- permission
title: VMCreateSessionRequest
type: object
VMCreateSessionResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
capabilities:
description: List of capabilities that Pitcher has
items:
type: string
type: array
permissions:
description: The permissions of the current session
type: object
pitcher_token:
description: Token to authenticate with Pitcher (the agent running inside the VM)
type: string
pitcher_url:
description: WebSocket URL to connect to Pitcher
type: string
user_workspace_path:
description: Path to the user's workspace in the VM
type: string
username:
description: The Linux username created for this session
type: string
required:
- username
- pitcher_token
- user_workspace_path
- capabilities
- permissions
- pitcher_url
type: object
type: object
title: VMCreateSessionResponse
type: object
WorkspaceCreateResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
id:
type: string
name:
type: string
required:
- id
- name
type: object
type: object
title: WorkspaceCreateResponse
type: object
VMUpdateHibernationTimeoutResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
hibernation_timeout_seconds:
type: integer
id:
type: string
required:
- id
- hibernation_timeout_seconds
type: object
type: object
title: VMUpdateHibernationTimeoutResponse
type: object
SandboxForkResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
alias:
type: string
id:
type: string
start_response:
$ref: '#/components/schemas/VMStartData'
title:
nullable: true
type: string
required:
- alias
- id
- title
type: object
type: object
title: SandboxForkResponse
type: object
PreviewTokenCreateResponse:
allOf:
- properties:
errors:
items:
oneOf:
- type: string
- additionalProperties: true
type: object
title: Error
type: array
success:
type: boolean
title: Response
type: object
- properties:
data:
properties:
sandbox_id:
type: string
token:
allOf:
- properties:
expires_at:
nullable: true
type: string
last_used_at:
nullable: true
type: string
token_id: