Put entries into object tables from command line?

Sep 17, 2020
315
20
38
Hello,

I was able to pull records from an object in the DB with command like
pmgsh get /config/ruledb/who/49/objects

Is there a way to put entries into an object via the command line?
I looked through what I could find documentation wise, but didn't find anything.

Thanks
 
yes, its a bit complicated

you look the id and otype from the object

pmgsh get /config/ruledb/who/{ogroup}/objects

here comes the 'problematic' part, there is a mapping of 'otype' to type (e.g. 1001 is 'regex'). sadly this is not completely documented...

then you use that type to generate a new api path

pmgsh get /config/ruledb/who/{group}/regex/{id}

here you can use also set or help

e.g.

pmgsh help --verbose /config/ruledb/who/{group}/regex/{id}
 
So lets say I get the objects using something like
pmgsh get /config/ruledb/who/49/objects

How can I push that to what objects?
(trying to avoid copy and pasting 40 rules, and I can write a script to potentially add to multiple object types.)

Thanks!!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!