summaryrefslogtreecommitdiffstats
path: root/server/lib/external-backends/backends
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-31 15:50:50 +0200
committerJannik Schönartz2019-03-31 15:50:50 +0200
commit0873cc0b67a5e3103f1efea8f3b6a18b116b0751 (patch)
tree7549966b862e400474c908b86871e17fa2d66961 /server/lib/external-backends/backends
parent[server/clients] add more responses (diff)
downloadbas-0873cc0b67a5e3103f1efea8f3b6a18b116b0751.tar.gz
bas-0873cc0b67a5e3103f1efea8f3b6a18b116b0751.tar.xz
bas-0873cc0b67a5e3103f1efea8f3b6a18b116b0751.zip
[server/registration] Performance improvements & add automatic registration with custom name
Manual registration now sends the client as json idoit: Add server bug fixes shell: Fix building pcbios ipxe version eslint fixes
Diffstat (limited to 'server/lib/external-backends/backends')
-rw-r--r--server/lib/external-backends/backends/idoit-backend.js30
1 files changed, 8 insertions, 22 deletions
diff --git a/server/lib/external-backends/backends/idoit-backend.js b/server/lib/external-backends/backends/idoit-backend.js
index c76b6bf..601c9f9 100644
--- a/server/lib/external-backends/backends/idoit-backend.js
+++ b/server/lib/external-backends/backends/idoit-backend.js
@@ -185,7 +185,7 @@ class IdoitBackend extends ExternalBackends {
if (client.formfactor) params.categories.C__CATG__FORMFACTOR = { 'data': { 'formfactor': client.formfactor, 'rackunits': client.formfactor.rackunits } }
// Rack segmentation
- if (client.location.bay) {
+ if (client.location.bay !== undefined && client.location.bay !== null) {
// Get all assigned objects of the rack (parentid) to check for existing rack segments at slot position.
const rackobjectsBody = this.getBody('cmdb.category.read', { 'apikey': c.apikey, 'object': client.parentId, 'objID': client.parentId, 'category': 'C__CATG__OBJECT' }, 'get_rack_objects')
const rackobjects = await this.axiosRequest(c.url, [rackobjectsBody], headers)
@@ -218,8 +218,8 @@ class IdoitBackend extends ExternalBackends {
'categories': {
'C__CATS__CHASSIS': {
'data': {
- 'front_x': 4,
- 'front_y': 2,
+ 'front_x': 2,
+ 'front_y': 1,
'rear_x': 0,
'rear_y': 0
}
@@ -231,7 +231,7 @@ class IdoitBackend extends ExternalBackends {
'from_x': 0,
'to_x': 0,
'from_y': 0,
- 'to_y': 1
+ 'to_y': 0
},
{
'title': 'Bay 2',
@@ -239,23 +239,7 @@ class IdoitBackend extends ExternalBackends {
'from_x': 1,
'to_x': 1,
'from_y': 0,
- 'to_y': 1
- },
- {
- 'title': 'Bay 3',
- 'insertion': 'front',
- 'from_x': 2,
- 'to_x': 2,
- 'from_y': 0,
- 'to_y': 1
- },
- {
- 'title': 'Bay 4',
- 'insertion': 'front',
- 'from_x': 3,
- 'to_x': 3,
- 'from_y': 0,
- 'to_y': 1
+ 'to_y': 0
}
],
'C__CATG__LOCATION': {
@@ -273,6 +257,7 @@ class IdoitBackend extends ExternalBackends {
const createSegment = await this.axiosRequest(c.url, [createSegmentParam], headers)
chassisId = createSegment[0].result.id
+ /*
// Set the new rack units height. (Needs an extra request, why? I DONT KNOW... idoit...)
const setSegmentSizeParams = this.getBody('cmdb.category.save', { 'apikey': c.apikey,
'object': chassisId,
@@ -280,6 +265,7 @@ class IdoitBackend extends ExternalBackends {
'category': 'C__CATG__FORMFACTOR',
'data': { 'rackunits': client.formfactor.rackunits } }, 'set_segment_size')
await this.axiosRequest(c.url, [setSegmentSizeParams], headers)
+ */
}
}
}
@@ -331,7 +317,7 @@ class IdoitBackend extends ExternalBackends {
// If chassis id is set, assign the object to the chassis bay
if (chassisId) {
- const bay = client.location.bay + ''
+ const bay = client.location.bay + 1 + ''
const assignToSlotBody = this.getBody('cmdb.category.save', { 'apikey': c.apikey,
'objID': chassisId,
'object': chassisId,