File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -555,4 +555,14 @@ public function deleteVolumeAttachments(): array
555
555
]
556
556
];
557
557
}
558
+
559
+ public function getHypervisorStatistics (): array
560
+ {
561
+ return [
562
+ 'method ' => 'GET ' ,
563
+ 'path ' => 'os-hypervisors/statistics ' ,
564
+ 'params ' => [
565
+ ]
566
+ ];
567
+ }
558
568
}
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 4
4
5
5
use OpenCloud \Common \Service \AbstractService ;
6
6
use OpenStack \Compute \v2 \Models \Flavor ;
7
+ use OpenStack \Compute \v2 \Models \HypervisorStatistic ;
7
8
use OpenStack \Compute \v2 \Models \Image ;
8
9
use OpenStack \Compute \v2 \Models \Keypair ;
9
10
use OpenStack \Compute \v2 \Models \Limit ;
@@ -186,4 +187,16 @@ public function getLimits(): Limit
186
187
$ limits ->populateFromResponse ($ this ->execute ($ this ->api ->getLimits (), []));
187
188
return $ limits ;
188
189
}
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
+ }
189
202
}
You can’t perform that action at this time.
0 commit comments