We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I wrote a very basic code but it always game code 400, request is not valid:
from phpipam_client import PhpIpamClient, GET ipam = PhpIpamClient( url='https://myurl.local', app_id='myapp', token='ipam_provided_appcode', encryption=True, ) response=ipam.get('/devices/') print (response)
I tried the same with a basic rest script and it works fine:
import requests import json app='myapp' appCode='ipam_provided_appcode' controller=input('Type the controller to perform the search: [subnets|addresses]\n ') action='search' if controller == ('subnets' or 'addresses'): target=input('Type the IP address/subnet to search\n ') url=f'https://myurl/api/{app}/{controller}/{action}/{target}/' response = requests.get(url, headers={ "token": appCode, }) response = (response.json()) print (json.dumps(response, indent=4)) else: print ('Error: invalid target\n')
What am I doing wrong?
phpipam_client 0.4.0 python 3.6.8
The text was updated successfully, but these errors were encountered:
Good. Then it isn't just me. Seeing the same. Python 3.7.7 phpipam-client 0.4.0
Tried playing with the url as well, but no go,
Sorry, something went wrong.
I'm also here, sharing my founds:
python 3.8 phpipam from master branch phpipam-client 0.4.0
using the @gpipito code example as test
in phpipam, config.php with $api_crypt_encryption_library = "mcrypt"; and it works.
$api_crypt_encryption_library = "mcrypt";
no changes needed in config.php (default to openssl) and in phpipam-client, just by commenting the section below in client.py (quick way to test):
#if not self._api_encryption: # self.login()
changing the parameter encryption to False in the code, and it works also.
encryption
False
hope it could help
No branches or pull requests
Hi,
I wrote a very basic code but it always game code 400, request is not valid:
I tried the same with a basic rest script and it works fine:
What am I doing wrong?
phpipam_client 0.4.0
python 3.6.8
The text was updated successfully, but these errors were encountered: