'tenantId', 'admin_state_up' => 'adminStateUp', 'vip_address' => 'vipAddress', 'vip_subnet_id' => 'vipSubnetId', 'operating_status' => 'operatingStatus', 'provisioning_status' => 'provisioningStatus', ]; /** * {@inheritdoc} */ protected function getAliases(): array { return parent::getAliases() + [ 'listeners' => new Alias('listeners', LoadBalancerListener::class, true), ]; } /** * {@inheritdoc} */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postLoadBalancer(), $userOptions); return $this->populateFromResponse($response); } /** * {@inheritdoc} */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancer(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } /** * {@inheritdoc} */ public function update() { $response = $this->executeWithState($this->api->putLoadBalancer()); $this->populateFromResponse($response); } /** * {@inheritdoc} */ public function delete() { $this->executeWithState($this->api->deleteLoadBalancer()); } /** * Add a listener to this load balancer. */ public function addListener(array $userOptions = []): LoadBalancerListener { $userOptions = array_merge(['loadbalancerId' => $this->id], $userOptions); return $this->model(LoadBalancerListener::class)->create($userOptions); } /** * Get stats for this loadbalancer. */ public function getStats(): LoadBalancerStat { $model = $this->model(LoadBalancerStat::class, ['loadbalancerId' => $this->id]); $model->retrieve(); return $model; } /** * Get the status tree for this loadbalancer. */ public function getStatuses(): LoadBalancerStatus { $model = $this->model(LoadBalancerStatus::class, ['loadbalancerId' => $this->id]); $model->retrieve(); return $model; } }