fix(xo-server/disk): remove unused resize method (#4796)

- resizing a VDI can be done with `vdi.set`
- `disk.resize` doesn't check Self Service constraints
This commit is contained in:
Pierre Donias
2020-02-11 16:02:14 +01:00
committed by GitHub
parent 433b309907
commit 8b99f2ecbc

View File

@@ -5,7 +5,6 @@ import { format, JsonRpcError } from 'json-rpc-peer'
import { noSuchObject } from 'xo-common/api-errors'
import { peekFooterFromVhdStream } from 'vhd-lib'
import { parseSize } from '../utils'
import { VDI_FORMAT_VHD } from '../xapi'
const log = createLogger('xo:disk')
@@ -154,21 +153,6 @@ importContent.resolve = {
// -------------------------------------------------------------------
export async function resize({ vdi, size }) {
await this.getXapi(vdi).resizeVdi(vdi._xapiId, parseSize(size))
}
resize.description = 'resize an existing VDI'
resize.params = {
id: { type: 'string' },
size: { type: ['integer', 'string'] },
}
resize.resolve = {
vdi: ['id', ['VDI', 'VDI-snapshot'], 'administrate'],
}
async function handleImport(
req,
res,