Skip to content

adzhurinskij/phpipam-client

Repository files navigation

phpipam-client

PyPI PyPI - Python Version Pyup Status Travis (.org)

PHPIPAM Python RESP API Client. It supports Python 2.7 and 3.4+.

Installation

pip install phpipam-client

Example

Basic usage:

from phpipam_client import PhpIpamClient, GET, PATCH

ipam = PhpIpamClient(
    url='https://ipam',
    app_id='myapp',
    username='mylogin',
    password='mypassword',
    user_agent='myapiclient', # custom user-agent header
)

# read object
ipam.get('/sections/')

ipam.get('/sections/', {
    'filter_by': 'id',
    'filter_value': 2,
})

# create object
ipam.post('/sections/', {
    'description': 'example',
})

# update object
ipam.patch('/sections/1/', {
    'description': 'example',
})

# delete object
ipam.delete('/sections/1/')

# read object
ipam.query('/sections/', method=GET)

# update object
ipam.query('/sections/1/', method=PATCH, data={
    'description': 'example',
})

Use encryption:

ipam = PhpIpamClient(
    url='https://ipam',
    app_id='myapp',
    token='mytoken',
    encryption=True,
)

Other API clients