outini / python-powerdns Goto Github PK
View Code? Open in Web Editor NEWPowerDNS web api python client and interface
License: MIT License
PowerDNS web api python client and interface
License: MIT License
Just when call zone.create_records()
Whats wrong ?
python-powerdns/powerdns/interface.py
Line 221 in 173763c
Shouldn't this method have some kind of flag to skip caching "all zones" if not desired?
I can understand benefit of this caching in small environment, however in huge setup it wouldn't likely complete, or, would cause huge impact on PDNS/DB when trying to fetch lets say million zones. (when you actually need 1 )
Whe installieng your package on Windows I get:
pip install python-powerdns
Collecting python-powerdns
Using cached python-powerdns-2.1.0.tar.gz (14 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\mroose\AppData\Local\Temp\pip-install-9lebja68\python-powerdns_acda99872ed242afb6c7bfa0fc067fd1\setup.py", line 36, in <module>
long_description=open(readme_file).read(),
File "C:\Python39\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 5076: character maps to <undefined>
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
This is possibly caused by the statement:
long_description=open(readme_file).read(),
which should maybe changed to:
long_description=open(readme_file, 'r', encoding='UTF-8').read(),
As there are more open
statements in setup.py the may get changed, too.
PowerDNS supports comments on RRSets, but python-powerdns does not. It is simply not available in the RRSet constructor.
This should only be a small change to the RRSet Constructor because currently you can hack it in this way:
rrset = powerdns.RRSet(name="dummy", rtype="AAAA", records=["2001:db8::42"])
rrset["comments"] = [{"account": "test", "modifized_at":1622463776, "content": "yolo"}]
my_zone.create_records([rrset])
This is not very nice to use.
A solution would be to expand the RRSet constructor to allow comments and extend the __str__
and __repr__
methods.
I will prepare a Pull Request for that.
Comments in the PowerDNS Docs: https://doc.powerdns.com/md/httpapi/api_spec/#zone95collection
When installing using pip, this warning is being showed: DEPRECATION: python-powerdns is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change.
I have zones "company.com" and "prt.company.com". If I call Server.suggest_zone('foo-prt.company.com.') I get back the zone "prt.company.com" instead of "company.com".
Looking at https://github.com/outini/python-powerdns/blob/master/powerdns/interface.py#L241 it seems that you need to modify it to check for a dot, like so
if r_name.endswith('.' + zone.name):
The default return value of get_record should probably be None. Instead of "" at https://github.com/outini/python-powerdns/blob/master/powerdns/interface.py#L244 this should be None. Then one can easily check if there is a valid return value.
Since the original vente-privée repository no longer exists, will this repository be made available on pypi for python-powerdns module?
Not seeing in code, any way to get each zone's metadata using python-powerdns?
https://doc.powerdns.com/authoritative/http-api/metadata.html#metadata
It's at /servers/{server_id}/zones/{zone_id}/metadata
My use case is a validation script against powerdns, wanting to check to confirm sanity checks like SOA-EDIT-API is set properly, ALLOW-AXFR-FROM is set when a zone is primary, etc.
I need to allow users to list and request the server_id by string.
When attempting to cast PDNSServer object to a string, it is composed of the <class name>:<server_id>
.
Is there any particular reason why casting to string doesn't return just the server_id
?
PR #20 was merged 1 day after the last release and is therefore not public yet. Would really appreciate if i could finally use the official package :D
If you want to to delete one record where more than one entry of this type exists, all entries of the same type are deleted no matter what data you specify in the RRSet.
Tested with TLSA
zone.delete_record([
powerdns.RRSET('_Blah.example.org.', 'TLSA', [('3 1 1 expired key')])
])
Deletes all TLSA records for a given name not only the expired one.
In my opinion this is a bug, do you agree?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.