-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
113 lines (86 loc) · 5.97 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
This README file explains what the configuration-dashboard-server application is and how to run it in the local server.
TITLE: Configuration Dashboard Server
SUMMARY: This is the backend server application for the configuration-dashboard react application which exposes services for CRUD operations to be performed on each configuration.
-- PREREQUISITES --
1. Java 1.8 or higher
2. Play 2.6.x
3. SBT 1.x
4. Mongo 4.x.x
-- LIBRARY DEPENDENCIES --
1. org.mongodb -> mongo-java-driver-3.8.1
2. com.google.code.gson -> gson.2.2.4
3. ehcache-2.10.4
-- RUNNING THE APPLICATION --
Run `sbt run` from the root folder configuration-dashboard-server to have the application running. For the services to function, the mongo daemon should be started and the mongo instance should be running in localhost on port 27017
-- APPLICATION.CONF EXPLAINED --
1. CORS Filter enabled
2. Cache name is present.
3. Details to connect to Mongo DB instance is present.
-- AVAILABLE SERVICES AND ENDPOINTS --
=================================================================================================================================================================================================================
|S.NO.| METHOD | RELATIVE URL | SERVICE DETAILS |
=================================================================================================================================================================================================================
| 1. | GET | /find/:configId | To find the configuration JSON for the given configId. Triggered from UI on page load, on clicking add or update |
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| 2. | GET | /findAll | To find all the configurations to be listed in the dashboard. Returns a array of configId and configName values. Triggered from UI on clicking view |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 3. | POST | /save | To save a configuration JSON with configId and configName on clicking Add button |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 4. | POST | /update | To update a configuration JSON with configId and configName on clicking Add button |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 5. | GET | /delete/:configId | To delete a configuration for a given configId. Triggered from UI on clicking Delete |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 6. | POST | /updateReadOnlyProperties | To configure readonly properties for given keys in payload. Sample JSON is given below. Same endpoint is used for both saving and updating readonly keys| |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 7. | GET | /getReadOnlyProperties | To retrieve the currently configured readonly properties | |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 8. | GET | /getValueOfKey/:configId/:key | To retrieve the value for a given configId and key |
=================================================================================================================================================================================================================
-- READNONLY PROPERTIES EXPLAINED --
Sample Payload:
{
"property": "readOnly",
"keys": ["_id", "$oid", "configId", "dbSettings,#,host"]
}
Example Configuration:
{
"configuration": {
"configId": 1,
"configName": "Default",
"appSettings": {
"domain": "http://localhost",
"port": 8080,
"token": "A123",
"logging": {
"logLevel": "Debug"
},
"logoRelativeUrl": "/public/images/logo/logo.png",
"applicationName": "My First Application",
"version": "1.0.0"
},
"dbSettings": [{
"dbVariant": "oracle",
"host": "localhost",
"port": 1521,
"schema": "configDashboard",
"username": "orcl",
"password": "1234",
"queryString": "jdbc:oracle:thin:@localhost:1521:orcl"
},
{
"dbVariant": "mysql",
"host": "127.0.0.1",
"port": 3306,
"schema": "configDashboard",
"username": "root",
"password": "12345",
"queryString": "server=127.0.0.1;uid=root;pwd=12345;database=configDashboard"
}
]
}
}
The following examples are with reference to the above mentioned example configuration.
The keyPath is represented using comma-separated keys. To represent `applicationName`, the keyPath is appSettings,applicationName
To make `applicationName` read-only, the keys array in payload should contain "appSettings,applicationName" value.
To represent a key present in an array, # is used to represent all indexes of array. To represent `queryString`, the keyPath is dbSettings,#,queryString
To make `queryString` of all indexes of dbSettings array read-only, the keys array in payload should contain "dbSettings,#,queryString" value.