Discussion:
[PVE-User] View firewall rule with pvesh
Yannick Palanque
2018-11-01 15:05:16 UTC
Permalink
Hello,

I run PVE 5.2.

I hope it isn't a silly question but I searched quite long.

I want to view a firewall rule with the API and pvesh.
With
pvesh get /nodes/toto/qemu/107/firewall/rules/
I can view that I have 6 firewall rules.

I can easily delete a rule with
pvesh delete /nodes/toto/qemu/107/firewall/rules/7

I thought that I could view a particular rule but I can't have more
information than:
pvesh get /nodes/toto/qemu/107/firewall/rules/5
┌─────┬───────┐
│ key │ value │
├─────┼───────┤
│ pos │ 5 │
└─────┴───────┘

The API viewer describes "Get single rule data" still.
Is there a way to view the settings for a particular rule?


And a remark:
It's written on <https://pve.proxmox.com/wiki/Proxmox_VE_API> that
pvesh "can be run interactively" (entering PVE shell) but it doesn't
work ("ERROR: no command specified").



Yannick
Dietmar Maurer
2018-11-01 17:26:47 UTC
Permalink
Post by Yannick Palanque
I thought that I could view a particular rule but I can't have more
pvesh get /nodes/toto/qemu/107/firewall/rules/5
┌─────┬───────┐
│ key │ value │
├─────┼───────┤
│ pos │ 5 │
└─────┴───────┘
The API viewer describes "Get single rule data" still.
Is there a way to view the settings for a particular rule?
The default formatter does not show all values (bug), but you can
get the full information with:

# pvesh get /nodes/toto/qemu/107/firewall/rules/5 --output-format json

(you can use output format 'json', 'yaml', or 'json-pretty')

Loading...