tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
SwarmConstants.cs
Go to the documentation of this file.
1using Newtonsoft.Json;
2using Newtonsoft.Json.Serialization;
3
7
9{
13 static class SwarmConstants
14 {
18 public const string ControllerRoute = Routes.ApiRoot + "Swarm";
19
23 public const string ApiKeyHeader = "X-API-KEY";
24
28 public const string RegistrationIdHeader = "SwarmRegistration";
29
33 public const string RegisterRoute = "Register";
34
38 public const string UpdateRoute = "Update";
39
44
48 public const int NodeHealthCheckIntervalMinutes = 5;
49
53 public const int UpdateCommitTimeoutMinutes = 10;
54
58 public const int SecondsToDelayForcedHealthChecks = 15;
59
63 public static JsonSerializerSettings SerializerSettings { get; }
64
69 {
70 SerializerSettings = new()
71 {
72 ContractResolver = new DefaultContractResolver
73 {
74 NamingStrategy = new CamelCaseNamingStrategy(),
75 },
76 Converters = new JsonConverter[]
77 {
78 new VersionConverter(),
79 new BoolConverter(),
80 },
81 DefaultValueHandling = DefaultValueHandling.Ignore,
82 ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
83 };
84 }
85 }
86}
JsonConverter for decoding bools returned by BYOND.
Constants used by the swarm system.
const int ControllerHealthCheckIntervalMinutes
Interval at which the swarm controller makes health checks on nodes.
static JsonSerializerSettings SerializerSettings
See JsonSerializerSettings for the swarm system.
const string ApiKeyHeader
The header used to pass in the Configuration.SwarmConfiguration.PrivateKey.
const string UpdateRoute
The route used for swarm updates.
const string ControllerRoute
The base route for Controllers.SwarmController.
const string RegisterRoute
The route used for swarm registration.
static SwarmConstants()
Initializes static members of the SwarmConstants class.
const int NodeHealthCheckIntervalMinutes
Interval at which the node makes health checks on the controller if it has not received one.
const string RegistrationIdHeader
The header used to pass in swarm registration IDs.
const int UpdateCommitTimeoutMinutes
Number of minutes the controller waits to receive a ready-commit from all nodes before aborting an up...
const int SecondsToDelayForcedHealthChecks
Number of seconds between a health check global::System.Threading.Tasks.TaskCompletionSource triggeri...
JsonConverter and IYamlTypeConverter for serializing global::System.Versions in semver format.