/DigitalOcean.WebApi.Clients

Primary LanguageC#GNU General Public License v3.0GPL-3.0

DigitalOcean API

GitHub Actions status

Forked implementation heavily inspired by DigitalOcean.API and modernized to target current APIs. The underlying core now uses HttpClient and System.Text.Json instead of RestSharp and Newtonsoft which are now deprecated. Current targets are .NET 7

High Performance Async

Added cancellation tokens and leveraged high performance APIs like ValueTask to take advantage of the free upgrades of current versions of .NET

Install

DigitalOcean.API is available for install from NuGet and the GitHub Package Registry.

dotnet add package DigitalOcean.API

Example

var builder = WebApplication.CreateDefaultBuilder(args)

builder.AddDigitalOcean();

var request = new Droplet {
  Name = "example.com",
  Region = "nyc3",
  Size = "s-1vcpu-1gb",
  Image = "ubuntu-16-04-x64",
  SshKeys = new List<object> { 107149 },
  Backups = false,
  Ipv6 = true,
  Tags = new List<string> { "web" }
};

Droplets.CreateAsync(request, token);
var droplet = await client.Droplets.Create(request);

Documentation

Check out DigitalOcean's documentation of their API to see all possible interactions.

License

This project is licensed under the GNU General Public License Version 3(GPLv3) - see the LICENSE.md file for details.