Create basic api client

This commit is contained in:
Guilherme Werner 2025-04-13 11:10:45 -03:00
parent 3f80ace7b8
commit 6d584cc063
29 changed files with 1008 additions and 1 deletions

View 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}");
}
}
}
}