1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace OpenStack\Compute\v2\Models; |
4
|
|
|
|
5
|
|
|
use OpenStack\Common\Resource\Deletable; |
6
|
|
|
use OpenStack\Common\Resource\OperatorResource; |
7
|
|
|
use OpenStack\Common\Resource\Retrievable; |
8
|
|
|
use OpenStack\Common\Resource\Updateable; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Represents a Compute v2 Quota Set |
12
|
|
|
* |
13
|
|
|
* @property \OpenStack\Compute\v2\Api $api |
14
|
|
|
*/ |
15
|
|
|
class QuotaSet extends OperatorResource implements Retrievable, Updateable, Deletable |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* The number of allowed instance cores for each tenant. |
19
|
|
|
* |
20
|
|
|
* @var int|array |
21
|
|
|
*/ |
22
|
|
|
public $cores; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* The number of allowed fixed IP addresses for each tenant. |
26
|
|
|
* Must be equal to or greater than the number of allowed instances. |
27
|
|
|
* |
28
|
|
|
* @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this. |
29
|
|
|
* @var int|object |
30
|
|
|
*/ |
31
|
|
|
public $fixedIps; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* The number of allowed floating IP addresses for each tenant. |
35
|
|
|
* |
36
|
|
|
* @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this. |
37
|
|
|
* @var int|array |
38
|
|
|
*/ |
39
|
|
|
public $floatingIps; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* The UUID of the tenant/user the quotas listed for. |
43
|
|
|
* |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
public $tenantId; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* The number of allowed bytes of content for each injected file. |
50
|
|
|
* |
51
|
|
|
* @var int|array |
52
|
|
|
*/ |
53
|
|
|
public $injectedFileContentBytes; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* The number of allowed bytes for each injected file path. |
57
|
|
|
* |
58
|
|
|
* @var int|array |
59
|
|
|
*/ |
60
|
|
|
public $injectedFilePathBytes; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* The number of allowed injected files for each tenant. |
64
|
|
|
* |
65
|
|
|
* @var int|array |
66
|
|
|
*/ |
67
|
|
|
public $injectedFiles; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* The number of allowed instances for each tenant. |
71
|
|
|
* |
72
|
|
|
* @var int|array |
73
|
|
|
*/ |
74
|
|
|
public $instances; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* The number of allowed key pairs for each user. |
78
|
|
|
* |
79
|
|
|
* @var int|array |
80
|
|
|
*/ |
81
|
|
|
public $keyPairs; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* The number of allowed metadata items for each instance. |
85
|
|
|
* |
86
|
|
|
* @var int|array |
87
|
|
|
*/ |
88
|
|
|
public $metadataItems; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* The amount of allowed instance RAM, in MB, for each tenant. |
92
|
|
|
* |
93
|
|
|
* @var int|array |
94
|
|
|
*/ |
95
|
|
|
public $ram; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* The number of allowed rules for each security group. |
99
|
|
|
* |
100
|
|
|
* @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this. |
101
|
|
|
* @var int|array |
102
|
|
|
*/ |
103
|
|
|
public $securityGroupRules; |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* The number of allowed security groups for each tenant. |
107
|
|
|
* |
108
|
|
|
* @deprecated Since Nova v2.35. This attribute will eventually move to Neutron, it is advised you do not use this. |
109
|
|
|
* @var int|array |
110
|
|
|
*/ |
111
|
|
|
public $securityGroups; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* The number of allowed server groups for each tenant. |
115
|
|
|
* |
116
|
|
|
* @var int|array |
117
|
|
|
*/ |
118
|
|
|
public $serverGroups; |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* The number of allowed members for each server group. |
122
|
|
|
* |
123
|
|
|
* @var int|object |
124
|
|
|
*/ |
125
|
|
|
public $serverGroupMembers; |
126
|
|
|
|
127
|
|
|
protected $resourceKey = 'quota_set'; |
128
|
|
|
|
129
|
|
|
protected $aliases = [ |
130
|
|
|
'id' => 'tenantId', |
131
|
|
|
'fixed_ips' => 'fixedIps', |
132
|
|
|
'floating_ips' => 'floatingIps', |
133
|
|
|
'injected_file_content_bytes' => 'injectedFileContentBytes', |
134
|
|
|
'injected_file_path_bytes' => 'injectedFilePathBytes', |
135
|
|
|
'injected_files' => 'injectedFiles', |
136
|
|
|
'key_pairs' => 'keyPairs', |
137
|
|
|
'metadata_items' => 'metadataItems', |
138
|
|
|
'security_group_rules' => 'securityGroupRules', |
139
|
|
|
'security_groups' => 'securityGroups', |
140
|
|
|
'server_group_members' => 'serverGroupMembers', |
141
|
|
|
'server_groups' => 'serverGroups', |
142
|
|
|
]; |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @inheritdoc |
146
|
|
|
*/ |
147
|
|
|
public function retrieve() |
148
|
|
|
{ |
149
|
|
|
$response = $this->execute($this->api->getQuotaSet(), ['tenantId' => (string)$this->tenantId]); |
150
|
|
|
$this->populateFromResponse($response); |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @inheritdoc |
155
|
|
|
*/ |
156
|
|
|
public function delete() |
157
|
|
|
{ |
158
|
|
|
$response = $this->executeWithState($this->api->deleteQuotaSet()); |
159
|
|
|
$this->populateFromResponse($response); |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @inheritdoc |
164
|
|
|
*/ |
165
|
|
|
public function update() |
166
|
|
|
{ |
167
|
|
|
$response = $this->executeWithState($this->api->putQuotaSet()); |
168
|
|
|
$this->populateFromResponse($response); |
169
|
|
|
} |
170
|
|
|
} |
171
|
|
|
|