GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#157)
by
unknown
01:44
created

Cluster   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 95
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 95
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A retrieve() 0 5 1
A create() 0 5 1
A delete() 0 4 1
A update() 0 5 1
A scale() 0 6 1
A getNodeGroups() 0 6 1
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']));
0 ignored issues
show
Bug introduced by
The method getCluster() does not seem to exist on object<OpenStack\Common\Api\ApiInterface>.

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.

Loading history...
73
        $this->populateFromResponse($response);
74
    }
75
76
    public function create(array $userOptions): Creatable
77
    {
78
        $response = $this->execute($this->api->postCluster(), $userOptions);
0 ignored issues
show
Bug introduced by
The method postCluster() does not seem to exist on object<OpenStack\Common\Api\ApiInterface>.

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.

Loading history...
79
        return $this->populateFromResponse($response);
80
    }
81
82
    public function delete()
83
    {
84
        $this->execute($this->api->deleteCluster(), $this->getAttrs(['id']));
0 ignored issues
show
Bug introduced by
The method deleteCluster() does not seem to exist on object<OpenStack\Common\Api\ApiInterface>.

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.

Loading history...
85
    }
86
87
    public function update()
88
    {
89
        $response = $this->execute($this->api->patchCluster(), $this->getAttrs(['id', 'name', 'isPublic', 'isProtected', 'description']));
0 ignored issues
show
Bug introduced by
The method patchCluster() does not seem to exist on object<OpenStack\Common\Api\ApiInterface>.

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.

Loading history...
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));
0 ignored issues
show
Bug introduced by
The method putCluster() does not seem to exist on object<OpenStack\Common\Api\ApiInterface>.

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.

Loading history...
96
97
        return $this->populateFromResponse($response);
98
    }
99
100
    public function getNodeGroups(array $options = []): array
101
    {
102
        $response = $this->execute($this->api->getNodeGroups(), $options);
0 ignored issues
show
Bug introduced by
The method getNodeGroups() does not seem to exist on object<OpenStack\Common\Api\ApiInterface>.

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.

Loading history...
103
104
        return Utils::jsonDecode($response);
105
    }
106
}
107