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\Domain; |
15
|
|
|
|
16
|
|
|
use Linode\BaseLinodeApi; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* This class is autogenerated. |
20
|
|
|
* |
21
|
|
|
* @version Linode API v3.3 |
22
|
|
|
*/ |
23
|
|
|
class ResourceApi extends BaseLinodeApi |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* Create a domain record. |
27
|
|
|
* |
28
|
|
|
* @param int $DomainID [required] |
29
|
|
|
* @param string $Type [required] One of: NS, MX, A, AAAA, CNAME, TXT, or SRV |
30
|
|
|
* @param string $Name [optional] The hostname or FQDN. When Type=MX the subdomain to delegate to the Target MX server. |
31
|
|
|
* @param string $Target [optional] When Type=MX the hostname. When Type=CNAME the target of the alias. When Type=TXT the value of the record. When Type=A or AAAA the token of '[remote_addr]' will be substituted with the IP address of the request. |
32
|
|
|
* @param int $Priority [optional] Priority for MX and SRV records, 0-255 |
33
|
|
|
* @param int $Weight [optional] |
34
|
|
|
* @param int $Port [optional] |
35
|
|
|
* @param string $Protocol [optional] The protocol to append to an SRV record. Ignored on other record types. |
36
|
|
|
* @param int $TTL_sec [optional] TTL. Leave as 0 to accept our default. |
37
|
|
|
* |
38
|
|
|
* @return array |
39
|
|
|
*/ |
40
|
1 |
|
public function create($DomainID, $Type, $Name = null, $Target = null, $Priority = null, $Weight = null, $Port = null, $Protocol = null, $TTL_sec = null) |
41
|
|
|
{ |
42
|
1 |
|
return $this->call('domain.resource.create', [ |
43
|
1 |
|
'DomainID' => $DomainID, |
44
|
1 |
|
'Type' => $Type, |
45
|
1 |
|
'Name' => $Name, |
46
|
1 |
|
'Target' => $Target, |
47
|
1 |
|
'Priority' => $Priority, |
48
|
1 |
|
'Weight' => $Weight, |
49
|
1 |
|
'Port' => $Port, |
50
|
1 |
|
'Protocol' => $Protocol, |
51
|
1 |
|
'TTL_sec' => $TTL_sec, |
52
|
1 |
|
]); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @param int $DomainID [required] |
57
|
|
|
* @param int $ResourceID [required] |
58
|
|
|
* |
59
|
|
|
* @return array |
60
|
|
|
*/ |
61
|
1 |
|
public function delete($DomainID, $ResourceID) |
62
|
|
|
{ |
63
|
1 |
|
return $this->call('domain.resource.delete', [ |
64
|
1 |
|
'DomainID' => $DomainID, |
65
|
1 |
|
'ResourceID' => $ResourceID, |
66
|
1 |
|
]); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @param int $DomainID [required] |
71
|
|
|
* @param int $ResourceID [optional] |
72
|
|
|
* |
73
|
|
|
* @return array |
74
|
|
|
*/ |
75
|
1 |
|
public function getList($DomainID, $ResourceID = null) |
76
|
|
|
{ |
77
|
1 |
|
return $this->call('domain.resource.list', [ |
78
|
1 |
|
'DomainID' => $DomainID, |
79
|
1 |
|
'ResourceID' => $ResourceID, |
80
|
1 |
|
]); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Update a domain record. |
85
|
|
|
* |
86
|
|
|
* @param int $DomainID [optional] |
87
|
|
|
* @param int $ResourceID [required] |
88
|
|
|
* @param string $Name [optional] The hostname or FQDN. When Type=MX the subdomain to delegate to the Target MX server. |
89
|
|
|
* @param string $Target [optional] When Type=MX the hostname. When Type=CNAME the target of the alias. When Type=TXT the value of the record. When Type=A or AAAA the token of '[remote_addr]' will be substituted with the IP address of the request. |
90
|
|
|
* @param int $Priority [optional] Priority for MX and SRV records, 0-255 |
91
|
|
|
* @param int $Weight [optional] |
92
|
|
|
* @param int $Port [optional] |
93
|
|
|
* @param string $Protocol [optional] The protocol to append to an SRV record. Ignored on other record types. |
94
|
|
|
* @param int $TTL_sec [optional] TTL. Leave as 0 to accept our default. |
95
|
|
|
* |
96
|
|
|
* @return array |
97
|
|
|
*/ |
98
|
1 |
|
public function update($DomainID = null, $ResourceID, $Name = null, $Target = null, $Priority = null, $Weight = null, $Port = null, $Protocol = null, $TTL_sec = null) |
99
|
|
|
{ |
100
|
1 |
|
return $this->call('domain.resource.update', [ |
101
|
1 |
|
'DomainID' => $DomainID, |
102
|
1 |
|
'ResourceID' => $ResourceID, |
103
|
1 |
|
'Name' => $Name, |
104
|
1 |
|
'Target' => $Target, |
105
|
1 |
|
'Priority' => $Priority, |
106
|
1 |
|
'Weight' => $Weight, |
107
|
1 |
|
'Port' => $Port, |
108
|
1 |
|
'Protocol' => $Protocol, |
109
|
1 |
|
'TTL_sec' => $TTL_sec, |
110
|
1 |
|
]); |
111
|
|
|
} |
112
|
|
|
} |
113
|
|
|
|