opennms
Version:
Client API for the OpenNMS network monitoring platform
1 lines • 21.2 kB
JSON
{"remainingRequest":"/data/node_modules/babel-loader/lib/index.js!/data/node_modules/ts-loader/index.js!/data/src/api/ServerMetadata.ts","dependencies":[{"path":"/data/src/api/ServerMetadata.ts","mtime":1553611371628},{"path":"/data/node_modules/typescript-logging/dist/commonjs/typescript-logging.d.ts","mtime":1553611387808},{"path":"/data/node_modules/typescript-logging/dist/commonjs/control/LogGroupControl.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/control/CategoryServiceControl.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/MessagesToExtensionJSON.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/MessagesFromExtensionJSON.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/ExtensionMessageJSON.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/ExtensionHelper.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/AbstractCategoryLogger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/LoggerOptions.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryLogger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryService.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryConsoleLoggerImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryDelegateLoggerImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryMessageBufferImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/Logger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/LoggerFactory.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/LoggerFactoryService.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/LoggerFactoryRuntimeSettings.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/AbstractLogger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/ConsoleLoggerImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/MessageBufferLoggerImpl.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/utils/DataStructures.d.ts","mtime":1553611387936},{"path":"/data/node_modules/typescript-logging/dist/commonjs/utils/JSONHelper.d.ts","mtime":1553611387936},{"path":"/data/node_modules/typescript-logging/dist/commonjs/utils/MessageUtils.d.ts","mtime":1553611387936},{"path":"/data/node_modules/moment/moment.d.ts","mtime":1553611386704},{"path":"/data/node_modules/axios/index.d.ts","mtime":1553611386356},{"path":"/data/typings/index.d.ts","mtime":1553611371628},{"path":"/data/node_modules/@types/fs-extra/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/node/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/node/inspector.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/glob/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/minimatch/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/glob/node_modules/@types/minimatch/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/handlebars/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/highlight.js/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/jest/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/jquery/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/lodash/index.d.ts","mtime":1553611386320},{"path":"/data/node_modules/@types/lodash/common/common.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/array.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/collection.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/date.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/function.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/lang.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/math.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/number.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/object.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/seq.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/string.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/util.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/marked/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/shelljs/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/urijs/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/typescript/lib/lib.es2015.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.core.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.collection.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.generator.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.promise.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.iterable.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.symbol.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.proxy.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.reflect.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es5.d.ts","mtime":1553611387388},{"path":"/data/node_modules/typescript/lib/lib.dom.d.ts","mtime":1553611387384},{"path":"/data/src/api/OnmsVersion.ts","mtime":1553611371624},{"path":"/data/src/api/ServerType.ts","mtime":1553611371628},{"path":"/data/src/api/TicketerConfig.ts","mtime":1553611371628},{"path":"/data/.babelrc","mtime":1553611371556},{"path":"/data/node_modules/cache-loader/dist/cjs.js","mtime":1553611387012},{"path":"/data/node_modules/babel-loader/lib/index.js","mtime":1553611386992},{"path":"/data/node_modules/ts-loader/index.js","mtime":1553611386824}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OnmsVersion_1 = require(\"../api/OnmsVersion\");\nvar ServerType_1 = require(\"../api/ServerType\");\n/**\n * A class that represents the capabilities an OpenNMS server has and other information about it.\n * @module ServerMetadata\n */\n\nvar ServerMetadata = function () {\n /**\n * Construct a ServerMetadata object.\n * @constructor\n * @param version the version of the server\n * @param type the type of server (Horizon, Meridian)\n */\n function ServerMetadata(version, type) {\n _classCallCheck(this, ServerMetadata);\n\n if (version instanceof OnmsVersion_1.OnmsVersion) {\n this.version = version || new OnmsVersion_1.OnmsVersion('0.0.0');\n } else {\n this.version = new OnmsVersion_1.OnmsVersion(version || '0.0.0');\n }\n this.type = type || ServerType_1.ServerTypes.HORIZON;\n }\n /** Can you ack alarms through ReST? */\n\n\n _createClass(ServerMetadata, [{\n key: \"ackAlarms\",\n value: function ackAlarms() {\n return this.version.ge('14.0.0');\n }\n /** Does this server support flow data? */\n\n }, {\n key: \"flows\",\n value: function flows() {\n if (this.type && this.type === ServerType_1.ServerTypes.MERIDIAN) {\n return this.version.ge('2019.0.0');\n } else {\n return this.version.ge('22.0.0');\n }\n }\n /** Does this server support graphs? (ie, the measurements API) */\n\n }, {\n key: \"graphs\",\n value: function graphs() {\n if (this.type && this.type === ServerType_1.ServerTypes.MERIDIAN) {\n return this.version.ge('2016.1.0');\n } else {\n return this.version.ge('16.0.0');\n }\n }\n /** Does this server support outage summaries? */\n\n }, {\n key: \"outageSummaries\",\n value: function outageSummaries() {\n return this.version.ge('14.0.3');\n }\n /** Does this server support setting the location on a node? */\n\n }, {\n key: \"setNodeLocation\",\n value: function setNodeLocation() {\n return this.version.ge('15.0.2');\n }\n /** Is it safe to use JSON for most operations? */\n\n }, {\n key: \"useJson\",\n value: function useJson() {\n if (this.type && this.type === ServerType_1.ServerTypes.MERIDIAN) {\n return this.version.ge('2017.0.0');\n } else {\n return this.version.ge('19.0.0');\n }\n }\n /** Does this server support situations? */\n\n }, {\n key: \"situations\",\n value: function situations() {\n if (this.type && this.type === ServerType_1.ServerTypes.MERIDIAN) {\n return this.version.ge('2019.0.0');\n } else {\n return this.version.ge('23.0.0');\n }\n }\n /** Does this server support ticketer configuration metadata? */\n\n }, {\n key: \"ticketer\",\n value: function ticketer() {\n if (this.type && this.type === ServerType_1.ServerTypes.MERIDIAN) {\n return this.version.ge('2017.0.0');\n } else {\n return this.version.ge('21.0.0');\n }\n }\n /** What version of the ReST API does this server support? */\n\n }, {\n key: \"apiVersion\",\n value: function apiVersion() {\n if (this.type && this.type === ServerType_1.ServerTypes.MERIDIAN) {\n return this.version.ge('2017.1.0') ? 2 : 1;\n } else {\n return this.version.ge('20.1.0') ? 2 : 1;\n }\n }\n /** Returs a convenient data structure with all capabilities listed. */\n\n }, {\n key: \"capabilities\",\n value: function capabilities() {\n return {\n ackAlarms: this.ackAlarms(),\n apiVersion: this.apiVersion(),\n flows: this.flows(),\n graphs: this.graphs(),\n outageSummaries: this.outageSummaries(),\n setNodeLocation: this.setNodeLocation(),\n situations: this.situations(),\n ticketer: this.ticketer(),\n type: this.type === ServerType_1.ServerTypes.MERIDIAN ? 'Meridian' : 'Horizon'\n };\n }\n /** A human-readable representation of the metadata. */\n\n }, {\n key: \"toString\",\n value: function toString() {\n return 'ServerMetadata[version=' + this.version.toString() + ',apiVersion=' + this.apiVersion() + ',type=' + this.type.toString() + ',ackAlarms=' + this.ackAlarms() + ',flows=' + this.flows() + ',graphs=' + this.graphs() + ',outageSummaries=' + this.outageSummaries() + ',setNodeLocation=' + this.setNodeLocation() + ',situations=' + this.situations() + ',ticketer=' + this.ticketer() + ']';\n }\n /**\n * Create a new metadata object from this existing one.\n */\n\n }, {\n key: \"clone\",\n value: function clone() {\n return new ServerMetadata(this.version.clone(), this.type);\n }\n }]);\n\n return ServerMetadata;\n}();\n\nexports.ServerMetadata = ServerMetadata;",{"version":3,"file":"/data/src/api/ServerMetadata.ts","sourceRoot":"","sources":["/data/src/api/ServerMetadata.ts"],"names":[],"mappings":";;;;;;;AAAA,4BAA+C;AAC/C,2BAA0D;AAG1D,AAGG,AACH;;;;;;AAUE,AAKG;;;;;;AACH,4BAAY,AAA8B,SAAE,AAAiB;;;AAC3D,AAAE,AAAC,YAAC,AAAO,mBAAY,cAAW,AAAC,aAAC,AAAC;AACnC,AAAI,iBAAC,AAAO,UAAG,AAAO,WAAI,IAAI,cAAW,YAAC,AAAO,AAAC,AAAC,AACrD;AAAC,AAAC,AAAI,eAAC,AAAC;AACN,AAAI,iBAAC,AAAO,UAAG,IAAI,cAAW,YAAC,AAAO,WAAI,AAAO,AAAC,AAAC,AACrD;AAAC;AACD,AAAI,aAAC,AAAI,OAAG,AAAI,QAAI,aAAW,YAAC,AAAO,AAAC,AAC1C;AAAC;AAED,AAAuC,AAChC,AAAS;;;;;;AACd,AAAM,mBA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AAAC,AAC7D;AAAC,AACF;;;;;;AAlID,yBAkIC","sourcesContent":["import {OnmsVersion} from '../api/OnmsVersion';\nimport {ServerType, ServerTypes} from '../api/ServerType';\nimport {TicketerConfig} from './TicketerConfig';\n\n/**\n * A class that represents the capabilities an OpenNMS server has and other information about it.\n * @module ServerMetadata\n */\nexport class ServerMetadata {\n /** The version of the server. */\n public version: OnmsVersion;\n\n /** The type of server (Horizon, Meridian). */\n public type: ServerType;\n\n /** The ticketer config. Requires at least version 21.0.0 of OpenNMS. */\n public ticketerConfig: TicketerConfig;\n\n /**\n * Construct a ServerMetadata object.\n * @constructor\n * @param version the version of the server\n * @param type the type of server (Horizon, Meridian)\n */\n constructor(version?: string | OnmsVersion, type?: ServerType) {\n if (version instanceof OnmsVersion) {\n this.version = version || new OnmsVersion('0.0.0');\n } else {\n this.version = new OnmsVersion(version || '0.0.0');\n }\n this.type = type || ServerTypes.HORIZON;\n }\n\n /** Can you ack alarms through ReST? */\n public ackAlarms() {\n return this.version.ge('14.0.0');\n }\n\n /** Does this server support flow data? */\n public flows() {\n if (this.type && this.type === ServerTypes.MERIDIAN) {\n return this.version.ge('2019.0.0');\n } else {\n return this.version.ge('22.0.0');\n }\n }\n\n /** Does this server support graphs? (ie, the measurements API) */\n public graphs() {\n if (this.type && this.type === ServerTypes.MERIDIAN) {\n return this.version.ge('2016.1.0');\n } else {\n return this.version.ge('16.0.0');\n }\n }\n\n /** Does this server support outage summaries? */\n public outageSummaries() {\n return this.version.ge('14.0.3');\n }\n\n /** Does this server support setting the location on a node? */\n public setNodeLocation() {\n return this.version.ge('15.0.2');\n }\n\n /** Is it safe to use JSON for most operations? */\n public useJson() {\n if (this.type && this.type === ServerTypes.MERIDIAN) {\n return this.version.ge('2017.0.0');\n } else {\n return this.version.ge('19.0.0');\n }\n }\n\n /** Does this server support situations? */\n public situations() {\n if (this.type && this.type === ServerTypes.MERIDIAN) {\n return this.version.ge('2019.0.0');\n } else {\n return this.version.ge('23.0.0');\n }\n }\n\n /** Does this server support ticketer configuration metadata? */\n public ticketer() {\n if (this.type && this.type === ServerTypes.MERIDIAN) {\n return this.version.ge('2017.0.0');\n } else {\n return this.version.ge('21.0.0');\n }\n }\n\n /** What version of the ReST API does this server support? */\n public apiVersion() {\n if (this.type && this.type === ServerTypes.MERIDIAN) {\n return this.version.ge('2017.1.0') ? 2 : 1;\n } else {\n return this.version.ge('20.1.0') ? 2 : 1;\n }\n }\n\n /** Returs a convenient data structure with all capabilities listed. */\n public capabilities() {\n return {\n ackAlarms: this.ackAlarms(),\n apiVersion: this.apiVersion(),\n flows: this.flows(),\n graphs: this.graphs(),\n outageSummaries: this.outageSummaries(),\n setNodeLocation: this.setNodeLocation(),\n situations: this.situations(),\n ticketer: this.ticketer(),\n type: (this.type === ServerTypes.MERIDIAN ? 'Meridian' : 'Horizon'),\n };\n }\n\n /** A human-readable representation of the metadata. */\n public toString() {\n return 'ServerMetadata[version=' + this.version.toString()\n + ',apiVersion=' + this.apiVersion()\n + ',type=' + this.type.toString()\n + ',ackAlarms=' + this.ackAlarms()\n + ',flows=' + this.flows()\n + ',graphs=' + this.graphs()\n + ',outageSummaries=' + this.outageSummaries()\n + ',setNodeLocation=' + this.setNodeLocation()\n + ',situations=' + this.situations()\n + ',ticketer=' + this.ticketer()\n + ']';\n }\n\n /**\n * Create a new metadata object from this existing one.\n */\n public clone() {\n return new ServerMetadata(this.version.clone(), this.type);\n }\n}\n"]}]}