1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02: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:
epriestley 2015-02-25 11:16:25 -08:00
parent 8316c9dc14
commit 7294512411

View file

@ -16,6 +16,7 @@ final class AlmanacQueryServicesConduitAPIMethod
'ids' => 'optional list<id>', 'ids' => 'optional list<id>',
'phids' => 'optional list<phid>', 'phids' => 'optional list<phid>',
'names' => 'optional list<phid>', 'names' => 'optional list<phid>',
'devicePHIDs' => 'option list<phid>',
'serviceClasses' => 'optional list<string>', 'serviceClasses' => 'optional list<string>',
) + self::getPagerParamTypes(); ) + self::getPagerParamTypes();
} }
@ -55,6 +56,11 @@ final class AlmanacQueryServicesConduitAPIMethod
$query->withServiceClasses($classes); $query->withServiceClasses($classes);
} }
$device_phids = $request->getValue('devicePHIDs');
if ($device_phids !== null) {
$query->withDevicePHIDs($device_phids);
}
$pager = $this->newPager($request); $pager = $this->newPager($request);
$services = $query->executeWithCursorPager($pager); $services = $query->executeWithCursorPager($pager);