IpApi   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 15
dl 0
loc 80
c 0
b 0
f 0
ccs 19
cts 19
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A addPrivate() 0 4 1
A addPublic() 0 4 1
A setReverseDNS() 0 5 1
A swap() 0 6 1
A getList() 0 5 1
1
<?php
2
3
//----------------------------------------------------------------------
4
//
5
//  Copyright (C) 2015-2017 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\Linode;
15
16
use Linode\BaseLinodeApi;
17
18
/**
19
 * This class is autogenerated.
20
 *
21
 * @version Linode API v3.3
22
 */
23
class IpApi extends BaseLinodeApi
24
{
25
    /**
26
     * Assigns a Private IP to a Linode.  Returns the IPAddressID that was added.
27
     *
28
     * @param int $LinodeID [required]
29
     *
30
     * @return array
31
     */
32 1
    public function addPrivate($LinodeID)
33
    {
34 1
        return $this->call('linode.ip.addprivate', [
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->call('lino...inodeID' => $LinodeID)) returns the type boolean which is incompatible with the documented return type array.
Loading history...
35 1
            'LinodeID' => $LinodeID,
36
        ]);
37
    }
38
39
    /**
40
     * Assigns a Public IP to a Linode.  Returns the IPAddressID and IPAddress that was added.
41
     *
42
     * @param int $LinodeID [required] The LinodeID of the Linode that will be assigned an additional public IP address
43
     *
44
     * @return array
45
     */
46 1
    public function addPublic($LinodeID)
47
    {
48 1
        return $this->call('linode.ip.addpublic', [
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->call('lino...inodeID' => $LinodeID)) returns the type boolean which is incompatible with the documented return type array.
Loading history...
49 1
            'LinodeID' => $LinodeID,
50
        ]);
51
    }
52
53
    /**
54
     * Returns the IP addresses of all Linodes you have access to.
55
     *
56
     * @param int $LinodeID    [optional] If specified, limits the result to this LinodeID
57
     * @param int $IPAddressID [optional] If specified, limits the result to this IPAddressID
58
     *
59
     * @return array
60
     */
61 1
    public function getList($LinodeID = null, $IPAddressID = null)
62
    {
63 1
        return $this->call('linode.ip.list', [
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->call('lino...ssID' => $IPAddressID)) returns the type boolean which is incompatible with the documented return type array.
Loading history...
64 1
            'LinodeID'    => $LinodeID,
65 1
            'IPAddressID' => $IPAddressID,
66
        ]);
67
    }
68
69
    /**
70
     * Sets the rDNS name of a Public IP.  Returns the IPAddressID and IPAddress that were updated.
71
     *
72
     * @param int    $IPAddressID [required] The IPAddressID of the address to update
73
     * @param string $Hostname    [required] The hostname to set the reverse DNS to
74
     *
75
     * @return array
76
     */
77 1
    public function setReverseDNS($IPAddressID, $Hostname)
78
    {
79 1
        return $this->call('linode.ip.setrdns', [
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->call('lino...ostname' => $Hostname)) returns the type boolean which is incompatible with the documented return type array.
Loading history...
80 1
            'IPAddressID' => $IPAddressID,
81 1
            'Hostname'    => $Hostname,
82
        ]);
83
    }
84
85
    /**
86
     * Exchanges Public IP addresses between two Linodes within a Datacenter.  The destination of the IP
87
     * Address can be designated by either the toLinodeID or withIPAddressID parameter.  Returns the
88
     * resulting relationship of the Linode and IP Address parameters.  When performing a one directional
89
     * swap, the source is represented by the first of the two resultant array members.
90
     *
91
     * @param int $IPAddressID     [required] The IPAddressID of an IP Address to transfer or swap
92
     * @param int $withIPAddressID [optional] The IP Address ID to swap
93
     * @param int $toLinodeID      [optional] The LinodeID of the Linode where IPAddressID will be transfered
94
     *
95
     * @return array
96
     */
97 1
    public function swap($IPAddressID, $withIPAddressID = null, $toLinodeID = null)
98
    {
99 1
        return $this->call('linode.ip.swap', [
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->call('lino...odeID' => $toLinodeID)) returns the type boolean which is incompatible with the documented return type array.
Loading history...
100 1
            'IPAddressID'     => $IPAddressID,
101 1
            'withIPAddressID' => $withIPAddressID,
102 1
            'toLinodeID'      => $toLinodeID,
103
        ]);
104
    }
105
}
106