'tenantId', 'admin_state_up' => 'adminStateUp', 'lb_algorithm' => 'lbAlgorithm', 'session_persistence' => 'sessionPersistence', 'healthmonitor_id' => 'healthmonitorId', 'loadbalancer_id' => 'loadbalancerId', 'operating_status' => 'operatingStatus', 'provisioning_status' => 'provisioningStatus', ]; /** * {@inheritdoc} */ protected function getAliases(): array { return parent::getAliases() + [ 'listeners' => new Alias('listeners', LoadBalancerListener::class, true), 'members' => new Alias('members', LoadBalancerMember::class, true), 'healthmonitors' => new Alias('healthmonitors', LoadBalancerHealthMonitor::class, true), ]; } /** * {@inheritdoc} */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postLoadBalancerPool(), $userOptions); return $this->populateFromResponse($response); } /** * {@inheritdoc} */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancerPool(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } /** * {@inheritdoc} */ public function update() { $response = $this->executeWithState($this->api->putLoadBalancerPool()); $this->populateFromResponse($response); } /** * {@inheritdoc} */ public function delete() { $this->executeWithState($this->api->deleteLoadBalancerPool()); } /** * Add a member to this pool. */ public function addMember(array $userOptions = []): LoadBalancerMember { $userOptions = array_merge(['poolId' => $this->id], $userOptions); return $this->model(LoadBalancerMember::class)->create($userOptions); } /** * Get an instance of a member. */ public function getMember(string $memberId): LoadBalancerMember { return $this->model(LoadBalancerMember::class, ['poolId' => $this->id, 'id' => $memberId]); } /** * Delete a member. */ public function deleteMember(string $memberId) { $this->model(LoadBalancerMember::class, ['poolId' => $this->id, 'id' => $memberId])->delete(); } /** * Add a healthmonitor to this load balancer pool. */ public function addHealthMonitor(array $userOptions = []): LoadBalancerHealthMonitor { $userOptions = array_merge(['poolId' => $this->id], $userOptions); return $this->model(LoadBalancerHealthMonitor::class)->create($userOptions); } }