Unofficial API client for managing Outline server
$ dotnet add package OutlineClientBuild the project yourself and connect it to the project as a .dll or install the nuget package OutlineClient
using TDV.OutlineClient;
var _client = new OutlineClient(apiUrl, certSha256)
where
apiUrl - server url, like https://127.0.0.1:51083/xlUG4F5BBft4rSrIvDSWuw/. Should be ended on the / char
certSha256 - certificate hash, like A7B693EF6582E719F578764D7CE407930DF177B4433ECDD22402FB12162CA7BF
var info = await _client.Server.Info();
await _client.Server.Rename("New server name");
int newPort = 12332;
await _client.Server.SetPortForNewAccessKeys(newPort);
long bytesLimit = 500000;
await _client.Server.SetDataLimit(bytesLimit);
await _client.Server.DeleteDataLimit();
List<AccessKey> keys = await _client.AccessKeys.List();
string keyId = "2";
AccessKey key = await _client.AccessKeys.Get(keyId);
AccessKey key1 = await _client.AccessKeys.New();
// or
AccessKey key2 = await _client.AccessKeys.New(method, id, name, password, port, limit);
mehtod - aes-192-gcm or chacha20-ietf-poly1305. aes-192-gcm by default
await _client.AccessKeys.Delete("2");
string keyId = "2";
await _client.AccessKeys.Rename(keyId, "New key name");
string keyId = "2";
long bytesLimit = 500000;
await _client.AccessKeys.SetDataLimit(keyId, bytesLimit);
string keyId = "2";
await _client.AccessKeys.DeleteDataLimit(keyId);
List<MetricsTransfer> sut = await _client.Metrics.List();
To run tests, set the apiUrl and certSha256 enviromen variables for OutlineClient.Test project