Scalr\Service\OpenStack\Services\Network\V2\NetworkApi::createLbPool PHP Method

createLbPool() public method

Creates LBaaS pool (POST /lb/pools)
public createLbPool ( Scalr\Service\OpenStack\Services\Network\Type\CreateLbPool $request ) : object
$request Scalr\Service\OpenStack\Services\Network\Type\CreateLbPool The request object
return object Returns detailed info of the created pool
    public function createLbPool(CreateLbPool $request)
    {
        $result = null;
        if (empty($request->tenant_id)) {
            $request->tenant_id = $this->service->getTenantId();
        }
        $options = array('pool' => array_filter(get_object_vars($request), [$this, 'filterNull']));
        $response = $this->getClient()->call($this->service, '/lb/pools', $options, 'POST');
        if ($response->hasError() === false) {
            $result = json_decode($response->getContent());
            $result = $result->pool;
        }
        return $result;
    }