feat(xo-cli rest): support patch method
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
- @vates/node-vsphere-soap major
|
||||
- @xen-orchestra/vmware-explorer patch
|
||||
- xen-api patch
|
||||
- xo-cli minor
|
||||
- xo-server patch
|
||||
- xo-server-auth-oidc minor
|
||||
- xo-server-perf-alert patch
|
||||
|
||||
@@ -92,6 +92,18 @@ Usage:
|
||||
xo-cli rest get vms/<VM UUID>
|
||||
xo-cli rest get tasks/<task id>/actions wait=result
|
||||
|
||||
xo-cli rest patch <object> <name>=<value>...
|
||||
Update properties of an object (not all properties are writable).
|
||||
|
||||
<object>
|
||||
Full path of the object to update
|
||||
|
||||
<name>=<value>...
|
||||
Properties to update on the object
|
||||
|
||||
Examples:
|
||||
xo-cli rest patch vms/<VM UUID> name_label='My VM' name_description='Its description
|
||||
|
||||
xo-cli rest post <action> <name>=<value>...
|
||||
Execute an action.
|
||||
|
||||
|
||||
@@ -110,6 +110,18 @@ Usage:
|
||||
xo-cli rest get vms/<VM UUID>
|
||||
xo-cli rest get tasks/<task id>/actions wait=result
|
||||
|
||||
xo-cli rest patch <object> <name>=<value>...
|
||||
Update properties of an object (not all properties are writable).
|
||||
|
||||
<object>
|
||||
Full path of the object to update
|
||||
|
||||
<name>=<value>...
|
||||
Properties to update on the object
|
||||
|
||||
Examples:
|
||||
xo-cli rest patch vms/<VM UUID> name_label='My VM' name_description='Its description
|
||||
|
||||
xo-cli rest post <action> <name>=<value>...
|
||||
Execute an action.
|
||||
|
||||
|
||||
@@ -313,6 +313,18 @@ const help = wrap(
|
||||
$name rest get vms/<VM UUID>
|
||||
$name rest get tasks/<task id>/actions wait=result
|
||||
|
||||
$name rest patch <object> <name>=<value>...
|
||||
Update properties of an object (not all properties are writable).
|
||||
|
||||
<object>
|
||||
Full path of the object to update
|
||||
|
||||
<name>=<value>...
|
||||
Properties to update on the object
|
||||
|
||||
Examples:
|
||||
$name rest patch vms/<VM UUID> name_label='My VM' name_description='Its description
|
||||
|
||||
$name rest post <action> <name>=<value>...
|
||||
Execute an action.
|
||||
|
||||
|
||||
@@ -61,6 +61,18 @@ const COMMANDS = {
|
||||
return this.json ? JSON.stringify(result, null, 2) : result
|
||||
},
|
||||
|
||||
async patch([path, ...params]) {
|
||||
const response = await this.exec(path, {
|
||||
body: JSON.stringify(parseParams(params)),
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
method: 'PATCH',
|
||||
})
|
||||
|
||||
return await response.text()
|
||||
},
|
||||
|
||||
async post([path, ...params]) {
|
||||
const response = await this.exec(path, {
|
||||
body: JSON.stringify(parseParams(params)),
|
||||
|
||||
Reference in New Issue
Block a user