-
Notifications
You must be signed in to change notification settings - Fork 2
/
IpApi.php
105 lines (97 loc) · 3.33 KB
/
IpApi.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
//----------------------------------------------------------------------
//
// Copyright (C) 2015-2017 Artem Rodygin
//
// This file is part of Linode API Client Library for PHP.
//
// You should have received a copy of the MIT License along with
// the library. If not, see <http://opensource.org/licenses/MIT>.
//
//----------------------------------------------------------------------
namespace Linode\Linode;
use Linode\BaseLinodeApi;
/**
* This class is autogenerated.
*
* @version Linode API v3.3
*/
class IpApi extends BaseLinodeApi
{
/**
* Assigns a Private IP to a Linode. Returns the IPAddressID that was added.
*
* @param int $LinodeID [required]
*
* @return array
*/
public function addPrivate($LinodeID)
{
return $this->call('linode.ip.addprivate', [
'LinodeID' => $LinodeID,
]);
}
/**
* Assigns a Public IP to a Linode. Returns the IPAddressID and IPAddress that was added.
*
* @param int $LinodeID [required] The LinodeID of the Linode that will be assigned an additional public IP address
*
* @return array
*/
public function addPublic($LinodeID)
{
return $this->call('linode.ip.addpublic', [
'LinodeID' => $LinodeID,
]);
}
/**
* Returns the IP addresses of all Linodes you have access to.
*
* @param int $LinodeID [optional] If specified, limits the result to this LinodeID
* @param int $IPAddressID [optional] If specified, limits the result to this IPAddressID
*
* @return array
*/
public function getList($LinodeID = null, $IPAddressID = null)
{
return $this->call('linode.ip.list', [
'LinodeID' => $LinodeID,
'IPAddressID' => $IPAddressID,
]);
}
/**
* Sets the rDNS name of a Public IP. Returns the IPAddressID and IPAddress that were updated.
*
* @param int $IPAddressID [required] The IPAddressID of the address to update
* @param string $Hostname [required] The hostname to set the reverse DNS to
*
* @return array
*/
public function setReverseDNS($IPAddressID, $Hostname)
{
return $this->call('linode.ip.setrdns', [
'IPAddressID' => $IPAddressID,
'Hostname' => $Hostname,
]);
}
/**
* Exchanges Public IP addresses between two Linodes within a Datacenter. The destination of the IP
* Address can be designated by either the toLinodeID or withIPAddressID parameter. Returns the
* resulting relationship of the Linode and IP Address parameters. When performing a one directional
* swap, the source is represented by the first of the two resultant array members.
*
* @param int $IPAddressID [required] The IPAddressID of an IP Address to transfer or swap
* @param int $withIPAddressID [optional] The IP Address ID to swap
* @param int $toLinodeID [optional] The LinodeID of the Linode where IPAddressID will be transfered
*
* @return array
*/
public function swap($IPAddressID, $withIPAddressID = null, $toLinodeID = null)
{
return $this->call('linode.ip.swap', [
'IPAddressID' => $IPAddressID,
'withIPAddressID' => $withIPAddressID,
'toLinodeID' => $toLinodeID,
]);
}
}