Skip to content

Fork from OoRudYoO. Manage your Proxmox-Host in a very simple way without messing around with tokens/cookies

Notifications You must be signed in to change notification settings

SebastianHanz/PROXMOX-api-bash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Easy to use SHELL-script to manage your Proxmox-Host via API

Use Proxmox-API without complicated token/cookie handling, this script will do this for you!

Tested on Proxmox 7.1-12

What do I need?

  • Customize the script in the upper section with your own settings
  • The script on your system made executable with chmod +x ./proxmox_api.sh
  • A Proxmox user with the correct permissions for that specific command you want to execute
    (Note: User has to be created on Proxmox VE authentication server NOT Linux PAM )

What is possible?

  • Standard functions
    'Syntax: start|stop|reboot|resume|shutdown|suspend lxc|vm <vmid'>'

  • Use any possible API command available (see official documentation https://pve.proxmox.com/wiki/Proxmox_VE_API)
    Custom commands without retyping static URL part (https://$PROXMOX_NODE_IP:8006/api2/json/nodes/)"
    Syntax: custom GET|POST|PUT your/command/extending/static/url

  • Create/Delete LXCs with preconfigured settings with one command
    'Syntax: create|delete '

Examples?

Let's restart a VM, vmid 180 in this case:

/path/to/script/proxmox_api.sh restart vm 180

Now let's change the amount of RAM for LXC with ID 177 on our node called node3:

(Note: Use PUT, GET or POST like described in documentation)

/path/to/script/proxmox_api.sh custom PUT node3/lxc/177/config?memory=1024

Create a LXC like preconfigured in your script named "AdGuard-LXC" with vmid 189:

/path/to/script/proxmox_api.sh create 189 AdGuard-LXC

About

Fork from OoRudYoO. Manage your Proxmox-Host in a very simple way without messing around with tokens/cookies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%