$endtime_to = $this->Request->contains('endtime_to') && $misc->isValidInteger($this->Request['endtime_to']) ? (int)$this->Request['endtime_to'] : null;
$realendtime_from = $this->Request->contains('realendtime_from') && $misc->isValidInteger($this->Request['realendtime_from']) ? (int)$this->Request['realendtime_from'] : null;
$realendtime_to = $this->Request->contains('realendtime_to') && $misc->isValidInteger($this->Request['realendtime_to']) ? (int)$this->Request['realendtime_to'] : null;
+ $age = $this->Request->contains('age') && $misc->isValidInteger($this->Request['age']) ? (int)$this->Request['age'] : null;
$order_by = $this->Request->contains('order_by') && $misc->isValidColumn($this->Request['order_by']) ? $this->Request['order_by']: 'JobId';
$order_direction = $this->Request->contains('order_direction') && $misc->isValidOrderDirection($this->Request['order_direction']) ? $this->Request['order_direction']: 'DESC';
'vals' => date('Y-m-d H:i:s', $starttime_to)
];
}
+ } elseif (!empty($age)) { // Job age (now() - age)
+ $params['Job.StartTime'] = [];
+ $params['Job.StartTime'][] = [
+ 'operator' => '>=',
+ 'vals' => date('Y-m-d H:i:s', (time() - $age))
+ ];
}
// End time range
$endtime_to = $this->Request->contains('endtime_to') && $misc->isValidInteger($this->Request['endtime_to']) ? (int)$this->Request['endtime_to'] : null;
$realendtime_from = $this->Request->contains('realendtime_from') && $misc->isValidInteger($this->Request['realendtime_from']) ? (int)$this->Request['realendtime_from'] : null;
$realendtime_to = $this->Request->contains('realendtime_to') && $misc->isValidInteger($this->Request['realendtime_to']) ? (int)$this->Request['realendtime_to'] : null;
+ $age = $this->Request->contains('age') && $misc->isValidInteger($this->Request['age']) ? (int)$this->Request['age'] : null;
$order_by = $this->Request->contains('order_by') && $misc->isValidColumn($this->Request['order_by']) ? $this->Request['order_by']: 'ObjectId';
$order_direction = $this->Request->contains('order_direction') && $misc->isValidOrderDirection($this->Request['order_direction']) ? $this->Request['order_direction']: 'DESC';
'vals' => date('Y-m-d H:i:s', $starttime_to)
];
}
+ } elseif (!empty($age)) { // Job age (now() - age)
+ $params['Job.StartTime'] = [];
+ $params['Job.StartTime'][] = [
+ 'operator' => '>=',
+ 'vals' => date('Y-m-d H:i:s', (time() - $age))
+ ];
}
// End time range
"type": "integer"
}
},
+ {
+
+ "name": "age",
+ "in": "query",
+ "required": false,
+ "description": "Job age in seconds (used is start time). starttime_from and starttime_to take precedence over this parameter.",
+ "schema": {
+ "type": "integer"
+ }
+ },
{
"name": "order_by",
"in": "query",
"schema": {
"type": "integer"
}
+ },
+ {
+
+ "name": "age",
+ "in": "query",
+ "required": false,
+ "description": "Job age in seconds (used is start time). starttime_from and starttime_to take precedence over this parameter.",
+ "schema": {
+ "type": "integer"
+ }
}
]
}