File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed 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 Limit extends OperatorResource
16
+ {
17
+ /** @var string */
18
+ public $ rate ;
19
+
20
+ /** @var object */
21
+ public $ absolute ;
22
+
23
+ protected $ resourceKey = 'limits ' ;
24
+ }
Original file line number Diff line number Diff line change 6
6
use OpenStack \Compute \v2 \Models \Flavor ;
7
7
use OpenStack \Compute \v2 \Models \Image ;
8
8
use OpenStack \Compute \v2 \Models \Keypair ;
9
+ use OpenStack \Compute \v2 \Models \Limit ;
9
10
use OpenStack \Compute \v2 \Models \Server ;
10
11
11
12
/**
@@ -152,4 +153,16 @@ public function getKeypair(array $options = []): Keypair
152
153
$ keypair ->populateFromArray ($ options );
153
154
return $ keypair ;
154
155
}
156
+
157
+ /**
158
+ * Shows rate and absolute limits for the tenant
159
+ *
160
+ * @return Limit
161
+ */
162
+ public function getLimits (): Limit
163
+ {
164
+ $ limits = $ this ->model (Limit::class);
165
+ $ limits ->populateFromResponse ($ this ->execute ($ this ->api ->getLimits (), []));
166
+ return $ limits ;
167
+ }
155
168
}
You can’t perform that action at this time.
0 commit comments