Differential D11882 Diff 28632 src/applications/almanac/conduit/AlmanacQueryServicesConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/conduit/AlmanacQueryServicesConduitAPIMethod.php
Show All 10 Lines | public function getMethodDescription() { | ||||
return pht('Query Almanac services.'); | return pht('Query Almanac services.'); | ||||
} | } | ||||
public function defineParamTypes() { | public function defineParamTypes() { | ||||
return array( | return array( | ||||
'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(); | ||||
} | } | ||||
public function defineReturnType() { | public function defineReturnType() { | ||||
return 'list<wild>'; | return 'list<wild>'; | ||||
} | } | ||||
Show All 23 Lines | if ($names !== null) { | ||||
$query->withNames($names); | $query->withNames($names); | ||||
} | } | ||||
$classes = $request->getValue('serviceClasses'); | $classes = $request->getValue('serviceClasses'); | ||||
if ($classes !== null) { | if ($classes !== null) { | ||||
$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); | ||||
$data = array(); | $data = array(); | ||||
foreach ($services as $service) { | foreach ($services as $service) { | ||||
$phid = $service->getPHID(); | $phid = $service->getPHID(); | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |