File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -555,4 +555,14 @@ public function deleteVolumeAttachments(): array
555555 ]
556556 ];
557557 }
558+
559+ public function getHypervisorStatistics (): array
560+ {
561+ return [
562+ 'method ' => 'GET ' ,
563+ 'path ' => 'os-hypervisors/statistics ' ,
564+ 'params ' => [
565+ ]
566+ ];
567+ }
558568}
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace OpenStack \Compute \v2 \Models ;
4+
5+ use OpenCloud \Common \Resource \Creatable ;
6+ use OpenCloud \Common \Resource \OperatorResource ;
7+ use OpenCloud \Common \Resource \Retrievable ;
8+ use OpenCloud \Common \Transport \Utils ;
9+
10+ /**
11+ * Represents a Compute v2 Quota
12+ *
13+ * @property \OpenStack\Compute\v2\Api $api
14+ */
15+ class HypervisorStatistic extends OperatorResource
16+ {
17+ public $ count ;
18+ public $ vcpus_used ;
19+ public $ local_gb_used ;
20+ public $ memory_mb ;
21+ public $ current_workload ;
22+ public $ vcpus ;
23+ public $ running_vms ;
24+ public $ free_disk_gb ;
25+ public $ disk_available_least ;
26+ public $ local_gb ;
27+ public $ free_ram_mb ;
28+ public $ memory_mb_used ;
29+ protected $ resourceKey = 'hypervisor_statistics ' ;
30+ }
Original file line number Diff line number Diff line change 44
55use OpenCloud \Common \Service \AbstractService ;
66use OpenStack \Compute \v2 \Models \Flavor ;
7+ use OpenStack \Compute \v2 \Models \HypervisorStatistic ;
78use OpenStack \Compute \v2 \Models \Image ;
89use OpenStack \Compute \v2 \Models \Keypair ;
910use OpenStack \Compute \v2 \Models \Limit ;
@@ -186,4 +187,16 @@ public function getLimits(): Limit
186187 $ limits ->populateFromResponse ($ this ->execute ($ this ->api ->getLimits (), []));
187188 return $ limits ;
188189 }
190+
191+ /**
192+ * Shows summary statistics for all hypervisors over all compute nodes.
193+ *
194+ * @return HypervisorStatistic
195+ */
196+ public function getHypervisorStatistics (): HypervisorStatistic
197+ {
198+ $ statistics = $ this ->model (HypervisorStatistic::class);
199+ $ statistics ->populateFromResponse ($ this ->execute ($ this ->api ->getHypervisorStatistics (), []));
200+ return $ statistics ;
201+ }
189202}
You can’t perform that action at this time.
0 commit comments