The Module Config endpoint is used to configure and control the nodes and modules in your cluster. It can be used to query for module configuration, update it, and start/stop the modules in the cluster.
This method will return a complete Smile CDR configuration property file. This is useful for example if you want to export a complete configuration from one environment in order to build another environment.
To invoke:
GET http://localhost:9000/module-config/properties
The server will produce a response resembling the following:
################################################################################
# Master
################################################################################
node.id=Master
################################################################################
# admin_json
################################################################################
module.admin_json.type=ADMIN_JSON
module.admin_json.requires.SECURITY_IN_UP=local_security
module.admin_json.config.cors.origins=*
module.admin_json.config.context_path=/
module.admin_json.config.threadpool.max=10
module.admin_json.config.sessions.timeout.mins=30
module.admin_json.config.threadpool.min=5
module.admin_json.config.sessions.scavenger.interval.millis=60000
module.admin_json.config.port=9000
For brevity only 1 module and a small subset of its configuration are shown but a real response might contain many more.
This method will return the complete configuration for the modules in your cluster. Note that passwords for external systems (e.g. database credentials) will be obscured.
To invoke:
GET http://localhost:9000/module-config/
The server will produce a response resembling the following:
{
"nodes": [
{
"nodeId": "Master",
"modules": [
{
"moduleId": "clustermgr",
"moduleType": "CLUSTER_MGR",
"options": [
{
"key": "kafka.ack_mode"
},
{
"key": "db.driver",
"value": "POSTGRES_9_4"
},
{
"key": "db.url",
"value": "jdbc:postgresql://localhost/cdr"
},
{
"key": "db.username",
"value": "cdr"
}
]
},
{
"moduleId": "local_security",
"moduleType": "SECURITY_IN_LOCAL",
"options": [
{
"key": "seed.username",
"value": "admin"
}
]
},
{
"moduleId": "smart_app_demo_host",
"moduleType": "SMART_APPS_HOST",
"options": [
{
"key": "port",
"value": "19201"
},
{
"key": "respect_forward_headers",
"value": "true"
}
]
}
]
}
]
}
For brevity only 1 module and a small subset of its configuration are shown but a real response might contain many more.
This method will return the complete configuration for a given module. Note that passwords for external systems (e.g. database credentials) will be obscured.
To invoke (substitute a node ID and module ID into the path below):
GET http://localhost:9000/module-config/{node_id}/{module_id}
The server will produce a response resembling the following:
{
"moduleType": "ADMIN_JSON",
"options": [
{
"key": "port",
"value": "19000"
},
{
"key": "respect_forward_headers",
"value": "true"
},
{
"key": "anonymous.access.enabled",
"value": "true"
},
{
"key": "security.http.basic.enabled",
"value": "true"
}
],
"dependencies": [
{
"moduleId": "local_security",
"type": "SECURITY_IN_UP"
}
]
}
Note that only settings which are not set to their default value are included in the response.
This method instantiates a new module.
To invoke (substitute a node ID and module ID into the path below):
POST http://localhost:9000/module-config/{node_id}/{module_id}/create[?start=true]
Content-Type: application/json
start=true
to the request URL in order to have the module automatically be started on all running processes for the given node after it is created.This call should include a body such as the following:
{
"moduleType": "ENDPOINT_FHIR_REST_DSTU3",
"options": [
{
"key": "anonymous.access.enabled",
"value": "true"
}
],
"dependencies": [
{
"type": "PERSISTENCE_DSTU3",
"moduleId": "persistence"
},
{
"type": "SECURITY_IN_OIC",
"moduleId": "smart_auth"
},
{
"type": "SECURITY_IN_UP",
"moduleId": "local_security"
}
]
}
In this example, a new module will be created with id {module_id} and the options and dependencies as they were set in the request body.
The module Types that can be created are listed Here.
You can find the applicable options for each module type under the Modules heading.
The server will produce a response resembling the following:
{
"options": [
{
"name": "cors.origins",
"previousValue": "https://example.com",
"newValue": "*"
}
]
}
This method updates configuration for a given module. This can include changing dependencies and updating configuration properties. Any number of dependencies and properties can be changed.
To invoke (substitute a node ID and module ID into the path below):
PUT http://localhost:9000/module-config/{node_id}/{module_id}/set
Content-Type: application/json
restart=true
to the request URL in order to have the module automatically be restarted on all running processes for the given node after the configuration has been updated.This call should include a body such as the following:
{
"options": [
{
"key": "cors.origins",
"value": "*"
}
]
}
Each option has two parts:
key
is the property key, such as the value security.http.basic.enabled
listed here.value
is the actual value to setIn this example, a single configuration item is being updated but many could be updated at one time.
The server will produce a response resembling the following:
{
"options": [
{
"key": "cors.origins",
"previousValue": "https://example.com",
"newValue": "*"
}
]
}
This method starts a given module if it isn't already running or in the process of starting (in which case this method has no effect). This operation will trigger a start on all running Node Processes.
To invoke (substitute a node ID and module ID into the path below):
POST http://localhost:9000/module-config/{node_id}/{module_id}/start
The server will produce a response resembling the following:
{
"processes": [
{
"processId": "LongPoint",
"previousStatus": "STOPPED",
"newStatus": "START_REQUESTED"
}
]
}
This method stops a given module if it isn't already stopped or in the process of stopping (in which case this method has no effect). This operation will trigger a stop on all running Node Processes.
To invoke (substitute a node ID and module ID into the path below):
POST http://localhost:9000/module-config/{node_id}/{module_id}/stop
The server will produce a response resembling the following:
{
"processes": [
{
"processId": "LongPoint",
"previousStatus": "STARTED",
"newStatus": "STOP_REQUESTED"
}
]
}
This method restarts a given module if it isn't already in the process of starting or stopping (in which case this method has no effect). This operation will trigger a restart on all running Node Processes.
To invoke (substitute a node ID and module ID into the path below):
POST http://localhost:9000/module-config/{node_id}/{module_id}/restart
The server will produce a response resembling the following:
{
"moduleId": "admin_web",
"previousStatus": "STARTED",
"newStatus": "RESTART_REQUESTED"
}
This method archives a given module. Note that this is a logical delete; the module will be retained in the database because audit logs and other elements may depend on it. It will be marked as "archived", a random string will be appended to its ID, and it will no longer appear in the list of modules.
To invoke (substitute a node ID and module ID into the path below):
DELETE http://localhost:9000/module-config/{node_id}/{module_id}/archive