How to Execute shell command properly

CheeseRat007

New Member
Apr 25, 2024
2
0
1
Hi Guys, I am new to proxmox. I am currently using the Corsinvest C# API to interface with proxmox.

Execute API: https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/execute


I am trying to execute the cmd "ip link show vmbr1", but it says bad format. What changes should I do to the parameters to get it working.

Thanks in advance.

Code:
var cmd = "ip link show vmbr1";

var cmdObj = new[]
{
    new
    {
    args = cmd,
    method = "GET",
    path = ""
    },
};
var cmdSerialized = JsonConvert.SerializeObject(cmdObj);
var cmdExecuteResult = await node1Obj.Execute.Execute(cmdSerialized);
 
the commands this endpoint is referring to are calls to PVE API endpoints, not generic shell commands..
 
the commands this endpoint is referring to are calls to PVE API endpoints, not generic shell commands..
How would I call the shell cmd using PVE API.

Also is there a way to obtain the Mac address associated with the bridge using the API. The network configuration API does not return the Mac address. So far only this worked in shell cmd.
"ip link show vmbr1"
 
I am not sure we expose the MAC anywhere on the API except in the report endpoint. there is no "execute arbitrary command on node" endpoint either..
 

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!