128 authenticationContext,
185 Logger.LogWarning(
e,
"Not found exception while retrieving upstream repository info!");
191 TrackedRepositoryUrl =
repoUrl,
213 catch (ApiException
e)
218 AdditionalData = e.Message,
254 if (
model.NewVersion ==
null)
257 AdditionalData =
"newVersion is required!",
260 if (
model.NewVersion.Major < 3)
285 Logger.LogDebug(
"Restart request failed due to lack of host watchdog!");
336 .OrderByDescending(
x =>
x.Name));
343 AdditionalData = ex.ToString(),
398 AdditionalData = ex.ToString(),
435 catch (ApiException
e)
440 AdditionalData = e.Message,
AdministrationRights? AdministrationRights
The Rights.AdministrationRights for the user.
Represents a request to update TGS.
Represents administrative server information.
Represents an error message returned by the server.
Represents a server log file.
Represents a paginated set of models.
A response to a Request.ServerUpdateRequest.
Routes to a server actions.
const string Administration
The server administration controller.
const string Logs
The endpoint to download server logs.
File logging configuration options.
string GetFullLogDirectory(IIOManager ioManager, IAssemblyInformationProvider assemblyInformationProvider, IPlatformIdentifier platformIdentifier)
Gets the evaluated log Directory.
ApiController for TGS administration purposes.
ValueTask< IActionResult > ListLogs([FromQuery] int? page, [FromQuery] int? pageSize, CancellationToken cancellationToken)
List LogFileResponses present.
readonly FileLoggingConfiguration fileLoggingConfiguration
The FileLoggingConfiguration for the AdministrationController.
readonly IMemoryCache cacheService
The IMemoryCache for the AdministrationController.
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the AdministrationController.
readonly IFileTransferTicketProvider fileTransferService
The IFileTransferTicketProvider for the AdministrationController.
async ValueTask< IActionResult > Read([FromQuery] bool? fresh, CancellationToken cancellationToken)
Get AdministrationResponse server information.
async ValueTask< IActionResult > Update([FromBody] ServerUpdateRequest model, CancellationToken cancellationToken)
Attempt to perform a server upgrade.
AdministrationController(IDatabaseContext databaseContext, IAuthenticationContext authenticationContext, IGitHubServiceFactory gitHubServiceFactory, IServerControl serverControl, IServerUpdateInitiator serverUpdateInitiator, IAssemblyInformationProvider assemblyInformationProvider, IIOManager ioManager, IPlatformIdentifier platformIdentifier, IFileTransferTicketProvider fileTransferService, IMemoryCache cacheService, ILogger< AdministrationController > logger, IOptions< FileLoggingConfiguration > fileLoggingConfigurationOptions, IApiHeadersProvider apiHeadersProvider)
Initializes a new instance of the AdministrationController class.
static readonly object ReadCacheKey
The IMemoryCache key for Read(bool?, CancellationToken).
async ValueTask< IActionResult > GetLog(string path, CancellationToken cancellationToken)
Download a LogFileResponse.
readonly IPlatformIdentifier platformIdentifier
The IPlatformIdentifier for the AdministrationController.
const string OctokitException
Default Exception.Message for ApiExceptions.
readonly IGitHubServiceFactory gitHubServiceFactory
The IGitHubServiceFactory for the AdministrationController.
readonly IIOManager ioManager
The IIOManager for the AdministrationController.
async ValueTask< IActionResult > AttemptInitiateUpdate(Version newVersion, bool attemptingUpload, CancellationToken cancellationToken)
Attempt to initiate an update.
async ValueTask< IActionResult > Delete()
Attempts to restart the server.
readonly IServerUpdateInitiator serverUpdateInitiator
The IServerUpdateInitiator for the AdministrationController.
readonly IServerControl serverControl
The IServerControl for the AdministrationController.
Base Controller for API functions.
StatusCodeResult StatusCode(HttpStatusCode statusCode)
Strongly type calls to ControllerBase.StatusCode(int).
ObjectResult RateLimit(RateLimitExceededException rateLimitException)
429 response for a given rateLimitException .
ILogger< ApiController > Logger
The ILogger for the ApiController.
PermissionSet PermissionSet
The User's effective PermissionSet.
Represents a file on disk to be downloaded.
Represents a service that may take an updated Host assembly and run it, stopping the current assembly...
bool WatchdogPresent
true if live updates are supported, false. TryStartUpdate(IServerUpdateExecutor, Version) and Restart...
ValueTask Restart()
Restarts the Host.
Initiates server self updates.
ValueTask< ServerUpdateResult > InitiateUpdate(IFileStreamProvider? fileStreamProvider, Version version, CancellationToken cancellationToken)
Start the process of downloading and applying an update to a new server version .
Interface for using filesystems.
Task< IReadOnlyList< string > > GetFiles(string path, CancellationToken cancellationToken)
Returns full file names in a given path .
string GetFileName(string path)
Gets the file name portion of a path .
string ConcatPath(params string[] paths)
Combines an array of strings into a path.
Task< DateTimeOffset > GetLastModified(string path, CancellationToken cancellationToken)
Get the DateTimeOffset of when a given path was last modified.
Represents the currently authenticated Models.User.
Service for temporarily storing files to be downloaded or uploaded.
FileTicketResponse CreateDownload(FileDownloadProvider fileDownloadProvider)
Create a FileTicketResponse for a download.
IFileUploadTicket CreateUpload(FileUploadStreamKind streamKind)
Create a IFileUploadTicket.
A FileTicketResponse that waits for a pending upload.
Factory for IGitHubServices.
ValueTask< IGitHubService > CreateService(CancellationToken cancellationToken)
Create a IGitHubService.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
@ List
User may list files if the Models.Instance allows it.
AdministrationRights
Administration rights for the server.
ServerUpdateResult
The result of a call to start a server update.
FileUploadStreamKind
Determines the type of global::System.IO.Stream returned from IFileUploadTicket's created from IFileT...