Scalr\Service\CloudStack\CloudStack::listOsCategories PHP Method

listOsCategories() public method

Lists all supported OS categories for this cloud.
public listOsCategories ( string $id = null, string $name = null, string $keyword = null, Scalr\Service\CloudStack\DataType\PaginationType $pagination = null ) : Scalr\Service\CloudStack\DataType\OsCategoryList | null
$id string List Os category by id
$name string List os category by name
$keyword string List by keyword
$pagination Scalr\Service\CloudStack\DataType\PaginationType Pagination
return Scalr\Service\CloudStack\DataType\OsCategoryList | null
    public function listOsCategories($id = null, $name = null, $keyword = null, PaginationType $pagination = null)
    {
        $result = null;
        $args = array('id' => $this->escape($id), 'name' => $this->escape($name), 'keyword' => $this->escape($keyword));
        if ($pagination !== null) {
            array_merge($args, $pagination->toArray());
        }
        $response = $this->getClient()->call('listOsCategories', $args);
        if ($response->hasError() === false) {
            $resultObject = $response->getResult();
            if (!empty($resultObject) && property_exists($resultObject, 'count') && $resultObject->count > 0) {
                $result = $this->_loadOsCategoryList($resultObject->oscategory);
            }
        }
        return $result;
    }