diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-12-20 23:21:12 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-12-20 23:21:12 +0100 |
commit | 06567915c5605fa98326c16036aa107741c3ddd1 (patch) | |
tree | c4a7f9665ac8ad5bec36d2de5a226014c1e4a5dd | |
parent | 654e1c6d74f8b17ff6ceabb9d46b1d081a59b670 (diff) | |
download | python-phpipam-06567915c5605fa98326c16036aa107741c3ddd1.tar.gz |
documentation
-rw-r--r-- | README.md | 62 | ||||
-rwxr-xr-x | phpipam/resources.py | 4 |
2 files changed, 62 insertions, 4 deletions
@@ -1,7 +1,65 @@ # phpipam -An incomplete phpIPAM API implementation for python +An incomplete phpIPAM API implementation in python. -[API Doc](https://phpipam.net/api-documentation/) +Refer to the [API Doc](https://phpipam.net/api-documentation/) for data layout. + +``` +import phpipam + +ipam = phpipam.phpipam("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 + +### addresses + +* `getByIP(subnet_id=<subnet id>, ip=<ip>)` +* `search(ip=<ip>)` +* `getFirstFree(subnet_id=<subnet 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 diff --git a/phpipam/resources.py b/phpipam/resources.py index 461daf5..20725c1 100755 --- a/phpipam/resources.py +++ b/phpipam/resources.py @@ -19,7 +19,7 @@ resource_types = { }, }, 'addresses' : { - 'getByIp':{ + 'getByIP':{ 'method':'GET', 'request':'/addresses/{ip}/{subnet_id}/' }, @@ -33,7 +33,7 @@ resource_types = { }, 'createFirstFree':{ 'method':'POST', - 'request':'/addresses/first_free/{subnetId}/' + 'request':'/addresses/first_free/{subnet_id}/' } }, 'vlan':{}, |