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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user