aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 985068d404634c30e4963ac700295fc4affe3411 (plain)
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
# phpipam

An incomplete phpIPAM API implementation in python.

Refer to the [API Doc](https://phpipam.net/api-documentation/) for data layout.

```
import phpipam

ipam = phpipam.PhpipamAPI("https://phpipam.example.com/", "myapp", "apiuser", "p4s5word")
```

Usage:

```
data = ipam.<controller>.<operation>(<arguments>)
```

All functions return a dictionary object or a list of dictionary objects.
If an error is encountered, an exception is raised.

## Controllers

* `get()` returns all obejcts in in controller
* `byID(object_id=<object id>)` get specific obejct by ID
* `create(data=<data>)`
* `edit(data=<data>)`
* `delete(object_id=<object id>)`

### sections

* `getSubnets(section_id=<section id>)`

### subnets

* `search(search=<query>)` search for subnet by CIDR
* `getIP(subnet_id=<subnet id>, ip=<ip>)` get address object from subnet by IP
* `getAddresses(subnet_id=<subnet id>)` get all addresses in subnet

### addresses

* `getByIP(subnet_id=<subnet id>, ip=<ip>)`
* `getByTag(tag_id=<tag id>)`
* `search(ip=<ip>)`
* `getFirstFree(subnet_id=<subnet id>)`
* `getTags()`
* `getTag(tag_id=<tag id>)`
* `createFirstFree(subnet_id=<subnet id>)`

### vlan

### l2domains

### vrf

### devices

* `getAddresses(device_id=<device id>)`
* `getSubnets(device_id=<device id>)`

### prefix


requires

	dateutil
	requests

License: MIT