From b5482bfd4e4f4f69b3ff3c210c54d00dfb97b895 Mon Sep 17 00:00:00 2001 From: tjoubert Date: Sun, 1 May 2022 17:41:22 +0400 Subject: [PATCH 1/5] Admin endpoints --- .../AdminApi/AdminApiClient.cs | 168 ++++++++++++++++++ .../AdminApi/IAdminApiClient.cs | 56 ++++++ .../AdminApi/Models/EngineAlias.cs | 7 + .../AdminApi/Models/EngineAliasIndex.cs | 8 + .../AdminApi/Models/EngineSupports.cs | 11 ++ .../AdminApi/Models/GetLogsQuery.cs | 56 ++++++ .../AdminApi/Models/GetLogsResponse.cs | 14 ++ .../Models/GetServerEngineTypeResponse.cs | 11 ++ .../AdminApi/Models/GetServerIdResponse.cs | 10 ++ .../AdminApi/Models/GetServerRoleResponse.cs | 19 ++ .../Models/GetServerVersionResponse.cs | 12 ++ .../AdminApi/Models/LogLevel.cs | 12 ++ .../AdminApi/Models/LogMessage.cs | 14 ++ .../AdminApi/Models/ResponseBase.cs | 21 +++ 14 files changed, 419 insertions(+) create mode 100644 arangodb-net-standard/AdminApi/AdminApiClient.cs create mode 100644 arangodb-net-standard/AdminApi/IAdminApiClient.cs create mode 100644 arangodb-net-standard/AdminApi/Models/EngineAlias.cs create mode 100644 arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs create mode 100644 arangodb-net-standard/AdminApi/Models/EngineSupports.cs create mode 100644 arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs create mode 100644 arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs create mode 100644 arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs create mode 100644 arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs create mode 100644 arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs create mode 100644 arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs create mode 100644 arangodb-net-standard/AdminApi/Models/LogLevel.cs create mode 100644 arangodb-net-standard/AdminApi/Models/LogMessage.cs create mode 100644 arangodb-net-standard/AdminApi/Models/ResponseBase.cs diff --git a/arangodb-net-standard/AdminApi/AdminApiClient.cs b/arangodb-net-standard/AdminApi/AdminApiClient.cs new file mode 100644 index 00000000..058e6178 --- /dev/null +++ b/arangodb-net-standard/AdminApi/AdminApiClient.cs @@ -0,0 +1,168 @@ +using System.Net; +using System.Threading.Tasks; +using ArangoDBNetStandard.Serialization; +using ArangoDBNetStandard.Transport; +using ArangoDBNetStandard.AdminApi.Models; + +namespace ArangoDBNetStandard.AdminApi +{ + /// + /// A client for interacting with ArangoDB Index endpoints, + /// implementing . + /// + public class AdminApiClient : ApiClientBase, IAdminApiClient + { + /// + /// The transport client used to communicate with the ArangoDB host. + /// + protected IApiClientTransport _client; + + /// + /// The root path of the API. + /// + protected readonly string _adminApiPath = "_admin"; + + /// + /// Creates an instance of + /// using the provided transport layer and the default JSON serialization. + /// + /// Transport client that the API client will use to communicate with ArangoDB + public AdminApiClient(IApiClientTransport client) + : base(new JsonNetApiClientSerialization()) + { + _client = client; + } + + /// + /// Creates an instance of + /// using the provided transport and serialization layers. + /// + /// Transport client that the API client will use to communicate with ArangoDB. + /// Serializer to be used. + public AdminApiClient(IApiClientTransport client, IApiClientSerialization serializer) + : base(serializer) + { + _client = client; + } + + /// + /// Retrieves log messages from the server. + /// GET /_admin/log/entries + /// + /// Query string parameters + /// + public virtual async Task GetLogsAsync(GetLogsQuery query) + { + string uri = $"{_adminApiPath}/log/entries"; + if (query != null) + { + uri += '?' + query.ToQueryString(); + } + using (var response = await _client.GetAsync(uri).ConfigureAwait(false)) + { + if (response.IsSuccessStatusCode) + { + var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + return DeserializeJsonFromStream(stream); + } + throw await GetApiErrorException(response).ConfigureAwait(false); + } + } + + /// + /// Reloads the routing table. + /// POST /_admin/routing/reload + /// + /// + public virtual async Task PostReloadRoutingInfoAsync() + { + string uri = $"{_adminApiPath}/routing/reload"; + var body = new byte[] { }; + using (var response = await _client.PostAsync(uri, body).ConfigureAwait(false)) + { + if (response.IsSuccessStatusCode) + { + return true; + } + throw await GetApiErrorException(response).ConfigureAwait(false); + } + } + + /// + /// Retrieves the internal id of the server. + /// The method will fail if the server is not running in cluster mode. + /// GET /_admin/server/id + /// + /// + public virtual async Task GetServerIdAsync() + { + string uri = $"{_adminApiPath}/server/id"; + using (var response = await _client.GetAsync(uri).ConfigureAwait(false)) + { + if (response.IsSuccessStatusCode) + { + var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + return DeserializeJsonFromStream(stream); + } + throw await GetApiErrorException(response).ConfigureAwait(false); + } + } + + /// + /// Retrieves the role of the server in a cluster. + /// GET /_admin/server/role + /// + /// + public virtual async Task GetServerRoleAsync() + { + string uri = $"{_adminApiPath}/server/role"; + using (var response = await _client.GetAsync(uri).ConfigureAwait(false)) + { + if (response.IsSuccessStatusCode) + { + var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + return DeserializeJsonFromStream(stream); + } + throw await GetApiErrorException(response).ConfigureAwait(false); + } + } + + /// + /// Retrieves the server database engine type. + /// GET /_api/engine + /// + /// + public virtual async Task GetServerEngineTypeAsync() + { + string uri = "_api/engine"; + using (var response = await _client.GetAsync(uri).ConfigureAwait(false)) + { + if (response.IsSuccessStatusCode) + { + var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + return DeserializeJsonFromStream(stream); + } + throw await GetApiErrorException(response).ConfigureAwait(false); + } + } + + /// + /// Retrieves the server version. + /// GET /_api/version + /// + /// + public virtual async Task GetServerVersionAsync() + { + string uri = "_api/version"; + using (var response = await _client.GetAsync(uri).ConfigureAwait(false)) + { + if (response.IsSuccessStatusCode) + { + var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + return DeserializeJsonFromStream(stream); + } + throw await GetApiErrorException(response).ConfigureAwait(false); + } + } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/IAdminApiClient.cs b/arangodb-net-standard/AdminApi/IAdminApiClient.cs new file mode 100644 index 00000000..ab3beefc --- /dev/null +++ b/arangodb-net-standard/AdminApi/IAdminApiClient.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using ArangoDBNetStandard.AdminApi.Models; + +namespace ArangoDBNetStandard.AdminApi +{ + /// + /// Defines a client to access the ArangoDB Admin API. + /// + public interface IAdminApiClient + { + /// + /// Retrieves log messages from the server. + /// GET /_admin/log/entries + /// + /// Query string parameters + /// + Task GetLogsAsync(GetLogsQuery query); + + /// + /// Reloads the routing table. + /// POST /_admin/routing/reload + /// + /// + Task PostReloadRoutingInfoAsync(); + + /// + /// Retrieves the internal id of the server. + /// The method will fail if the server is not running in cluster mode. + /// GET /_admin/server/id + /// + /// + Task GetServerIdAsync(); + + /// + /// Retrieves the role of the server in a cluster. + /// GET /_admin/server/role + /// + /// + Task GetServerRoleAsync(); + + /// + /// Retrieves the server database engine type. + /// GET /_api/engine + /// + /// + Task GetServerEngineTypeAsync(); + + /// + /// Retrieves the server version. + /// GET /_api/version + /// + /// + Task GetServerVersionAsync(); + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/EngineAlias.cs b/arangodb-net-standard/AdminApi/Models/EngineAlias.cs new file mode 100644 index 00000000..29b655b8 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/EngineAlias.cs @@ -0,0 +1,7 @@ +namespace ArangoDBNetStandard.AdminApi.Models +{ + public class EngineAlias + { + public EngineAliasIndex Indexes { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs b/arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs new file mode 100644 index 00000000..537c0fc4 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs @@ -0,0 +1,8 @@ +namespace ArangoDBNetStandard.AdminApi.Models +{ + public class EngineAliasIndex + { + public string Skiplist { get; set; } + public string Hash { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/EngineSupports.cs b/arangodb-net-standard/AdminApi/Models/EngineSupports.cs new file mode 100644 index 00000000..67290840 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/EngineSupports.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace ArangoDBNetStandard.AdminApi.Models +{ + public class EngineSupports + { + public bool DFDB { get; set; } + public IList Indexes { get; set; } + public EngineAlias Aliases { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs b/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs new file mode 100644 index 00000000..bfce419e --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; + +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Parameters for + /// + public class GetLogsQuery + { + public LogLevel? UpTo { get; set; } + public LogLevel? Level { get; set; } + public long? Start { get; set; } + public long? Size { get; set; } + public long? Offset { get; set; } + public string Search { get; set; } + public string Sort { get; set; } + public string ServerId { get; set; } + internal string ToQueryString() + { + var queryParams = new List(); + if (UpTo != null) + { + queryParams.Add("upto=" + ((int)UpTo).ToString()); + } + if (Level != null) + { + queryParams.Add("level=" + UpTo.ToString()); + } + if (Start != null) + { + queryParams.Add("start=" + Start.ToString()); + } + if (Size != null) + { + queryParams.Add("size=" + Size.ToString()); + } + if (Offset != null) + { + queryParams.Add("offset=" + Offset.ToString()); + } + if (!string.IsNullOrEmpty(Search)) + { + queryParams.Add("search=" + Search); + } + if (!string.IsNullOrEmpty(Sort)) + { + queryParams.Add("sort=" + Sort); + } + if (!string.IsNullOrEmpty(ServerId)) + { + queryParams.Add("serverId=" + ServerId); + } + return string.Join("&", queryParams); + } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs b/arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs new file mode 100644 index 00000000..0b8c92c5 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Text; + +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Response from + /// + public class GetLogsResponse + { + public int Total { get; set; } + public List Messages { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs new file mode 100644 index 00000000..ccb8a28b --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs @@ -0,0 +1,11 @@ +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Response from + /// + public class GetServerEngineTypeResponse + { + public string Name { get; set; } + public EngineSupports Supports { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs new file mode 100644 index 00000000..fa255598 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs @@ -0,0 +1,10 @@ +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Response from + /// + public class GetServerIdResponse : ResponseBase + { + public string Id { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs new file mode 100644 index 00000000..b7c660d6 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs @@ -0,0 +1,19 @@ +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Response from + /// + public class GetServerRoleResponse : ResponseBase + { + /// + /// Possible values for role are: + /// SINGLE: the server is a standalone server without clustering. + /// COORDINATOR: the server is a Coordinator in a cluster. + /// PRIMARY: the server is a DB-Server in a cluster. + /// SECONDARY: this role is not used anymore. + /// AGENT: the server is an Agency node in a cluster. + /// UNDEFINED: the server is in a cluster, but its role cannot be determined. + /// + public string Role { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs new file mode 100644 index 00000000..b2c5b1ca --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs @@ -0,0 +1,12 @@ +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Response from + /// + public class GetServerVersionResponse + { + public string Server { get; set; } + public string License { get; set; } + public string Version { get; set; } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/LogLevel.cs b/arangodb-net-standard/AdminApi/Models/LogLevel.cs new file mode 100644 index 00000000..029e6439 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/LogLevel.cs @@ -0,0 +1,12 @@ +namespace ArangoDBNetStandard.AdminApi.Models +{ + public enum LogLevel + { + Fatal = 0, + Error = 1, + Warning = 2, + Info = 3, + Debug = 4 + } + +} diff --git a/arangodb-net-standard/AdminApi/Models/LogMessage.cs b/arangodb-net-standard/AdminApi/Models/LogMessage.cs new file mode 100644 index 00000000..147fa9ea --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/LogMessage.cs @@ -0,0 +1,14 @@ +using System; + +namespace ArangoDBNetStandard.AdminApi.Models +{ + public class LogMessage + { + public int Id { get; set; } + public string Topic { get; set; } + public string Level { get; set; } + public DateTime Date { get; set; } + public string Message { get; set; } + } + +} diff --git a/arangodb-net-standard/AdminApi/Models/ResponseBase.cs b/arangodb-net-standard/AdminApi/Models/ResponseBase.cs new file mode 100644 index 00000000..82e91561 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/ResponseBase.cs @@ -0,0 +1,21 @@ +using System.Net; + +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Represents a common response class for Admin API operations. + /// + public class ResponseBase + { + /// + /// Indicates whether an error occurred + /// + public bool Error { get; set; } + + /// + /// The HTTP status code. + /// + public HttpStatusCode Code { get; set; } + } + +} From eb8d9d28faa20fea70d0ece8c019d33293f34b55 Mon Sep 17 00:00:00 2001 From: tjoubert Date: Mon, 2 May 2022 11:11:30 +0400 Subject: [PATCH 2/5] Admin tests and documentation --- .../AdminApi/AdminApiClientTest.cs | 90 +++++++++++++++++++ .../AdminApi/AdminApiClientTestFixture.cs | 41 +++++++++ .../AdminApi/AdminApiClient.cs | 2 +- .../AdminApi/IAdminApiClient.cs | 2 +- .../AdminApi/Models/GetLogsQuery.cs | 60 +++++++++++++ .../AdminApi/Models/GetLogsResponse.cs | 9 +- .../Models/GetServerEngineTypeResponse.cs | 9 +- .../AdminApi/Models/GetServerIdResponse.cs | 5 +- .../AdminApi/Models/GetServerRoleResponse.cs | 3 +- .../Models/GetServerVersionResponse.cs | 13 ++- .../AdminApi/Models/LogLevel.cs | 6 +- .../AdminApi/Models/LogMessage.cs | 25 +++++- arangodb-net-standard/ArangoDBClient.cs | 13 ++- arangodb-net-standard/IArangoDBClient.cs | 12 ++- project/roadmap.md | 9 ++ 15 files changed, 282 insertions(+), 17 deletions(-) create mode 100644 arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs create mode 100644 arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs diff --git a/arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs b/arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs new file mode 100644 index 00000000..2a12ade2 --- /dev/null +++ b/arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs @@ -0,0 +1,90 @@ +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using ArangoDBNetStandard; +using ArangoDBNetStandard.AdminApi; +using ArangoDBNetStandard.AdminApi.Models; +using ArangoDBNetStandard.Transport; +using Moq; +using Xunit; + +namespace ArangoDBNetStandardTest.IndexApi +{ + public class AdminApiClientTest : IClassFixture, IAsyncLifetime + { + private AdminApiClient _adminApi; + private ArangoDBClient _adb; + + public AdminApiClientTest(AdminApiClientTestFixture fixture) + { + _adb = fixture.ArangoDBClient; + _adminApi = _adb.Admin; + } + + public Task InitializeAsync() + { + return Task.CompletedTask; + } + + public Task DisposeAsync() + { + return Task.CompletedTask; + } + + [Fact] + public async Task GetLogsAsync_ShouldSucceed() + { + var getResponse = await _adminApi.GetLogsAsync(); + Assert.NotNull(getResponse); + } + + [Fact] + public async Task PostReloadRoutingInfoAsync_ShouldSucceed() + { + var postResponse = await _adminApi.PostReloadRoutingInfoAsync(); + Assert.True(postResponse); + } + + /// + /// This test will run only in a cluster + /// + /// + [Fact] + [Trait("RunningMode", "Cluster")] + public async Task GetServerIdAsync_ShouldSucceed() + { + var getResponse = await _adminApi.GetServerIdAsync(); + Assert.NotNull(getResponse); + Assert.False(getResponse.Error); + Assert.NotNull(getResponse.Id); + } + + [Fact] + public async Task GetServerRoleAsync_ShouldSucceed() + { + var getResponse = await _adminApi.GetServerRoleAsync(); + Assert.NotNull(getResponse); + Assert.False(getResponse.Error); + Assert.NotNull(getResponse.Role); + } + + [Fact] + public async Task GetServerEngineTypeAsync_ShouldSucceed() + { + var getResponse = await _adminApi.GetServerEngineTypeAsync(); + Assert.NotNull(getResponse); + Assert.NotNull(getResponse.Name); + } + + [Fact] + public async Task GetServerVersionAsync_ShouldSucceed() + { + var getResponse = await _adminApi.GetServerVersionAsync(); + Assert.NotNull(getResponse); + Assert.NotNull(getResponse.License); + Assert.NotNull(getResponse.Version); + Assert.NotNull(getResponse.Server); + } + } +} \ No newline at end of file diff --git a/arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs b/arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs new file mode 100644 index 00000000..0129136f --- /dev/null +++ b/arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs @@ -0,0 +1,41 @@ +using ArangoDBNetStandard; +using ArangoDBNetStandard.CollectionApi.Models; +using ArangoDBNetStandard.IndexApi.Models; +using System; +using System.Threading.Tasks; + +namespace ArangoDBNetStandardTest.IndexApi +{ + public class AdminApiClientTestFixture : ApiClientTestFixtureBase + { + public ArangoDBClient ArangoDBClient { get; internal set; } + + public AdminApiClientTestFixture() + { + } + + public override async Task InitializeAsync() + { + await base.InitializeAsync(); + string dbName = nameof(AdminApiClientTestFixture); + await CreateDatabase(dbName); + Console.WriteLine("Database " + dbName + " created successfully"); + ArangoDBClient = GetArangoDBClient(dbName); + try + { + var dbRes = await ArangoDBClient.Database.GetCurrentDatabaseInfoAsync(); + if (dbRes.Error) + throw new Exception("GetCurrentDatabaseInfoAsync failed: " + dbRes.Code.ToString()); + else + { + Console.WriteLine("Running tests in database " + dbRes.Result.Name); + } + } + catch (ApiErrorException ex) + { + Console.WriteLine(ex.Message); + throw ex; + } + } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/AdminApiClient.cs b/arangodb-net-standard/AdminApi/AdminApiClient.cs index 058e6178..ead62046 100644 --- a/arangodb-net-standard/AdminApi/AdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/AdminApiClient.cs @@ -51,7 +51,7 @@ public AdminApiClient(IApiClientTransport client, IApiClientSerialization serial /// /// Query string parameters /// - public virtual async Task GetLogsAsync(GetLogsQuery query) + public virtual async Task GetLogsAsync(GetLogsQuery query = null) { string uri = $"{_adminApiPath}/log/entries"; if (query != null) diff --git a/arangodb-net-standard/AdminApi/IAdminApiClient.cs b/arangodb-net-standard/AdminApi/IAdminApiClient.cs index ab3beefc..860f5a19 100644 --- a/arangodb-net-standard/AdminApi/IAdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/IAdminApiClient.cs @@ -15,7 +15,7 @@ public interface IAdminApiClient /// /// Query string parameters /// - Task GetLogsAsync(GetLogsQuery query); + Task GetLogsAsync(GetLogsQuery query = null); /// /// Reloads the routing table. diff --git a/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs b/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs index bfce419e..8864611e 100644 --- a/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs +++ b/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs @@ -7,14 +7,74 @@ namespace ArangoDBNetStandard.AdminApi.Models /// public class GetLogsQuery { + public const string SortAscending = "asc"; + public const string SortDescending = "desc"; + + /// + /// Optional. Retrieves all log entries + /// up to this log level. + /// public LogLevel? UpTo { get; set; } + + /// + /// Optional. Retrieves all log entries + /// of this log level. Note that the query + /// parameters and + /// are mutually exclusive. + /// public LogLevel? Level { get; set; } + + /// + /// Optional. Retrieves all log entries + /// that their log entry identifier (lid value) + /// is greater or equal to this value. + /// public long? Start { get; set; } + + /// + /// Optional. Specifies the number of + /// log entries to retrieve. + /// public long? Size { get; set; } + + /// + /// Optional. Specifies the number of + /// records to skip when retrieving + /// log entries. + /// and + /// can be used for pagination. + /// public long? Offset { get; set; } + + /// + /// Optional. Retrieves all log entries + /// containing this text string. + /// public string Search { get; set; } + + /// + /// Optional. Specify whether to sort + /// log entries in ascending or descending order. + /// Only or + /// are accepted here. + /// Log entries are sorted by their Id values. + /// The default value is . + /// public string Sort { get; set; } + + /// + /// Optional. Retrieves all log entries of + /// the specified server. All other query + /// parameters remain valid. If no serverId + /// is given, the asked server will reply. + /// This parameter is only meaningful on Coordinators. + /// public string ServerId { get; set; } + + /// + /// Generates the querystring + /// + /// internal string ToQueryString() { var queryParams = new List(); diff --git a/arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs b/arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs index 0b8c92c5..d0ff6233 100644 --- a/arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs +++ b/arangodb-net-standard/AdminApi/Models/GetLogsResponse.cs @@ -4,11 +4,18 @@ namespace ArangoDBNetStandard.AdminApi.Models { /// - /// Response from + /// Returned by /// public class GetLogsResponse { + /// + /// The total amount of log entries before pagination + /// public int Total { get; set; } + + /// + /// List of log messages that matched the criteria + /// public List Messages { get; set; } } } \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs index ccb8a28b..4bb6dd98 100644 --- a/arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs +++ b/arangodb-net-standard/AdminApi/Models/GetServerEngineTypeResponse.cs @@ -1,11 +1,18 @@ namespace ArangoDBNetStandard.AdminApi.Models { /// - /// Response from + /// Returned by /// public class GetServerEngineTypeResponse { + /// + /// Type of engine + /// public string Name { get; set; } + + /// + /// Features supported by the engine + /// public EngineSupports Supports { get; set; } } } \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs index fa255598..1c8b955c 100644 --- a/arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs +++ b/arangodb-net-standard/AdminApi/Models/GetServerIdResponse.cs @@ -1,10 +1,13 @@ namespace ArangoDBNetStandard.AdminApi.Models { /// - /// Response from + /// Returned by /// public class GetServerIdResponse : ResponseBase { + /// + /// Id of the server in the cluster. + /// public string Id { get; set; } } } \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs index b7c660d6..f44d693b 100644 --- a/arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs +++ b/arangodb-net-standard/AdminApi/Models/GetServerRoleResponse.cs @@ -1,11 +1,12 @@ namespace ArangoDBNetStandard.AdminApi.Models { /// - /// Response from + /// Returned by /// public class GetServerRoleResponse : ResponseBase { /// + /// The server's role. /// Possible values for role are: /// SINGLE: the server is a standalone server without clustering. /// COORDINATOR: the server is a Coordinator in a cluster. diff --git a/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs index b2c5b1ca..a322b627 100644 --- a/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs +++ b/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs @@ -1,12 +1,23 @@ namespace ArangoDBNetStandard.AdminApi.Models { /// - /// Response from + /// Returned by /// public class GetServerVersionResponse { + /// + /// The type of server. + /// public string Server { get; set; } + + /// + /// The type of license. + /// public string License { get; set; } + + /// + /// The version of the server. + /// public string Version { get; set; } } } \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/LogLevel.cs b/arangodb-net-standard/AdminApi/Models/LogLevel.cs index 029e6439..f14dd48d 100644 --- a/arangodb-net-standard/AdminApi/Models/LogLevel.cs +++ b/arangodb-net-standard/AdminApi/Models/LogLevel.cs @@ -1,5 +1,8 @@ namespace ArangoDBNetStandard.AdminApi.Models { + /// + /// Log levels in ArangoDB + /// public enum LogLevel { Fatal = 0, @@ -8,5 +11,4 @@ public enum LogLevel Info = 3, Debug = 4 } - -} +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/LogMessage.cs b/arangodb-net-standard/AdminApi/Models/LogMessage.cs index 147fa9ea..287cd7c6 100644 --- a/arangodb-net-standard/AdminApi/Models/LogMessage.cs +++ b/arangodb-net-standard/AdminApi/Models/LogMessage.cs @@ -2,13 +2,34 @@ namespace ArangoDBNetStandard.AdminApi.Models { + /// + /// Represents one log entry in ArangoDB + /// public class LogMessage { + /// + /// Unique Id of the log entry. + /// public int Id { get; set; } + + /// + /// Topic or subject of the log entry. + /// public string Topic { get; set; } + + /// + /// Level of the log entry. + /// public string Level { get; set; } + + /// + /// Date and time when the log entry was created. + /// public DateTime Date { get; set; } + + /// + /// The logged message. + /// public string Message { get; set; } } - -} +} \ No newline at end of file diff --git a/arangodb-net-standard/ArangoDBClient.cs b/arangodb-net-standard/ArangoDBClient.cs index 6faf497a..9d928f01 100644 --- a/arangodb-net-standard/ArangoDBClient.cs +++ b/arangodb-net-standard/ArangoDBClient.cs @@ -1,4 +1,5 @@ using System.Net.Http; +using ArangoDBNetStandard.AdminApi; using ArangoDBNetStandard.AqlFunctionApi; using ArangoDBNetStandard.AuthApi; using ArangoDBNetStandard.CollectionApi; @@ -66,15 +67,20 @@ public class ArangoDBClient : IArangoDBClient public GraphApiClient Graph { get; private set; } /// - /// User management API. + /// User management API /// public UserApiClient User { get; private set; } /// - /// Index management API. + /// Index management API /// public IndexApiClient Index { get; private set; } + /// + /// Admin management API + /// + public AdminApiClient Admin { get; private set; } + /// /// Create an instance of from an existing /// instance, using the default JSON serialization. @@ -138,6 +144,7 @@ private void InitializeApis( Graph = new GraphApiClient(transport, serialization); User = new UserApiClient(transport, serialization); Index = new IndexApiClient(transport, serialization); + Admin = new AdminApiClient(transport, serialization); } } -} +} \ No newline at end of file diff --git a/arangodb-net-standard/IArangoDBClient.cs b/arangodb-net-standard/IArangoDBClient.cs index 84805cd5..4e9f8fab 100644 --- a/arangodb-net-standard/IArangoDBClient.cs +++ b/arangodb-net-standard/IArangoDBClient.cs @@ -1,4 +1,5 @@ using System; +using ArangoDBNetStandard.AdminApi; using ArangoDBNetStandard.AqlFunctionApi; using ArangoDBNetStandard.AuthApi; using ArangoDBNetStandard.CollectionApi; @@ -55,13 +56,18 @@ public interface IArangoDBClient : IDisposable GraphApiClient Graph { get; } /// - /// User management API. + /// User management API /// UserApiClient User { get; } /// - /// Index management API. + /// Index management API /// IndexApiClient Index { get; } + + /// + /// Admin API + /// + AdminApiClient Admin { get; } } -} +} \ No newline at end of file diff --git a/project/roadmap.md b/project/roadmap.md index 524d9092..62e63d40 100644 --- a/project/roadmap.md +++ b/project/roadmap.md @@ -207,3 +207,12 @@ A tick indicates an item is implemented and has automated tests in place. - [X] `PUT​/_api​/collection​/{collection-name}​/responsibleShard` Return responsible shard for a document - [X] `GET/_api/collection/{collection-name}/shards` Return the shard ids of a collection - [X] `PUT/_api/collection/{collection-name}/compact` Compact a collection + +#### Admin API + +- [X] `GET/_admin/log/entries` Read global logs from the server +- [X] `POST/_admin/routing/reload` Reloads the routing information +- [X] `GET/_admin/server/id` Return id of a server in a cluster +- [X] `GET/_admin/server/role` Return role of a server in a cluster +- [X] `GET/_api/engine` Return server database engine type +- [X] `GET/_api/version` Return server version \ No newline at end of file From 2f2c5b96f453904f235039e3dc612e86bacd9124 Mon Sep 17 00:00:00 2001 From: tjoubert Date: Mon, 2 May 2022 11:35:27 +0400 Subject: [PATCH 3/5] Fixed server version on tests --- .circleci/config.yml | 8 ++++---- arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs | 7 ++++++- .../AdminApi/AdminApiClientTestFixture.cs | 2 +- arangodb-net-standard/AdminApi/AdminApiClient.cs | 1 + arangodb-net-standard/AdminApi/IAdminApiClient.cs | 1 + 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c982b29..8a52a0ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,7 +61,7 @@ jobs: - run: name: Test command: - dotnet test -c Release --filter "Feature!=StreamTransaction&RunningMode!=Cluster" + dotnet test -c Release --filter "Feature!=StreamTransaction&RunningMode!=Cluster&ServerVersion!=3_8_PLUS" "test-arangodb-3_5": working_directory: ~/arangodb-net-standard @@ -80,7 +80,7 @@ jobs: - run: name: Test command: - dotnet test -c Release --filter RunningMode!=Cluster + dotnet test -c Release --filter "RunningMode!=Cluster&ServerVersion!=3_8_PLUS" "test-arangodb-3_6": working_directory: ~/arangodb-net-standard @@ -99,7 +99,7 @@ jobs: - run: name: Test command: - dotnet test -c Release --filter RunningMode!=Cluster + dotnet test -c Release --filter "RunningMode!=Cluster&ServerVersion!=3_8_PLUS" "test-arangodb-3_7": working_directory: ~/arangodb-net-standard @@ -118,7 +118,7 @@ jobs: - run: name: Test command: - dotnet test -c Release --filter RunningMode!=Cluster + dotnet test -c Release --filter "RunningMode!=Cluster&ServerVersion!=3_8_PLUS" "test-arangodb-3_8": working_directory: ~/arangodb-net-standard diff --git a/arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs b/arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs index 2a12ade2..1dadb9d7 100644 --- a/arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs +++ b/arangodb-net-standard.Test/AdminApi/AdminApiClientTest.cs @@ -9,7 +9,7 @@ using Moq; using Xunit; -namespace ArangoDBNetStandardTest.IndexApi +namespace ArangoDBNetStandardTest.AdminApi { public class AdminApiClientTest : IClassFixture, IAsyncLifetime { @@ -32,7 +32,12 @@ public Task DisposeAsync() return Task.CompletedTask; } + /// + /// Works only on version 3.8 onwards. + /// + /// [Fact] + [Trait("ServerVersion", "3_8_PLUS")] public async Task GetLogsAsync_ShouldSucceed() { var getResponse = await _adminApi.GetLogsAsync(); diff --git a/arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs b/arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs index 0129136f..eeb714ab 100644 --- a/arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs +++ b/arangodb-net-standard.Test/AdminApi/AdminApiClientTestFixture.cs @@ -4,7 +4,7 @@ using System; using System.Threading.Tasks; -namespace ArangoDBNetStandardTest.IndexApi +namespace ArangoDBNetStandardTest.AdminApi { public class AdminApiClientTestFixture : ApiClientTestFixtureBase { diff --git a/arangodb-net-standard/AdminApi/AdminApiClient.cs b/arangodb-net-standard/AdminApi/AdminApiClient.cs index ead62046..2e1868a0 100644 --- a/arangodb-net-standard/AdminApi/AdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/AdminApiClient.cs @@ -48,6 +48,7 @@ public AdminApiClient(IApiClientTransport client, IApiClientSerialization serial /// /// Retrieves log messages from the server. /// GET /_admin/log/entries + /// Works on ArangoDB 3.8 or later. /// /// Query string parameters /// diff --git a/arangodb-net-standard/AdminApi/IAdminApiClient.cs b/arangodb-net-standard/AdminApi/IAdminApiClient.cs index 860f5a19..6ef774b6 100644 --- a/arangodb-net-standard/AdminApi/IAdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/IAdminApiClient.cs @@ -12,6 +12,7 @@ public interface IAdminApiClient /// /// Retrieves log messages from the server. /// GET /_admin/log/entries + /// Works on ArangoDB 3.8 or later. /// /// Query string parameters /// From 7e751091b37fcebd0835c46b4191086ff72d7c3f Mon Sep 17 00:00:00 2001 From: tjoubert Date: Mon, 9 May 2022 21:40:08 +0400 Subject: [PATCH 4/5] #370 fixes --- .../AdminApi/AdminApiClient.cs | 27 ++++++++++++-- .../AdminApi/IAdminApiClient.cs | 23 ++++++++++-- .../AdminApi/Models/EngineAlias.cs | 9 +++-- .../AdminApi/Models/EngineAliasIndex.cs | 8 ----- .../AdminApi/Models/GetLogsQuery.cs | 2 +- .../AdminApi/Models/GetServerVersionQuery.cs | 35 +++++++++++++++++++ .../Models/GetServerVersionResponse.cs | 14 ++++++-- .../AdminApi/Models/ResponseBase.cs | 6 +++- 8 files changed, 106 insertions(+), 18 deletions(-) delete mode 100644 arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs create mode 100644 arangodb-net-standard/AdminApi/Models/GetServerVersionQuery.cs diff --git a/arangodb-net-standard/AdminApi/AdminApiClient.cs b/arangodb-net-standard/AdminApi/AdminApiClient.cs index 2e1868a0..57aa475a 100644 --- a/arangodb-net-standard/AdminApi/AdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/AdminApiClient.cs @@ -7,7 +7,7 @@ namespace ArangoDBNetStandard.AdminApi { /// - /// A client for interacting with ArangoDB Index endpoints, + /// A client for interacting with ArangoDB Admin API, /// implementing . /// public class AdminApiClient : ApiClientBase, IAdminApiClient @@ -52,6 +52,9 @@ public AdminApiClient(IApiClientTransport client, IApiClientSerialization serial /// /// Query string parameters /// + /// + /// For further information + /// public virtual async Task GetLogsAsync(GetLogsQuery query = null) { string uri = $"{_adminApiPath}/log/entries"; @@ -75,6 +78,9 @@ public virtual async Task GetLogsAsync(GetLogsQuery query = nul /// POST /_admin/routing/reload /// /// + /// + /// For further information + /// public virtual async Task PostReloadRoutingInfoAsync() { string uri = $"{_adminApiPath}/routing/reload"; @@ -95,6 +101,9 @@ public virtual async Task PostReloadRoutingInfoAsync() /// GET /_admin/server/id /// /// + /// + /// For further information + /// public virtual async Task GetServerIdAsync() { string uri = $"{_adminApiPath}/server/id"; @@ -114,6 +123,9 @@ public virtual async Task GetServerIdAsync() /// GET /_admin/server/role /// /// + /// + /// For further information + /// public virtual async Task GetServerRoleAsync() { string uri = $"{_adminApiPath}/server/role"; @@ -133,6 +145,9 @@ public virtual async Task GetServerRoleAsync() /// GET /_api/engine /// /// + /// + /// For further information + /// public virtual async Task GetServerEngineTypeAsync() { string uri = "_api/engine"; @@ -151,10 +166,18 @@ public virtual async Task GetServerEngineTypeAsync( /// Retrieves the server version. /// GET /_api/version /// + /// Query string parameters /// - public virtual async Task GetServerVersionAsync() + /// + /// For further information + /// + public virtual async Task GetServerVersionAsync(GetServerVersionQuery query = null) { string uri = "_api/version"; + if (query != null) + { + uri += '?' + query.ToQueryString(); + } using (var response = await _client.GetAsync(uri).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) diff --git a/arangodb-net-standard/AdminApi/IAdminApiClient.cs b/arangodb-net-standard/AdminApi/IAdminApiClient.cs index 6ef774b6..8523b843 100644 --- a/arangodb-net-standard/AdminApi/IAdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/IAdminApiClient.cs @@ -5,7 +5,7 @@ namespace ArangoDBNetStandard.AdminApi { /// - /// Defines a client to access the ArangoDB Admin API. + /// Defines a client to access the ArangoDB Admin API. /// public interface IAdminApiClient { @@ -16,6 +16,9 @@ public interface IAdminApiClient /// /// Query string parameters /// + /// + /// For further information + /// Task GetLogsAsync(GetLogsQuery query = null); /// @@ -23,6 +26,9 @@ public interface IAdminApiClient /// POST /_admin/routing/reload /// /// + /// + /// For further information + /// Task PostReloadRoutingInfoAsync(); /// @@ -31,6 +37,9 @@ public interface IAdminApiClient /// GET /_admin/server/id /// /// + /// + /// For further information + /// Task GetServerIdAsync(); /// @@ -38,6 +47,9 @@ public interface IAdminApiClient /// GET /_admin/server/role /// /// + /// + /// For further information + /// Task GetServerRoleAsync(); /// @@ -45,13 +57,20 @@ public interface IAdminApiClient /// GET /_api/engine /// /// + /// + /// For further information + /// Task GetServerEngineTypeAsync(); /// /// Retrieves the server version. /// GET /_api/version /// + /// Query string parameters /// - Task GetServerVersionAsync(); + /// + /// For further information + /// + Task GetServerVersionAsync(GetServerVersionQuery query = null); } } \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/EngineAlias.cs b/arangodb-net-standard/AdminApi/Models/EngineAlias.cs index 29b655b8..08e014c1 100644 --- a/arangodb-net-standard/AdminApi/Models/EngineAlias.cs +++ b/arangodb-net-standard/AdminApi/Models/EngineAlias.cs @@ -1,7 +1,12 @@ -namespace ArangoDBNetStandard.AdminApi.Models +using System.Collections.Generic; + +namespace ArangoDBNetStandard.AdminApi.Models { public class EngineAlias { - public EngineAliasIndex Indexes { get; set; } + /// + /// List of indexes and associated types + /// + public Dictionary Indexes { get; set; } } } \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs b/arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs deleted file mode 100644 index 537c0fc4..00000000 --- a/arangodb-net-standard/AdminApi/Models/EngineAliasIndex.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ArangoDBNetStandard.AdminApi.Models -{ - public class EngineAliasIndex - { - public string Skiplist { get; set; } - public string Hash { get; set; } - } -} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs b/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs index 8864611e..b8b07b71 100644 --- a/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs +++ b/arangodb-net-standard/AdminApi/Models/GetLogsQuery.cs @@ -84,7 +84,7 @@ internal string ToQueryString() } if (Level != null) { - queryParams.Add("level=" + UpTo.ToString()); + queryParams.Add("level=" + Level.ToString()); } if (Start != null) { diff --git a/arangodb-net-standard/AdminApi/Models/GetServerVersionQuery.cs b/arangodb-net-standard/AdminApi/Models/GetServerVersionQuery.cs new file mode 100644 index 00000000..c3e71ac7 --- /dev/null +++ b/arangodb-net-standard/AdminApi/Models/GetServerVersionQuery.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; + +namespace ArangoDBNetStandard.AdminApi.Models +{ + /// + /// Parameters for + /// + public class GetServerVersionQuery + { + /// + /// If set to true, the response will + /// contain a details attribute with + /// additional information about included + /// components and their versions. + /// The attribute names and internals of + /// the details object may vary depending + /// on platform and ArangoDB version. + /// + public bool? Details { get; set; } + + /// + /// Generates the querystring + /// + /// + internal string ToQueryString() + { + var queryParams = new List(); + if (Details != null) + { + queryParams.Add("details=" + Details.ToString()); + } + return string.Join("&", queryParams); + } + } +} \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs b/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs index a322b627..adf5f555 100644 --- a/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs +++ b/arangodb-net-standard/AdminApi/Models/GetServerVersionResponse.cs @@ -1,7 +1,9 @@ -namespace ArangoDBNetStandard.AdminApi.Models +using System.Collections.Generic; + +namespace ArangoDBNetStandard.AdminApi.Models { /// - /// Returned by + /// Returned by /// public class GetServerVersionResponse { @@ -19,5 +21,13 @@ public class GetServerVersionResponse /// The version of the server. /// public string Version { get; set; } + + /// + /// Additional details about the DB server. + /// This is returned only if the + /// query parameter is set to true in + /// the request. + /// + public Dictionary Details {get;set;} } } \ No newline at end of file diff --git a/arangodb-net-standard/AdminApi/Models/ResponseBase.cs b/arangodb-net-standard/AdminApi/Models/ResponseBase.cs index 82e91561..f9d62f96 100644 --- a/arangodb-net-standard/AdminApi/Models/ResponseBase.cs +++ b/arangodb-net-standard/AdminApi/Models/ResponseBase.cs @@ -8,8 +8,12 @@ namespace ArangoDBNetStandard.AdminApi.Models public class ResponseBase { /// - /// Indicates whether an error occurred + /// Always false. /// + /// + /// To handle errors, catch + /// thrown by API client methods. + /// public bool Error { get; set; } /// From d0cbb422457298f163777d5eb511460c1682f88f Mon Sep 17 00:00:00 2001 From: tjoubert Date: Fri, 13 May 2022 13:03:57 +0400 Subject: [PATCH 5/5] Fixed comment URLs --- .../AdminApi/AdminApiClient.cs | 18 ++++++++++++------ .../AdminApi/IAdminApiClient.cs | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/arangodb-net-standard/AdminApi/AdminApiClient.cs b/arangodb-net-standard/AdminApi/AdminApiClient.cs index 57aa475a..9013357f 100644 --- a/arangodb-net-standard/AdminApi/AdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/AdminApiClient.cs @@ -53,7 +53,8 @@ public AdminApiClient(IApiClientTransport client, IApiClientSerialization serial /// Query string parameters /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#read-global-logs-from-the-server /// public virtual async Task GetLogsAsync(GetLogsQuery query = null) { @@ -79,7 +80,8 @@ public virtual async Task GetLogsAsync(GetLogsQuery query = nul /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#reloads-the-routing-information /// public virtual async Task PostReloadRoutingInfoAsync() { @@ -102,7 +104,8 @@ public virtual async Task PostReloadRoutingInfoAsync() /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#return-id-of-a-server-in-a-cluster /// public virtual async Task GetServerIdAsync() { @@ -124,7 +127,8 @@ public virtual async Task GetServerIdAsync() /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#return-the-role-of-a-server-in-a-cluster /// public virtual async Task GetServerRoleAsync() { @@ -146,7 +150,8 @@ public virtual async Task GetServerRoleAsync() /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/miscellaneous-functions.html#return-server-database-engine-type /// public virtual async Task GetServerEngineTypeAsync() { @@ -169,7 +174,8 @@ public virtual async Task GetServerEngineTypeAsync( /// Query string parameters /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/miscellaneous-functions.html#return-server-version /// public virtual async Task GetServerVersionAsync(GetServerVersionQuery query = null) { diff --git a/arangodb-net-standard/AdminApi/IAdminApiClient.cs b/arangodb-net-standard/AdminApi/IAdminApiClient.cs index 8523b843..4a8812a1 100644 --- a/arangodb-net-standard/AdminApi/IAdminApiClient.cs +++ b/arangodb-net-standard/AdminApi/IAdminApiClient.cs @@ -17,7 +17,8 @@ public interface IAdminApiClient /// Query string parameters /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#read-global-logs-from-the-server /// Task GetLogsAsync(GetLogsQuery query = null); @@ -27,7 +28,8 @@ public interface IAdminApiClient /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#reloads-the-routing-information /// Task PostReloadRoutingInfoAsync(); @@ -38,7 +40,8 @@ public interface IAdminApiClient /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#return-id-of-a-server-in-a-cluster /// Task GetServerIdAsync(); @@ -48,7 +51,8 @@ public interface IAdminApiClient /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#return-the-role-of-a-server-in-a-cluster /// Task GetServerRoleAsync(); @@ -58,7 +62,8 @@ public interface IAdminApiClient /// /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/miscellaneous-functions.html#return-server-database-engine-type /// Task GetServerEngineTypeAsync(); @@ -69,7 +74,8 @@ public interface IAdminApiClient /// Query string parameters /// /// - /// For further information + /// For further information see + /// https://www.arangodb.com/docs/stable/http/miscellaneous-functions.html#return-server-version /// Task GetServerVersionAsync(GetServerVersionQuery query = null); }