Skip to content

Commit

Permalink
feat: save additional values to mps mongo db
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbrache committed Oct 17, 2023
1 parent 5a487c7 commit 7853afd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/stateMachines/activation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ describe('Activation State Machine', () => {
client: 'PPC',
profile: 'profile1',
digestRealm: 'Digest:A3829B3827DE4D33D4449B366831FD01',
action: ClientAction.ADMINCTLMODE
action: ClientAction.ADMINCTLMODE,
ipConfiguration: { ipAddress: '' },
hostnameInfo: { dnsSuffixOS: '' }
}
},
ciraconfig: {},
Expand Down
11 changes: 10 additions & 1 deletion src/stateMachines/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,13 +967,22 @@ export class Activation {
const clientObj = devices[clientId]
/* Register device metadata with MPS */
try {
const deviceInfo = {
fwVersion: clientObj.ClientData.payload.ver,
fwBuild: clientObj.ClientData.payload.build,
fwSku: clientObj.ClientData.payload.sku,
currentMode: clientObj.ClientData.payload.currentMode?.toString(),
features: clientObj.ClientData.payload.features,
ipAddress: clientObj.ClientData.payload.ipConfiguration?.ipAddress
}
const url = `${Environment.Config.mps_server}/api/v1/devices`
const jsonData: any = {
guid: clientObj.uuid,
hostname: clientObj.hostname,
mpsusername: clientObj.mpsUsername,
tags: profile?.tags ?? [],
tenantId: profile.tenantId
tenantId: profile.tenantId,
deviceInfo
}
// friendlyName with an empty string indicates clearing the value
// otherwise, do not include the property so an update of the device
Expand Down

0 comments on commit 7853afd

Please sign in to comment.