@xen-orchestra/rest-api 0.30.0 → 0.31.0

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.
@@ -2488,7 +2488,6 @@
2488
2488
  "required": [
2489
2489
  "status",
2490
2490
  "start",
2491
- "result",
2492
2491
  "properties",
2493
2492
  "id"
2494
2493
  ],
@@ -5690,11 +5689,8 @@
5690
5689
  "UnbrandedXoVif": {
5691
5690
  "$ref": "#/components/schemas/Unbrand_XoVif_"
5692
5691
  },
5693
- "Pick_CreateVifParams_91_0_93_.Exclude_keyofCreateVifParams_91_0_93_.network-or-VM__": {
5692
+ "Pick_CreateVifParams_91_0_93_.Exclude_keyofCreateVifParams_91_0_93_.network-or-VM-or-other_config-or-qos_algorithm_params__": {
5694
5693
  "properties": {
5695
- "other_config": {
5696
- "$ref": "#/components/schemas/Record_string.string_"
5697
- },
5698
5694
  "device": {
5699
5695
  "type": "string"
5700
5696
  },
@@ -5720,9 +5716,6 @@
5720
5716
  "locking_mode": {
5721
5717
  "$ref": "#/components/schemas/VIF_LOCKING_MODE"
5722
5718
  },
5723
- "qos_algorithm_params": {
5724
- "$ref": "#/components/schemas/Record_string.string_"
5725
- },
5726
5719
  "qos_algorithm_type": {
5727
5720
  "type": "string"
5728
5721
  }
@@ -5730,14 +5723,14 @@
5730
5723
  "type": "object",
5731
5724
  "description": "From T, pick a set of properties whose keys are in the union K"
5732
5725
  },
5733
- "Omit_CreateVifParams_91_0_93_.network-or-VM_": {
5734
- "$ref": "#/components/schemas/Pick_CreateVifParams_91_0_93_.Exclude_keyofCreateVifParams_91_0_93_.network-or-VM__",
5726
+ "Omit_CreateVifParams_91_0_93_.network-or-VM-or-other_config-or-qos_algorithm_params_": {
5727
+ "$ref": "#/components/schemas/Pick_CreateVifParams_91_0_93_.Exclude_keyofCreateVifParams_91_0_93_.network-or-VM-or-other_config-or-qos_algorithm_params__",
5735
5728
  "description": "Construct a type with the properties of T except for those in type K."
5736
5729
  },
5737
5730
  "CreateVifBody": {
5738
5731
  "allOf": [
5739
5732
  {
5740
- "$ref": "#/components/schemas/Omit_CreateVifParams_91_0_93_.network-or-VM_"
5733
+ "$ref": "#/components/schemas/Omit_CreateVifParams_91_0_93_.network-or-VM-or-other_config-or-qos_algorithm_params_"
5741
5734
  },
5742
5735
  {
5743
5736
  "properties": {
@@ -5749,6 +5742,20 @@
5749
5742
  },
5750
5743
  {
5751
5744
  "properties": {
5745
+ "qos_algorithm_params": {
5746
+ "properties": {},
5747
+ "additionalProperties": {
5748
+ "type": "string"
5749
+ },
5750
+ "type": "object"
5751
+ },
5752
+ "other_config": {
5753
+ "properties": {},
5754
+ "additionalProperties": {
5755
+ "type": "string"
5756
+ },
5757
+ "type": "object"
5758
+ },
5752
5759
  "vmId": {
5753
5760
  "type": "string"
5754
5761
  },
@@ -6328,7 +6335,11 @@
6328
6335
  "type": "string"
6329
6336
  },
6330
6337
  "permission": {
6331
- "type": "string"
6338
+ "type": "string",
6339
+ "enum": [
6340
+ "none",
6341
+ "admin"
6342
+ ]
6332
6343
  },
6333
6344
  "pw_hash": {
6334
6345
  "type": "string"
@@ -6401,7 +6412,11 @@
6401
6412
  "type": "string"
6402
6413
  },
6403
6414
  "permission": {
6404
- "type": "string"
6415
+ "type": "string",
6416
+ "enum": [
6417
+ "none",
6418
+ "admin"
6419
+ ]
6405
6420
  },
6406
6421
  "pw_hash": {
6407
6422
  "type": "string"
@@ -6428,7 +6443,11 @@
6428
6443
  "type": "string"
6429
6444
  },
6430
6445
  "permission": {
6431
- "type": "string"
6446
+ "type": "string",
6447
+ "enum": [
6448
+ "none",
6449
+ "admin"
6450
+ ]
6432
6451
  },
6433
6452
  "preferences": {
6434
6453
  "$ref": "#/components/schemas/Record_string.string_"
@@ -6894,6 +6913,9 @@
6894
6913
  "*",
6895
6914
  "read",
6896
6915
  "allow-vm",
6916
+ "disable",
6917
+ "enable",
6918
+ "evacuate",
6897
6919
  "export:logs",
6898
6920
  "update:tags"
6899
6921
  ]
@@ -7102,8 +7124,10 @@
7102
7124
  "action": {
7103
7125
  "type": "string",
7104
7126
  "enum": [
7127
+ "update",
7105
7128
  "*",
7106
- "read"
7129
+ "read",
7130
+ "update:management"
7107
7131
  ]
7108
7132
  },
7109
7133
  "selector": {
@@ -7356,6 +7380,7 @@
7356
7380
  "import",
7357
7381
  "update",
7358
7382
  "*",
7383
+ "delete",
7359
7384
  "read",
7360
7385
  "update:tags",
7361
7386
  "import:vdi",
@@ -7844,6 +7869,7 @@
7844
7869
  "reboot",
7845
7870
  "reboot:clean",
7846
7871
  "reboot:hard",
7872
+ "revert-snapshot",
7847
7873
  "shutdown:clean",
7848
7874
  "shutdown:hard",
7849
7875
  "update:datasources"
@@ -8095,7 +8121,6 @@
8095
8121
  "required": [
8096
8122
  "id",
8097
8123
  "properties",
8098
- "result",
8099
8124
  "start",
8100
8125
  "status"
8101
8126
  ],
@@ -14479,6 +14504,9 @@
14479
14504
  "*",
14480
14505
  "read",
14481
14506
  "allow-vm",
14507
+ "disable",
14508
+ "enable",
14509
+ "evacuate",
14482
14510
  "export:logs",
14483
14511
  "update:tags"
14484
14512
  ]
@@ -14711,8 +14739,10 @@
14711
14739
  "action": {
14712
14740
  "type": "string",
14713
14741
  "enum": [
14742
+ "update",
14714
14743
  "*",
14715
- "read"
14744
+ "read",
14745
+ "update:management"
14716
14746
  ]
14717
14747
  },
14718
14748
  "selector": {
@@ -14993,6 +15023,7 @@
14993
15023
  "import",
14994
15024
  "update",
14995
15025
  "*",
15026
+ "delete",
14996
15027
  "read",
14997
15028
  "update:tags",
14998
15029
  "import:vdi",
@@ -15533,6 +15564,7 @@
15533
15564
  "reboot",
15534
15565
  "reboot:clean",
15535
15566
  "reboot:hard",
15567
+ "revert-snapshot",
15536
15568
  "shutdown:clean",
15537
15569
  "shutdown:hard",
15538
15570
  "update:datasources"
@@ -16019,6 +16051,9 @@
16019
16051
  "*",
16020
16052
  "read",
16021
16053
  "allow-vm",
16054
+ "disable",
16055
+ "enable",
16056
+ "evacuate",
16022
16057
  "export:logs",
16023
16058
  "update:tags"
16024
16059
  ]
@@ -16275,8 +16310,10 @@
16275
16310
  "action": {
16276
16311
  "type": "string",
16277
16312
  "enum": [
16313
+ "update",
16278
16314
  "*",
16279
- "read"
16315
+ "read",
16316
+ "update:management"
16280
16317
  ]
16281
16318
  },
16282
16319
  "selector": {
@@ -16585,6 +16622,7 @@
16585
16622
  "import",
16586
16623
  "update",
16587
16624
  "*",
16625
+ "delete",
16588
16626
  "read",
16589
16627
  "update:tags",
16590
16628
  "import:vdi",
@@ -17177,6 +17215,7 @@
17177
17215
  "reboot",
17178
17216
  "reboot:clean",
17179
17217
  "reboot:hard",
17218
+ "revert-snapshot",
17180
17219
  "shutdown:clean",
17181
17220
  "shutdown:hard",
17182
17221
  "update:datasources"
@@ -17538,6 +17577,9 @@
17538
17577
  "*",
17539
17578
  "read",
17540
17579
  "allow-vm",
17580
+ "disable",
17581
+ "enable",
17582
+ "evacuate",
17541
17583
  "export:logs",
17542
17584
  "update:tags"
17543
17585
  ]
@@ -17710,8 +17752,10 @@
17710
17752
  "action": {
17711
17753
  "type": "string",
17712
17754
  "enum": [
17755
+ "update",
17713
17756
  "*",
17714
- "read"
17757
+ "read",
17758
+ "update:management"
17715
17759
  ]
17716
17760
  },
17717
17761
  "selector": {
@@ -17922,6 +17966,7 @@
17922
17966
  "import",
17923
17967
  "update",
17924
17968
  "*",
17969
+ "delete",
17925
17970
  "read",
17926
17971
  "update:tags",
17927
17972
  "import:vdi",
@@ -18332,6 +18377,7 @@
18332
18377
  "reboot",
18333
18378
  "reboot:clean",
18334
18379
  "reboot:hard",
18380
+ "revert-snapshot",
18335
18381
  "shutdown:clean",
18336
18382
  "shutdown:hard",
18337
18383
  "update:datasources"
@@ -18395,7 +18441,7 @@
18395
18441
  },
18396
18442
  "info": {
18397
18443
  "title": "@xen-orchestra/rest-api",
18398
- "version": "0.30.0",
18444
+ "version": "0.31.0",
18399
18445
  "description": "REST API to manage your XOA",
18400
18446
  "license": {
18401
18447
  "name": "AGPL-3.0-or-later"
@@ -20993,6 +21039,104 @@
20993
21039
  ]
20994
21040
  }
20995
21041
  },
21042
+ "/vms/{id}/actions/revert_snapshot": {
21043
+ "post": {
21044
+ "operationId": "RevertSnapshotVm",
21045
+ "responses": {
21046
+ "202": {
21047
+ "description": "Action executed asynchronously",
21048
+ "content": {
21049
+ "application/json": {
21050
+ "schema": {
21051
+ "$ref": "#/components/schemas/CreateActionReturnType_void_"
21052
+ },
21053
+ "examples": {
21054
+ "Example 1": {
21055
+ "value": {
21056
+ "taskId": "0m7kl0j9l"
21057
+ }
21058
+ }
21059
+ }
21060
+ }
21061
+ }
21062
+ },
21063
+ "204": {
21064
+ "description": "No content"
21065
+ },
21066
+ "400": {
21067
+ "description": "Bad request"
21068
+ },
21069
+ "401": {
21070
+ "description": "Authentication required"
21071
+ },
21072
+ "403": {
21073
+ "description": "Forbidden"
21074
+ },
21075
+ "404": {
21076
+ "description": "Resource not found"
21077
+ },
21078
+ "422": {
21079
+ "description": "Invalid parameters"
21080
+ },
21081
+ "500": {
21082
+ "description": "Internal server error, XenServer/XCP-ng error"
21083
+ }
21084
+ },
21085
+ "description": "Required privilege:\n- resource: vm, action: revert-snapshot\n- resource: vm, action: snapshot (if `snapshotBefore: true`)",
21086
+ "tags": [
21087
+ "vms"
21088
+ ],
21089
+ "security": [
21090
+ {
21091
+ "*": []
21092
+ }
21093
+ ],
21094
+ "parameters": [
21095
+ {
21096
+ "in": "path",
21097
+ "name": "id",
21098
+ "required": true,
21099
+ "schema": {
21100
+ "type": "string"
21101
+ },
21102
+ "example": "f07ab729-c0e8-721c-45ec-f11276377030"
21103
+ },
21104
+ {
21105
+ "in": "query",
21106
+ "name": "sync",
21107
+ "required": false,
21108
+ "schema": {
21109
+ "type": "boolean"
21110
+ }
21111
+ }
21112
+ ],
21113
+ "requestBody": {
21114
+ "required": true,
21115
+ "content": {
21116
+ "application/json": {
21117
+ "schema": {
21118
+ "properties": {
21119
+ "snapshotBefore": {
21120
+ "type": "boolean"
21121
+ },
21122
+ "snapshotId": {
21123
+ "type": "string"
21124
+ }
21125
+ },
21126
+ "required": [
21127
+ "snapshotId"
21128
+ ],
21129
+ "type": "object"
21130
+ },
21131
+ "example": {
21132
+ "snapshotId": "f07ab729-c0e8-721c-45ec-f11276377030",
21133
+ "snapshotBefore": true
21134
+ }
21135
+ }
21136
+ }
21137
+ }
21138
+ }
21139
+ },
20996
21140
  "/vms/{id}/actions/snapshot": {
20997
21141
  "post": {
20998
21142
  "operationId": "SnapshotVm",
@@ -25042,7 +25186,14 @@
25042
25186
  },
25043
25187
  "example": {
25044
25188
  "networkId": "6b6ca0f5-6611-0636-4b0a-1fb1c1e96414",
25045
- "vmId": "613f541c-4bed-fc77-7ca8-2db6b68f079c"
25189
+ "vmId": "613f541c-4bed-fc77-7ca8-2db6b68f079c",
25190
+ "other_config": {
25191
+ "ethtool-tx": "false"
25192
+ },
25193
+ "qos_algorithm_params": {
25194
+ "kbps": "42"
25195
+ },
25196
+ "qos_algorithm_type": "ratelimit"
25046
25197
  }
25047
25198
  }
25048
25199
  }
@@ -28207,7 +28358,11 @@
28207
28358
  "schema": {
28208
28359
  "properties": {
28209
28360
  "permission": {
28210
- "type": "string"
28361
+ "type": "string",
28362
+ "enum": [
28363
+ "none",
28364
+ "admin"
28365
+ ]
28211
28366
  },
28212
28367
  "password": {
28213
28368
  "type": "string"
@@ -29637,6 +29792,46 @@
29637
29792
  "example": "c4284e12-37c9-7967-b9e8-83ef229c3e03"
29638
29793
  }
29639
29794
  ]
29795
+ },
29796
+ "delete": {
29797
+ "operationId": "DeleteSr",
29798
+ "responses": {
29799
+ "204": {
29800
+ "description": "No content"
29801
+ },
29802
+ "400": {
29803
+ "description": "Bad request"
29804
+ },
29805
+ "401": {
29806
+ "description": "Authentication required"
29807
+ },
29808
+ "403": {
29809
+ "description": "Forbidden"
29810
+ },
29811
+ "404": {
29812
+ "description": "Resource not found"
29813
+ }
29814
+ },
29815
+ "description": "Required privilege:\n- resource: sr, action: delete",
29816
+ "tags": [
29817
+ "srs"
29818
+ ],
29819
+ "security": [
29820
+ {
29821
+ "*": []
29822
+ }
29823
+ ],
29824
+ "parameters": [
29825
+ {
29826
+ "in": "path",
29827
+ "name": "id",
29828
+ "required": true,
29829
+ "schema": {
29830
+ "type": "string"
29831
+ },
29832
+ "example": "c4284e12-37c9-7967-b9e8-83ef229c3e03"
29833
+ }
29834
+ ]
29640
29835
  }
29641
29836
  },
29642
29837
  "/srs/{id}/alarms": {
@@ -44962,6 +45157,9 @@
44962
45157
  "401": {
44963
45158
  "description": "Authentication required"
44964
45159
  },
45160
+ "403": {
45161
+ "description": "Forbidden"
45162
+ },
44965
45163
  "404": {
44966
45164
  "description": "Resource not found"
44967
45165
  },
@@ -44972,7 +45170,7 @@
44972
45170
  "description": "Internal server error, XenServer/XCP-ng error"
44973
45171
  }
44974
45172
  },
44975
- "description": "Reconfigure the management interface of the host to use the given PIF.\n\nThe target PIF must already have an IP address configured.",
45173
+ "description": "Required privilege:\n- resource: pif, action: update:management\n\nReconfigure the management interface of the host to use the given PIF.\n\nThe target PIF must already have an IP address configured.",
44976
45174
  "tags": [
44977
45175
  "hosts"
44978
45176
  ],
@@ -45053,6 +45251,9 @@
45053
45251
  "401": {
45054
45252
  "description": "Authentication required"
45055
45253
  },
45254
+ "403": {
45255
+ "description": "Forbidden"
45256
+ },
45056
45257
  "404": {
45057
45258
  "description": "Resource not found"
45058
45259
  },
@@ -45063,7 +45264,7 @@
45063
45264
  "description": "Internal server error, XenServer/XCP-ng error"
45064
45265
  }
45065
45266
  },
45066
- "description": "Disable a host.\n\nSet `evacuate` to `true` to also evacuate all running VMs to other hosts in the pool.\n\nUse `vmIdsToForceMigrate` to unblock VMs whose migration is currently blocked (e.g. by `pool_migrate` or `migrate_send` blocked operations).\n\nUse `force` to ignore evacuation errors.",
45267
+ "description": "Required privileges:\n- resource: host, action: disable\n- resource: host, action: evacuate (if `evacuate: true`)\n\nDisable a host.\n\nSet `evacuate` to `true` to also evacuate all running VMs to other hosts in the pool.\n\nUse `vmIdsToForceMigrate` to unblock VMs whose migration is currently blocked (e.g. by `pool_migrate` or `migrate_send` blocked operations).\n\nUse `force` to ignore evacuation errors.",
45067
45268
  "tags": [
45068
45269
  "hosts"
45069
45270
  ],
@@ -45176,6 +45377,9 @@
45176
45377
  "401": {
45177
45378
  "description": "Authentication required"
45178
45379
  },
45380
+ "403": {
45381
+ "description": "Forbidden"
45382
+ },
45179
45383
  "404": {
45180
45384
  "description": "Resource not found"
45181
45385
  },
@@ -45183,7 +45387,7 @@
45183
45387
  "description": "Internal server error, XenServer/XCP-ng error"
45184
45388
  }
45185
45389
  },
45186
- "description": "Enable a host, taking it out of disabled state.",
45390
+ "description": "Required privilege:\n- resource: host, action: enable\n\nEnable a host, taking it out of disabled state.",
45187
45391
  "tags": [
45188
45392
  "hosts"
45189
45393
  ],
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "main": "./dist/index.mjs",
7
7
  "name": "@xen-orchestra/rest-api",
8
8
  "homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/rest-api",
9
- "version": "0.30.0",
9
+ "version": "0.31.0",
10
10
  "description": "REST API to manage your XOA",
11
11
  "license": "AGPL-3.0-or-later",
12
12
  "private": false,
@@ -28,6 +28,7 @@
28
28
  "@eslint/js": "^9.19.0",
29
29
  "@types/express": "^5.0.0",
30
30
  "@types/swagger-ui-express": "^4.1.7",
31
+ "openapi-types": "^12.1.3",
31
32
  "rimraf": "^6.0.1",
32
33
  "typescript": "~5.6.3",
33
34
  "typescript-eslint": "^8.23.0"
@@ -35,11 +36,11 @@
35
36
  "dependencies": {
36
37
  "@vates/async-each": "^1.0.3",
37
38
  "@vates/task": "^0.7.0",
38
- "@vates/types": "^1.24.0",
39
- "@xen-orchestra/acl": "^1.0.0",
40
- "@xen-orchestra/backups": "^0.72.1",
39
+ "@vates/types": "^1.25.0",
40
+ "@xen-orchestra/acl": "^1.1.0",
41
+ "@xen-orchestra/backups": "^0.73.0",
41
42
  "@xen-orchestra/log": "^0.7.2",
42
- "@xen-orchestra/xapi": "^8.7.2",
43
+ "@xen-orchestra/xapi": "^8.8.0",
43
44
  "complex-matcher": "^1.1.1",
44
45
  "golike-defer": "^0.5.1",
45
46
  "inversify": "^6.2.2",
@@ -51,7 +52,9 @@
51
52
  "tsoa": "^6.6.0",
52
53
  "value-matcher": "^0.2.0",
53
54
  "xo-common": "^0.9.1",
54
- "xo-remote-parser": "^0.10.1"
55
+ "xo-remote-parser": "^0.10.1",
56
+ "zod": "^4.3.6",
57
+ "zod-openapi": "^5.4.6"
55
58
  },
56
59
  "bugs": "https://github.com/vatesfr/xen-orchestra/issues",
57
60
  "repository": {
package/turbo.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build": {
5
+ "outputs": ["dist/**", "open-api/spec/**"]
6
+ }
7
+ }
8
+ }