From 729451241104ffcb7fbfe1bfee980c14472a88b9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 25 Feb 2015 11:16:25 -0800 Subject: [PATCH] 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 --- .../conduit/AlmanacQueryServicesConduitAPIMethod.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/applications/almanac/conduit/AlmanacQueryServicesConduitAPIMethod.php b/src/applications/almanac/conduit/AlmanacQueryServicesConduitAPIMethod.php index 746da1dc3f..ffabfbbc45 100644 --- a/src/applications/almanac/conduit/AlmanacQueryServicesConduitAPIMethod.php +++ b/src/applications/almanac/conduit/AlmanacQueryServicesConduitAPIMethod.php @@ -16,6 +16,7 @@ final class AlmanacQueryServicesConduitAPIMethod 'ids' => 'optional list', 'phids' => 'optional list', 'names' => 'optional list', + 'devicePHIDs' => 'option list', 'serviceClasses' => 'optional list', ) + 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);