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
Added cancellation tokens and leveraged high performance APIs like ValueTask to take advantage of the free upgrades of current versions of .NET
DigitalOcean.API is available for install from NuGet and the GitHub Package Registry.
dotnet add package DigitalOcean.API
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);
Check out DigitalOcean's documentation of their API to see all possible interactions.
This project is licensed under the GNU General Public License Version 3(GPLv3) - see the LICENSE.md file for details.