You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
775 B
JavaScript
33 lines
775 B
JavaScript
"use strict";
|
|
|
|
const {createDataObject, LocalProperties, ID} = require("../../packages/graphql-interface/data-object");
|
|
|
|
module.exports = function (types) {
|
|
return function LVMPhysicalVolume({ path }) {
|
|
return createDataObject({
|
|
[LocalProperties]: {
|
|
path: path,
|
|
blockDevice: () => {
|
|
return types.BlockDevice({ path: path });
|
|
}
|
|
},
|
|
lvmPhysicalVolumes: {
|
|
[ID]: path,
|
|
volumeGroup: (volume) => {
|
|
if (volume.volumeGroup != null) {
|
|
return types.LVMVolumeGroup({ name: volume.volumeGroup });
|
|
}
|
|
},
|
|
format: "format",
|
|
size: "totalSpace",
|
|
freeSpace: "freeSpace",
|
|
duplicate: "isDuplicate",
|
|
allocatable: "isAllocatable",
|
|
used: "isUsed",
|
|
exported: "isExported",
|
|
missing: "isMissing"
|
|
}
|
|
});
|
|
};
|
|
};
|