const OUTPUT_TYPE_RUNNING = 'running';
const OUTPUT_TYPE_TERMINATED = 'terminated';
const OUTPUT_TYPE_DEVICES = 'devices';
+ const OUTPUT_TYPE_DEDUPENGINE = 'dedupengine';
/**
* Get parsed storage status.
$autochangers = [];
$ach_dev = [];
$empty_lines = 0;
- for($i = 0; $i < count($output); $i++) {
+ for ($i = 0; $i < count($output); $i++) {
+ if (preg_match('/[\[\]]$/', $output[$i]) === 1) {
+ $output[$i] = '';
+ }
if (empty($output[$i])) {
$empty_lines++;
- if (count($part) > 10) {
- $result[] = $part;
- $part = [];
- }
if (count($ach_dev) == 2) {
$autochangers[$autochanger]['devices'][] = $ach_dev;
$ach_dev = [];
+ continue;
+ }
+ if (count($part) > 7) {
+ $result[] = $part;
+ $part = [];
+ continue;
}
- if ($empty_lines == 4 && $autochanger) {
+ if ($empty_lines > 3 && $autochanger) {
$autochanger = null;
}
} else {
self::OUTPUT_TYPE_HEADER,
self::OUTPUT_TYPE_RUNNING,
self::OUTPUT_TYPE_TERMINATED,
- self::OUTPUT_TYPE_DEVICES
+ self::OUTPUT_TYPE_DEVICES,
+ self::OUTPUT_TYPE_DEDUPENGINE
)
);
}
$out = (object)['output' => [], 'error' => 0];
if ($out_format === parent::OUTPUT_FORMAT_RAW) {
- $out = $this->getRawOutput(['storage' => $storage->name]);
+ $out = $this->getRawOutput([
+ 'storage' => $storage->name
+ ]);
} elseif ($out_format === parent::OUTPUT_FORMAT_JSON) {
$out = $this->getJSONOutput([
'storage' => $storage->name,
{
"$ref": "#/components/parameters/StorageId"
},
- {
- "$ref": "#/components/parameters/Output"
- },
{
"name": "type",
"in": "query",
+ "required": false,
"description": "Output type using together with output=json parameter.",
"schema": {
"type": "string",
- "enum": ["header", "running", "devices", "terminated"]
+ "enum": ["header", "running", "devices", "terminated", "dedupengine"]
}
+ },
+ {
+ "$ref": "#/components/parameters/Output"
}
]
}