| @@ 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} |
|
| @@ 207-213 (lines=7) @@ | ||
| 204 | * |
|
| 205 | * @return Quota |
|
| 206 | */ |
|
| 207 | public function getDefaultQuota(string $tenantId): Quota |
|
| 208 | { |
|
| 209 | $quota = $this->model(Quota::class, ['tenantId' => $tenantId]); |
|
| 210 | $quota->populateFromResponse($this->execute($this->api->getQuotaDefault(), ['tenantId' => $tenantId])); |
|
| 211 | ||
| 212 | return $quota; |
|
| 213 | } |
|
| 214 | ||
| 215 | /** |
|
| 216 | * Lists loadbalancers for projects |
|
| @@ 384-392 (lines=9) @@ | ||
| 381 | * @param string $portId The unique ID of the port. |
|
| 382 | * @return InterfaceAttachment |
|
| 383 | */ |
|
| 384 | public function getInterfaceAttachment(string $portId): InterfaceAttachment |
|
| 385 | { |
|
| 386 | $response = $this->execute($this->api->getInterfaceAttachment(), [ |
|
| 387 | 'id' => $this->id, |
|
| 388 | 'portId' => $portId |
|
| 389 | ]); |
|
| 390 | ||
| 391 | return $this->model(InterfaceAttachment::class)->populateFromResponse($response); |
|
| 392 | } |
|
| 393 | ||
| 394 | /** |
|
| 395 | * Creates an interface attachment. |
|
| @@ 498-505 (lines=8) @@ | ||
| 495 | * |
|
| 496 | * @return SecurityGroup |
|
| 497 | */ |
|
| 498 | public function addSecurityGroup(array $options) : SecurityGroup |
|
| 499 | { |
|
| 500 | $options['id'] = $this->id; |
|
| 501 | ||
| 502 | $response = $this->execute($this->api->postSecurityGroup(), $options); |
|
| 503 | ||
| 504 | return $this->model(SecurityGroup::class)->populateFromResponse($response); |
|
| 505 | } |
|
| 506 | ||
| 507 | /** |
|
| 508 | * Add security group to a server (addSecurityGroup action) |
|