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.
32 lines
755 B
JavaScript
32 lines
755 B
JavaScript
5 years ago
|
"use strict";
|
||
|
|
||
|
const {createDataObject, LocalProperties, ID} = require("../../graphql/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"
|
||
|
}
|
||
|
});
|
||
|
};
|
||
|
};
|