1
0
Fork 0
mirror of https://github.com/Corsinvest/cv4pve-pepper.git synced 2025-02-14 19:11:50 +00:00

Add support shell api token

This commit is contained in:
Daniele Corsini 2020-07-30 15:22:20 +02:00
parent 63253f2a4e
commit 7accc64d68
3 changed files with 12 additions and 6 deletions

View file

@ -17,6 +17,7 @@ Options:
-?|-h|--help Show help information -?|-h|--help Show help information
--version Show version information --version Show version information
--host The host name host[:port],host1[:port],host2[:port] --host The host name host[:port],host1[:port],host2[:port]
--api-token Api token format 'USER@REALM!TOKENID=UUID'. Require Proxmox VE 6.2 or later
--username User name <username>@<realm> --username User name <username>@<realm>
--password The password. Specify 'file:path_file' to store password in file. --password The password. Specify 'file:path_file' to store password in file.
--vmid The id or name VM/CT --vmid The id or name VM/CT
@ -63,6 +64,13 @@ this software aims to simplify run SPICE client from Proxmox VE using command li
* Not require Web login * Not require Web login
* Support multiple host for HA in --host parameter es. host[:port],host1[:port],host2[:port] * Support multiple host for HA in --host parameter es. host[:port],host1[:port],host2[:port]
* Check-Update and Upgrade application * Check-Update and Upgrade application
* Use Api token --api-token parameter
## Api token
From version 6.2 of Proxmox VE is possible to use [Api token](https://pve.proxmox.com/pve-docs/pveum-plain.html).
This feature permit execute Api without using user and password.
If using **Privilege Separation** when create api token remember specify in permission.
## Configuration and use ## Configuration and use

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<Version>1.3.0</Version> <Version>1.3.1</Version>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>cv4pve-pepper</AssemblyName> <AssemblyName>cv4pve-pepper</AssemblyName>
<Company>Corsinvest Srl</Company> <Company>Corsinvest Srl</Company>
@ -19,6 +19,6 @@
<TrimmerRootAssembly Include="System.Net.WebClient" /> <TrimmerRootAssembly Include="System.Net.WebClient" />
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> --> <!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="2.5.3" /> <PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="2.6.3" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -22,8 +22,7 @@ namespace Corsinvest.ProxmoxVE.Pepper
{ {
static int Main(string[] args) static int Main(string[] args)
{ {
var app = ShellHelper.CreateConsoleApp("cv4pve-pepper", var app = ShellHelper.CreateConsoleApp("cv4pve-pepper", "Launching SPICE on Proxmox VE");
"Launching SPICE on Proxmox VE");
var optVmId = app.VmIdOrNameOption().DependOn(app, CommandOptionExtension.HOST_OPTION_NAME); var optVmId = app.VmIdOrNameOption().DependOn(app, CommandOptionExtension.HOST_OPTION_NAME);
var optRemoteViewer = app.Option("--viewer", var optRemoteViewer = app.Option("--viewer",
@ -40,10 +39,9 @@ namespace Corsinvest.ProxmoxVE.Pepper
if (ret) if (ret)
{ {
var process = new Process var process = new Process
{ {
StartInfo = new ProcessStartInfo() StartInfo = new ProcessStartInfo
{ {
UseShellExecute = false, UseShellExecute = false,
CreateNoWindow = true, CreateNoWindow = true,