@dx-do/cli 5.2.37 → 5.2.38
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/README.md +2 -2
- package/dist-node/main.js +38 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npx @dx-do/cli@<version> <--config=<config-file>> command-group command <paramet
|
|
|
16
16
|
#### Output
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
ℹ info dx-do v5.2.
|
|
19
|
+
ℹ info dx-do v5.2.38 on node v24.14.1 on linux-x64 via node (ssl: 3.5.5)
|
|
20
20
|
ℹ info Loading configuration from env DXDO_CONFIGURATION (base64)
|
|
21
21
|
✔ success Command line configuration complete
|
|
22
22
|
ℹ info Allow Insecure HTTPS: false
|
|
@@ -359,7 +359,7 @@ npx @dx-do/cli@<version> <--config=<config-file>> command-group command <paramet
|
|
|
359
359
|
```
|
|
360
360
|
#### o2-alert
|
|
361
361
|
```o2-alert
|
|
362
|
-
⤜ update............................................: updates a platform alert spec
|
|
362
|
+
⤜ update............................................: updates a platform alert spec (dry-run by default)
|
|
363
363
|
⤜ list..............................................: lists platform alert specs, optionally filtered by management module
|
|
364
364
|
⤜ detail............................................: shows full detail of a platform alert spec
|
|
365
365
|
⤜ delete............................................: deletes a platform alert spec (dry-run by default)
|
package/dist-node/main.js
CHANGED
|
@@ -219095,8 +219095,8 @@ var semver3 = __toESM(require_semver2(), 1);
|
|
|
219095
219095
|
|
|
219096
219096
|
// src/runtime.ts
|
|
219097
219097
|
function getVersion() {
|
|
219098
|
-
if ("5.2.
|
|
219099
|
-
return "5.2.
|
|
219098
|
+
if ("5.2.38") {
|
|
219099
|
+
return "5.2.38";
|
|
219100
219100
|
} else {}
|
|
219101
219101
|
}
|
|
219102
219102
|
|
|
@@ -219385,7 +219385,10 @@ __export(exports_commands, {
|
|
|
219385
219385
|
addFolderTagsCommand: () => addFolderTagsCommand,
|
|
219386
219386
|
addFolderPermissionCommand: () => addFolderPermissionCommand,
|
|
219387
219387
|
addDashboardTagsCommand: () => addDashboardTagsCommand,
|
|
219388
|
-
acknowledgeCommand: () => acknowledgeCommand
|
|
219388
|
+
acknowledgeCommand: () => acknowledgeCommand,
|
|
219389
|
+
VALID_RESOLUTIONS: () => VALID_RESOLUTIONS,
|
|
219390
|
+
RESOLUTION_MAP: () => RESOLUTION_MAP,
|
|
219391
|
+
DEFAULT_ALERT_MESSAGE: () => DEFAULT_ALERT_MESSAGE
|
|
219389
219392
|
});
|
|
219390
219393
|
|
|
219391
219394
|
// src/app/util/validation/validation.ts
|
|
@@ -233814,7 +233817,11 @@ var eventQueryChangeEvent = buildCommand("event", "query-change-events", "execut
|
|
|
233814
233817
|
signale10.pending("querying change events");
|
|
233815
233818
|
const { startTime, endTime } = getDurationFromArgsMap(argsMap);
|
|
233816
233819
|
const output = await ServiceMonolith.dxEventService.queryChangeEvents(argsMap.get("query"), startTime, endTime);
|
|
233817
|
-
|
|
233820
|
+
if (output && output.hits && output._shards) {
|
|
233821
|
+
signale10.complete(`Query returned ${output?.hits?.total?.value ?? 0} results across ${output._shards.total} shards with ${output._shards.failed} failed shards in ${output.took}ms`);
|
|
233822
|
+
} else {
|
|
233823
|
+
signale10.complete("Query returned no results");
|
|
233824
|
+
}
|
|
233818
233825
|
OutputHandler.setDefaultHiddenFields(argsMap, [
|
|
233819
233826
|
"product_version",
|
|
233820
233827
|
"@product_id",
|
|
@@ -233824,7 +233831,7 @@ var eventQueryChangeEvent = buildCommand("event", "query-change-events", "execut
|
|
|
233824
233831
|
"@timestamp"
|
|
233825
233832
|
]);
|
|
233826
233833
|
return {
|
|
233827
|
-
output: output.hits.hits.map((hit) => hit._source),
|
|
233834
|
+
output: output.hits ? output.hits.hits.map((hit) => hit._source) : [],
|
|
233828
233835
|
testContinuationValue: "anything"
|
|
233829
233836
|
};
|
|
233830
233837
|
});
|
|
@@ -238306,7 +238313,11 @@ var inventorizeList = buildCommand("inventory", "list-inventorize-rules", "shows
|
|
|
238306
238313
|
"allowRegexOnAttributeName",
|
|
238307
238314
|
"timestamp"
|
|
238308
238315
|
]);
|
|
238309
|
-
if (output
|
|
238316
|
+
if (output) {
|
|
238317
|
+
if (output.length === 0) {
|
|
238318
|
+
signale10.warn("No Inventorize Rules Found");
|
|
238319
|
+
}
|
|
238320
|
+
} else {
|
|
238310
238321
|
signale10.warn("No Inventorize Rules Found");
|
|
238311
238322
|
}
|
|
238312
238323
|
return {
|
|
@@ -238605,6 +238616,7 @@ var disableJavascriptExtensionCommand = createCommand("jsextension", "disable",
|
|
|
238605
238616
|
});
|
|
238606
238617
|
// src/app/commands/log/query.ts
|
|
238607
238618
|
var FieldCondition = LogQuery.FieldCondition;
|
|
238619
|
+
var LogEntry = LogQuery.LogEntry;
|
|
238608
238620
|
var logQueryCommand = buildCommand("log", "query", "queries DXO2 Log analytics", {
|
|
238609
238621
|
addOutputOptions: true,
|
|
238610
238622
|
addTimeRangeOptions: true
|
|
@@ -238639,7 +238651,10 @@ var logQueryCommand = buildCommand("log", "query", "queries DXO2 Log analytics",
|
|
|
238639
238651
|
}, ors, severities);
|
|
238640
238652
|
signale10.debug("log query", logQueryBody);
|
|
238641
238653
|
const logQueryResults = await ServiceMonolith.dxLogsService.queryLogs(logQueryBody);
|
|
238642
|
-
|
|
238654
|
+
let output = [];
|
|
238655
|
+
if (logQueryResults && logQueryResults.response && logQueryResults.response.hits) {
|
|
238656
|
+
output = logQueryResults.response.hits ?? [];
|
|
238657
|
+
}
|
|
238643
238658
|
return {
|
|
238644
238659
|
output,
|
|
238645
238660
|
testContinuationValue: "anything"
|
|
@@ -239923,7 +239938,7 @@ var updateMetadataAttributeCommand = createCommand("nass", "update-metadata-attr
|
|
|
239923
239938
|
executionTime: 0
|
|
239924
239939
|
});
|
|
239925
239940
|
});
|
|
239926
|
-
// src/app/commands/o2-alert/
|
|
239941
|
+
// src/app/commands/o2-alert/alert-constants.ts
|
|
239927
239942
|
var RESOLUTION_MAP = {
|
|
239928
239943
|
"15s": 15,
|
|
239929
239944
|
"30s": 30,
|
|
@@ -239939,6 +239954,7 @@ var RESOLUTION_MAP = {
|
|
|
239939
239954
|
};
|
|
239940
239955
|
var VALID_RESOLUTIONS = Object.keys(RESOLUTION_MAP).join(", ");
|
|
239941
239956
|
var DEFAULT_ALERT_MESSAGE = "The alert ${alertName} has breached the ${severity} threshold of ${breached_threshold}";
|
|
239957
|
+
// src/app/commands/o2-alert/create.ts
|
|
239942
239958
|
var o2AlertCreateCommand = buildCommand("o2-alert", "create", "creates a new platform alert spec (dry-run by default)", { addOutputOptions: true }).setNormalArgumentDescriptors({
|
|
239943
239959
|
alertName: requiredArgument("name of the alert"),
|
|
239944
239960
|
metricGroupId: requiredArgument("id of the metric grouping to monitor"),
|
|
@@ -240229,21 +240245,7 @@ var o2AlertListCommand = buildCommand("o2-alert", "list", "lists platform alert
|
|
|
240229
240245
|
};
|
|
240230
240246
|
});
|
|
240231
240247
|
// src/app/commands/o2-alert/update.ts
|
|
240232
|
-
var
|
|
240233
|
-
"15s": 15,
|
|
240234
|
-
"30s": 30,
|
|
240235
|
-
"1m": 60,
|
|
240236
|
-
"2m": 120,
|
|
240237
|
-
"6m": 360,
|
|
240238
|
-
"12m": 720,
|
|
240239
|
-
"24m": 1440,
|
|
240240
|
-
"48m": 2880,
|
|
240241
|
-
"168m": 10080,
|
|
240242
|
-
"1h": 3600,
|
|
240243
|
-
"12h": 43200
|
|
240244
|
-
};
|
|
240245
|
-
var VALID_RESOLUTIONS2 = Object.keys(RESOLUTION_MAP2).join(", ");
|
|
240246
|
-
var o2AlertUpdateCommand = buildCommand("o2-alert", "update", "updates a platform alert spec", { addOutputOptions: true }).setNormalArgumentDescriptors({
|
|
240248
|
+
var o2AlertUpdateCommand = buildCommand("o2-alert", "update", "updates a platform alert spec (dry-run by default)", { addOutputOptions: true }).setNormalArgumentDescriptors({
|
|
240247
240249
|
id: requiredArgument("id of the alert spec to update"),
|
|
240248
240250
|
alertName: optionalArgument("new alert name"),
|
|
240249
240251
|
alertDescription: optionalArgument("new description"),
|
|
@@ -240252,7 +240254,7 @@ var o2AlertUpdateCommand = buildCommand("o2-alert", "update", "updates a platfor
|
|
|
240252
240254
|
operator: optionalArgument("threshold operator: GREATER_THAN | LESS_THAN | EQUAL_TO | NOT_EQUAL_TO"),
|
|
240253
240255
|
cautionThreshold: optionalArgument("new caution threshold value"),
|
|
240254
240256
|
dangerThreshold: optionalArgument("new danger threshold value"),
|
|
240255
|
-
resolution: optionalArgument(`check interval: ${
|
|
240257
|
+
resolution: optionalArgument(`check interval: ${VALID_RESOLUTIONS}`),
|
|
240256
240258
|
combinationMode: optionalArgument("combination mode: ANY | ALL"),
|
|
240257
240259
|
cautionObservedPeriods: optionalArgument("caution observed periods"),
|
|
240258
240260
|
cautionPeriodsOverThreshold: optionalArgument("caution periods over threshold"),
|
|
@@ -240261,7 +240263,8 @@ var o2AlertUpdateCommand = buildCommand("o2-alert", "update", "updates a platfor
|
|
|
240261
240263
|
closeOnNoData: optionalArgument("close alert when no data (true/false)"),
|
|
240262
240264
|
maxNoDataPeriods: optionalArgument("max periods with no data before closing"),
|
|
240263
240265
|
policyName: optionalArgument("notification policy name"),
|
|
240264
|
-
metricGroupId: optionalArgument("new metric grouping id")
|
|
240266
|
+
metricGroupId: optionalArgument("new metric grouping id"),
|
|
240267
|
+
"dry-run": optionalArgument("preview without updating (default: true, set to false to update)")
|
|
240265
240268
|
}).setPrefixArgumentDescriptors({}).setValidationFunction(async (validate4) => {
|
|
240266
240269
|
validate4.thatValueOfArgument("id").exists();
|
|
240267
240270
|
validate4.thatValueOfArgument("operator").isOneOf("GREATER_THAN", "LESS_THAN", "EQUAL_TO", "NOT_EQUAL_TO");
|
|
@@ -240296,6 +240299,7 @@ var o2AlertUpdateCommand = buildCommand("o2-alert", "update", "updates a platfor
|
|
|
240296
240299
|
policyName: argsMap.getUnsafe("policyName"),
|
|
240297
240300
|
metricGroupId: argsMap.getUnsafe("metricGroupId")
|
|
240298
240301
|
};
|
|
240302
|
+
const dryRun = argsMap.getUnsafe("dry-run") !== "false";
|
|
240299
240303
|
const hasUpdates = Object.values(updates).some((v2) => v2 !== undefined);
|
|
240300
240304
|
if (!hasUpdates) {
|
|
240301
240305
|
signale16.warn("No update fields provided.");
|
|
@@ -240311,9 +240315,9 @@ var o2AlertUpdateCommand = buildCommand("o2-alert", "update", "updates a platfor
|
|
|
240311
240315
|
const existingCfg = existing.attributes.alert;
|
|
240312
240316
|
let resolution = existingCfg.resolution;
|
|
240313
240317
|
if (updates.resolution !== undefined) {
|
|
240314
|
-
const mapped =
|
|
240318
|
+
const mapped = RESOLUTION_MAP[updates.resolution];
|
|
240315
240319
|
if (mapped === undefined) {
|
|
240316
|
-
signale16.error(`Invalid resolution '${updates.resolution}'. Must be one of: ${
|
|
240320
|
+
signale16.error(`Invalid resolution '${updates.resolution}'. Must be one of: ${VALID_RESOLUTIONS}`);
|
|
240317
240321
|
return { output: undefined };
|
|
240318
240322
|
}
|
|
240319
240323
|
resolution = mapped;
|
|
@@ -240386,6 +240390,13 @@ var o2AlertUpdateCommand = buildCommand("o2-alert", "update", "updates a platfor
|
|
|
240386
240390
|
custom: existing.attributes.custom
|
|
240387
240391
|
}
|
|
240388
240392
|
};
|
|
240393
|
+
if (dryRun) {
|
|
240394
|
+
signale16.star("Dry run complete. Set dry-run=false to update the alert.");
|
|
240395
|
+
return {
|
|
240396
|
+
output: saveRequest,
|
|
240397
|
+
testContinuationValue: saveRequest
|
|
240398
|
+
};
|
|
240399
|
+
}
|
|
240389
240400
|
signale16.pending(`Updating alert '${mergedConfig.alertName}'.`);
|
|
240390
240401
|
const result = await ServiceMonolith.dxPlatformAlertService.save(saveRequest);
|
|
240391
240402
|
signale16.success(`Alert '${mergedConfig.alertName}' updated.`);
|