mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-29 17:00:59 +01:00
Expose devicePHIDs
on almanac.queryservices
Summary: This already exists on the Query, just expose it via API. For context, I want to fix `bin/remote restart` so it actually identifies the services on a box rather than faking it. To do this, I'll look up the device PHID of the box, then look up all the services which are bound to it, then look up all the instances attached to those services. This allows me to do the second step. Test Plan: Called method from web UI, got expected result. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D11882
This commit is contained in:
parent
8316c9dc14
commit
7294512411
1 changed files with 6 additions and 0 deletions
|
@ -16,6 +16,7 @@ final class AlmanacQueryServicesConduitAPIMethod
|
|||
'ids' => 'optional list<id>',
|
||||
'phids' => 'optional list<phid>',
|
||||
'names' => 'optional list<phid>',
|
||||
'devicePHIDs' => 'option list<phid>',
|
||||
'serviceClasses' => 'optional list<string>',
|
||||
) + self::getPagerParamTypes();
|
||||
}
|
||||
|
@ -55,6 +56,11 @@ final class AlmanacQueryServicesConduitAPIMethod
|
|||
$query->withServiceClasses($classes);
|
||||
}
|
||||
|
||||
$device_phids = $request->getValue('devicePHIDs');
|
||||
if ($device_phids !== null) {
|
||||
$query->withDevicePHIDs($device_phids);
|
||||
}
|
||||
|
||||
$pager = $this->newPager($request);
|
||||
|
||||
$services = $query->executeWithCursorPager($pager);
|
||||
|
|
Loading…
Reference in a new issue