|
1 | | -#kdb-rest-service |
| 1 | +# kdb-rest-service |
2 | 2 |
|
3 | 3 | This is an open source rest service written in java which can be used to connect to an instance of kdb using json. The rest service can provide a single query to run or call a function predefined on the instance of kdb. |
4 | 4 |
|
5 | | -##Pre-requisite Configuration |
6 | | -#####Properties |
| 5 | +## Pre-requisite Configuration |
| 6 | +##### Properties |
7 | 7 | There is an application.properties file in the resources folder, connect the rest service and the instance of kdb by updating the properties below: |
8 | 8 |
|
9 | | -kdb.host=localhost |
| 9 | + kdb.host=localhost |
10 | 10 |
|
11 | | -kdb.port=6007 |
| 11 | + kdb.port=6007 |
12 | 12 |
|
13 | | -kdb.username=admin |
| 13 | + kdb.username=admin |
14 | 14 |
|
15 | | -kdb.password=admin |
| 15 | + kdb.password=admin |
16 | 16 |
|
17 | | -server.port=8080 |
| 17 | + server.port=8080 |
18 | 18 |
|
19 | 19 |
|
20 | | -#####EndPoints |
| 20 | +##### EndPoints |
21 | 21 | The kdb-rest-service provides two endpoints:executeFunction and executeQuery. |
22 | 22 |
|
23 | 23 | The executeFunction provides a means to call a predefined function and pass parameters to the kdb instance. |
24 | 24 | For example this is the format of a request call a function called plus which passes two arguments labelled "xarg" and "yarg" with values 96.3 and 9.7: |
25 | 25 |
|
26 | 26 | e.g. |
27 | 27 | { |
28 | | -"function_name" : "plus", |
29 | | -"arguments" : { |
30 | | - "xarg" : "96.3", |
31 | | - "yarg" : "9.7" |
| 28 | + |
| 29 | + "function_name" : "plus", |
| 30 | + "arguments" : |
| 31 | + { |
| 32 | + "xarg" : "96.3", |
| 33 | + "yarg" : "9.7" |
32 | 34 | } |
33 | 35 | } |
34 | 36 |
|
35 | 37 | The executeQuery provides a means to provide a query to the kdb instance, by default this endpoint is disabled using the property freeform.query.mode.enabled, to enable change the value to true. |
36 | 38 | For example this is the format of a synchronous query request where the user expects a response to be returned: |
37 | 39 |
|
| 40 | +e.g. |
38 | 41 | { |
39 | | -"type" : "sync", |
40 | | -"query" : "select from table", |
41 | | -"response" : true |
| 42 | + |
| 43 | + "type" : "sync", |
| 44 | + |
| 45 | + "query" : "select from table", |
| 46 | + |
| 47 | + "response" : true |
| 48 | + |
42 | 49 | } |
43 | 50 |
|
44 | | -#####Certificates |
| 51 | +##### Certificates |
45 | 52 | The requests are sent in HTTPS format and to provide this the project has a self-signed certifiate embedded within. It is strongly recommended that you add your own certificate. Updating the certificate will require and update to the following properties in application.properties: |
46 | 53 |
|
47 | | -security.require-ssl=true |
| 54 | + security.require-ssl=true |
48 | 55 |
|
49 | | -server.ssl.key-store-type=PKCS12 |
| 56 | + server.ssl.key-store-type=PKCS12 |
50 | 57 |
|
51 | | -server.ssl.key-store=classpath:keystore.p12 |
| 58 | + server.ssl.key-store=classpath:keystore.p12 |
52 | 59 |
|
53 | | -server.ssl.key-store-password=aquaq2018 |
| 60 | + server.ssl.key-store-password=aquaq2018 |
54 | 61 |
|
55 | | -server.ssl.key-alias=tomcat |
| 62 | + server.ssl.key-alias=tomcat |
56 | 63 |
|
57 | | -#####Authentication |
| 64 | +##### Authentication |
58 | 65 | The rest service uses basic authentication and is using a single username and password which are configured in the application.properties file: |
59 | 66 |
|
60 | | -basic.authentication.user=user |
| 67 | + basic.authentication.user=user |
61 | 68 |
|
62 | | -basic.authentication.password=pass |
| 69 | + basic.authentication.password=pass |
63 | 70 |
|
64 | 71 | These value are provided within the header of the request, it is strongly recommended to invoke your own security if you use the project. |
65 | 72 |
|
66 | 73 |
|
67 | | -##Deploying |
| 74 | +## Deploying |
68 | 75 |
|
69 | 76 | There is a DockerFile within the project for deploying the project on docker. |
70 | 77 |
|
71 | 78 | Alternatively it can be run locally by providing the appropriate build configuration via command line or ide. |
72 | 79 |
|
73 | | -##Built with |
| 80 | +## Built with |
74 | 81 | Maven |
75 | 82 |
|
76 | | -##Licensing |
| 83 | +## Licensing |
77 | 84 | Please see license file. |
78 | 85 |
|
79 | | -##Contributing |
| 86 | +## Contributing |
80 | 87 | The branch is currently locked down and will require a pull request reviewed by a member of the aquaq team before any changes can be committed. |
0 commit comments