-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackup.v1.3.1.openapi.json
832 lines (832 loc) · 26.4 KB
/
backup.v1.3.1.openapi.json
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
{
"openapi" : "3.0.1",
"info" : {
"description" : "<p> The ctrlX Backup API provides functionalities for backup and restore. </p> <p>Usage:</p> <ul> <li>Click 'Authorize' to open the 'Available authorizations' dialog.</li> <li>Enter 'username' and 'password'. The 'Client credentials location' selector together with the 'client_id' and 'client_secret' fields as well as the 'Bearer' section can be ignored.</li> <li>Click 'Authorize' and then 'Close' to close the 'Available authorizations' dialog.</li> <li>Try out those GET, PUT, ... operations you're interested in.</li> </ul>",
"license" : {
"name" : "MIT"
},
"title" : "ctrlX OS - Backup API",
"version" : "1.3.1"
},
"servers" : [ {
"url" : "/backup/api/v1"
}, {
"url" : "https://[fe80::dcad:beff:fe00:1]/backup/api/v1"
}, {
"url" : "https://{host}/backup/api/v1",
"variables" : {
"host" : {
"default" : "[fe80::dcad:beff:fe00:0001]",
"description" : "Hostname or ip address of the ctrlX OS system"
}
}
} ],
"security" : [ {
"UsernamePassword" : [ ]
}, {
"Bearer" : [ ]
} ],
"tags" : [ {
"description" : "Create backup archive and download it.",
"name" : "Backup"
}, {
"description" : "Upload backup archive and restore it.",
"name" : "Restore"
}, {
"description" : "Contains information about running tasks for asynchronous request handling.",
"name" : "Tasks"
} ],
"paths" : {
"/backup" : {
"post" : {
"operationId" : "createBackup",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Backup"
}
}
}
},
"responses" : {
"200" : {
"content" : {
"application/x-tar" : {
"schema" : {
"format" : "binary",
"type" : "string"
}
}
},
"description" : "Returns the archive file of the backup"
},
"202" : {
"description" : "Accepted",
"headers" : {
"Location" : {
"explode" : false,
"schema" : {
"example" : "/tasks/123",
"type" : "string"
},
"style" : "simple"
}
}
},
"400" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The request is incomplete or malformed"
},
"401" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Not authorized to access this resource"
},
"403" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Access forbidden for this resource"
},
"409" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The request conflicts with the current state of the resource."
},
"500" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Something unexpected happened on the server"
}
},
"summary" : "Creates a new backup archive",
"tags" : [ "Backup" ]
}
},
"/restore" : {
"post" : {
"operationId" : "restoreBackup",
"requestBody" : {
"content" : {
"multipart/form-data" : {
"schema" : {
"$ref" : "#/components/schemas/Restore"
}
}
}
},
"responses" : {
"202" : {
"description" : "Accepted",
"headers" : {
"Location" : {
"explode" : false,
"schema" : {
"example" : "/tasks/123",
"type" : "string"
},
"style" : "simple"
}
}
},
"204" : {
"description" : "No Content (restore succeeded)"
},
"400" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The request is incomplete or malformed"
},
"401" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Not authorized to access this resource"
},
"403" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Access forbidden for this resource"
},
"409" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The request conflicts with the current state of the resource."
},
"500" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Something unexpected happened on the server"
}
},
"summary" : "Upload a backup archive and restores it",
"tags" : [ "Restore" ]
}
},
"/archives/{taskId}" : {
"get" : {
"operationId" : "getArchiveByTaskId",
"parameters" : [ {
"description" : "task id",
"explode" : false,
"in" : "path",
"name" : "taskId",
"required" : true,
"schema" : {
"example" : "a1b2c3d4e5",
"type" : "string"
},
"style" : "simple"
} ],
"responses" : {
"200" : {
"content" : {
"application/x-tar" : {
"schema" : {
"format" : "binary",
"type" : "string"
}
}
},
"description" : "Returns the packed archive file by the task id"
},
"401" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Not authorized to access this resource"
},
"403" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Access forbidden for this resource"
},
"404" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The resource was not found"
},
"500" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Something unexpected happened on the server"
}
},
"summary" : "Receive an backup archive file by the task id",
"tags" : [ "Backup" ]
}
},
"/backups" : {
"get" : {
"operationId" : "listBackups",
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"items" : {
"$ref" : "#/components/schemas/BackupInfo"
},
"type" : "array"
}
}
},
"description" : "List of backup archives"
},
"401" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Not authorized to access this resource"
},
"403" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Access forbidden for this resource"
},
"500" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Something unexpected happened on the server"
}
},
"summary" : "Get backup archives from removable media",
"tags" : [ "Restore" ]
}
},
"/tasks" : {
"get" : {
"operationId" : "getTasks",
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Tasks"
}
}
},
"description" : "List of Tasks"
},
"401" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Not authorized to access this resource"
},
"403" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Access forbidden for this resource"
},
"500" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Something unexpected happened on the server"
}
},
"summary" : "Receive a list of tasks",
"tags" : [ "Tasks" ]
}
},
"/tasks/{taskId}" : {
"get" : {
"operationId" : "getTask",
"parameters" : [ {
"description" : "task id",
"explode" : false,
"in" : "path",
"name" : "taskId",
"required" : true,
"schema" : {
"example" : "a1b2c3d4e5",
"type" : "string"
},
"style" : "simple"
} ],
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Task"
}
}
},
"description" : "Done - Task information"
},
"401" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Not authorized to access this resource"
},
"403" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Access forbidden for this resource"
},
"404" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The resource was not found"
},
"500" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Something unexpected happened on the server"
}
},
"summary" : "Receive information about a task",
"tags" : [ "Tasks" ]
}
}
},
"components" : {
"parameters" : {
"taskId" : {
"description" : "task id",
"explode" : false,
"in" : "path",
"name" : "taskId",
"required" : true,
"schema" : {
"example" : "a1b2c3d4e5",
"type" : "string"
},
"style" : "simple"
}
},
"responses" : {
"BadRequest" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The request is incomplete or malformed"
},
"Unauthorized" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Not authorized to access this resource"
},
"Forbidden" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Access forbidden for this resource"
},
"NotFound" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The resource was not found"
},
"Conflict" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "The request conflicts with the current state of the resource."
},
"InternalServerError" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
},
"description" : "Something unexpected happened on the server"
}
},
"schemas" : {
"Backup" : {
"example" : {
"includesnaps" : true,
"async" : false,
"password" : "password",
"download" : true,
"useexternalstorage" : true,
"targetdir" : "targetdir"
},
"properties" : {
"password" : {
"default" : "",
"description" : "The password for encryption of the backup archive.",
"format" : "password",
"maxLength" : 64,
"minLength" : 1,
"pattern" : "^[a-zA-Z]+[\\w\\-\\_\\.]*$",
"type" : "string"
},
"targetdir" : {
"default" : "",
"description" : "The target directory for a copy of the backup on device.",
"maxLength" : 256,
"minLength" : 0,
"type" : "string"
},
"download" : {
"default" : true,
"description" : "True if the backup archive should be downloaded.",
"example" : true,
"type" : "boolean"
},
"includesnaps" : {
"default" : true,
"description" : "True if the snaps should be included in backup archive.",
"example" : true,
"type" : "boolean"
},
"async" : {
"default" : false,
"description" : "True if the operation should be asynchronous.",
"example" : false,
"type" : "boolean"
},
"useexternalstorage" : {
"default" : true,
"description" : "True if the operation should use external storage for temporary files (if possible).",
"example" : true,
"type" : "boolean"
}
},
"required" : [ "password" ],
"type" : "object"
},
"BackupInfo" : {
"example" : {
"path" : "/media/sdb2/ctrlX-2021-05-01-08-30-00.tar"
},
"properties" : {
"path" : {
"description" : "Path of backup archive on device",
"example" : "/media/sdb2/ctrlX-2021-05-01-08-30-00.tar",
"type" : "string"
}
},
"type" : "object"
},
"Restore" : {
"properties" : {
"password" : {
"default" : "",
"description" : "The password for decryption of the backup archive.",
"format" : "password",
"maxLength" : 64,
"minLength" : 1,
"pattern" : "^[a-zA-Z]+[\\w\\-\\_\\.]*$",
"type" : "string"
},
"archive" : {
"description" : "The backup archive file to upload for restore. Required if 'uri' is undefined.",
"format" : "binary",
"type" : "string"
},
"uri" : {
"default" : "",
"description" : "URI of backup archive that should be used for restore. Required if 'archive' is undefined.",
"example" : "file:///media/sdb2/ctrlX-2021-05-01-08-30-00.tar",
"type" : "string"
},
"async" : {
"default" : false,
"description" : "True if the operation should be asynchronous.",
"example" : false,
"type" : "boolean"
},
"useexternalstorage" : {
"default" : true,
"description" : "True if the operation should use external storage for temporary files (if possible).",
"example" : true,
"type" : "boolean"
}
},
"type" : "object"
},
"Task" : {
"example" : {
"actionIndex" : 0,
"eta" : "2019-01-01T12:00:27.87+00:20",
"warnings" : [ "warnings", "warnings" ],
"progress" : 10,
"id" : "123",
"state" : "running",
"error" : "error",
"actions" : [ "actions", "actions" ],
"parameters" : {
"process" : "backup",
"version" : "v1.0.0",
"state" : "SaveSnaps"
}
},
"properties" : {
"id" : {
"description" : "The temporary id of a task",
"example" : "123",
"readOnly" : true,
"type" : "string"
},
"state" : {
"enum" : [ "pending", "failed", "done", "running" ],
"example" : "running",
"readOnly" : true,
"type" : "string"
},
"progress" : {
"description" : "Progress of the task",
"example" : 10,
"maximum" : 100,
"minimum" : 0,
"readOnly" : true,
"type" : "integer"
},
"eta" : {
"description" : "ETA in RFC 3339 format",
"example" : "2019-01-01T12:00:27.87+00:20",
"format" : "dateTime",
"readOnly" : true,
"type" : "string"
},
"actionIndex" : {
"description" : "Current zero based index of possible actions list",
"minimum" : 0,
"type" : "integer"
},
"actions" : {
"description" : "List of possible actions which are processed in the task",
"items" : {
"type" : "string"
},
"type" : "array"
},
"warnings" : {
"description" : "List of possible warnings which are occurred in the task",
"items" : {
"type" : "string"
},
"type" : "array"
},
"error" : {
"description" : "Error occurred in the task",
"type" : "string"
},
"parameters" : {
"additionalProperties" : {
"type" : "string"
},
"description" : "Additional properties not explicitly declared",
"example" : {
"process" : "backup",
"version" : "v1.0.0",
"state" : "SaveSnaps"
},
"type" : "object"
}
},
"type" : "object"
},
"Tasks" : {
"items" : {
"$ref" : "#/components/schemas/Task"
},
"type" : "array"
},
"Problem" : {
"description" : "This document defines a \"problem detail\" as a way to carry machine-readable details of errors in a HTTP response to avoid the need to define new error response formats for HTTP APIs.\n",
"properties" : {
"type" : {
"default" : "about:blank",
"description" : "A URI reference [RFC3986] that identifies the problem type. \nThis specification encourages that, when dereferenced, \nit provide human-readable documentation for the problem type \n(e.g., using HTML [W3C.REC-html5-20141028]). When this member \nis not present, its value is assumed to be \"about:blank\".\n",
"example" : "https://example.com/probs/out-of-credit",
"format" : "uri",
"type" : "string"
},
"title" : {
"description" : "A short, human-readable summary of the problem type. \nIt SHOULD NOT change from occurrence to occurrence of the problem, \nexcept for purposes of localization (e.g., using proactive content \nnegotiation; see [RFC7231], Section 3.4).\n",
"example" : "You do not have enough credit.",
"type" : "string"
},
"status" : {
"description" : "The HTTP status code ([RFC7231], Section 6) generated by the \norigin server for this occurrence of the problem.\n",
"example" : 403,
"format" : "int32",
"type" : "integer"
},
"detail" : {
"description" : "A human-readable explanation specific to this occurrence of the problem.\n",
"example" : "Your current balance is 30, but that costs 50.",
"type" : "string"
},
"instance" : {
"description" : "A URI reference that identifies the specific occurrence of the problem.\nIt may or may not yield further information if dereferenced.\n",
"example" : "/account/12345/msgs/abc",
"type" : "string"
},
"code" : {
"deprecated" : true,
"description" : "An error code issued by the system that caused the original problem.\nThis code can be used to track down the root cause of the error.\n",
"example" : "F360001",
"type" : "string"
},
"mainDiagnosisCode" : {
"description" : "The main diagnosis code is issued by the system that caused the problem.\nThis code can be used to track down the root cause and source of the error.\nIt can be used to search in the documentation for a solution.\nIt SHOULD NOT change from occurrence to occurrence of the same problem.\n",
"example" : "080F0100",
"type" : "string"
},
"detailedDiagnosisCode" : {
"description" : "The detailed diagnosis code issued by the system that caused the problem.\nThis code can be used to track down the detailed cause and source of the error.\nIt can be used to search in the documentation for a solution.\nThe detailed diagnosis code gives additional information about the cause of the error.\nIt SHOULD NOT change from occurrence to occurrence of the same problem.\n",
"example" : "00666001",
"type" : "string"
},
"dynamicDescription" : {
"description" : "A dynamic description gives detailed information about the occurrence of a problem.\nIt can change between different occurrences of the same error.\n",
"example" : "value = -4.5",
"type" : "string"
},
"severity" : {
"description" : " Severity of a problem as defined RFC5424 of the Syslog standard, see https://tools.ietf.org/html/rfc5424",
"enum" : [ "Emergency", "Alert", "Critical", "Error", "Warning", "Notice", "Informational", "Debug" ],
"example" : "Error",
"type" : "string"
},
"links" : {
"description" : "Collection of links to fix the problem. E.g. links to online user manual,\nto an online community (using tags) or a developer chat (e.g. Slack).\n",
"items" : {
"example" : "https://stackoverflow.com/questions/tagged/boschrexroth+controlx+f360001",
"format" : "uri",
"type" : "string"
},
"type" : "array"
},
"moreInfo" : {
"additionalProperties" : true,
"example" : {
"trace" : "ExampleClass.cpp#452 Null pointer exception",
"class" : "ExampleClass"
},
"type" : "object"
}
},
"required" : [ "title", "type" ],
"type" : "object",
"x-version" : "1.0.0"
}
},
"securitySchemes" : {
"UsernamePassword" : {
"description" : "Enter username and password",
"flows" : {
"password" : {
"scopes" : {
"dummy" : "Dummy scope (scopes not used)"
},
"tokenUrl" : "/identity-manager/api/v1.0/auth/token"
}
},
"type" : "oauth2"
},
"Bearer" : {
"description" : "Alternatively: Enter bearer token (without prefix 'Bearer')",
"scheme" : "bearer",
"type" : "http"
}
}
}
}