Skip to content

Commit 0f3d985

Browse files
committed
Added method getHypervisor
1 parent ecbe9ad commit 0f3d985

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Compute/v2/Models/Hypervisor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Hypervisor extends OperatorResource implements
7272
*/
7373
public function retrieve()
7474
{
75-
$response = $this->execute($this->api->getHypervisor(), $this->getAttrs(['id']));
75+
$response = $this->execute($this->api->getHypervisor(), ['id' => (string) $this->id]);
7676
$this->populateFromResponse($response);
7777
}
7878
}

src/Compute/v2/Service.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,17 @@ public function listHypervisors(bool $detailed = false, array $options = [], cal
216216
$def = ($detailed === true) ? $this->api->getHypervisorsDetail() : $this->api->getHypervisors();
217217
return $this->model(Hypervisor::class)->enumerate($def, $options, $mapFn);
218218
}
219+
220+
/**
221+
* Shows details for a given hypervisor.
222+
*
223+
* @param array $options
224+
*
225+
* @return Hypervisor
226+
*/
227+
public function getHypervisor(array $options = []): Hypervisor
228+
{
229+
$hypervisor = $this->model(Hypervisor::class);
230+
return $hypervisor->populateFromArray($options);
231+
}
219232
}

0 commit comments

Comments
 (0)