Skip to content

Commit 92ccfae

Browse files
Merge pull request #374 from microsoft/dev/murphymcquet/add-servicehub-host-schema
Add public schemas folder
2 parents 2516dca + f7566c7 commit 92ccfae

File tree

3 files changed

+191
-0
lines changed

3 files changed

+191
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema",
3+
"title": "Microsoft ServiceHub Configuration",
4+
"type": "object",
5+
"required": ["controller", "hosts", "services"],
6+
"properties": {
7+
"controller": {
8+
"type": "object",
9+
"description": "Specifies the location of the controller executable and activation parameters.",
10+
"required": ["executable"],
11+
"properties": {
12+
"contextEnvironmentVariables": {
13+
"type": "array",
14+
"description": "Array of environment variable names. These variables are mixed-up into hash that determines the location service pipe name. The order is significant.",
15+
"items": {
16+
"type": "string"
17+
},
18+
"uniqueItems": true
19+
},
20+
"executable": {
21+
"type": "string"
22+
},
23+
"args": {
24+
"type": "array",
25+
"items": {
26+
"type": "string"
27+
}
28+
},
29+
"additionalEnvironmentVariables": {
30+
"type": "object",
31+
"description": "An object with properties like \"environment variable name\": \"value\" that describes what environment variables to set for the Hub Controller.",
32+
"additionalProperties": false,
33+
"patternProperties": {
34+
"^[A-Za-z0-9_/\\.]+$": {
35+
"type": "string",
36+
"description": "The value of the environment variable to set."
37+
}
38+
}
39+
}
40+
}
41+
},
42+
"hosts": {
43+
"type": "object",
44+
"required": ["rootDir"],
45+
"properties": {
46+
"rootDir": {
47+
"type": "string",
48+
"description": "The path to the directory immediately under which are folders that contain *.servicehub.host.json files."
49+
}
50+
}
51+
},
52+
"services": {
53+
"type": "object",
54+
"required": ["rootDir"],
55+
"properties": {
56+
"rootDir": {
57+
"type": "string",
58+
"description": "The path to the directory immediately under which are folders that contain *.servicehub.service.json files."
59+
},
60+
"discoveryServices": {
61+
"description": "Service names of optional discovery service modules. Controller will use them to locate a service which it cannot find in the services folder.",
62+
"type": "array",
63+
"items": {
64+
"type": "string"
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema",
3+
"title": "Microsoft ServiceHub Host",
4+
"type": "object",
5+
"required": ["hostExecutable", "hostArgs"],
6+
"properties": {
7+
"hostExecutable": {
8+
"type": "string",
9+
"description": "The path to the executable to launch to start the host, relative to this file."
10+
},
11+
"hostArgs": {
12+
"type": "array",
13+
"description": "The array of arguments to pass to the executable. $HOSTID will be replaced with the host id; $PIPE will be replaced with the host callback pipe name.",
14+
"items": {
15+
"type": "string"
16+
},
17+
"minItems": 2
18+
},
19+
"additionalEnvironmentVariables": {
20+
"type": "object",
21+
"description": "Additional environment variables to set when launching the host.",
22+
"additionalProperties": {
23+
"type": "string"
24+
}
25+
},
26+
"dotnetRootOverride": {
27+
"type": "string",
28+
"description": "Path to override .NET runtime."
29+
}
30+
}
31+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema",
3+
"title": "Microsoft ServiceHub Service",
4+
"type": "object",
5+
"properties": {
6+
"hostId": {
7+
"type": "string",
8+
"pattern": "^[^ ]*$",
9+
"description": "A non-empty value will cause this service to be activated on a dedicated host with this ID. All services with the same host / hostId combination will run in the same host process such that they may share global data. If unspecified or empty, a service will share its host process with other services that require the same host and also leave this field empty. If specified, the value must not have spaces in it."
10+
},
11+
"hostGroupAllowed": {
12+
"type": "boolean",
13+
"description": "A value of 'true' will allow a client to specify a host group when requesting this service."
14+
},
15+
"friendServices": {
16+
"type": "array",
17+
"description": "A set of ServiceHub service names whose AssemblyLoadContext will be used for resolving dependencies. These AssemblyLoadContexts will be queried in the order that appear, stopping when/if the assembly is successfully loaded. The additional AssemblyLoadContexts will only be searched if the assembly fails to resolve first by searching the directory that the service assembly is in. This property is only applicable to services running inside of .NET Core host processes."
18+
},
19+
"entryPoint": {
20+
"type": "object",
21+
"description": "Host-specific parameters that describe how to activate this service.",
22+
"oneOf": [
23+
{
24+
"type": "object",
25+
"required": ["assemblyPath", "fullClassName"],
26+
"properties": {
27+
"assemblyPath": {
28+
"type": "string",
29+
"description": "The path to the assembly that carries the service entrypoint class, relative to this file."
30+
},
31+
"fullClassName": {
32+
"type": "string",
33+
"description": "The full name of the class to instantiate (that accepts a Stream in its constructor) when a new client requests this service."
34+
},
35+
"appBasePath": {
36+
"type": "string",
37+
"description": "The path that the AppDomain hosting the service should be configured to consider the ApplicationBase, relative to this file. Only applicable for services running inside .NET Framework Host processes."
38+
},
39+
"configPath": {
40+
"type": "string",
41+
"description": "The config file used to initialize the service's AppDomain. It may be omitted if the config file has the same name (+.config) as the service assembly, and resides in the same directory. It is also possible to have the service without the config file. Only applicable for services running inside .NET Framework host processes."
42+
},
43+
"assemblySearchPathsConfig": {
44+
"type": "string",
45+
"description": "A path to a file that should contain an array of paths that are to be used to resolve assemblies if neither this service's AssemblyLoadContext, or one of its friends can resolve the assembly. The paths can either be relative to the location of this file, or absolute. This property is only applicable for services running inside .NET Core host processes."
46+
}
47+
},
48+
"additionalProperties": false
49+
},
50+
{
51+
"type": "object",
52+
"required": ["scriptPath", "constructorFunction"],
53+
"properties": {
54+
"scriptPath": {
55+
"type": "string",
56+
"description": "The path to the .js file to 'require', relative to this file."
57+
},
58+
"constructorFunction": {
59+
"type": "string",
60+
"description": "The name of the constructor function to use (that accepts a stream) when a new client requests this service."
61+
}
62+
},
63+
"additionalProperties": false
64+
}
65+
]
66+
}
67+
},
68+
"oneOf": [
69+
{
70+
"type": "object",
71+
"required": ["hostConfiguration"],
72+
"properties": {
73+
"hostConfiguration": {
74+
"type": "string",
75+
"description": "Configuration information for how to start the service in a host process that it provides."
76+
}
77+
}
78+
},
79+
{
80+
"type": "object",
81+
"required": ["host"],
82+
"properties": {
83+
"host": {
84+
"type": "string",
85+
"description": "The name of the host that should activate the service."
86+
}
87+
}
88+
}
89+
]
90+
}

0 commit comments

Comments
 (0)