2using System.Collections.Generic;
5using System.Threading.Tasks;
27 public ValueTask<AdministrationResponse>
Read(
bool forceFresh, CancellationToken cancellationToken) =>
ApiClient.Read<
AdministrationResponse>($
"{Routes.Administration}?fresh={forceFresh}", cancellationToken);
30 public async ValueTask<ServerUpdateResponse>
Update(
33 CancellationToken cancellationToken)
35 if (updateRequest ==
null)
36 throw new ArgumentNullException(nameof(updateRequest));
38 if (updateRequest.
UploadZip ==
true && zipFileStream ==
null)
39 throw new ArgumentNullException(nameof(zipFileStream));
47 await
ApiClient.
Upload(result, zipFileStream, cancellationToken).ConfigureAwait(
false);
57 => ReadPaged<LogFileResponse>(paginationSettings,
Routes.
Logs,
null, cancellationToken);
60 public async ValueTask<Tuple<LogFileResponse, Stream>>
GetLog(
LogFileResponse logFile, CancellationToken cancellationToken)
64 HttpUtility.UrlEncode(
65 logFile?.
Name ??
throw new ArgumentNullException(nameof(logFile)))),
67 .ConfigureAwait(
false);
69 var stream = await
ApiClient.
Download(resultFile, cancellationToken).ConfigureAwait(
false);
72 return Tuple.Create(resultFile, stream);
Represents a request to update TGS.
bool? UploadZip
If the user will provide the server update package .zip file via file transfer as opposed to TGS retr...
Represents administrative server information.
Represents a server log file.
string? Name
The name of the log file.
A response to a Request.ServerUpdateRequest.
Routes to a server actions.
const string Administration
The server administration controller.
static string SanitizeGetPath(string path)
Sanitize a Models.Response.FileTicketResponse path for use in a GET Uri.
const string Logs
The endpoint to download server logs.
async ValueTask< Tuple< LogFileResponse, Stream > > GetLog(LogFileResponse logFile, CancellationToken cancellationToken)
Download a given logFile .A ValueTask<TResult> resulting a Tuple<T1, T2> containing the downloaded Lo...
ValueTask< List< LogFileResponse > > ListLogs(PaginationSettings? paginationSettings, CancellationToken cancellationToken)
Lists the log files available for download.A ValueTask<TResult> resulting in an List<T> of LogFileRes...
async ValueTask< ServerUpdateResponse > Update(ServerUpdateRequest updateRequest, Stream? zipFileStream, CancellationToken cancellationToken)
Updates the AdministrationResponse setttings.A ValueTask<TResult> resulting in the echoed ServerUpdat...
ValueTask< AdministrationResponse > Read(bool forceFresh, CancellationToken cancellationToken)
Get the AdministrationResponse represented by the IAdministrationClient.A ValueTask<TResult> resultin...
AdministrationClient(IApiClient apiClient)
Initializes a new instance of the AdministrationClient class.
ValueTask Restart(CancellationToken cancellationToken)
Restarts the TGS server.A ValueTask representing the running operation.
ValueTask< Stream > Download(FileTicketResponse ticket, CancellationToken cancellationToken)
Downloads a file Stream for a given ticket .A ValueTask<TResult> resulting in the downloaded Stream.
async ValueTask Upload(FileTicketResponse ticket, Stream? uploadStream, CancellationToken cancellationToken)
Uploads a given uploadStream for a given ticket .A ValueTask representing the running operation.
ValueTask Delete(string route, CancellationToken cancellationToken)
Run an HTTP DELETE request.A ValueTask representing the running operation.
Client that deals with getting paginated results.
For managing server administration.
Web interface for the API.