Skip to content

Latest commit

 

History

History
101 lines (64 loc) · 4.42 KB

README.md

File metadata and controls

101 lines (64 loc) · 4.42 KB

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