CloudflareClient 0.1.0

dotnet add package CloudflareClient --version 0.1.0
NuGet\Install-Package CloudflareClient -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CloudflareClient" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CloudflareClient --version 0.1.0
#r "nuget: CloudflareClient, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CloudflareClient as a Cake Addin
#addin nuget:?package=CloudflareClient&version=0.1.0

// Install CloudflareClient as a Cake Tool
#tool nuget:?package=CloudflareClient&version=0.1.0

Endpoints Implemented

User (CloudFlare ref): Get Details, Update

Zone (CloudFlare ref): Create, Get Details, Delete, List

Load Balancer (CloudFlare ref): Create, Get Details, Delete, List

Load Balancer Pool (CloudFlare ref): Create, Get Details, Delete, List, Add Origin, Delete Origin, Set Minimum Origins

Load Balancer Monitor (CloudFlare ref): Create, Get Details, Delete, List

Get Started

To use this library first add it to your C# project

$ dotnet add package CloudflareClient

Set your CloudFlare API credentials. Refer to the API keys area of the CloudFlare docs for more info.

var _xAuthEmail = "<YOUR_EMAIL>";
var _xAuthKey = "<YOUR_KEY>";

Create an instance of the client and construct the desired endpoint class.

var apiClient = new ApiClient(new Configuration(_xAuthEmail,_xAuthKey));
var loadBalancerPoolApi = new LoadBalancerPoolApi(apiClient);

Make a call to an endpoint

var loadBalancerPools = await loadBalancerPoolApi.ListLoadBalancerPoolsAsync();

Features

The client uses RestSharp for all HTTP interactions. The design has been influenced by the patterns in openapi-generator C# template as well as the kubernetes C# client.

Along with the obvious crud actions the load balancer pool object has some added benefits.

  1. Re-balance origin weight: when an origin is added/removed, equal weight can be (optionally) recalculated between all of them.
  2. Logical pool validation: when any change or additions are made to a pool, they are validated for logic. Things like is there at least 1 origin, and is the minimum origin equal to or less than the origin count.

Unless overridden, the client will assume a base path of https://api.cloudflare.com/client/v4.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 829 8/27/2021