Completed
Push — master ( d0d40f...472735 )
by Artem
02:46
created

NodeBalancerApi   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 4
c 5
b 0
f 0
lcom 1
cbo 1
dl 0
loc 65
ccs 20
cts 20
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
A delete() 0 6 1
A getList() 0 6 1
A update() 0 8 1
1
<?php
2
3
//----------------------------------------------------------------------
4
//
5
//  Copyright (C) 2015-2016 Artem Rodygin
6
//
7
//  This file is part of Linode API Client Library for PHP.
8
//
9
//  You should have received a copy of the MIT License along with
10
//  the library. If not, see <http://opensource.org/licenses/MIT>.
11
//
12
//----------------------------------------------------------------------
13
14
namespace Linode;
15
16
/**
17
 * This class is autogenerated.
18
 *
19
 * @version Linode API v3.3
20
 */
21
class NodeBalancerApi extends BaseLinodeApi
22
{
23
    /**
24
     * @param int    $DatacenterID       [required] The DatacenterID from avail.datacenters() where you wish to place this new NodeBalancer
25
     * @param string $Label              [optional] This NodeBalancer's label
26
     * @param int    $ClientConnThrottle [optional] To help mitigate abuse, throttle connections per second, per client IP. 0 to disable. Max of 20.
27
     *
28
     * @return array
29
     */
30 1
    public function create($DatacenterID, $Label = null, $ClientConnThrottle = null)
31
    {
32 1
        return $this->call('nodebalancer.create', [
33 1
            'DatacenterID'       => $DatacenterID,
34 1
            'Label'              => $Label,
35 1
            'ClientConnThrottle' => $ClientConnThrottle,
36 1
        ]);
37
    }
38
39
    /**
40
     * Immediately removes a NodeBalancer from your account and issues a pro-rated credit back to your
41
     * account, if applicable.
42
     *
43
     * @param int $NodeBalancerID [required] The NodeBalancerID to delete
44
     *
45
     * @return array
46
     */
47 1
    public function delete($NodeBalancerID)
48
    {
49 1
        return $this->call('nodebalancer.delete', [
50 1
            'NodeBalancerID' => $NodeBalancerID,
51 1
        ]);
52
    }
53
54
    /**
55
     * Returns a list of NodeBalancers this user has access or delete to, including their properties.
56
     *
57
     * @param int $NodeBalancerID [optional] Limits the list to the specified NodeBalancerID
58
     *
59
     * @return array
60
     */
61 1
    public function getList($NodeBalancerID = null)
62
    {
63 1
        return $this->call('nodebalancer.list', [
64 1
            'NodeBalancerID' => $NodeBalancerID,
65 1
        ]);
66
    }
67
68
    /**
69
     * Updates a NodeBalancer's properties.
70
     *
71
     * @param int    $NodeBalancerID     [required] 
72
     * @param string $Label              [optional] This NodeBalancer's label
73
     * @param int    $ClientConnThrottle [optional] To help mitigate abuse, throttle connections per second, per client IP. 0 to disable. Max of 20.
74
     *
75
     * @return array
76
     */
77 1
    public function update($NodeBalancerID, $Label = null, $ClientConnThrottle = null)
78
    {
79 1
        return $this->call('nodebalancer.update', [
80 1
            'NodeBalancerID'     => $NodeBalancerID,
81 1
            'Label'              => $Label,
82 1
            'ClientConnThrottle' => $ClientConnThrottle,
83 1
        ]);
84
    }
85
}
86