From 3541b8c655c10f6b3bd7018f2e37771289cf5445 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Wed, 19 Jan 2022 10:44:17 +0200 Subject: [PATCH] proxmox shutdown notes --- NetworkResurrector.sln | 7 ++++--- notes/proxmox-shutdown-notes.txt | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 notes/proxmox-shutdown-notes.txt diff --git a/NetworkResurrector.sln b/NetworkResurrector.sln index 4ba14d9..11223fc 100644 --- a/NetworkResurrector.sln +++ b/NetworkResurrector.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30002.166 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Server", "src\server\NetworkResurrector.Server\NetworkResurrector.Server.csproj", "{F6600491-5D79-4548-8745-59D9D337D3DB}" EndProject @@ -69,9 +69,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "notes", "notes", "{6973CB33 ProjectSection(SolutionItems) = preProject notes\generic.txt = notes\generic.txt notes\nugets.txt = notes\nugets.txt + notes\proxmox-shutdown-notes.txt = notes\proxmox-shutdown-notes.txt EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetworkResurrector.Agent.Wrapper", "src\agent\NetworkResurrector.Agent.Wrapper\NetworkResurrector.Agent.Wrapper.csproj", "{3624DFF4-C692-42F8-BDC2-1C2107E6EDC8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Agent.Wrapper", "src\agent\NetworkResurrector.Agent.Wrapper\NetworkResurrector.Agent.Wrapper.csproj", "{3624DFF4-C692-42F8-BDC2-1C2107E6EDC8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/notes/proxmox-shutdown-notes.txt b/notes/proxmox-shutdown-notes.txt new file mode 100644 index 0000000..6dde3bd --- /dev/null +++ b/notes/proxmox-shutdown-notes.txt @@ -0,0 +1,16 @@ +Hi Guys +So long story short I want to shut down my physical server that is running Proxmox VE using the API. I am fairly new to using API but what I have found thus far is this: +curl https://yourip:8006/api2/json//nodes/proxmox/stop -k -d 'username=root@pam&password=yourpassword' +Above does not seem to work, Anyone able to assist and just provide the correct curl to use + +Thanx + +!!!!!!! +Please don't use the root user for that. It is possible to create a new user, name it "shutdown" or something like that, create a new role like "shutdown", add the "shutdown" role to the "shutdown" user. If you then only give that role the rights to use "Sys.PowerMgmt" that user is only allowed to start/shutdown/reboot the node. +Never a good idea to use the root user and its password in clear text. The password could end up in logs if the command fails to execute and so on. + + + +URLS: +https://pve.proxmox.com/wiki/Proxmox_VE_API +https://forum.proxmox.com/threads/shutdown-the-server-via-api.98125/