summaryrefslogtreecommitdiffstats
path: root/server/lib/external-backends/index.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-11-12 08:26:40 +0100
committerJannik Schönartz2018-11-12 08:26:40 +0100
commitb25692fdd948d25b2dcf39bd775d50849014c180 (patch)
tree45d76aa1ca78ea5dcf4937895b8d1a74934afa41 /server/lib/external-backends/index.js
parent[registration] add configurator for registration hooks (diff)
downloadbas-b25692fdd948d25b2dcf39bd775d50849014c180.tar.gz
bas-b25692fdd948d25b2dcf39bd775d50849014c180.tar.xz
bas-b25692fdd948d25b2dcf39bd775d50849014c180.zip
[idoit] Clients are now added to the idoit backend
Delete client in the backends if client is deleted in the bas. Add method for creating the client in the backends Add method for adding additional information to the client in the backend Add backend helper for calling all backends with the matching external id Add idoit mehtod for creating and updating a client
Diffstat (limited to 'server/lib/external-backends/index.js')
-rw-r--r--server/lib/external-backends/index.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/server/lib/external-backends/index.js b/server/lib/external-backends/index.js
index 9f99153..00d0da3 100644
--- a/server/lib/external-backends/index.js
+++ b/server/lib/external-backends/index.js
@@ -84,6 +84,16 @@ class ExternalBackends {
}
/*
+ * credendtials: <BACKEND_CREDENTIALS>
+ * objectIds: [<OBJECT_ID>, <OBJECT_ID>, ...]
+ *
+ * Deletes the objecs from the backend.
+ */
+ async deleteObjects (credentials, objectIds) {
+ return { status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have a deleteObject method' }
+ }
+
+ /*
* credentials: <BACKEND_CREDENTIALS>
* objects: [{ eid: <EXTERNAL_ID>, gid: <GROUP_ID> }, ...]
* EXTERNAL_ID is the id of the objects in the external backend requestet.
@@ -110,6 +120,24 @@ class ExternalBackends {
async getObjectTypes (credentials) {
return []
}
+
+ /*
+ * Adds the client to the backend.
+ *
+ * credentials: <BACKEND_CREDENTIALS>
+ * The client parameters are all optional. If the client has an id the object is not created but the categories of the object.
+ * client: {
+ * id: <CLIENT_ID>, title: <CLIENT_TITLE>, parentId: <PARENT_ID>,
+ * system: { model: <SYSTEM_MODEL>, manufacturer: <SYSTEM_MANUFACTURER>, serialnumber: <SYSTEM_SERIALNUMBER> },
+ * cpu: { model: <CPU_MODEL>, manufacturer: <CPU_MANUFACTURER>, type: <CPU_TYPE>, frequency: <CPU_FREQUENCY>, cores: <CPU_CORES> },
+ * ram: [{ model: <RAM_MODEL>, manufacturer: <RAM_MANUFACTURER>, type: <RAM_TYPE>, capacity: <RAM_CAPACITY>, unit: <RAM_UNIT> }, ...],
+ * storage: {},
+ * network: { mac: <MAC_ADDRESS>, ip: <IP_ADDRESS> }
+ * }
+ */
+ async addClient (credentials, client) {
+ return { success: false, status: 'NOT_IMPLEMENTED_EXCEPTION', error: 'The provided backend does not have an addClient method' }
+ }
}
module.exports = ExternalBackends