mirror of
https://github.com/Tribufu/ProxmoxSharp
synced 2026-08-09 12:51:07 +00:00
Create basic api client
This commit is contained in:
parent
3f80ace7b8
commit
6d584cc063
29 changed files with 1008 additions and 1 deletions
27
src/Tribufu.Proxmox.Tests/Program.cs
Normal file
27
src/Tribufu.Proxmox.Tests/Program.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
|
||||
using dotenv.net;
|
||||
|
||||
namespace Tribufu.Proxmox.Tests
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
DotEnv.Load(new DotEnvOptions(ignoreExceptions: true, envFilePaths: [".env", "../../.env"]));
|
||||
|
||||
var clusterUrl = Environment.GetEnvironmentVariable("PROXMOX_CLUSTER_URL");
|
||||
var tokenId = Environment.GetEnvironmentVariable("PROXMOX_TOKEN_ID");
|
||||
var tokenSecret = Environment.GetEnvironmentVariable("PROXMOX_TOKEN_SECRET");
|
||||
|
||||
var proxmox = new ProxmoxClient(clusterUrl, tokenId, tokenSecret);
|
||||
|
||||
var nodes = await proxmox.ListNodesAsync();
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
Console.WriteLine($"- {node.Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue