[GH-ISSUE #73] Unable to update ipsets #39

Closed
opened 2026-02-27 15:46:08 +03:00 by kerem · 2 comments
Owner

Originally created by @xkill on GitHub (Nov 5, 2021).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/73

Hi,

I'm trying to use the library to check, add or update ipsets, but, as the IP addresses contains . it is not possible.

DOC: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/cluster/firewall/ipset/{name}/{cidr}

So I have to create a call like:



from proxmoxer import ProxmoxAPI
proxmox = ProxmoxAPI(PROXMOX_HOST, user=USER_NAME, token_name=TOKEN_NAME, token_value=TOKEN_SECRET, verify_ssl=False)

CheckIP='1.2.3.4'


# Adding a IP into the blacklist IPset
proxmox.cluster.firewall.ipset.blacklist.post(cidr='1.2.3.4',comment='test asdf')

# Getting the IP from blacklist IPset
MyIP=proxmox.cluster.firewall.ipset.blacklist.get('1.2.3.4')

# MyIP = {'digest': 'randomstring',
# 'comment': 'test asdf',
# 'cidr': '1.2.3.4'}

# Updating the IP
# ????
# should be something like:

proxmox.cluster.firewall.ipset.blacklist.1.2.3.4.put(comment='new comment')
# but . is a special character in python, so it is not possible except the library changes another character to `.` on the API call.

Same problem for delete, which should be:

proxmox.cluster.firewall.ipset.blacklist.1.2.3.4.delete()
Originally created by @xkill on GitHub (Nov 5, 2021). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/73 Hi, I'm trying to use the library to check, add or update ipsets, but, as the IP addresses contains `.` it is not possible. DOC: [https://pve.proxmox.com/pve-docs/api-viewer/index.html#/cluster/firewall/ipset/{name}/{cidr}](https://pve.proxmox.com/pve-docs/api-viewer/index.html#/cluster/firewall/ipset/{name}/{cidr}) So I have to create a call like: ```python from proxmoxer import ProxmoxAPI proxmox = ProxmoxAPI(PROXMOX_HOST, user=USER_NAME, token_name=TOKEN_NAME, token_value=TOKEN_SECRET, verify_ssl=False) CheckIP='1.2.3.4' # Adding a IP into the blacklist IPset proxmox.cluster.firewall.ipset.blacklist.post(cidr='1.2.3.4',comment='test asdf') # Getting the IP from blacklist IPset MyIP=proxmox.cluster.firewall.ipset.blacklist.get('1.2.3.4') # MyIP = {'digest': 'randomstring', # 'comment': 'test asdf', # 'cidr': '1.2.3.4'} # Updating the IP # ???? # should be something like: proxmox.cluster.firewall.ipset.blacklist.1.2.3.4.put(comment='new comment') # but . is a special character in python, so it is not possible except the library changes another character to `.` on the API call. ``` Same problem for delete, which should be: ```python proxmox.cluster.firewall.ipset.blacklist.1.2.3.4.delete() ```
kerem 2026-02-27 15:46:08 +03:00
Author
Owner

@jhollowe commented on GitHub (Nov 5, 2021):

You will want to use proxmox.cluster.firewall.ipset.blacklist("1.2.3.4").put(comment='new comment')

I'm still working on the new documentation, but you can check out the Basic Usage page to learn how to fully use the dotted notation.

<!-- gh-comment-id:962228705 --> @jhollowe commented on GitHub (Nov 5, 2021): You will want to use `proxmox.cluster.firewall.ipset.blacklist("1.2.3.4").put(comment='new comment')` I'm still working on the new documentation, but you can check out the [Basic Usage](https://proxmoxer.github.io/docs/basic_usage/#dotted-notation) page to learn how to fully use the dotted notation.
Author
Owner

@jhollowe commented on GitHub (Nov 13, 2021):

I'm going to go ahead and close this, but if you are still having issues, please feel free to reopen or comment.

<!-- gh-comment-id:968114565 --> @jhollowe commented on GitHub (Nov 13, 2021): I'm going to go ahead and close this, but if you are still having issues, please feel free to reopen or comment.
Sign in to join this conversation.
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/proxmoxer#39
No description provided.