master
Tudor Stanciu 2022-01-19 11:31:24 +02:00
parent d83b321968
commit 4a4f9c6bb4
2 changed files with 32 additions and 0 deletions

View File

@ -5,6 +5,17 @@ VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxmoxConnector.Tester", "ProxmoxConnector.Tester\ProxmoxConnector.Tester.csproj", "{A0C0198B-8327-4DC5-8577-0B55DF0F06A4}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxmoxConnector.Tester", "ProxmoxConnector.Tester\ProxmoxConnector.Tester.csproj", "{A0C0198B-8327-4DC5-8577-0B55DF0F06A4}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{E73280D9-92D3-4894-B0CA-43AEADB86FD2}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "notes", "notes", "{3C571A15-3810-4F6D-8C61-DC97A8428C7A}"
ProjectSection(SolutionItems) = preProject
notes\pve-api.txt = notes\pve-api.txt
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -19,6 +30,9 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3C571A15-3810-4F6D-8C61-DC97A8428C7A} = {E73280D9-92D3-4894-B0CA-43AEADB86FD2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2BE248DF-16B1-42EF-9A34-C3FE5359D418} SolutionGuid = {2BE248DF-16B1-42EF-9A34-C3FE5359D418}
EndGlobalSection EndGlobalSection

18
notes/pve-api.txt Normal file
View File

@ -0,0 +1,18 @@
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***REMOVED***/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/
https://github.com/Corsinvest/cv4pve-api-dotnet