cisco-perfmon 1.3.1 → 1.3.2

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.
Files changed (2) hide show
  1. package/main.js +6 -1
  2. package/package.json +2 -1
package/main.js CHANGED
@@ -1,3 +1,5 @@
1
+ // fetch-retry can also wrap Node.js's native fetch API implementation:
2
+ const fetch = require('fetch-retry')(global.fetch);
1
3
  const util = require("util");
2
4
  const parseString = require("xml2js").parseString;
3
5
  const stripPrefix = require("xml2js").processors.stripPrefix;
@@ -98,12 +100,15 @@ var XML_REMOVE_COUNTER_ENVELOPE = `<soapenv:Envelope xmlns:soapenv="http://schem
98
100
  class perfMonService {
99
101
  constructor(host, username, password, options) {
100
102
  this._OPTIONS = {
103
+ retries: 5,
104
+ retryDelay: 800,
105
+ retryOn: [503],
101
106
  method: "POST",
102
107
  headers: {
103
108
  Authorization: "Basic " + Buffer.from(username + ":" + password).toString("base64"),
104
109
  "Content-Type": "text/xml;charset=UTF-8",
105
110
  Connection: "keep-alive",
106
- },
111
+ }
107
112
  };
108
113
 
109
114
  // Adds additional headers if they are provided. Useful for adding cookies for SSO sessions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cisco-perfmon",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "A library to pull Perfmon data from Cisco VOS applications via SOAP",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "homepage": "https://github.com/sieteunoseis/cisco-perfmon#readme",
27
27
  "dependencies": {
28
+ "fetch-retry": "^6.0.0",
28
29
  "util": "*",
29
30
  "xml2js": "*"
30
31
  },