diff --git a/catapult-sdk/src/model/ModelSchemaBuilder.js b/catapult-sdk/src/model/ModelSchemaBuilder.js index b1046d17..a2e27a8f 100644 --- a/catapult-sdk/src/model/ModelSchemaBuilder.js +++ b/catapult-sdk/src/model/ModelSchemaBuilder.js @@ -248,7 +248,13 @@ class ModelSchemaBuilder { }, serverInfoData: { restVersion: ModelType.string, - sdkVersion: ModelType.string + sdkVersion: ModelType.string, + deployment: { type: ModelType.object, schemaName: 'deploymentData' } + }, + deploymentData: { + deploymentTool: ModelType.string, + deploymentToolVersion: ModelType.string, + lastUpdatedDate: ModelType.string }, stateTree: { tree: { type: ModelType.array, schemaName: ModelType.binary } diff --git a/catapult-sdk/test/model/ModelSchemaBuilder_spec.js b/catapult-sdk/test/model/ModelSchemaBuilder_spec.js index c0abc8b9..870cd841 100644 --- a/catapult-sdk/test/model/ModelSchemaBuilder_spec.js +++ b/catapult-sdk/test/model/ModelSchemaBuilder_spec.js @@ -104,6 +104,7 @@ describe('model schema builder', () => { 'nodeTime', 'serverInfo', 'serverInfoData', + 'deploymentData', 'stateTree', 'storageInfo' ]); @@ -179,7 +180,8 @@ describe('model schema builder', () => { 'nodeHealth.status', 'nodeTime.communicationTimestamps', - 'serverInfo.serverInfo' + 'serverInfo.serverInfo', + 'serverInfoData.deployment' ]); }); @@ -333,7 +335,11 @@ describe('model schema builder', () => { 'nodeInfo.friendlyName', 'nodeInfo.host', 'serverInfoData.restVersion', - 'serverInfoData.sdkVersion' + 'serverInfoData.sdkVersion', + 'deploymentData.deploymentTool', + 'deploymentData.deploymentToolVersion', + 'deploymentData.lastUpdatedDate' + ]); }); diff --git a/rest/resources/rest.json b/rest/resources/rest.json index 90d623d8..454f7af8 100644 --- a/rest/resources/rest.json +++ b/rest/resources/rest.json @@ -81,5 +81,11 @@ } }, - "numBlocksTransactionFeeStats": 300 + "numBlocksTransactionFeeStats": 300, + + "deployment": { + "deploymentTool": "", + "deploymentToolVersion": "", + "lastUpdatedDate": "" + } } diff --git a/rest/src/routes/nodeRoutes.js b/rest/src/routes/nodeRoutes.js index 70a4e6d7..27c821e6 100644 --- a/rest/src/routes/nodeRoutes.js +++ b/rest/src/routes/nodeRoutes.js @@ -142,11 +142,18 @@ module.exports = { }); server.get('/node/server', (req, res, next) => { + const { deployment } = services.config; res.send({ payload: { serverInfo: { restVersion, - sdkVersion + sdkVersion, + deployment: { + deploymentTool: deployment && deployment.deploymentTool ? deployment.deploymentTool : 'N/A', + deploymentToolVersion: deployment && deployment.deploymentToolVersion + ? deployment.deploymentToolVersion : 'N/A', + lastUpdatedDate: deployment && deployment.lastUpdatedDate ? deployment.lastUpdatedDate : 'N/A' + } } }, type: routeResultTypes.serverInfo diff --git a/rest/test/routes/nodeRoutes_spec.js b/rest/test/routes/nodeRoutes_spec.js index 3e7d9396..06783cd3 100644 --- a/rest/test/routes/nodeRoutes_spec.js +++ b/rest/test/routes/nodeRoutes_spec.js @@ -42,7 +42,12 @@ describe('node routes', () => { }) }, config: { - apiNode: { timeout: 1000 } + apiNode: { timeout: 1000 }, + deployment: { + deploymentTool: 'symbol-bootstrap', + deploymentToolVersion: '1.0.2', + lastUpdatedDate: '1900-01-01' + } } }); @@ -356,7 +361,12 @@ describe('node routes', () => { payload: { serverInfo: { restVersion, - sdkVersion + sdkVersion, + deployment: { + deploymentTool: 'symbol-bootstrap', + deploymentToolVersion: '1.0.2', + lastUpdatedDate: '1900-01-01' + } } }, type: 'serverInfo'