Difference between revisions of "GPII Services Configuration"
Line 132: | Line 132: | ||
"type": "gpii.server", | "type": "gpii.server", | ||
"options": { | "options": { | ||
+ | // GPII Server options | ||
"logging": true, | "logging": true, | ||
"port": 80 | "port": 80 | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
+ | <pre> | ||
+ | { | ||
+ | "typeName": "your configuration name", | ||
+ | "options": { | ||
+ | "gradeNames": ["autoInit", "fluid.littleComponent"], | ||
+ | "components": { | ||
+ | "server": { | ||
+ | "type": "gpii.server", | ||
+ | "components": { | ||
+ | "gpii app component": { | ||
+ | "type": "gpii.app", | ||
+ | "options": { | ||
+ | "some option": "some option value" // GPII App option | ||
+ | } | ||
+ | } | ||
} | } | ||
} | } |
Revision as of 17:15, 9 April 2013
Contents
Description
This is page contains all the necessary information on how to configure various components (Flow Manager, Match Maker, Device Reporter, etc) within the GPII framework.
The source code for the core framework and all platform independent components can be found here: GPII Universal
All platform specific components can be found in the following repositories:
GPII Server
gpii.server
component is one of the building blocks of the GPII framework you are deploying. It represents a single instance of a Node.js http server.
It serves as a container for one or more gpii.app
's (see below). A developer has an option of distributing as many gpii.app
's across as many gpii.server
's as part of their deployment.
The source code for the gpii.server
can be found here: gpii.server
GPII App
gpii.app
component is a component that represents a single purpose app deployed within a particular gpii.server
. Majority of the existing components within the GPII architecture that support the HTTP API (such as the Flow Manager, Device Reporter, Match Maker, Preferences Server, Solutions Registry, etc) are, in fact, gpii.app
s themselves.
The source code for the gpii.app
can be found here: gpii.app
A developer, generally, would not need to use these components directly in code and instead should be able to bootstrap the whole system with the configuration approach.
Creating a new configuration or editing an existing one for a specific GPII deployment essentially means setting up the appropriate GPII servers and GPII apps for a single deployment.
Creating Configuration File
There are several conventions in regards to where you configuration file should go (set for consistency and is not a technical constraint):
- If you are creating configuration for multiple apps, consider putting it in
universal/gpii/configs
if all your GPII apps are defined in a GPII Universal repository. If one or more apps are defined in a platform specific repository, your configuration files should go into a top levelconfigs
directory (Note: you might have to create it) within the appropriate platform specific repository. - If you are creating configuration for a single
gpii.app
, you need to save it in theconfigs
directory that corresponds to the location of that GPII app. Currently all GPII apps are located inuniversal/gpii/node_modules
(e.g. Preferences Server, Solutions Registry, etc). Thus, the config file should be located at this path:universal/gpii/node_modules/{some gpii app}/configs
.
Basic configuration
A single gpii.server
and no gpii.app
s will look like this:
{ "typeName": "your configuration name", "options": { "gradeNames": ["autoInit", "fluid.littleComponent"], "components": { // List of components to be deployed. "gpii server component": { // The name of the server component. "type": "gpii.server" // The type of the server compoennt. } } } }
Mulitple servers
Two gpii.server
s with no gpii.app
s will look like this:
{ "typeName": "your configuration name", "options": { "gradeNames": ["autoInit", "fluid.littleComponent"], "components": { "server one": { "type": "gpii.server" }, "server two": { "type": "gpii.server" } } } }
One server with one app
A single gpii.server
that contains a gpii.app
will look like this:
{ "typeName": "your configuration name", "options": { "gradeNames": ["autoInit", "fluid.littleComponent"], "components": { "server": { "type": "gpii.server", "components": { "gpii app component": { "type": "gpii.app" // For example: "gpii.preferencesServer" } } } } } }
One server with several apps
A single gpii.server
that contains two gpii.app
s will look like this:
{ "typeName": "your configuration name", "options": { "gradeNames": ["autoInit", "fluid.littleComponent"], "components": { "server": { "type": "gpii.server", "components": { "gpii app component": { "type": "gpii.app" }, "preferencesServer": { "type": "gpii.preferencesServer" } } } } } }
Options
Each GPII component is capable of interpreting optional parameters passed to it (these options are meant to override the default setting found in the actual component definition).
{ "typeName": "your configuration name", "options": { "gradeNames": ["autoInit", "fluid.littleComponent"], "components": { "gpii server component": { "type": "gpii.server", "options": { // GPII Server options "logging": true, "port": 80 } } } } }
{ "typeName": "your configuration name", "options": { "gradeNames": ["autoInit", "fluid.littleComponent"], "components": { "server": { "type": "gpii.server", "components": { "gpii app component": { "type": "gpii.app", "options": { "some option": "some option value" // GPII App option } } } } } } }