[PR #79] [MERGED] feat: Add submit_xml method for posting XML as a string argument #78

Closed
opened 2026-02-27 23:18:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sophos/sophos-firewall-sdk/pull/79
Author: @mamullen13316
Created: 8/28/2024
Status: Merged
Merged: 8/28/2024
Merged by: @mamullen13316

Base: mainHead: submit_xml


📝 Commits (2)

  • 9332f9e feat: add submit_xml method for posting XML as a string argument
  • 7da9da5 version: update to v0.1.49

📊 Changes

3 files changed (+70 additions, -2 deletions)

View changed files

📝 pyproject.toml (+1 -1)
📝 sophosfirewall_python/api_client.py (+51 -1)
📝 sophosfirewall_python/firewallapi.py (+18 -0)

📄 Description

Added the submit_xml method which provides the ability to pass in the XML payload needed to configure a feature as an argument to the method. The XML string can also use Jinja2 variable substitution by using {{ variable_name }} inside of the body.

EXAMPLE:

payload = """<MACHost>
  <Name>{{ name }}</Name>
<Description>{{ description }}</Description>
<Type>MACAddress</Type>
<MACAddress>00:16:76:49:33:CE</MACAddress>
</MACHost>"""

template_vars = {"name": "TestMacHost", "description": "Test MAC Host"}

fw.submit_xml(template_data=payload, template_vars=template_vars, debug=True)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sophos/sophos-firewall-sdk/pull/79 **Author:** [@mamullen13316](https://github.com/mamullen13316) **Created:** 8/28/2024 **Status:** ✅ Merged **Merged:** 8/28/2024 **Merged by:** [@mamullen13316](https://github.com/mamullen13316) **Base:** `main` ← **Head:** `submit_xml` --- ### 📝 Commits (2) - [`9332f9e`](https://github.com/sophos/sophos-firewall-sdk/commit/9332f9e852b5e05a4e4d00930fcbc23218edd37e) feat: add submit_xml method for posting XML as a string argument - [`7da9da5`](https://github.com/sophos/sophos-firewall-sdk/commit/7da9da5bd74891e1cb02a4bb7d0e612f9cc734b8) version: update to v0.1.49 ### 📊 Changes **3 files changed** (+70 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pyproject.toml` (+1 -1) 📝 `sophosfirewall_python/api_client.py` (+51 -1) 📝 `sophosfirewall_python/firewallapi.py` (+18 -0) </details> ### 📄 Description Added the `submit_xml` method which provides the ability to pass in the XML payload needed to configure a feature as an argument to the method. The XML string can also use Jinja2 variable substitution by using `{{ variable_name }}` inside of the body. EXAMPLE: ```python payload = """<MACHost> <Name>{{ name }}</Name> <Description>{{ description }}</Description> <Type>MACAddress</Type> <MACAddress>00:16:76:49:33:CE</MACAddress> </MACHost>""" template_vars = {"name": "TestMacHost", "description": "Test MAC Host"} fw.submit_xml(template_data=payload, template_vars=template_vars, debug=True) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 23:18:57 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sophos-firewall-sdk#78
No description provided.