1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Axsor\PhpIPAM\Http\Requests; |
4
|
|
|
|
5
|
|
|
class ToolRequest extends Connector |
6
|
|
|
{ |
7
|
|
|
public function locations() |
8
|
|
|
{ |
9
|
|
|
return $this->get('tools/locations'); |
10
|
|
|
} |
11
|
|
|
|
12
|
|
|
public function location($location) |
13
|
|
|
{ |
14
|
|
|
$id = get_id_from_variable($location); |
15
|
|
|
|
16
|
|
|
return $this->get("tools/locations/{$id}"); |
17
|
|
|
} |
18
|
|
|
|
19
|
|
|
public function locationCreate(array $location) |
20
|
|
|
{ |
21
|
|
|
return $this->post('tools/locations', $location); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function locationUpdate($location, array $newData) |
25
|
|
|
{ |
26
|
|
|
$id = get_id_from_variable($location); |
27
|
|
|
|
28
|
|
|
return $this->patch("tools/locations/{$id}", $newData); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function locationDrop($location) |
32
|
|
|
{ |
33
|
|
|
$id = get_id_from_variable($location); |
34
|
|
|
|
35
|
|
|
return $this->delete("tools/locations/{$id}"); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function tags() |
39
|
|
|
{ |
40
|
|
|
return $this->get('tools/tags'); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function tag($tag) |
44
|
|
|
{ |
45
|
|
|
$id = get_id_from_variable($tag); |
46
|
|
|
|
47
|
|
|
return $this->get("tools/tags/{$id}"); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function tagCreate(array $tag) |
51
|
|
|
{ |
52
|
|
|
return $this->post('tools/tags', $tag); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function tagUpdate($tag, array $newData) |
56
|
|
|
{ |
57
|
|
|
$id = get_id_from_variable($tag); |
58
|
|
|
|
59
|
|
|
return $this->patch("tools/tags/{$id}", $newData); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function tagDrop($tag) |
63
|
|
|
{ |
64
|
|
|
$id = get_id_from_variable($tag); |
65
|
|
|
|
66
|
|
|
return $this->delete("tools/tags/{$id}"); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|