Skip to content

Commit aef02d6

Browse files
author
Github action on xapi-project/xen-api
committed
1 parent 9738006 commit aef02d6

3 files changed

Lines changed: 114 additions & 31 deletions

File tree

source/includes/datapath.html.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Volumes must be attached via the following sequence of calls:
210210
{
211211
"method": "Datapath.open",
212212
"params": [ { "persistent": true, "uri": "uri", "dbg": "dbg" } ],
213-
"id": 31
213+
"id": 32
214214
}
215215
```
216216

@@ -282,7 +282,7 @@ class Datapath_myimplementation(Datapath_skeleton):
282282
{
283283
"method": "Datapath.attach",
284284
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
285-
"id": 32
285+
"id": 33
286286
}
287287
```
288288

@@ -377,7 +377,7 @@ class Datapath_myimplementation(Datapath_skeleton):
377377
{
378378
"method": "Datapath.activate",
379379
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
380-
"id": 33
380+
"id": 34
381381
}
382382
```
383383

@@ -449,7 +449,7 @@ class Datapath_myimplementation(Datapath_skeleton):
449449
{
450450
"method": "Datapath.activate_readonly",
451451
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
452-
"id": 34
452+
"id": 35
453453
}
454454
```
455455

@@ -526,7 +526,7 @@ class Datapath_myimplementation(Datapath_skeleton):
526526
{
527527
"method": "Datapath.import_activate",
528528
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
529-
"id": 35
529+
"id": 36
530530
}
531531
```
532532

@@ -606,7 +606,7 @@ class Datapath_myimplementation(Datapath_skeleton):
606606
{
607607
"method": "Datapath.deactivate",
608608
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
609-
"id": 36
609+
"id": 37
610610
}
611611
```
612612

@@ -678,7 +678,7 @@ class Datapath_myimplementation(Datapath_skeleton):
678678
{
679679
"method": "Datapath.detach",
680680
"params": [ { "domain": "domain", "uri": "uri", "dbg": "dbg" } ],
681-
"id": 37
681+
"id": 38
682682
}
683683
```
684684

@@ -753,7 +753,7 @@ class Datapath_myimplementation(Datapath_skeleton):
753753
{
754754
"method": "Datapath.close",
755755
"params": [ { "uri": "uri", "dbg": "dbg" } ],
756-
"id": 38
756+
"id": 39
757757
}
758758
```
759759

@@ -870,7 +870,7 @@ To mirror a VDI a sequence of these API calls is required:
870870
"dbg": "dbg"
871871
}
872872
],
873-
"id": 39
873+
"id": 40
874874
}
875875
```
876876

@@ -950,7 +950,7 @@ class Data_myimplementation(Data_skeleton):
950950
"params": [
951951
{ "remote": "remote", "domain": "domain", "uri": "uri", "dbg": "dbg" }
952952
],
953-
"id": 40
953+
"id": 41
954954
}
955955
```
956956

@@ -1023,7 +1023,7 @@ class Data_myimplementation(Data_skeleton):
10231023
{
10241024
"method": "Data.stat",
10251025
"params": [ { "operation": [ "CopyV1", "CopyV1" ], "dbg": "dbg" } ],
1026-
"id": 41
1026+
"id": 42
10271027
}
10281028
```
10291029

@@ -1093,7 +1093,7 @@ class Data_myimplementation(Data_skeleton):
10931093
{
10941094
"method": "Data.cancel",
10951095
"params": [ { "operation": [ "CopyV1", "CopyV1" ], "dbg": "dbg" } ],
1096-
"id": 42
1096+
"id": 43
10971097
}
10981098
```
10991099

@@ -1161,7 +1161,7 @@ class Data_myimplementation(Data_skeleton):
11611161
{
11621162
"method": "Data.destroy",
11631163
"params": [ { "operation": [ "CopyV1", "CopyV1" ], "dbg": "dbg" } ],
1164-
"id": 43
1164+
"id": 44
11651165
}
11661166
```
11671167

@@ -1227,7 +1227,7 @@ class Data_myimplementation(Data_skeleton):
12271227
> Client
12281228
12291229
```json
1230-
{ "method": "Data.ls", "params": [ { "dbg": "dbg" } ], "id": 44 }
1230+
{ "method": "Data.ls", "params": [ { "dbg": "dbg" } ], "id": 45 }
12311231
```
12321232

12331233
```ocaml

source/includes/task.html.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ The task interface is for querying the status of asynchronous tasks. All long-r
154154
{
155155
"method": "Task.stat",
156156
"params": [ { "id": "id", "dbg": "dbg" } ],
157-
"id": 45
157+
"id": 46
158158
}
159159
```
160160

@@ -228,7 +228,7 @@ class Task_myimplementation(Task_skeleton):
228228
{
229229
"method": "Task.cancel",
230230
"params": [ { "id": "id", "dbg": "dbg" } ],
231-
"id": 46
231+
"id": 47
232232
}
233233
```
234234

@@ -299,7 +299,7 @@ class Task_myimplementation(Task_skeleton):
299299
{
300300
"method": "Task.destroy",
301301
"params": [ { "id": "id", "dbg": "dbg" } ],
302-
"id": 47
302+
"id": 48
303303
}
304304
```
305305

@@ -364,7 +364,7 @@ class Task_myimplementation(Task_skeleton):
364364
> Client
365365
366366
```json
367-
{ "method": "Task.ls", "params": [ { "dbg": "dbg" } ], "id": 48 }
367+
{ "method": "Task.ls", "params": [ { "dbg": "dbg" } ], "id": 49 }
368368
```
369369

370370
```ocaml

source/includes/volume.html.md

Lines changed: 96 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,6 +1505,89 @@ class Volume_myimplementation(Volume_skeleton):
15051505
dbg | in | string | Debug context from the caller
15061506
sr | in | string | The Storage Repository
15071507
key | in | key | The volume key
1508+
## Method: `revert`
1509+
\[revert sr snapshot volume\] returns a reference to a volume. This volume must contain the contents of the read-only \[snapshot\], and its identity must remain the same as \[volume\].
1510+
1511+
> Client
1512+
1513+
```json
1514+
{
1515+
"method": "Volume.revert",
1516+
"params": [
1517+
{ "key": "key", "snapshot": "snapshot", "sr": "sr", "dbg": "dbg" }
1518+
],
1519+
"id": 18
1520+
}
1521+
```
1522+
1523+
```ocaml
1524+
try
1525+
let () = Client.revert dbg sr snapshot key in
1526+
...
1527+
with Exn (Sr_not_attached str) -> ...
1528+
| Exn (SR_does_not_exist str) -> ...
1529+
| Exn (Volume_does_not_exist str) -> ...
1530+
| Exn (Unimplemented str) -> ...
1531+
| Exn (Cancelled str) -> ...
1532+
| Exn (Activated_on_another_host str) -> ...
1533+
1534+
```
1535+
1536+
```python
1537+
1538+
# import necessary libraries if needed
1539+
# we assume that your library providing the client is called myclient and it provides a connect method
1540+
import myclient
1541+
1542+
if __name__ == "__main__":
1543+
c = myclient.connect()
1544+
results = c.Volume.revert({ dbg: "string", sr: "string", snapshot: "string", key: "string" })
1545+
print(repr(results))
1546+
```
1547+
1548+
> Server
1549+
1550+
```json
1551+
null
1552+
```
1553+
1554+
```ocaml
1555+
try
1556+
let () = Client.revert dbg sr snapshot key in
1557+
...
1558+
with Exn (Sr_not_attached str) -> ...
1559+
| Exn (SR_does_not_exist str) -> ...
1560+
| Exn (Volume_does_not_exist str) -> ...
1561+
| Exn (Unimplemented str) -> ...
1562+
| Exn (Cancelled str) -> ...
1563+
| Exn (Activated_on_another_host str) -> ...
1564+
1565+
```
1566+
1567+
```python
1568+
1569+
# import additional libraries if needed
1570+
1571+
class Volume_myimplementation(Volume_skeleton):
1572+
# by default each method will return a Not_implemented error
1573+
# ...
1574+
1575+
def revert(self, dbg, sr, snapshot, key):
1576+
"""
1577+
[revert sr snapshot volume] returns a reference to a volume. This
1578+
volume must contain the contents of the read-only [snapshot], and its
1579+
identity must remain the same as [volume].
1580+
"""
1581+
# ...
1582+
```
1583+
1584+
1585+
Name | Direction | Type | Description
1586+
----------|-----------|--------|-----------------------------------------------------------------------------------
1587+
dbg | in | string | Debug context from the caller
1588+
sr | in | string | The Storage Repository
1589+
snapshot | in | key | Read-only volume with the contents that are to be present in the resulting volume
1590+
key | in | key | The volume key
15081591
## Method: `set_name`
15091592
\[set\_name sr volume new\_name\] changes the name of \[volume\]
15101593

@@ -1516,7 +1599,7 @@ class Volume_myimplementation(Volume_skeleton):
15161599
"params": [
15171600
{ "new_name": "new_name", "key": "key", "sr": "sr", "dbg": "dbg" }
15181601
],
1519-
"id": 18
1602+
"id": 19
15201603
}
15211604
```
15221605

@@ -1602,7 +1685,7 @@ class Volume_myimplementation(Volume_skeleton):
16021685
"dbg": "dbg"
16031686
}
16041687
],
1605-
"id": 19
1688+
"id": 20
16061689
}
16071690
```
16081691

@@ -1684,7 +1767,7 @@ class Volume_myimplementation(Volume_skeleton):
16841767
"params": [
16851768
{ "v": "v", "k": "k", "key": "key", "sr": "sr", "dbg": "dbg" }
16861769
],
1687-
"id": 20
1770+
"id": 21
16881771
}
16891772
```
16901773

@@ -1766,7 +1849,7 @@ class Volume_myimplementation(Volume_skeleton):
17661849
{
17671850
"method": "Volume.unset",
17681851
"params": [ { "k": "k", "key": "key", "sr": "sr", "dbg": "dbg" } ],
1769-
"id": 21
1852+
"id": 22
17701853
}
17711854
```
17721855

@@ -1848,7 +1931,7 @@ class Volume_myimplementation(Volume_skeleton):
18481931
{
18491932
"method": "Volume.resize",
18501933
"params": [ { "new_size": 0, "key": "key", "sr": "sr", "dbg": "dbg" } ],
1851-
"id": 22
1934+
"id": 23
18521935
}
18531936
```
18541937

@@ -1928,7 +2011,7 @@ class Volume_myimplementation(Volume_skeleton):
19282011
{
19292012
"method": "Volume.stat",
19302013
"params": [ { "key": "key", "sr": "sr", "dbg": "dbg" } ],
1931-
"id": 23
2014+
"id": 24
19322015
}
19332016
```
19342017

@@ -2021,7 +2104,7 @@ class Volume_myimplementation(Volume_skeleton):
20212104
{
20222105
"method": "Volume.compare",
20232106
"params": [ { "key2": "key2", "key": "key", "sr": "sr", "dbg": "dbg" } ],
2024-
"id": 24
2107+
"id": 25
20252108
}
20262109
```
20272110

@@ -2108,7 +2191,7 @@ class Volume_myimplementation(Volume_skeleton):
21082191
{
21092192
"method": "Volume.similar_content",
21102193
"params": [ { "key": "key", "sr": "sr", "dbg": "dbg" } ],
2111-
"id": 25
2194+
"id": 26
21122195
}
21132196
```
21142197

@@ -2189,7 +2272,7 @@ class Volume_myimplementation(Volume_skeleton):
21892272
{
21902273
"method": "Volume.enable_cbt",
21912274
"params": [ { "key": "key", "sr": "sr", "dbg": "dbg" } ],
2192-
"id": 26
2275+
"id": 27
21932276
}
21942277
```
21952278

@@ -2267,7 +2350,7 @@ class Volume_myimplementation(Volume_skeleton):
22672350
{
22682351
"method": "Volume.disable_cbt",
22692352
"params": [ { "key": "key", "sr": "sr", "dbg": "dbg" } ],
2270-
"id": 27
2353+
"id": 28
22712354
}
22722355
```
22732356

@@ -2345,7 +2428,7 @@ class Volume_myimplementation(Volume_skeleton):
23452428
{
23462429
"method": "Volume.data_destroy",
23472430
"params": [ { "key": "key", "sr": "sr", "dbg": "dbg" } ],
2348-
"id": 28
2431+
"id": 29
23492432
}
23502433
```
23512434

@@ -2433,7 +2516,7 @@ class Volume_myimplementation(Volume_skeleton):
24332516
"dbg": "dbg"
24342517
}
24352518
],
2436-
"id": 29
2519+
"id": 30
24372520
}
24382521
```
24392522

@@ -2521,7 +2604,7 @@ class Volume_myimplementation(Volume_skeleton):
25212604
{
25222605
"method": "Volume.compose",
25232606
"params": [ { "key2": "key2", "key": "key", "sr": "sr", "dbg": "dbg" } ],
2524-
"id": 30
2607+
"id": 31
25252608
}
25262609
```
25272610

0 commit comments

Comments
 (0)