|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace OpenStack\DataProcessing\v1\Models; |
|
4
|
|
|
|
|
5
|
|
|
use OpenStack\Common\Resource\Creatable; |
|
6
|
|
|
use OpenStack\Common\Resource\Deletable; |
|
7
|
|
|
use OpenStack\Common\Resource\Listable; |
|
8
|
|
|
use OpenStack\Common\Resource\OperatorResource; |
|
9
|
|
|
use OpenStack\Common\Resource\Retrievable; |
|
10
|
|
|
use OpenStack\Common\Transport\Utils; |
|
11
|
|
|
|
|
12
|
|
|
class Cluster extends OperatorResource implements Listable, Retrievable, Creatable, Deletable |
|
13
|
|
|
{ |
|
14
|
|
|
public $isTransient; |
|
15
|
|
|
public $userKeypairId; |
|
16
|
|
|
public $updatedAt; |
|
17
|
|
|
public $provisionProgress; |
|
18
|
|
|
public $useAutoconfig; |
|
19
|
|
|
public $nodeGroups; |
|
20
|
|
|
public $managementPublicKey; |
|
21
|
|
|
public $id; |
|
22
|
|
|
public $trustId; |
|
23
|
|
|
public $clusterConfigs; |
|
24
|
|
|
public $defaultImageId; |
|
25
|
|
|
public $domainName; |
|
26
|
|
|
public $shares; |
|
27
|
|
|
public $status; |
|
28
|
|
|
public $neutronManagementNetwork; |
|
29
|
|
|
public $description; |
|
30
|
|
|
public $pluginName; |
|
31
|
|
|
public $antiAffinity; |
|
32
|
|
|
public $isPublic; |
|
33
|
|
|
public $statusDescription; |
|
34
|
|
|
public $hadoopVersion; |
|
35
|
|
|
public $info; |
|
36
|
|
|
public $clusterTemplateId; |
|
37
|
|
|
public $name; |
|
38
|
|
|
public $tenantId; |
|
39
|
|
|
public $createdAt; |
|
40
|
|
|
public $isProtected; |
|
41
|
|
|
public $verification; |
|
42
|
|
|
|
|
43
|
|
|
protected $resourceKey = 'cluster'; |
|
44
|
|
|
protected $resourcesKey = 'clusters'; |
|
45
|
|
|
|
|
46
|
|
|
protected $aliases = [ |
|
47
|
|
|
'is_transient' => 'isTransient', |
|
48
|
|
|
'user_keypair_id' => 'userKeypairId', |
|
49
|
|
|
'updated_at' => 'updatedAt', |
|
50
|
|
|
'provision_progress' => 'provisionProgress', |
|
51
|
|
|
'use_autoconfig' => 'useAutoconfig', |
|
52
|
|
|
'node_groups' => 'nodeGroups', |
|
53
|
|
|
'management_public_key' => 'managementPublicKey', |
|
54
|
|
|
'trust_id' => 'trustId', |
|
55
|
|
|
'cluster_configs' => 'clusterConfigs', |
|
56
|
|
|
'default_image_id' => 'defaultImageId', |
|
57
|
|
|
'domain_name' => 'domainName', |
|
58
|
|
|
'neutron_management_network' => 'neutronManagementNetwork', |
|
59
|
|
|
'plugin_name' => 'pluginName', |
|
60
|
|
|
'anti_affinity' => 'antiAffinity', |
|
61
|
|
|
'is_public' => 'isPublic', |
|
62
|
|
|
'status_description' => 'statusDescription', |
|
63
|
|
|
'hadoop_version' => 'hadoopVersion', |
|
64
|
|
|
'cluster_template_id' => 'clusterTemplateId', |
|
65
|
|
|
'tenant_id' => 'tenantId', |
|
66
|
|
|
'created_at' => 'createdAt', |
|
67
|
|
|
'is_protected' => 'isProtected', |
|
68
|
|
|
]; |
|
69
|
|
|
|
|
70
|
|
|
public function retrieve() |
|
71
|
|
|
{ |
|
72
|
|
|
$response = $this->execute($this->api->getCluster(), $this->getAttrs(['id'])); |
|
|
|
|
|
|
73
|
|
|
$this->populateFromResponse($response); |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function create(array $userOptions): Creatable |
|
77
|
|
|
{ |
|
78
|
|
|
$response = $this->execute($this->api->postCluster(), $userOptions); |
|
|
|
|
|
|
79
|
|
|
return $this->populateFromResponse($response); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function delete() |
|
83
|
|
|
{ |
|
84
|
|
|
$this->execute($this->api->deleteCluster(), $this->getAttrs(['id'])); |
|
|
|
|
|
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
public function update() |
|
88
|
|
|
{ |
|
89
|
|
|
$response = $this->execute($this->api->patchCluster(), $this->getAttrs(['id', 'name', 'isPublic', 'isProtected', 'description'])); |
|
|
|
|
|
|
90
|
|
|
$this->populateFromResponse($response); |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function scale(array $userOptions) |
|
94
|
|
|
{ |
|
95
|
|
|
$response = $this->execute($this->api->putCluster(), array_merge($this->getAttrs(['id']), $userOptions)); |
|
|
|
|
|
|
96
|
|
|
|
|
97
|
|
|
return $this->populateFromResponse($response); |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
public function getNodeGroups(array $options = []): array |
|
101
|
|
|
{ |
|
102
|
|
|
$response = $this->execute($this->api->getNodeGroups(), $options); |
|
|
|
|
|
|
103
|
|
|
|
|
104
|
|
|
return Utils::jsonDecode($response); |
|
105
|
|
|
} |
|
106
|
|
|
} |
|
107
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.