Skip to content

lk-code/hetzner-cloud-api-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hetzner Cloud API for .NET

Hetzner Cloud API for .NET

.NET Version License Build Downloads NuGet

Lines of Code Vulnerabilities

Here you can find a .NET library for the Hetzner Cloud API, with which all functions of the endpoints can be used.

The current version is provided as .NET Standard 2.0, currently I am working on a new version for .NET 6 (with features like dependency injection, etc.)

Buy Me A Coffee

Hetzner Cloud API Client for .NET

installation

see the getting started page here https://github.com/lk-code/hetzner-cloud-api-net/wiki/getting-started

demo

see the demo projects here https://github.com/lk-code/hetzner-cloud-api-net-demo

documentation

see the documentation on https://github.com/lk-code/hetzner-cloud-api-net/wiki

informations :)

see the demo projects here https://github.com/lk-code/hetzner-cloud-api-net-demo

New Documentation for Hetzner Cloud API Client (based on v3-Client)

.NET Version License Build Downloads NuGet

Lines of Code Vulnerabilities

installation

The v3 client is currently only available as a prerelease. Accordingly, the "Include Prerelease" flag must be set in the NuGet search.

dotnet add package hetznercloudapi

usage

initialization

API Token via AppSettings

add the following block to your AppSettings:

{
    "HetznerCloud": {
        "ApiToken": "YOUR_API_TOKEN"
    }
}

Load API Token dynamically

Alternatively, the API token can also be set dynamically:

IHetznerCloudService _hetznerCloudService = {get instance via DI};

...

_hetznerCloudService.LoadApiToken("{YOUR_API_TOKEN}");

Server

Access via IServerService

Get all servers

Definition:

Task<Page<Server>> GetAllAsync(int page = 1,
    int itemsPerPage = 25,
    List<IFilter>? filter = null,
    Sorting<ServerSortField>? sorting = null,
    CancellationToken cancellationToken = default);

Contributors