public function getComponentsbyRelease(SS_HTTPRequest $request) { $release_id = intval($request->param('RELEASE_ID')); $term = Convert::raw2sql($request->getVar('term')); $adoption = intval(Convert::raw2sql($request->getVar('adoption'))); $maturity = intval(Convert::raw2sql($request->getVar('maturity'))); $age = intval(Convert::raw2sql($request->getVar('age'))); $sort = Convert::raw2sql($request->getVar('sort')); $sort_dir = ''; if (!empty($sort)) { $sort = explode(':', $sort); $sort_dir = $sort[1]; $sort = $sort[0]; } $release = OpenStackRelease::get()->byID($release_id); if (is_null($release)) { return $this->notFound(); } list($core_components, $optional_components) = $this->manager->getComponents($release, $term, $adoption, $maturity, $age, $sort, $sort_dir); $res = array('core_components' => $core_components, 'optional_components' => $optional_components); return $this->ok($res); }
public function getDefaultComponents() { list($core_components, $optional_components) = $this->manager->getComponents($this->getDefaultRelease()); return json_encode(array('core_components' => $core_components, 'optional_components' => $optional_components)); }