tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
AdministrationMutations.cs
Go to the documentation of this file.
1using System;
4
5using HotChocolate;
7
13
15{
20 [GraphQLDescription(Mutation.GraphQLDescription)]
21 public sealed class AdministrationMutations
22 {
31 [Service] IGraphQLAuthorityInvoker<IAdministrationAuthority> administrationAuthority)
32 {
33 ArgumentNullException.ThrowIfNull(administrationAuthority);
34 await administrationAuthority.Invoke(
35 authority => authority.TriggerServerRestart());
36
37 return new Query();
38 }
39
50 Version targetVersion,
51 [Service] IGraphQLAuthorityInvoker<IAdministrationAuthority> administrationAuthority,
52 CancellationToken cancellationToken)
53 {
55 ArgumentNullException.ThrowIfNull(administrationAuthority);
56 await administrationAuthority.Invoke<ServerUpdateResponse, ServerUpdateResponse>(
57 authority => authority.TriggerServerVersionChange(targetVersion, false, cancellationToken));
58 return new Query();
59 }
60
72 Version targetVersion,
73 [Service] IGraphQLAuthorityInvoker<IAdministrationAuthority> administrationAuthority,
74 CancellationToken cancellationToken)
75 {
77 ArgumentNullException.ThrowIfNull(administrationAuthority);
78 var response = await administrationAuthority.Invoke<ServerUpdateResponse, FileTicketResponse>(
79 authority => authority.TriggerServerVersionChange(targetVersion, true, cancellationToken));
80
81 return response.FileTicket ?? throw new InvalidOperationException("Administration authority did not generate a FileUploadTicket!");
82 }
83 }
84}
Response for when file transfers are necessary.
Exception representing ErrorMessageResponses.
Root type for GraphQL mutations.
Definition Mutation.cs:19
const string GraphQLDescription
Description to show on the Mutation type.
Definition Mutation.cs:23
async ValueTask< Query > ChangeServerNodeVersionViaTrackedRepository(Version targetVersion, [Service] IGraphQLAuthorityInvoker< IAdministrationAuthority > administrationAuthority, CancellationToken cancellationToken)
Restarts the mutated Interfaces.IServerNode without terminating running game instances and changes it...
async ValueTask< Query > RestartServerNode([Service] IGraphQLAuthorityInvoker< IAdministrationAuthority > administrationAuthority)
Restarts the mutated Interfaces.IServerNode without terminating running game instances.
async ValueTask< string > ChangeServerNodeVersionViaUpload(Version targetVersion, [Service] IGraphQLAuthorityInvoker< IAdministrationAuthority > administrationAuthority, CancellationToken cancellationToken)
Restarts the mutated Interfaces.IServerNode without terminating running game instances and changes it...
GraphQL query global::System.Type.
Definition Query.cs:12
IAuthority for administrative server operations.
ValueTask< AuthorityResponse > TriggerServerRestart()
Triggers a restart of tgstation-server without terminating running game instances.
@ List
User may list files if the Models.Instance allows it.
AdministrationRights
Administration rights for the server.