1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace OpenStack\BlockStorage\v2\Models; |
4
|
|
|
|
5
|
|
|
use OpenStack\Common\Resource\Alias; |
6
|
|
|
use OpenStack\Common\Resource\Deletable; |
7
|
|
|
use OpenStack\Common\Resource\OperatorResource; |
8
|
|
|
use OpenStack\Common\Resource\Retrievable; |
9
|
|
|
use OpenStack\Common\Resource\Updateable; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Represents a BlockStorage v2 Quota Set |
13
|
|
|
* |
14
|
|
|
* @property \OpenStack\BlockStorage\v2\Api $api |
15
|
|
|
*/ |
16
|
|
|
class QuotaSet extends OperatorResource implements Retrievable, Updateable, Deletable |
17
|
|
|
{ |
18
|
|
|
/** @var string */ |
19
|
|
|
public $tenantId; |
20
|
|
|
|
21
|
|
|
/** @var int */ |
22
|
|
|
public $backupGigabytes; |
23
|
|
|
|
24
|
|
|
/** @var int */ |
25
|
|
|
public $backups; |
26
|
|
|
|
27
|
|
|
/** @var int */ |
28
|
|
|
public $gigabytes; |
29
|
|
|
|
30
|
|
|
/** @var int */ |
31
|
|
|
public $gigabytesIscsi; |
32
|
|
|
|
33
|
|
|
/** @var int */ |
34
|
|
|
public $perVolumeGigabytes; |
35
|
|
|
|
36
|
|
|
/** @var int */ |
37
|
|
|
public $snapshots; |
38
|
|
|
|
39
|
|
|
/** @var int */ |
40
|
|
|
public $snapshotsIscsi; |
41
|
|
|
|
42
|
|
|
/** @var int */ |
43
|
|
|
public $volumes; |
44
|
|
|
|
45
|
|
|
/** @var int */ |
46
|
|
|
public $volumesIscsi; |
47
|
|
|
|
48
|
|
|
protected $resourceKey = 'quota_set'; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @inheritdoc |
52
|
|
|
*/ |
53
|
|
|
protected static function getAlias(): Alias |
54
|
|
|
{ |
55
|
|
|
$alias = parent::getAlias(); |
56
|
|
|
|
57
|
|
|
if (!$alias->hasAliases(self::class)) { |
58
|
|
|
$alias |
59
|
|
|
->add(self::class, 'backup_gigabytes', 'backupGigabytes') |
60
|
|
|
->add(self::class, 'gigabytes', 'gigabytes') |
61
|
|
|
->add(self::class, 'gigabytes_iscsi', 'gigabytesIscsi') |
62
|
|
|
->add(self::class, 'per_volume_gigabytes', 'perVolumeGigabytes') |
63
|
|
|
->add(self::class, 'snapshots_iscsi', 'snapshotsIscsi') |
64
|
|
|
->add(self::class, 'volumes_iscsi', 'volumesIscsi') |
65
|
|
|
->add(self::class, 'id', 'tenantId'); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
return $alias; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @inheritdoc |
73
|
|
|
*/ |
74
|
|
|
public function retrieve() |
75
|
|
|
{ |
76
|
|
|
$response = $this->execute($this->api->getQuotaSet(), ['tenantId' => (string)$this->tenantId]); |
77
|
|
|
$this->populateFromResponse($response); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @inheritdoc |
82
|
|
|
*/ |
83
|
|
|
public function update() |
84
|
|
|
{ |
85
|
|
|
$response = $this->executeWithState($this->api->putQuotaSet()); |
86
|
|
|
$this->populateFromResponse($response); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @inheritdoc |
91
|
|
|
*/ |
92
|
|
|
public function delete() |
93
|
|
|
{ |
94
|
|
|
$response = $this->executeWithState($this->api->deleteQuotaSet()); |
95
|
|
|
$this->populateFromResponse($response); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|