43 lines
891 B
JavaScript
43 lines
891 B
JavaScript
import { request } from '@cmp/cmp-element'
|
|
import { wrapperParams } from 'utils'
|
|
|
|
// 密钥
|
|
const keyUrl = '/cmp/plugins/hcso/v1/keypairs'
|
|
export function getKey(params) {
|
|
return request.get(keyUrl, {
|
|
params
|
|
})
|
|
}
|
|
|
|
export function createKey(params) {
|
|
return request.post(keyUrl, wrapperParams(params))
|
|
}
|
|
|
|
export function modifyKey(params) {
|
|
return request.put(`${keyUrl}/${params.id}`, wrapperParams(params))
|
|
}
|
|
|
|
export function removeKey(id) {
|
|
return request.delete(`${keyUrl}/${id}`)
|
|
}
|
|
|
|
export function detailKey(id) {
|
|
return request.get(`${keyUrl}/${id}`)
|
|
}
|
|
|
|
export function existKey(params) {
|
|
return request.get(keyUrl, {
|
|
params
|
|
})
|
|
}
|
|
|
|
export function removeKeys(params) {
|
|
return request.delete(keyUrl, {
|
|
params: wrapperParams(params)
|
|
})
|
|
}
|
|
|
|
export function keyBindVm(params) {
|
|
return request.patch(`${keyUrl}/${params.keypairId}`, wrapperParams(params))
|
|
}
|