No project description provided
Project description
README
Why the need for this library ?
For simple resource retrieval, the existing API is enough, but:
-
The libraries available are not practical for it, the manual management of urls is easier
-
For more complex operation, this does not suits well
The python SDK of PaloAltoNetworks itself relies on a third party wrapper for their API.
Design
The library provides 2 things:
-
A simple client for the API
-
Tool to manage the xml configuration
We will pull the whole configuration and search on it locally. We can then use the client to do some operations
We don't want to combine both the client and the management tool. This would requires a lot of boilerplate code that would be difficult to maintain.
Usage
client = XMLApi(HOST, API_KEY)
tree = client.get_tree()
# Find your object using its name (may not be unique)
my_object = config.find_by_name("my_object_name")[0]
print(my_object) # /address/entry[@name='my_object_name']
# Find the references to it (0 or multiple results are possible)
ref = my_object.get_references()[0]
print(ref) # /post-rulebase/security/rules/entry[@uuid='...']/destination/member
# We must not delete the <member> tag, but we can delete its parent
client.delete(ref.parent.xpath)
# Now we must commit the changes
client.commit_changes()
# We can also revert it
# client.revert_changes()
The library currently doesn't provide helper tools to know how to edit the configuration. Theses changes must be done manually
TODO
-
Provide wrapper classes for the resources.
nat = NatPolicy(...) tree.insert(nat) # or nat.insertInto(tree) client.create(nat.insert_xpath, nat.xml)
-
Mix Rest API and XML API ?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nagra_panorama_api-0.1.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea6d51fa1fc0aac3f1bdf7939be3176c397a2be841ecb1a2c9bc149f8a2fa4eb |
|
MD5 | 7f41e28fbf4c3e499dc521668dcc1cbd |
|
BLAKE2b-256 | c7242b4fba05816c851846bcb7a5ca1941103574fd65c190e365c925d2352f88 |
Hashes for nagra_panorama_api-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3122166a3a84fb8944f45c172e796d0a827f3166d0ed9efb676d1820447f4bbb |
|
MD5 | 929f57b4a760c40f75766f937769b4a3 |
|
BLAKE2b-256 | e802077b0c4965901a85ce8cbaf88865a4074d8745d5e9e37cbd0c51ab33d847 |