fix(xo-server/api): description params can be empty

Fixes #6721

Introduced by d6a3492e9
This commit is contained in:
Julien Fontanet 2023-03-12 23:24:10 +01:00
parent 2dbe35a31c
commit 921c700fab
9 changed files with 20 additions and 17 deletions

View File

@ -382,7 +382,7 @@ class SDNController extends EventEmitter {
},
},
name: { type: 'string' },
description: { type: 'string' },
description: { type: 'string', minLength: 0 },
encapsulation: { type: 'string' },
encrypted: { type: 'boolean', optional: true },
mtu: { type: 'integer', optional: true },

View File

@ -270,7 +270,7 @@ async function importDisk({ sr, type, name, description, vmdkData }) {
export { importDisk as import }
importDisk.params = {
description: { type: 'string', optional: true },
description: { type: 'string', minLength: 0, optional: true },
name: { type: 'string' },
sr: { type: 'string' },
type: { type: 'string' },

View File

@ -102,6 +102,7 @@ set.params = {
},
name_description: {
type: 'string',
minLength: 0,
optional: true,
},
multipathing: {

View File

@ -24,7 +24,7 @@ create.params = {
pool: { type: 'string' },
name: { type: 'string' },
nbd: { type: 'boolean', optional: true },
description: { type: 'string', optional: true },
description: { type: 'string', minLength: 0, optional: true },
pif: { type: 'string', optional: true },
mtu: { type: ['integer', 'string'], optional: true },
vlan: { type: ['integer', 'string'], optional: true },
@ -49,7 +49,7 @@ export async function createBonded({ pool, name, description, pifs, mtu = 1500,
createBonded.params = {
pool: { type: 'string' },
name: { type: 'string' },
description: { type: 'string', optional: true },
description: { type: 'string', minLength: 0, optional: true },
pifs: {
type: 'array',
items: {
@ -105,6 +105,7 @@ set.params = {
},
name_description: {
type: 'string',
minLength: 0,
optional: true,
},
name_label: {

View File

@ -45,6 +45,7 @@ set.params = {
},
name_description: {
type: 'string',
minLength: 0,
optional: true,
},
backupNetwork: {

View File

@ -29,7 +29,7 @@ set.params = {
name_label: { type: 'string', optional: true },
name_description: { type: 'string', optional: true },
name_description: { type: 'string', minLength: 0, optional: true },
}
set.resolve = {
@ -187,7 +187,7 @@ export async function createIso({
createIso.params = {
host: { type: 'string' },
nameLabel: { type: 'string' },
nameDescription: { type: 'string' },
nameDescription: { type: 'string', minLength: 0 },
path: { type: 'string' },
type: { type: 'string' },
user: { type: 'string', optional: true },
@ -260,7 +260,7 @@ export async function createNfs({
createNfs.params = {
host: { type: 'string' },
nameLabel: { type: 'string' },
nameDescription: { type: 'string' },
nameDescription: { type: 'string', minLength: 0 },
server: { type: 'string' },
serverPath: { type: 'string' },
nfsVersion: { type: 'string', optional: true },
@ -311,7 +311,7 @@ export async function createHba({ host, nameLabel, nameDescription, scsiId, srUu
createHba.params = {
host: { type: 'string' },
nameLabel: { type: 'string' },
nameDescription: { type: 'string' },
nameDescription: { type: 'string', minLength: 0 },
scsiId: { type: 'string' },
srUuid: { type: 'string', optional: true },
}
@ -348,7 +348,7 @@ export async function createLvm({ host, nameLabel, nameDescription, device }) {
createLvm.params = {
host: { type: 'string' },
nameLabel: { type: 'string' },
nameDescription: { type: 'string' },
nameDescription: { type: 'string', minLength: 0 },
device: { type: 'string' },
}
@ -384,7 +384,7 @@ export async function createExt({ host, nameLabel, nameDescription, device }) {
createExt.params = {
host: { type: 'string' },
nameLabel: { type: 'string' },
nameDescription: { type: 'string' },
nameDescription: { type: 'string', minLength: 0 },
device: { type: 'string' },
}
@ -456,7 +456,7 @@ export async function createZfs({ host, nameLabel, nameDescription, location })
createZfs.params = {
host: { type: 'string' },
nameLabel: { type: 'string' },
nameDescription: { type: 'string' },
nameDescription: { type: 'string', minLength: 0 },
location: { type: 'string' },
}
@ -616,7 +616,7 @@ export async function createIscsi({
createIscsi.params = {
host: { type: 'string' },
nameLabel: { type: 'string' },
nameDescription: { type: 'string' },
nameDescription: { type: 'string', minLength: 0 },
target: { type: 'string' },
port: { type: 'integer', optional: true },
targetIqn: { type: 'string' },

View File

@ -47,6 +47,6 @@ export async function set({ id, ...props }) {
set.description = 'changes the properties of an existing token'
set.params = {
description: { type: ['null', 'string'], optional: true },
description: { type: ['null', 'string'], minLength: 0, optional: true },
id: { type: 'string' },
}

View File

@ -90,7 +90,7 @@ set.params = {
name_label: { type: 'string', optional: true },
name_description: { type: 'string', optional: true },
name_description: { type: 'string', minLength: 0, optional: true },
// size of VDI
size: { type: ['integer', 'string'], optional: true },

View File

@ -300,7 +300,7 @@ create.params = {
// Name/description of the new VM.
name_label: { type: 'string' },
name_description: { type: 'string', optional: true },
name_description: { type: 'string', minLength: 0, optional: true },
// PV Args
pv_args: { type: 'string', optional: true },
@ -668,7 +668,7 @@ set.params = {
name_label: { type: 'string', optional: true },
name_description: { type: 'string', optional: true },
name_description: { type: 'string', minLength: 0, optional: true },
high_availability: {
optional: true,
@ -954,7 +954,7 @@ export const snapshot = defer(async function (
})
snapshot.params = {
description: { type: 'string', optional: true },
description: { type: 'string', minLength: 0, optional: true },
id: { type: 'string' },
name: { type: 'string', optional: true },
saveMemory: { type: 'boolean', optional: true },