@itentialopensource/adapter-nokia_altiplano 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/pronghorn.json CHANGED
@@ -386,6 +386,198 @@
386
386
  },
387
387
  "task": true
388
388
  },
389
+ {
390
+ "name": "moveEntitiesToDB",
391
+ "summary": "Moves entities from an adapter into the IAP database",
392
+ "description": "Moves entities from an adapter into the IAP database",
393
+ "input": [],
394
+ "output": {
395
+ "name": "res",
396
+ "type": "object",
397
+ "description": "A JSON Object containing status, code and the response from the mongo transaction",
398
+ "schema": {
399
+ "title": "res",
400
+ "type": "object"
401
+ }
402
+ },
403
+ "roles": [
404
+ "admin"
405
+ ],
406
+ "route": {
407
+ "verb": "POST",
408
+ "path": "/moveEntitiesToDB"
409
+ },
410
+ "task": true
411
+ },
412
+ {
413
+ "name": "getDevice",
414
+ "summary": "Get the Appliance",
415
+ "description": "Get the Appliance",
416
+ "input": [
417
+ {
418
+ "name": "deviceName",
419
+ "type": "string",
420
+ "info": "An Appliance Device Name",
421
+ "required": true,
422
+ "schema": {
423
+ "title": "deviceName",
424
+ "type": "string"
425
+ }
426
+ }
427
+ ],
428
+ "output": {
429
+ "name": "result",
430
+ "type": "object",
431
+ "description": "A JSON Object containing status, code and the result",
432
+ "schema": {
433
+ "title": "result",
434
+ "type": "object"
435
+ }
436
+ },
437
+ "roles": [
438
+ "admin"
439
+ ],
440
+ "route": {
441
+ "verb": "POST",
442
+ "path": "/getDevice"
443
+ },
444
+ "task": false
445
+ },
446
+ {
447
+ "name": "getDevicesFiltered",
448
+ "summary": "Get Appliances that match the filter",
449
+ "description": "Get Appliances that match the filter",
450
+ "input": [
451
+ {
452
+ "name": "options",
453
+ "type": "object",
454
+ "info": "options - e.g. { 'start': 1, 'limit': 20, 'filter': { 'name': 'abc123' } }",
455
+ "required": true,
456
+ "schema": {
457
+ "title": "options",
458
+ "type": "object"
459
+ }
460
+ }
461
+ ],
462
+ "output": {
463
+ "name": "result",
464
+ "type": "array",
465
+ "description": "A JSON Object containing status, code and the result",
466
+ "schema": {
467
+ "title": "result",
468
+ "type": "array"
469
+ }
470
+ },
471
+ "roles": [
472
+ "admin"
473
+ ],
474
+ "route": {
475
+ "verb": "POST",
476
+ "path": "/getDevicesFiltered"
477
+ },
478
+ "task": false
479
+ },
480
+ {
481
+ "name": "isAlive",
482
+ "summary": "Checks the status for the provided Appliance",
483
+ "description": "Checks the status for the provided Appliance",
484
+ "input": [
485
+ {
486
+ "name": "deviceName",
487
+ "type": "string",
488
+ "info": "An Appliance Device Name",
489
+ "required": true,
490
+ "schema": {
491
+ "title": "deviceName",
492
+ "type": "string"
493
+ }
494
+ }
495
+ ],
496
+ "output": {
497
+ "name": "result",
498
+ "type": "boolean",
499
+ "description": "A JSON Object containing status, code and the result",
500
+ "schema": {
501
+ "title": "result",
502
+ "type": "boolean"
503
+ }
504
+ },
505
+ "roles": [
506
+ "admin"
507
+ ],
508
+ "route": {
509
+ "verb": "POST",
510
+ "path": "/isAlive"
511
+ },
512
+ "task": false
513
+ },
514
+ {
515
+ "name": "getConfig",
516
+ "summary": "Gets a config for the provided Appliance",
517
+ "description": "Gets a config for the provided Appliance",
518
+ "input": [
519
+ {
520
+ "name": "deviceName",
521
+ "type": "string",
522
+ "info": "An Appliance Device Name",
523
+ "required": true,
524
+ "schema": {
525
+ "title": "deviceName",
526
+ "type": "string"
527
+ }
528
+ },
529
+ {
530
+ "name": "format",
531
+ "type": "string",
532
+ "info": "The format to be returned - this is ignored as we always return json",
533
+ "required": false,
534
+ "schema": {
535
+ "title": "format",
536
+ "type": "string"
537
+ }
538
+ }
539
+ ],
540
+ "output": {
541
+ "name": "result",
542
+ "type": "object",
543
+ "description": "A JSON Object containing status, code and the result",
544
+ "schema": {
545
+ "title": "result",
546
+ "type": "object"
547
+ }
548
+ },
549
+ "roles": [
550
+ "admin"
551
+ ],
552
+ "route": {
553
+ "verb": "POST",
554
+ "path": "/getConfig"
555
+ },
556
+ "task": false
557
+ },
558
+ {
559
+ "name": "getCount",
560
+ "summary": "Gets a device count from the system",
561
+ "description": "Gets a device count from the system",
562
+ "input": [],
563
+ "output": {
564
+ "name": "result",
565
+ "type": "object",
566
+ "description": "A JSON Object containing status, code and the result",
567
+ "schema": {
568
+ "title": "result",
569
+ "type": "object"
570
+ }
571
+ },
572
+ "roles": [
573
+ "admin"
574
+ ],
575
+ "route": {
576
+ "verb": "POST",
577
+ "path": "/getCount"
578
+ },
579
+ "task": false
580
+ },
389
581
  {
390
582
  "name": "getAccessToken",
391
583
  "summary": "GetAccessToken",
@@ -795,6 +987,194 @@
795
987
  },
796
988
  "task": true
797
989
  },
990
+ {
991
+ "name": "createOntWithQuery",
992
+ "summary": "Create ont with query",
993
+ "description": "Create ont with query",
994
+ "input": [
995
+ {
996
+ "name": "body",
997
+ "type": "object",
998
+ "info": ": {\"ibn:intent\": {\"target\": \"string\", \"intent-type\": \"string\", \"intent-type-version\": \"string\", \"required-network-state\": \"string\", \"intent-specific-data\": {\"ont:ont\": {\"ont-type\": \"string\", \"fiber-name\": \"string\", \"expected-serial-number\": \"string\", \"onu-service-profile\": \"string\", \"uni-service-configuration\": {\"uni-id\": \"string\", \"service-profile\": \"string\"}}}}}",
999
+ "required": true,
1000
+ "schema": {
1001
+ "title": "CreateontRequest",
1002
+ "required": [
1003
+ "ibn:intent"
1004
+ ],
1005
+ "type": "object",
1006
+ "properties": {
1007
+ "ibn:intent": {
1008
+ "title": "IbnIntent",
1009
+ "required": [
1010
+ "target",
1011
+ "intent-type",
1012
+ "intent-type-version",
1013
+ "required-network-state",
1014
+ "intent-specific-data"
1015
+ ],
1016
+ "type": "object",
1017
+ "properties": {
1018
+ "target": {
1019
+ "type": "string"
1020
+ },
1021
+ "intent-type": {
1022
+ "type": "string"
1023
+ },
1024
+ "intent-type-version": {
1025
+ "type": "string"
1026
+ },
1027
+ "required-network-state": {
1028
+ "type": "string"
1029
+ },
1030
+ "intent-specific-data": {
1031
+ "title": "IntentSpecificData",
1032
+ "required": [
1033
+ "ont:ont"
1034
+ ],
1035
+ "type": "object",
1036
+ "properties": {
1037
+ "ont:ont": {
1038
+ "title": "OntOnt",
1039
+ "required": [
1040
+ "ont-type",
1041
+ "fiber-name",
1042
+ "expected-serial-number",
1043
+ "onu-service-profile",
1044
+ "uni-service-configuration"
1045
+ ],
1046
+ "type": "object",
1047
+ "properties": {
1048
+ "ont-type": {
1049
+ "type": "string"
1050
+ },
1051
+ "fiber-name": {
1052
+ "type": "string"
1053
+ },
1054
+ "expected-serial-number": {
1055
+ "type": "string"
1056
+ },
1057
+ "onu-service-profile": {
1058
+ "type": "string"
1059
+ },
1060
+ "uni-service-configuration": {
1061
+ "title": "UniServiceConfiguration",
1062
+ "required": [
1063
+ "uni-id",
1064
+ "service-profile"
1065
+ ],
1066
+ "type": "object",
1067
+ "properties": {
1068
+ "uni-id": {
1069
+ "type": "string"
1070
+ },
1071
+ "service-profile": {
1072
+ "type": "string"
1073
+ }
1074
+ },
1075
+ "example": {
1076
+ "uni-id": "LAN1",
1077
+ "service-profile": "default"
1078
+ }
1079
+ }
1080
+ },
1081
+ "example": {
1082
+ "ont-type": "G-010G-Q",
1083
+ "fiber-name": "INES-1-1-4-3",
1084
+ "expected-serial-number": "ALCLF846403A",
1085
+ "onu-service-profile": "default",
1086
+ "uni-service-configuration": {
1087
+ "uni-id": "LAN1",
1088
+ "service-profile": "default"
1089
+ }
1090
+ }
1091
+ }
1092
+ },
1093
+ "example": {
1094
+ "ont:ont": {
1095
+ "ont-type": "G-010G-Q",
1096
+ "fiber-name": "INES-1-1-4-3",
1097
+ "expected-serial-number": "ALCLF846403A",
1098
+ "onu-service-profile": "default",
1099
+ "uni-service-configuration": {
1100
+ "uni-id": "LAN1",
1101
+ "service-profile": "default"
1102
+ }
1103
+ }
1104
+ }
1105
+ }
1106
+ },
1107
+ "example": {
1108
+ "target": "INES-1-1-4-3-a",
1109
+ "intent-type": "ont",
1110
+ "intent-type-version": "4",
1111
+ "required-network-state": "active",
1112
+ "intent-specific-data": {
1113
+ "ont:ont": {
1114
+ "ont-type": "G-010G-Q",
1115
+ "fiber-name": "INES-1-1-4-3",
1116
+ "expected-serial-number": "ALCLF846403A",
1117
+ "onu-service-profile": "default",
1118
+ "uni-service-configuration": {
1119
+ "uni-id": "LAN1",
1120
+ "service-profile": "default"
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ }
1126
+ },
1127
+ "example": {
1128
+ "ibn:intent": {
1129
+ "target": "INES-1-1-4-3-a",
1130
+ "intent-type": "ont",
1131
+ "intent-type-version": "4",
1132
+ "required-network-state": "active",
1133
+ "intent-specific-data": {
1134
+ "ont:ont": {
1135
+ "ont-type": "G-010G-Q",
1136
+ "fiber-name": "INES-1-1-4-3",
1137
+ "expected-serial-number": "ALCLF846403A",
1138
+ "onu-service-profile": "default",
1139
+ "uni-service-configuration": {
1140
+ "uni-id": "LAN1",
1141
+ "service-profile": "default"
1142
+ }
1143
+ }
1144
+ }
1145
+ }
1146
+ }
1147
+ }
1148
+ },
1149
+ {
1150
+ "name": "query",
1151
+ "type": "object",
1152
+ "info": "{\"altiplano-triggerSyncUponSuccess\": \"true\"}",
1153
+ "required": true,
1154
+ "schema": {
1155
+ "title": "query",
1156
+ "type": "object"
1157
+ }
1158
+ }
1159
+ ],
1160
+ "output": {
1161
+ "name": "result",
1162
+ "type": "object",
1163
+ "description": "A JSON Object containing status, code and the result",
1164
+ "schema": {
1165
+ "title": "result",
1166
+ "type": "object"
1167
+ }
1168
+ },
1169
+ "roles": [
1170
+ "admin"
1171
+ ],
1172
+ "route": {
1173
+ "verb": "POST",
1174
+ "path": "/createOntWithQuery"
1175
+ },
1176
+ "task": true
1177
+ },
798
1178
  {
799
1179
  "name": "getOnt",
800
1180
  "summary": "GET ont",
@@ -837,4 +837,4 @@
837
837
  }
838
838
  }
839
839
  }
840
- }
840
+ }
Binary file
@@ -0,0 +1,95 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 30
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 13
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 7
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 23
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^4.44.11"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 64
43
+ },
44
+ {
45
+ "owner": "readmeMd",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 688
48
+ },
49
+ {
50
+ "owner": "unitTestJS",
51
+ "description": "Number of lines of code in unit tests",
52
+ "value": 1822
53
+ },
54
+ {
55
+ "owner": "unitTestJS",
56
+ "description": "Number of unit tests",
57
+ "value": 86
58
+ },
59
+ {
60
+ "owner": "integrationTestJS",
61
+ "description": "Number of lines of code in integration tests",
62
+ "value": 859
63
+ },
64
+ {
65
+ "owner": "integrationTestJS",
66
+ "description": "Number of integration tests",
67
+ "value": 20
68
+ },
69
+ {
70
+ "owner": "staticFile",
71
+ "description": "Number of lines of code in adapterBase.js",
72
+ "value": 1029
73
+ },
74
+ {
75
+ "owner": "staticFile",
76
+ "description": "Number of static files added",
77
+ "value": 34
78
+ },
79
+ {
80
+ "owner": "Overall",
81
+ "description": "Total lines of Code",
82
+ "value": 3710
83
+ },
84
+ {
85
+ "owner": "Overall",
86
+ "description": "Total Tests",
87
+ "value": 106
88
+ },
89
+ {
90
+ "owner": "Overall",
91
+ "description": "Total Files",
92
+ "value": 6
93
+ }
94
+ ]
95
+ }
@@ -7,7 +7,7 @@
7
7
  "base_path": "/rest",
8
8
  "version": "",
9
9
  "cache_location": "none",
10
- "encode_pathvars": true,
10
+ "encode_pathvars": false,
11
11
  "save_metric": true,
12
12
  "stub": true,
13
13
  "protocol": "https",
@@ -20,7 +20,7 @@
20
20
  "token_cache": "local",
21
21
  "invalid_token_error": 401,
22
22
  "auth_field": "header.headers.Authorization",
23
- "auth_field_format": "{token}",
23
+ "auth_field_format": "Bearer {token}",
24
24
  "auth_logging": false,
25
25
  "client_id": "",
26
26
  "client_secret": "",
@@ -13,7 +13,10 @@ const winston = require('winston');
13
13
  const { expect } = require('chai');
14
14
  const { use } = require('chai');
15
15
  const td = require('testdouble');
16
+ const util = require('util');
17
+ const pronghorn = require('../../pronghorn.json');
16
18
 
19
+ pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
17
20
  const anything = td.matchers.anything();
18
21
 
19
22
  // stub and attemptTimeout are used throughout the code so set them here
@@ -468,6 +471,7 @@ describe('[integration] Nokia_altiplano Adapter Test', () => {
468
471
  }
469
472
  }
470
473
  };
474
+
471
475
  describe('#createOnt - errors', () => {
472
476
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
473
477
  try {
@@ -493,6 +497,31 @@ describe('[integration] Nokia_altiplano Adapter Test', () => {
493
497
  }).timeout(attemptTimeout);
494
498
  });
495
499
 
500
+ describe('#createOntWithQuery - errors', () => {
501
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
502
+ try {
503
+ a.createOntWithQuery(intentCreateOntBodyParam, {}, (data, error) => {
504
+ try {
505
+ if (stub) {
506
+ const displayE = 'Error 400 received on request';
507
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_altiplano-connectorRest-handleEndResponse', displayE);
508
+ } else {
509
+ runCommonAsserts(data, error);
510
+ }
511
+ saveMockData('Intent', 'createOnt', 'default', data);
512
+ done();
513
+ } catch (err) {
514
+ log.error(`Test Failure: ${err}`);
515
+ done(err);
516
+ }
517
+ });
518
+ } catch (error) {
519
+ log.error(`Adapter Exception: ${error}`);
520
+ done(error);
521
+ }
522
+ }).timeout(attemptTimeout);
523
+ });
524
+
496
525
  const intentIntent = 'fakedata';
497
526
  describe('#dependentsSummaryFiber - errors', () => {
498
527
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
@@ -317,7 +317,7 @@ describe('[unit] Adapter Base Test', () => {
317
317
  });
318
318
  it('should return a list of functions', (done) => {
319
319
  const returnedFunctions = ['addEntityCache', 'capabilityResults', 'checkActionFiles', 'checkProperties', 'connect', 'encryptProperty',
320
- 'entityInList', 'findPath', 'getAllCapabilities', 'getAllFunctions', 'getQueue', 'getWorkflowFunctions', 'healthCheck',
320
+ 'entityInList', 'findPath', 'getAllCapabilities', 'getAllFunctions', 'getQueue', 'getWorkflowFunctions', 'healthCheck', 'moveEntitiesToDB',
321
321
  'refreshProperties', 'runBasicGet', 'runConnectivity', 'runHealthcheck', 'suspend', 'troubleshoot', 'unsuspend', 'updateAdapterConfiguration', 'addListener',
322
322
  'emit', 'eventNames', 'getMaxListeners', 'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener',
323
323
  'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];