| @@ 108-121 (lines=14) @@ | ||
| 105 | * |
|
| 106 | * @return Metric |
|
| 107 | */ |
|
| 108 | public function getMetric(string $metric): Metric |
|
| 109 | { |
|
| 110 | $response = $this->execute( |
|
| 111 | $this->api->getResourceMetric(), |
|
| 112 | [ |
|
| 113 | 'resourceId' => $this->id, |
|
| 114 | 'metric' => $metric, |
|
| 115 | 'type' => $this->type, |
|
| 116 | ] |
|
| 117 | ); |
|
| 118 | $metric = $this->model(Metric::class)->populateFromResponse($response); |
|
| 119 | ||
| 120 | return $metric; |
|
| 121 | } |
|
| 122 | ||
| 123 | /** |
|
| 124 | * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResourceMetricMeasures} |
|
| @@ 474-482 (lines=9) @@ | ||
| 471 | * @param string $portId The unique ID of the port. |
|
| 472 | * @return InterfaceAttachment |
|
| 473 | */ |
|
| 474 | public function getInterfaceAttachment(string $portId): InterfaceAttachment |
|
| 475 | { |
|
| 476 | $response = $this->execute($this->api->getInterfaceAttachment(), [ |
|
| 477 | 'id' => $this->id, |
|
| 478 | 'portId' => $portId |
|
| 479 | ]); |
|
| 480 | ||
| 481 | return $this->model(InterfaceAttachment::class)->populateFromResponse($response); |
|
| 482 | } |
|
| 483 | ||
| 484 | /** |
|
| 485 | * Creates an interface attachment. |
|
| @@ 588-595 (lines=8) @@ | ||
| 585 | * |
|
| 586 | * @return SecurityGroup |
|
| 587 | */ |
|
| 588 | public function addSecurityGroup(array $options) : SecurityGroup |
|
| 589 | { |
|
| 590 | $options['id'] = $this->id; |
|
| 591 | ||
| 592 | $response = $this->execute($this->api->postSecurityGroup(), $options); |
|
| 593 | ||
| 594 | return $this->model(SecurityGroup::class)->populateFromResponse($response); |
|
| 595 | } |
|
| 596 | ||
| 597 | /** |
|
| 598 | * Add security group to a server (addSecurityGroup action) |
|
| @@ 208-214 (lines=7) @@ | ||
| 205 | * |
|
| 206 | * @return Quota |
|
| 207 | */ |
|
| 208 | public function getDefaultQuota(string $tenantId): Quota |
|
| 209 | { |
|
| 210 | $quota = $this->model(Quota::class, ['tenantId' => $tenantId]); |
|
| 211 | $quota->populateFromResponse($this->execute($this->api->getQuotaDefault(), ['tenantId' => $tenantId])); |
|
| 212 | ||
| 213 | return $quota; |
|
| 214 | } |
|
| 215 | ||
| 216 | /** |
|
| 217 | * Lists loadbalancers for projects |
|