testing
This commit is contained in:
parent
a0159948e8
commit
02c3f7a18e
26
pve_test.py
Normal file
26
pve_test.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import config
|
||||||
|
from proxmoxer import ProxmoxAPI
|
||||||
|
|
||||||
|
pve_host = config.PVE_HOST
|
||||||
|
pve_user = config.PVE_USER
|
||||||
|
pve_pass = config.PVE_PASS
|
||||||
|
pve_node = 'c530'
|
||||||
|
|
||||||
|
|
||||||
|
proxmox = ProxmoxAPI(pve_host, user=pve_user, password=pve_pass, verify_ssl=False)
|
||||||
|
|
||||||
|
all_nodes = proxmox.nodes.get()
|
||||||
|
|
||||||
|
def shutdown_pve():
|
||||||
|
try:
|
||||||
|
proxmox.nodes(pve_node).status.shutdown.post()
|
||||||
|
print("Node is shutting down.")
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
for node in all_nodes:
|
||||||
|
name = node['node']
|
||||||
|
node_status = proxmox.nodes(name).status.get()
|
||||||
|
print(f"Node {name} Status: {node_status}")
|
||||||
|
|
||||||
|
# shutdown_pve()
|
Loading…
Reference in New Issue
Block a user