-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add command for listing/exporting info about reload tasks
Implements #105
- Loading branch information
Göran Sander
committed
Oct 26, 2022
1 parent
851416e
commit 9c1e0c9
Showing
15 changed files
with
1,945 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const mapDaylightSavingTime = new Map([ | ||
[0, 'ObserveDaylightSavingTime'], | ||
[1, 'PermanentStandardTime'], | ||
[2, 'PermanentDaylightSavingTime'], | ||
]); | ||
|
||
const mapEventType = new Map([ | ||
[0, 'Schema'], | ||
[1, 'Composite'], | ||
]); | ||
|
||
const mapIncrementOption = new Map([ | ||
[0, 'once'], | ||
[1, 'hourly'], | ||
[2, 'daily'], | ||
[3, 'weekly'], | ||
[4, 'monthly'], | ||
[5, 'custom'], | ||
]); | ||
|
||
const mapRuleState = new Map([ | ||
[0, 'Undefined'], | ||
[1, 'TaskSuccessful'], | ||
[2, 'TaskFail'], | ||
]); | ||
|
||
const mapTaskExecutionStatus = new Map([ | ||
[0, 'NeverStarted'], | ||
[1, 'Triggered'], | ||
[2, 'Started'], | ||
[3, 'Queued'], | ||
[4, 'AbortInitiated'], | ||
[5, 'Aborting'], | ||
[6, 'Aborted'], | ||
[7, 'FinishedSuccess'], | ||
[8, 'FinishedFail'], | ||
[9, 'Skipped'], | ||
[10, 'Retry'], | ||
[11, 'Error'], | ||
[12, 'Reset'], | ||
]); | ||
|
||
const mapTaskType = new Map([ | ||
[0, 'Reload'], | ||
[1, 'ExternalProgram'], | ||
[2, 'UserSync'], | ||
[3, 'Distribute'], | ||
]); | ||
|
||
module.exports = { | ||
mapDaylightSavingTime, | ||
mapEventType, | ||
mapIncrementOption, | ||
mapRuleState, | ||
mapTaskExecutionStatus, | ||
mapTaskType, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const https = require('https'); | ||
|
||
const { logger, generateXrfKey, readCert } = require('../globals'); | ||
|
||
const setupQRSConnection = (options, param) => { | ||
const httpsAgent = new https.Agent({ | ||
rejectUnauthorized: false, | ||
cert: readCert(param.fileCert), | ||
key: readCert(param.fileCertKey), | ||
}); | ||
|
||
// Set up Sense repository service configuration | ||
const xrfKey = generateXrfKey(); | ||
|
||
const axiosConfig = { | ||
url: `${param.path}?xrfkey=${xrfKey}`, | ||
method: 'get', | ||
baseURL: `https://${options.host}:${options.port}`, | ||
headers: { | ||
'x-qlik-xrfkey': xrfKey, | ||
'X-Qlik-User': 'UserDirectory=Internal; UserId=sa_api', | ||
}, | ||
responseType: 'application/json', | ||
httpsAgent, | ||
timeout: 60000, | ||
// passphrase: "YYY" | ||
}; | ||
|
||
if (param.filter?.length > 0) { | ||
axiosConfig.url += `&filter=${param.filter}`; | ||
} | ||
|
||
return axiosConfig; | ||
}; | ||
|
||
module.exports = { | ||
setupQRSConnection, | ||
}; |
Oops, something went wrong.