mirror of
https://github.com/proxmoxer/proxmoxer.git
synced 2026-04-25 15:16:01 +03:00
[GH-ISSUE #100] Dot-Notation issue on /nodes/{node}/qemu/{vmid}/firewall/ipset/{name}/{cidr} #50
Labels
No labels
backend:https
backend:local
backend:openssh
backend:ssh_paramiko
pull-request
status:ansible-issue
status:help-wanted
status:info-needed
status:proxmox-issue
status:review-needed
type:bug 🐞
type:dependency ⛓️
type:docs 📝
type:enhancement ⏫
type:maintenance 🛠️
type:meta
type:question ❓
type:request ✋
type:testing 🧪
version:1.x
version:latest
version:py2
version:py3
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmoxer#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @d4fseeker on GitHub (May 14, 2022).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/100
Originally assigned to: @jhollowe on GitHub.
When trying to access the API-Path /nodes/{node}/qemu/{vmid}/firewall/ipset/{name}/{cidr} in Dot-Notation it seems impossible to execute it as it doesn't have a "verb" before the CIDR-Address in this case.
I would expect the following to work:
proxmoxer.nodes(node_name).qemu(vm_id).firewall.ipset(ipset_name,cidr_address).delete()However Dot-Notation building can be worked-around when using getattr to dynamically create the CIDR part of the API address:
getattr(proxmoxer.nodes(node_name).qemu(vm_id).firewall.ipset(ipset_name,cidr_address).delete()@jhollowe commented on GitHub (May 14, 2022):
you can only have one argument (can be an array) inside each parenthesis. Below are ways to do what you are wanting.
proxmoxer.nodes(node_name).qemu(vm_id).firewall.ipset(ipset_name)(cidr_address).delete()proxmoxer.nodes(node_name).qemu(vm_id).firewall.ipset([ipset_name,cidr_address]).delete()proxmoxer.nodes(node_name).qemu(vm_id).firewall.ipset(ipset_name).delete(cidr_address)