aboutsummaryrefslogtreecommitdiff
path: root/src/server/Session/session_config_schema.ts
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2020-01-09 15:52:05 -0500
committerFawn <fangrui_tong@brown.edu>2020-01-09 15:52:05 -0500
commit9a8d2a903b10568686cc66c849fba21b1ab75be2 (patch)
treeea0bf48e4f47c72f9eeab3cbd00a5f1494abbb34 /src/server/Session/session_config_schema.ts
parente0a8d325d601d305a166c1683dccfcc67e91fe95 (diff)
parent540bda7295f6ee7c2eed848598de6f5df74b2723 (diff)
pull and merge with master
Diffstat (limited to 'src/server/Session/session_config_schema.ts')
-rw-r--r--src/server/Session/session_config_schema.ts68
1 files changed, 50 insertions, 18 deletions
diff --git a/src/server/Session/session_config_schema.ts b/src/server/Session/session_config_schema.ts
index 76af04b9f..e32cf8c6a 100644
--- a/src/server/Session/session_config_schema.ts
+++ b/src/server/Session/session_config_schema.ts
@@ -1,35 +1,67 @@
import { Schema } from "jsonschema";
+const colorPattern = /black|red|green|yellow|blue|magenta|cyan|white|gray|grey/;
+
+const identifierProperties: Schema = {
+ type: "object",
+ properties: {
+ text: {
+ type: "string",
+ minLength: 1
+ },
+ color: {
+ type: "string",
+ pattern: colorPattern
+ }
+ }
+};
+
+const portProperties: Schema = {
+ type: "number",
+ minimum: 1024,
+ maximum: 65535
+};
+
export const configurationSchema: Schema = {
id: "/configuration",
type: "object",
properties: {
+ showServerOutput: { type: "boolean" },
ports: {
type: "object",
properties: {
- server: { type: "number", minimum: 1024, maximum: 65535 },
- socket: { type: "number", minimum: 1024, maximum: 65535 }
+ server: portProperties,
+ socket: portProperties
},
required: ["server"],
additionalProperties: true
},
- pollingRoute: {
- type: "string",
- pattern: /\/[a-zA-Z]*/g
- },
- masterIdentifier: {
- type: "string",
- minLength: 1
+ identifiers: {
+ type: "object",
+ properties: {
+ master: identifierProperties,
+ worker: identifierProperties,
+ exec: identifierProperties
+ }
},
- workerIdentifier: {
- type: "string",
- minLength: 1
+ polling: {
+ type: "object",
+ additionalProperties: false,
+ properties: {
+ intervalSeconds: {
+ type: "number",
+ minimum: 1,
+ maximum: 86400
+ },
+ route: {
+ type: "string",
+ pattern: /\/[a-zA-Z]*/g
+ },
+ failureTolerance: {
+ type: "number",
+ minimum: 0,
+ }
+ }
},
- showServerOutput: { type: "boolean" },
- pollingIntervalSeconds: {
- type: "number",
- minimum: 1,
- maximum: 86400
- }
}
}; \ No newline at end of file