@opscompass/skills 0.1.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/README.md +78 -0
- package/manifest.json +35 -0
- package/package.json +23 -0
- package/skills/opscompass-oracle-licensing/.opscompass-runtime/tools/cli-entrypoint.js +15 -0
- package/skills/opscompass-oracle-licensing/SKILL.md +211 -0
- package/skills/opscompass-oracle-licensing/api/entitlement-compliance/entitlement-compliance.json +189 -0
- package/skills/opscompass-oracle-licensing/api/entitlement-deployment/entitlement-deployment +26 -0
- package/skills/opscompass-oracle-licensing/api/entitlement-usage/entitlement-usage.json +114 -0
- package/skills/opscompass-oracle-licensing/assets/mock-entitlements/deployment-details.json +61 -0
- package/skills/opscompass-oracle-licensing/assets/mock-entitlements/license-usage-map.json +70 -0
- package/skills/opscompass-oracle-licensing/assets/mock-entitlements/overall-compliance.json +36 -0
- package/skills/opscompass-oracle-licensing/package.json +3 -0
- package/skills/opscompass-oracle-licensing/references/evidence-model.md +90 -0
- package/skills/opscompass-oracle-licensing/references/report-structure.md +54 -0
- package/skills/opscompass-oracle-licensing/scripts/fake-entitlements-api.tool.js +31 -0
- package/skills/opscompass-oracle-licensing/scripts/fake_entitlements_api.js +72 -0
- package/skills/opscompass-oracle-licensing/scripts/tools.js +2 -0
- package/skills/opscompass-resources/.opscompass-runtime/tools/cli-entrypoint.js +15 -0
- package/skills/opscompass-resources/.opscompass-runtime/tools/index.js +2 -0
- package/skills/opscompass-resources/.opscompass-runtime/tools/opsc-cli-context.js +24 -0
- package/skills/opscompass-resources/.opscompass-runtime/tools/opsc-cli-defaults.js +125 -0
- package/skills/opscompass-resources/.opscompass-runtime/tools/opsc-cli.js +90 -0
- package/skills/opscompass-resources/SKILL.md +335 -0
- package/skills/opscompass-resources/package.json +3 -0
- package/skills/opscompass-resources/references/resources-commands.md +178 -0
- package/skills/opscompass-resources/scripts/build-resources-command.tool.js +53 -0
- package/skills/opscompass-resources/scripts/build_resources_command.js +240 -0
- package/skills/opscompass-resources/scripts/list-and-fetch-latest-configs.tool.js +116 -0
- package/skills/opscompass-resources/scripts/list_and_fetch_latest_configs.js +714 -0
- package/skills/opscompass-resources/scripts/map-oracle-workloads-to-platform-cpus.tool.js +24 -0
- package/skills/opscompass-resources/scripts/map_oracle_workloads_to_platform_cpus.js +273 -0
- package/skills/opscompass-resources/scripts/opscompass-defaults.tool.js +80 -0
- package/skills/opscompass-resources/scripts/opscompass-resources.tool.js +51 -0
- package/skills/opscompass-resources/scripts/summarize-latest-configuration.tool.js +24 -0
- package/skills/opscompass-resources/scripts/summarize-resources-list.tool.js +24 -0
- package/skills/opscompass-resources/scripts/summarize_latest_configuration.js +254 -0
- package/skills/opscompass-resources/scripts/summarize_resources_list.js +126 -0
- package/skills/opscompass-resources/scripts/tools.js +16 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { resolveCliContext, } from "./opsc-cli-context.js";
|
|
5
|
+
/** Production defaults path, retained for explicit known-path operations. */
|
|
6
|
+
export const DEFAULTS_PATH = path.join(os.homedir(), ".opscompass", "defaults.json");
|
|
7
|
+
/** Allowed paths across Opscompass config roots. */
|
|
8
|
+
export const KNOWN_DEFAULTS_PATHS = [
|
|
9
|
+
DEFAULTS_PATH,
|
|
10
|
+
path.join(os.homedir(), ".opscompassdemo", "defaults.json"),
|
|
11
|
+
path.join(os.homedir(), ".opscompassdev", "defaults.json"),
|
|
12
|
+
];
|
|
13
|
+
/** Locate defaults only within the selected CLI's configuration home. */
|
|
14
|
+
export function getDefaultsPath(context = resolveCliContext()) {
|
|
15
|
+
return path.join(context.opscompassHome, "defaults.json");
|
|
16
|
+
}
|
|
17
|
+
/** Deeply sort an object by key for deterministic output. */
|
|
18
|
+
export function sortObject(value) {
|
|
19
|
+
if (Array.isArray(value))
|
|
20
|
+
return value.map(sortObject);
|
|
21
|
+
if (value !== null && typeof value === "object") {
|
|
22
|
+
return Object.fromEntries(Object.keys(value)
|
|
23
|
+
.sort()
|
|
24
|
+
.map((key) => [
|
|
25
|
+
key,
|
|
26
|
+
sortObject(value[key]),
|
|
27
|
+
]));
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Shell-quote a single token: single-quote and escape internal quotes.
|
|
33
|
+
* Unquoted strings are returned as-is if they match a safe pattern.
|
|
34
|
+
*/
|
|
35
|
+
export function shellQuote(value) {
|
|
36
|
+
if (/^[A-Za-z0-9_./:-]+$/.test(value))
|
|
37
|
+
return value;
|
|
38
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
39
|
+
}
|
|
40
|
+
/** Join an array of shell tokens into a quoted command string. */
|
|
41
|
+
export function commandText(command) {
|
|
42
|
+
return command.map(shellQuote).join(" ");
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Read and validate a defaults JSON file.
|
|
46
|
+
* @param filePath - absolute path to the defaults file; defaults to the selected CLI home.
|
|
47
|
+
* @returns a validated JSON object, or an empty object if the file does not exist.
|
|
48
|
+
* @throws if the file contains invalid JSON or a non-object payload.
|
|
49
|
+
*/
|
|
50
|
+
export function loadDefaults(filePath = getDefaultsPath()) {
|
|
51
|
+
if (!existsSync(filePath))
|
|
52
|
+
return {};
|
|
53
|
+
const text = readFileSync(filePath, "utf8");
|
|
54
|
+
const parsed = JSON.parse(text);
|
|
55
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
56
|
+
throw new Error(`defaults file is not a JSON object: ${filePath}`);
|
|
57
|
+
}
|
|
58
|
+
return parsed;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Extract the company value from defaults, returning null when absent.
|
|
62
|
+
* @param filePath - optional path override.
|
|
63
|
+
*/
|
|
64
|
+
export function getDefaultCompany(filePath = getDefaultsPath()) {
|
|
65
|
+
const value = loadDefaults(filePath).company;
|
|
66
|
+
if (value === undefined || value === null)
|
|
67
|
+
return null;
|
|
68
|
+
const company = String(value).trim();
|
|
69
|
+
return company || null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Resolve an explicit company argument, falling back to defaults.
|
|
73
|
+
* @param explicitCompany - user-supplied company, may be undefined.
|
|
74
|
+
* @param options - configuration flags.
|
|
75
|
+
* @param options.ignoreDefaults - when true, reject if no explicit company is provided.
|
|
76
|
+
* @returns the resolved company string, or throws if unavailable.
|
|
77
|
+
*/
|
|
78
|
+
export function resolveCompany(explicitCompany, options) {
|
|
79
|
+
if (explicitCompany)
|
|
80
|
+
return explicitCompany;
|
|
81
|
+
if (options?.ignoreDefaults) {
|
|
82
|
+
throw new Error("--company is required when --ignore-defaults is set");
|
|
83
|
+
}
|
|
84
|
+
// Host context is authoritative; never resolve ambient identity or search other homes.
|
|
85
|
+
const context = options?.context ?? resolveCliContext();
|
|
86
|
+
const defaultCompany = getDefaultCompany(getDefaultsPath(context));
|
|
87
|
+
if (defaultCompany)
|
|
88
|
+
return defaultCompany;
|
|
89
|
+
throw new Error(`resources command needs --company or configured OpsCompass defaults; run \`${context.cliCommand} data-gathering setup\`, run \`${context.cliCommand} defaults set-defaults --company <company>\`, or pass --company`);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Build a validated `opscompass defaults set-defaults` CLI command array.
|
|
93
|
+
*/
|
|
94
|
+
export function buildSetDefaultsCommand(args, context = resolveCliContext()) {
|
|
95
|
+
const command = [context.cliCommand, "defaults", "set-defaults"];
|
|
96
|
+
if (args.company)
|
|
97
|
+
command.push("--company", args.company);
|
|
98
|
+
if (args.account)
|
|
99
|
+
command.push("--account", args.account);
|
|
100
|
+
if (args.monitoringConfigurationId) {
|
|
101
|
+
command.push("--monitoring-configuration-id", args.monitoringConfigurationId);
|
|
102
|
+
}
|
|
103
|
+
for (const value of args.maskValues ?? [])
|
|
104
|
+
command.push("--mask-values", value);
|
|
105
|
+
if (command.length === 3) {
|
|
106
|
+
throw new Error("set requires at least one of --company, --account, --monitoring-configuration-id, or --mask-values");
|
|
107
|
+
}
|
|
108
|
+
return command;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Build a validated `opscompass data-gathering setup` CLI command array.
|
|
112
|
+
*/
|
|
113
|
+
export function buildSetupCommand(args, context = resolveCliContext()) {
|
|
114
|
+
const command = [context.cliCommand, "data-gathering", "setup"];
|
|
115
|
+
if (args.nonInteractive)
|
|
116
|
+
command.push("--non-interactive");
|
|
117
|
+
if (args.company)
|
|
118
|
+
command.push("--company", args.company);
|
|
119
|
+
if (args.account)
|
|
120
|
+
command.push("--account", args.account);
|
|
121
|
+
if (args.monitoringConfigurationId) {
|
|
122
|
+
command.push("--monitoring-configuration-id", args.monitoringConfigurationId);
|
|
123
|
+
}
|
|
124
|
+
return command;
|
|
125
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
const MAX_TIMEOUT_SECONDS = 120;
|
|
3
|
+
const MAX_OUTPUT_BYTES = 100_000;
|
|
4
|
+
export async function runCli(context, args) {
|
|
5
|
+
const child = spawn(context.cliEntryPoint, args, {
|
|
6
|
+
cwd: context.workspaceRoot,
|
|
7
|
+
// The host-selected executable must win over ambient standalone overrides.
|
|
8
|
+
env: {
|
|
9
|
+
...process.env,
|
|
10
|
+
OPSCOMPASS_CLI_ENTRYPOINT: context.cliEntryPoint,
|
|
11
|
+
ELECTRON_RUN_AS_NODE: "1",
|
|
12
|
+
OPSCOMPASS_STUDIO: "1",
|
|
13
|
+
},
|
|
14
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
15
|
+
detached: process.platform !== "win32",
|
|
16
|
+
});
|
|
17
|
+
const chunks = [];
|
|
18
|
+
let outputBytes = 0;
|
|
19
|
+
let timedOut = false;
|
|
20
|
+
const collect = (chunk) => {
|
|
21
|
+
if (outputBytes >= MAX_OUTPUT_BYTES)
|
|
22
|
+
return;
|
|
23
|
+
const bounded = chunk.subarray(0, MAX_OUTPUT_BYTES - outputBytes);
|
|
24
|
+
chunks.push(bounded);
|
|
25
|
+
outputBytes += bounded.length;
|
|
26
|
+
};
|
|
27
|
+
child.stdout?.on("data", collect);
|
|
28
|
+
child.stderr?.on("data", collect);
|
|
29
|
+
let graceTimer;
|
|
30
|
+
const forceKill = () => {
|
|
31
|
+
try {
|
|
32
|
+
if (process.platform !== "win32" && child.pid)
|
|
33
|
+
process.kill(-child.pid, "SIGKILL");
|
|
34
|
+
else
|
|
35
|
+
child.kill("SIGKILL");
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
try {
|
|
39
|
+
child.kill("SIGKILL");
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// The child may have exited between termination attempts.
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const kill = () => {
|
|
47
|
+
try {
|
|
48
|
+
const sent = process.platform !== "win32" && child.pid
|
|
49
|
+
? process.kill(-child.pid, "SIGTERM")
|
|
50
|
+
: child.kill("SIGTERM");
|
|
51
|
+
if (process.platform !== "win32" && sent && graceTimer === undefined) {
|
|
52
|
+
graceTimer = setTimeout(forceKill, 5_000);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
forceKill();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const result = new Promise((resolve, reject) => {
|
|
60
|
+
child.once("error", reject);
|
|
61
|
+
child.once("close", (code) => {
|
|
62
|
+
const output = Buffer.concat(chunks).toString("utf8");
|
|
63
|
+
if (context.signal.aborted)
|
|
64
|
+
reject(new Error("Opscompass command aborted."));
|
|
65
|
+
else if (timedOut)
|
|
66
|
+
reject(new Error(`Opscompass command timed out after ${MAX_TIMEOUT_SECONDS} seconds.`));
|
|
67
|
+
else if (code !== 0)
|
|
68
|
+
reject(new Error(output.trim() ||
|
|
69
|
+
`Opscompass command failed with exit code ${code}.`));
|
|
70
|
+
else
|
|
71
|
+
resolve(output);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
const timeout = setTimeout(() => {
|
|
75
|
+
timedOut = true;
|
|
76
|
+
kill();
|
|
77
|
+
}, MAX_TIMEOUT_SECONDS * 1_000);
|
|
78
|
+
if (context.signal.aborted)
|
|
79
|
+
kill();
|
|
80
|
+
else
|
|
81
|
+
context.signal.addEventListener("abort", kill, { once: true });
|
|
82
|
+
try {
|
|
83
|
+
return await result;
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
clearTimeout(timeout);
|
|
87
|
+
clearTimeout(graceTimer);
|
|
88
|
+
context.signal.removeEventListener("abort", kill);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: opscompass-resources
|
|
3
|
+
description: Analyze Oracle and SQL Server workloads across cloud and on-prem infrastructure using `opscompass resources list` plus list-follow-up actions `get-latest-configuration` and `get-compliance`. Use when users need to identify licensing risk, sprawl, misconfiguration, and workload hosting context for Oracle, SQL Server, Azure SQL, AWS RDS, AWS EC2, VMware vCenter, or Nutanix resources.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# OpsCompass Resources
|
|
7
|
+
|
|
8
|
+
**Hosted execution:** the host-selected CLI identity and home govern every query and reported command. Use the CLI identity returned by execution tools; their generic `opscompass` labels and the production examples below do not override it. For development, report `opscompassdev`; for demo, report `opscompassdemo`. Standalone examples default to production unless `--cli` selects otherwise.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Use this skill for a narrow workflow centered on Oracle and SQL Server risk analysis across cloud and on-prem infrastructure:
|
|
13
|
+
- `opscompass resources list` to find matching resources
|
|
14
|
+
- `opscompass resources get-latest-configuration` to inspect full configuration for resource `--id` values from the list results
|
|
15
|
+
- `opscompass resources get-compliance` to inspect compliance findings for resource `--id` values from the list results (with `--status`) when that resource type actually has compliance coverage
|
|
16
|
+
|
|
17
|
+
Translate user intent into exact commands, run them, and return concise risk-oriented summaries.
|
|
18
|
+
|
|
19
|
+
This skill is primarily for:
|
|
20
|
+
- Oracle license risk analysis
|
|
21
|
+
- SQL Server and Oracle sprawl analysis
|
|
22
|
+
- tracing workloads to AWS, Azure, VMware, or Nutanix infrastructure
|
|
23
|
+
- identifying misconfiguration and placement context from latest configuration data
|
|
24
|
+
|
|
25
|
+
For Oracle licensing and sprawl work, date-bounded inventory is a standard workflow. The model should remember it can start with `resources list` filtered by:
|
|
26
|
+
- `--resource-creation-date-beginning` for "created on or after" questions
|
|
27
|
+
- `--resource-creation-date-end` for "created before" questions
|
|
28
|
+
- both flags together for date-range questions
|
|
29
|
+
|
|
30
|
+
For Oracle specifically, licensing risk is a workload-plus-infrastructure problem, not just a database-config problem. The answer is stronger when it establishes:
|
|
31
|
+
- the Oracle workload identity
|
|
32
|
+
- where it is hosted
|
|
33
|
+
- the underlying compute or core exposure
|
|
34
|
+
- the configuration or compliance evidence supporting the license-risk conclusion
|
|
35
|
+
|
|
36
|
+
## CLI Environment and Execution
|
|
37
|
+
|
|
38
|
+
The `opscompass` examples below use production by default; apply the selected context to every resource/default command and login/setup instruction. A company named `opscompassdemo` is a tenant identifier, not an environment selector.
|
|
39
|
+
|
|
40
|
+
- In embedded use, the host-supplied `OpscompassCliContext` (`cliEntryPoint`, `cliCommand`, `opscompassHome`) is authoritative, including over ambient settings. Prefer approved resource tools and `opscompass_resources_defaults` for defaults inspection. Do not assume a global executable on `PATH`, a production session, or `~/.opscompass`.
|
|
41
|
+
- Standalone installed helpers need no host integration, Studio, Electron, or harness package. Use Node.js 22+ and the selected CLI/session for live queries. Pass `--cli opscompass|opscompassdev|opscompassdemo` to `scripts/build_resources_command.js` or `scripts/list_and_fetch_latest_configs.js`. The CLI identities select respectively `~/.opscompass`, `~/.opscompassdev`, and `~/.opscompassdemo`. Pure summarizers process supplied JSON and do not accept `--cli`.
|
|
42
|
+
- `OPSCOMPASS_CLI_ENTRYPOINT` can select a standalone executable or custom path. A recognized bare command selects its matching home when `--cli` is absent. An arbitrary path retains production identity unless paired with explicit `--cli`; its filename does not select a home. Explicit `--cli` overrides a conflicting recognized ambient command, while a custom executable override can pair with that explicit identity.
|
|
43
|
+
- Use only the selected home's defaults and authentication state. Never fall back to another environment. An explicit company wins over defaults.
|
|
44
|
+
- A command builder or tool result with `execute: false` is a preview: it has not run the resource query. Label it as proposed, and obtain actual execution output before claiming inventory, successful authentication, or findings.
|
|
45
|
+
|
|
46
|
+
Standalone dev defaults inspection: `opscompassdev defaults list-defaults`. For a custom executable in dev, preview a resource command from an installed Skill directory: `OPSCOMPASS_CLI_ENTRYPOINT=/opt/opscompass/bin/custom-cli node scripts/build_resources_command.js --cli opscompassdev --company acme --param resource-types=databases/oracle`.
|
|
47
|
+
|
|
48
|
+
## Workflow
|
|
49
|
+
|
|
50
|
+
1. Confirm whether the user is asking about licensing risk, sprawl, misconfiguration, hosting context, or generic inventory.
|
|
51
|
+
2. Resolve required scope: prefer an explicit `--company`; if absent, use `opscompass_resources_defaults` or the selected CLI's `defaults list-defaults` to inspect `<selected-home>/defaults.json` and use its configured `company`.
|
|
52
|
+
3. If filtering is needed, add only the `list` filters needed (start minimal, then refine).
|
|
53
|
+
4. Build and run `opscompass resources list`.
|
|
54
|
+
5. Read the list output and collect the numeric resource `id` values.
|
|
55
|
+
6. Iterate the ids needed for the user's objective and run one or both follow-up actions:
|
|
56
|
+
- `opscompass resources get-latest-configuration --company ... --id ...`
|
|
57
|
+
- `opscompass resources get-compliance --company ... --id ... --status ...`
|
|
58
|
+
7. When the question is about Oracle license risk, SQL Server/Oracle sprawl, or hosting context, continue correlating the workload to infrastructure rather than stopping at the workload resource alone.
|
|
59
|
+
8. Summarize the result(s) and include the exact command(s).
|
|
60
|
+
|
|
61
|
+
Before running live queries, ensure the selected CLI is available and its environment is authenticated. In embedded use, rely on the host's approved tools and selected context rather than testing a global `opscompass` on `PATH`.
|
|
62
|
+
In embedded use, use the approved `opscompass_resources_defaults` tool to inspect company, account, and monitoring configuration defaults from the selected home; standalone inspection uses the selected CLI's `defaults list-defaults`.
|
|
63
|
+
Use the selected CLI's interactive `data-gathering setup` as the preferred user-guided setup path, or `defaults set-defaults --company ... --account ... --monitoring-configuration-id ...` when the user explicitly wants direct defaults changes.
|
|
64
|
+
Changing defaults is a local mutating operation; do not change them unless the user asks.
|
|
65
|
+
To ignore defaults, pass explicit scope in commands and use helper-script `--ignore-defaults --company <company>`.
|
|
66
|
+
Even when defaults provide the company, include `--company <resolved-company>` in every generated `opscompass resources ...` command so transcripts show the tenant scope.
|
|
67
|
+
|
|
68
|
+
In Opscompass inventory, `cloud_provider: "mlss"` should generally be interpreted as a database or on-prem infrastructure context such as VMware or Nutanix, not as a final hosting-platform answer by itself.
|
|
69
|
+
When the user says `Oracle` in this skill, interpret it as Oracle database workloads by default, not Oracle Cloud infrastructure. Only treat `Oracle` as Oracle Cloud / OCI when the user explicitly asks about Oracle Cloud, OCI, or cloud-provider/platform inventory.
|
|
70
|
+
|
|
71
|
+
## Filter Selection
|
|
72
|
+
|
|
73
|
+
Use `references/resources-commands.md` for the supported `list` filters and the `get-latest-configuration` follow-up action.
|
|
74
|
+
Use `scripts/build_resources_command.js` to generate valid commands for:
|
|
75
|
+
- `list`
|
|
76
|
+
- `get-latest-configuration` (by numeric `--id`)
|
|
77
|
+
- `get-compliance` (by numeric `--id` plus `--status`)
|
|
78
|
+
When using `scripts/build_resources_command.js` for compliance, pass the compliance status as `--param status=...` to the builder. The final printed `opscompass resources get-compliance ...` command will use `--status ...`.
|
|
79
|
+
In embedded use, use the approved `opscompass_resources_defaults` tool to inspect defaults or preview requested setup/set commands with `dryRun: true`; only execute defaults changes when the user asks.
|
|
80
|
+
Use `scripts/summarize_resources_list.js` to summarize large `resources list` JSON output.
|
|
81
|
+
Use `scripts/summarize_latest_configuration.js` to summarize one or many `get-latest-configuration` JSON results into model-friendly summaries across resource types.
|
|
82
|
+
Use `scripts/list_and_fetch_latest_configs.js` to automate the full paired workflow (`list` -> iterate ids -> `get-latest-configuration` and/or `get-compliance` -> summary) when the user wants details for many resources.
|
|
83
|
+
When `scripts/list_and_fetch_latest_configs.js` collects mixed Oracle plus Nutanix or VMware VM configurations, it will also emit the Oracle workload to platform vCPU summary automatically.
|
|
84
|
+
|
|
85
|
+
Prefer tools/scripts this way:
|
|
86
|
+
- embedded host with approved resource/default tools -> use those tools with the host context rather than substituting standalone shell commands
|
|
87
|
+
- standalone, one or a few resources -> `scripts/build_resources_command.js` plus actual execution of the generated command
|
|
88
|
+
- standalone, many matching resources -> `scripts/list_and_fetch_latest_configs.js`
|
|
89
|
+
- many raw list rows already collected -> `scripts/summarize_resources_list.js`
|
|
90
|
+
- many config payloads already collected -> `scripts/summarize_latest_configuration.js`
|
|
91
|
+
|
|
92
|
+
Important: in this skill, `get-latest-configuration` and `get-compliance` are follow-up actions after `list`.
|
|
93
|
+
The `id` for follow-up actions should come from the `list` results in the same workflow.
|
|
94
|
+
Use the numeric OpsCompass resource `--id` for follow-up actions. Do not use `--resource-id` or `--resource-ids` for `get-latest-configuration` or `get-compliance`; those represent cloud platform resource identifiers such as ARNs or Azure resource ids and are not the same thing.
|
|
95
|
+
Do not use `opscompass resources show` in this skill.
|
|
96
|
+
For Oracle resources, version/edition are available in `get-latest-configuration` output under `document.version` and `document.edition`.
|
|
97
|
+
If the user asks "Do I have any Oracle?" or "Show me my Oracle," default to `--resource-types databases/oracle`.
|
|
98
|
+
For Oracle resources, `get-compliance` should usually be interpreted as Oracle license compliance rather than generic infrastructure/security compliance.
|
|
99
|
+
For Oracle resources, the important answer is usually the compliance findings themselves, not just the number of compliance problems. Oracle compliance findings should usually be treated as evidence of licensed feature, option, pack, or parameter usage that may put the workload out of compliance with Oracle entitlements.
|
|
100
|
+
For Oracle resources, `get-latest-configuration` also contains feature-usage evidence. Inspect `document.productUsageConcerns` for product/feature usage concerns and inspect `document.parameters` for entries where `isConcerning` is `true`.
|
|
101
|
+
For Oracle databases, do not say per-database feature usage is unavailable until both `get-compliance --status open` and `get-latest-configuration` have been checked for that database. In current Oracle configs, fields such as `document.productUsageConcerns` and concerning `document.parameters` are feature-usage evidence.
|
|
102
|
+
If a prior `resources list` result already shows `compliance_problems > 0` for Oracle or SQL Server resources and the user asks what the specific problems are, the next step is to run `get-compliance --status open` for those resource ids. Do not stop at the count-level list output.
|
|
103
|
+
For Oracle licensing questions, do not stop at Oracle config alone if hosting and compute context can be established. Correlate the database workload to the infrastructure it runs on and use that to inform license-risk analysis.
|
|
104
|
+
For Oracle on VMware or Nutanix, the hosting path matters: database workload -> VM -> host -> broader platform context. If that chain cannot be established, state that the Oracle license-risk conclusion is partial.
|
|
105
|
+
Opscompass currently does not provide compliance checks for VMware vCenter or Nutanix resource types in this skill's scope. For those resource types, focus on `get-latest-configuration`, not `get-compliance`.
|
|
106
|
+
For VMware vCenter resources, host and virtual machine configuration are related. When investigating VMware placement, movement, or change questions, inspect the latest configuration for both `vcenter/virtualMachine` and `vcenter/host` resources. The latest-configuration payloads include VM and host ids, so relationships can be analyzed and established from those results. In host configs, look at `document.virtualMachines[].id` and `document.virtualMachines[].name` together with host-level fields like `document.id`, `document.name`, `document.cluster`, and `document.datacenter`.
|
|
107
|
+
For VMware vCPU mapping, inspect VM latest-configuration for direct CPU count fields such as `numCpu`, `numCPU`, `cpuCount`, `numCpus`, `vcpuCount`, or nested hardware/config equivalents like `hardware.numCPU` and `hardware.numCoresPerSocket`.
|
|
108
|
+
For Nutanix resources, VM, host, and cluster configuration are related. In `Nutanix/Vm` configs, inspect `document.host.extId` and `document.cluster.extId`. In `Nutanix/Host` configs, inspect `document.extId`, `document.hostName`, and `document.cluster.uuid`. In `Nutanix/Cluster` configs, inspect `document.extId` and `document.nodes.nodeList[].nodeUuid` to relate VMs, hosts, and clusters. This is especially important for Oracle and SQL Server use cases, because those databases are often hosted on Nutanix infrastructure and the workload-to-infrastructure link is part of the answer.
|
|
109
|
+
For Nutanix host-to-VM mapping requests, proceed directly to latest-configuration relationship analysis. List `Nutanix/Vm` and `Nutanix/Host`, fetch latest configuration for the relevant ids, then map `Nutanix/Vm.document.host.extId` to `Nutanix/Host.document.extId`. Do not answer that relationships are unavailable from list output; list output is only the starting point.
|
|
110
|
+
For Nutanix vCPU mapping, inspect `document.numSockets`, `document.numCoresPerSocket`, and `document.numThreadsPerCore`, then compute provisioned vCPU as `numSockets * numCoresPerSocket * numThreadsPerCore`.
|
|
111
|
+
Naming conventions can provide strong supporting evidence for correlating Oracle or SQL Server workloads to Nutanix infrastructure when they align, but naming overlap is not required and its absence should not be treated as evidence that no relationship exists.
|
|
112
|
+
|
|
113
|
+
For `--resource-types`, this skill is intentionally limited to these OpsCompass-formatted values:
|
|
114
|
+
- `AWS::EC2::Instance`
|
|
115
|
+
- `Microsoft.Sql/servers`
|
|
116
|
+
- `AWS::RDS::DBInstance`
|
|
117
|
+
- `databases/mssqlserver`
|
|
118
|
+
- `databases/oracle`
|
|
119
|
+
- `Nutanix/AuthorizationPolicy`
|
|
120
|
+
- `Nutanix/Cluster`
|
|
121
|
+
- `Nutanix/Host`
|
|
122
|
+
- `Nutanix/Image`
|
|
123
|
+
- `Nutanix/Role`
|
|
124
|
+
- `Nutanix/Subnet`
|
|
125
|
+
- `Nutanix/User`
|
|
126
|
+
- `Nutanix/VirtualSwitch`
|
|
127
|
+
- `Nutanix/Vm`
|
|
128
|
+
- `Nutanix/VolumeGroup`
|
|
129
|
+
- `vcenter/host`
|
|
130
|
+
- `vcenter/virtualMachine`
|
|
131
|
+
|
|
132
|
+
Common user intents this skill should handle:
|
|
133
|
+
- "What Oracle licensing risk do I have?" -> treat as Oracle workload plus infrastructure analysis; use Oracle compliance/config plus hosting context
|
|
134
|
+
- "Which Oracle databases were created on or after X?" -> use `resources list` with `--resource-creation-date-beginning`, usually together with `--resource-types databases/oracle`
|
|
135
|
+
- "Which Oracle databases were created between X and Y?" -> use `resources list` with both `--resource-creation-date-beginning` and `--resource-creation-date-end`, usually together with `--resource-types databases/oracle`
|
|
136
|
+
- "Which recently created Oracle or SQL Server workloads may be sprawl candidates?" -> start with `resources list` filtered by creation-date range, then inspect latest configuration and hosting context
|
|
137
|
+
- "Do I have any Oracle?" -> default to `resources list --resource-types databases/oracle`
|
|
138
|
+
- "Show me my Oracle" -> default to `resources list --resource-types databases/oracle`
|
|
139
|
+
- "Do I have Oracle Cloud resources?" -> only then treat this as a provider/platform question rather than a database workload question
|
|
140
|
+
- "Map Oracle databases to provisioned vCPU cores on Nutanix" -> collect Oracle plus `Nutanix/Vm` latest configurations, then use `scripts/map_oracle_workloads_to_platform_cpus.js`
|
|
141
|
+
- "Map Oracle databases to provisioned vCPU cores on VMware" -> collect Oracle plus `vcenter/virtualMachine` latest configurations, then use `scripts/map_oracle_workloads_to_platform_cpus.js`
|
|
142
|
+
- "Where is this Oracle database hosted and what infrastructure backs it?" -> correlate the Oracle workload to VMware or Nutanix resources instead of stopping at the database record
|
|
143
|
+
- "Which Oracle or SQL Server workloads may be sprawl candidates?" -> list workloads, inspect latest config, and summarize hosting/platform footprint and notable risk signals
|
|
144
|
+
- "What misconfigurations or concerning settings do these Oracle or SQL Server workloads have?" -> inspect latest configuration and compliance where applicable, then summarize the risk-oriented differences
|
|
145
|
+
- "List resources created after X date" -> `--resource-creation-date-beginning`
|
|
146
|
+
- "List resources created before X date" -> `--resource-creation-date-end`
|
|
147
|
+
- "List resources for account/provider/region" -> `--accounts`, `--cloud-providers`, `--region-ids`
|
|
148
|
+
- "List resources with open compliance issues" -> `--open-compliance-issues true`
|
|
149
|
+
- "List resources with unacknowledged changes" -> `--unacknowledged-changes true`
|
|
150
|
+
- "List resources by tag or type" -> `--tags`, `--resource-types` (restricted to the approved set above)
|
|
151
|
+
- "List EC2 instances" -> `resources list ... --resource-types AWS::EC2::Instance`
|
|
152
|
+
- "List Nutanix clusters" -> `resources list ... --resource-types Nutanix/Cluster`
|
|
153
|
+
- "List Nutanix hosts" -> `resources list ... --resource-types Nutanix/Host`
|
|
154
|
+
- "List Nutanix virtual machines" -> `resources list ... --resource-types Nutanix/Vm`
|
|
155
|
+
- "Map Nutanix hosts to VMs" -> collect `Nutanix/Vm` and `Nutanix/Host` latest configurations, then map `vm.document.host.extId` to `host.document.extId`
|
|
156
|
+
- "Which VMs are running on each Nutanix host?" -> collect `Nutanix/Vm` and `Nutanix/Host` latest configurations, then group VMs by matched host
|
|
157
|
+
- "List Nutanix subnets" -> `resources list ... --resource-types Nutanix/Subnet`
|
|
158
|
+
- "List Nutanix volume groups" -> `resources list ... --resource-types Nutanix/VolumeGroup`
|
|
159
|
+
- "List Nutanix infrastructure hosting Oracle or SQL Server related workloads" -> start with `resources list ... --resource-types Nutanix/Vm`, then refine by account, region, or tag if needed
|
|
160
|
+
- "Show the Nutanix infrastructure behind this Oracle or SQL Server workload" -> correlate `Nutanix/Vm`, `Nutanix/Host`, and `Nutanix/Cluster` latest configurations and explain the workload-to-infrastructure relationship
|
|
161
|
+
- "Show Nutanix compliance issues" -> explain that Nutanix resources do not currently have compliance checks here; inspect latest configuration instead
|
|
162
|
+
- "List VMware hosts" -> `resources list ... --resource-types vcenter/host`
|
|
163
|
+
- "List VMware virtual machines" -> `resources list ... --resource-types vcenter/virtualMachine`
|
|
164
|
+
- "Investigate VMware VM movement or host placement changes" -> inspect both `vcenter/virtualMachine` and `vcenter/host` latest configurations, then use VM/host ids in those payloads to establish the relationships
|
|
165
|
+
- "Show VMware compliance issues" -> explain that vCenter resources do not currently have compliance checks here; inspect latest configuration instead
|
|
166
|
+
- "List Oracle databases and show their latest configs" -> `resources list ... --resource-types databases/oracle`, then iterate each returned `id` with `get-latest-configuration`
|
|
167
|
+
- "List SQL Server databases and show their latest configs" -> `resources list ... --resource-types databases/mssqlserver`, then iterate each returned `id` with `get-latest-configuration`
|
|
168
|
+
- "List VMware virtual machines hosting Oracle or SQL Server related workloads" -> start with `resources list ... --resource-types vcenter/virtualMachine`, then refine by account, region, or tag if needed
|
|
169
|
+
- "List Azure SQL servers and show their latest configs" -> `resources list ... --resource-types Microsoft.Sql/servers`, then iterate each returned `id` with `get-latest-configuration`
|
|
170
|
+
- "List AWS RDS instances and show their latest configs" -> `resources list ... --resource-types AWS::RDS::DBInstance`, then iterate each returned `id` with `get-latest-configuration`
|
|
171
|
+
- "Which Oracle DBs are version 19 / Enterprise Edition?" -> list Oracle resources, then inspect each with `get-latest-configuration` and read `document.version` / `document.edition`
|
|
172
|
+
- "Show open compliance issues for each Oracle database" -> treat this as Oracle license compliance by default; list Oracle resources, then iterate each returned `id` with `get-compliance --status open`
|
|
173
|
+
|
|
174
|
+
## Command Rules
|
|
175
|
+
|
|
176
|
+
- Use only these actions:
|
|
177
|
+
- `opscompass resources list`
|
|
178
|
+
- `opscompass resources get-latest-configuration`
|
|
179
|
+
- `opscompass resources get-compliance`
|
|
180
|
+
- Choose follow-up actions with this priority:
|
|
181
|
+
- Oracle license/compliance question -> `get-compliance` plus `get-latest-configuration`, then correlate to infrastructure when possible
|
|
182
|
+
- Oracle or SQL Server hosting/sprawl/misconfiguration question -> `get-latest-configuration` first, then correlate to infrastructure
|
|
183
|
+
- VMware or Nutanix question -> `get-latest-configuration`, not `get-compliance`
|
|
184
|
+
- generic inventory question -> `list`, then only fetch follow-up data if needed to answer the question
|
|
185
|
+
- For Oracle licensing or sprawl questions scoped to time, start with a date-bounded `resources list` rather than a broad list. Use `--resource-creation-date-beginning`, `--resource-creation-date-end`, or both.
|
|
186
|
+
- Prefer explicit long flags exactly as documented.
|
|
187
|
+
- Keep filters minimal first, then narrow further if the user asks.
|
|
188
|
+
- If output is empty, remove the most restrictive filter first.
|
|
189
|
+
- For date filters, use the CLI-help format:
|
|
190
|
+
- `--resource-creation-date-beginning "YYYY-MM-DD HH:MM:SS.mmm"`
|
|
191
|
+
- `--resource-creation-date-end "YYYY-MM-DD HH:MM:SS.mmm"`
|
|
192
|
+
- For enum filters, only use allowed values (`cloud-providers`, compliance/change booleans).
|
|
193
|
+
- For `--resource-types`, only use the approved resource types listed in this skill.
|
|
194
|
+
- Use the helper validation to fail fast on missing company/defaults and invalid enum values.
|
|
195
|
+
- If `--company` is omitted in helper scripts, they may read `<selected-home>/defaults.json`; pass `--ignore-defaults --company <company>` to require explicit company scope.
|
|
196
|
+
- For configuration inspection, prefer `--id` taken from list output in the same session/workflow.
|
|
197
|
+
- For compliance inspection, require `--status` and use allowed values from CLI help (`open`, `remediated`, `policy-exception`, `mitigation`).
|
|
198
|
+
- For hosting questions, do not assume `cloud_provider: "mlss"` alone answers the infrastructure question. Treat it as a signal that the workload may be backed by on-prem infrastructure such as VMware or Nutanix and continue correlation when possible.
|
|
199
|
+
- For Oracle databases, interpret compliance questions as license compliance unless the user clearly asks about something else.
|
|
200
|
+
- If the user pivots from a VMware or Nutanix thread to "Oracle" or "SQL Server", re-evaluate the request from scratch and default to the workload resource type (`databases/oracle` or `databases/mssqlserver`) rather than staying in the prior infrastructure/resource-type context.
|
|
201
|
+
- For Oracle license compliance workflows, pair `get-compliance` with `get-latest-configuration` so the answer can include `document.version`, `document.edition`, `document.productUsageConcerns`, and concerning `document.parameters`.
|
|
202
|
+
- For Oracle latest-configuration, treat non-empty `document.productUsageConcerns` as per-database licensed feature/option usage concern evidence.
|
|
203
|
+
- For Oracle latest-configuration, treat `document.parameters.*.isConcerning=true` as license-relevant parameter evidence; for example, `CONTROL_MANAGEMENT_PACK_ACCESS=DIAGNOSTIC+TUNING` indicates Diagnostic Pack and Tuning Pack exposure.
|
|
204
|
+
- For Oracle compliance questions, prioritize the actual findings and their license impact over the raw `compliance_problems` count.
|
|
205
|
+
- If a resource list already established which Oracle or SQL Server resources have non-zero `compliance_problems`, and the user asks for the specific problems, iterate those ids with `get-compliance --status open` rather than restating the counts.
|
|
206
|
+
- For Oracle license-risk workflows, try to establish where the database is hosted and what underlying compute context applies. If that infrastructure evidence is missing, say the license-risk conclusion is incomplete or partial.
|
|
207
|
+
- For Oracle workload-to-vCPU mapping on Nutanix or VMware, prefer collecting mixed Oracle and VM latest-configuration payloads and running `scripts/map_oracle_workloads_to_platform_cpus.js` instead of extracting CPU fields manually in the model.
|
|
208
|
+
- Do not use `get-compliance` for `vcenter/*` or `Nutanix/*` resource types in normal workflows, because Opscompass does not currently provide compliance checks for those resource types.
|
|
209
|
+
- For VMware workflows involving movement, placement, or change analysis, pair VM and host `get-latest-configuration` lookups and use VM/host ids in those payloads to establish the relationships.
|
|
210
|
+
- When VMware VM and host configs are collected together, `scripts/list_and_fetch_latest_configs.js` can summarize VM-to-host relationships from those payloads.
|
|
211
|
+
- In VMware host configs, inspect `document.virtualMachines[]` to map hosted VMs back to the host, cluster, and datacenter context.
|
|
212
|
+
- For Nutanix workflows involving VM placement or infrastructure analysis, pair `Nutanix/Vm`, `Nutanix/Host`, and `Nutanix/Cluster` `get-latest-configuration` lookups and use the extId/uuid fields in those payloads to establish the relationships.
|
|
213
|
+
- For Nutanix host-to-VM mapping, do not stop after listing hosts and VMs. Use latest configuration to map `Nutanix/Vm.document.host.extId` to `Nutanix/Host.document.extId`.
|
|
214
|
+
- For Oracle and SQL Server on Nutanix, treat the VM/host/cluster relationship as part of the core answer, not optional context.
|
|
215
|
+
- When workload and infrastructure names clearly align, use that as strong correlation evidence, but do not require naming matches before relating Oracle/SQL Server workloads to Nutanix infrastructure.
|
|
216
|
+
- For large result sets, prefer paging with `--skip` rather than dumping one broad unfiltered list.
|
|
217
|
+
|
|
218
|
+
## Output Rules
|
|
219
|
+
|
|
220
|
+
- Report the actual command run and selected environment/company. Clearly separate command previews (`execute: false` or builder output) from executed commands and retrieved evidence.
|
|
221
|
+
- Prioritize the answer in this order when applicable:
|
|
222
|
+
- risk type and severity
|
|
223
|
+
- affected workload(s)
|
|
224
|
+
- hosting platform and placement
|
|
225
|
+
- underlying compute/core evidence or other infrastructure context
|
|
226
|
+
- supporting configuration/compliance evidence
|
|
227
|
+
- gaps or next evidence needed
|
|
228
|
+
- For list output, report the most relevant fields only (resource ids/names, provider, account, region, counts).
|
|
229
|
+
- For `get-latest-configuration`, report key metadata (`id`, `name`, `type`, `location`) and the most relevant document fields for the user's request.
|
|
230
|
+
- For Oracle databases, check `document.version` and `document.edition` (not list output).
|
|
231
|
+
- For Oracle databases, check `document.productUsageConcerns` and concerning `document.parameters` before saying feature usage is unavailable.
|
|
232
|
+
- For `get-compliance`, report finding count and key fields per finding (`checkName`, `checkSeverity`, `status`, `errorMessage`, `recommendedAction`, compliance framework/control names).
|
|
233
|
+
- For Oracle `get-compliance`, frame findings as Oracle license compliance findings and call out version/edition context when relevant.
|
|
234
|
+
- For Oracle `get-compliance`, explain the finding in terms of the Oracle feature, option, pack, or parameter in use and why that usage can create an entitlement/compliance issue.
|
|
235
|
+
- For Oracle compliance answers, do not lead with "N databases have compliance problems" unless the user asked for counts; lead with the actual license-relevant findings.
|
|
236
|
+
- Do not claim the Opscompass CLI lacks resource-level compliance detail unless an actual `get-compliance` command failed and the failure output supports that conclusion.
|
|
237
|
+
- If `get-compliance` fails, report the real command failure or stderr and state that the detailed compliance answer is partial because retrieval failed.
|
|
238
|
+
- For Oracle license-risk answers, explicitly state whether hosting/platform evidence and underlying compute context were established. If not, say the conclusion is partial and identify what infrastructure evidence is still missing.
|
|
239
|
+
- For VMware and Nutanix resource types, do not frame the answer around compliance findings; frame the answer around latest configuration structure, relationships, placement, changes, and supporting infrastructure context.
|
|
240
|
+
- For Oracle workload-to-vCPU mapping answers, report the Oracle workload, matched VM, platform, provisioned vCPU count, and the CPU fields used to derive that count.
|
|
241
|
+
- For VMware config questions, call out that relevant changes may appear in both the VM and host latest configuration payloads, and use the VM/host ids in those payloads to explain the relationship when possible.
|
|
242
|
+
- For VMware host config summaries, call out hosted VM names/ids from `document.virtualMachines[]` plus `document.cluster` and `document.datacenter` when relevant.
|
|
243
|
+
- For Nutanix config questions, call out VM-to-host and VM-to-cluster relationships from `document.host.extId`, `document.cluster.extId`, `document.cluster.uuid`, and `document.nodes.nodeList[].nodeUuid` when relevant.
|
|
244
|
+
- For Nutanix host-to-VM mappings, report whether the mapping is complete for all retrieved VMs. If pagination or limits mean only a subset was retrieved, say "retrieved VMs" rather than "all VMs." Include unmapped VMs, host extIds when useful, hosts with no mapped VMs, and duplicate VM names or resource ids when duplicates appear.
|
|
245
|
+
- For Oracle and SQL Server workloads on Nutanix, explicitly connect the workload VM back to the supporting host and cluster when the data is available.
|
|
246
|
+
- If a workload resource shows `cloud_provider: "mlss"`, explain that this usually indicates a database or on-prem infrastructure context and keep tracing to VMware or Nutanix when the user is asking about hosting.
|
|
247
|
+
- If naming conventions support the correlation, mention that as supporting evidence. If naming conventions do not align, state that the relationship was established from configuration data instead.
|
|
248
|
+
- When iterating many resources, summarize repeated fields in a compact table/list and call out exceptions or concerning values.
|
|
249
|
+
- When inspecting many configs, prefer collecting JSON results and running `scripts/summarize_latest_configuration.js` so the model gets a compact cross-resource summary in context.
|
|
250
|
+
- When the user wants configs and/or compliance for many matching resources, prefer `scripts/list_and_fetch_latest_configs.js` instead of manually writing shell loops.
|
|
251
|
+
- When list results are large, report that pagination was used and avoid flooding the response with raw rows.
|
|
252
|
+
- If output is empty, state which filters likely constrained results and provide the next command to broaden the query.
|
|
253
|
+
- Report the actual error, preserving useful diagnostics without exposing credentials. Distinguish authentication failures from missing scope/defaults, authorization denial, invalid arguments, and service/network failures. Do not classify every failed query as expired login or an empty inventory.
|
|
254
|
+
- Recommend login only when authentication evidence supports it, using the selected CLI's `login` or `login --use-device-code` guidance. For missing scope, request the company or inspect selected-home defaults; for authorization denial, explain the access issue rather than switching environments.
|
|
255
|
+
- If the selected executable cannot be launched, report that executable failure and use the host's setup guidance or the Opscompass CLI install article as appropriate. Do not require a global `opscompass` when the host supplies an entrypoint.
|
|
256
|
+
|
|
257
|
+
## Examples
|
|
258
|
+
|
|
259
|
+
These are production examples. For standalone non-production calls to `build_resources_command.js` or `list_and_fetch_latest_configs.js`, add `--cli opscompassdev` or `--cli opscompassdemo`; use that environment's executable for direct CLI commands. Do not add `--cli` to pure summarizers. Company names and sample resource ids below do not select an environment or constitute collected evidence.
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
opscompass resources list --company acme --cloud-providers aws --resource-types AWS::RDS::DBInstance --open-compliance-issues true
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
opscompass resources list --company acme --cloud-providers aws --resource-types AWS::EC2::Instance
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
opscompass resources list --company acme --resource-types Nutanix/Vm
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
opscompass resources list --company acme --resource-types vcenter/virtualMachine
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
opscompass resources list --company acme --cloud-providers azure --resource-types Microsoft.Sql/servers
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
opscompass resources list --company acme --resource-creation-date-beginning "2025-01-01 00:00:00.000"
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
opscompass resources list --company acme --accounts 406219038857 --unacknowledged-changes true
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
node scripts/build_resources_command.js --company acme --param resource-creation-date-beginning="2025-01-01 00:00:00.000" --param resource-types=databases/oracle
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
node scripts/build_resources_command.js --action get-latest-configuration --company opscompassdemo --id 9403537
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
node scripts/build_resources_command.js --action get-compliance --company opscompassdemo --id 7180543 --param status=open
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
opscompass resources list --company opscompassdemo --resource-types databases/oracle
|
|
303
|
+
# then use returned ids (for example 9403537) with:
|
|
304
|
+
opscompass resources get-latest-configuration --company opscompassdemo --id 9403537
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
opscompass resources get-latest-configuration --company opscompassdemo --id 9403537
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
opscompass resources get-compliance --company opscompassdemo --status open --id 7180543
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
opscompass resources list --company opscompassdemo --accounts 406219038857 > resources.json
|
|
317
|
+
node scripts/summarize_resources_list.js --input resources.json --top 5
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
opscompass resources get-latest-configuration --company opscompassdemo --id 9403537 > config.json
|
|
322
|
+
node scripts/summarize_latest_configuration.js --input config.json
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
node scripts/list_and_fetch_latest_configs.js --company opscompassdemo --param resource-types=databases/oracle --summary-top 10 --max-resources 25
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
node scripts/list_and_fetch_latest_configs.js --company opscompassdemo --param resource-types=databases/oracle --compliance-status open --summary-top 10 --max-resources 25
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
node scripts/list_and_fetch_latest_configs.js --company opscompassdemo --param resource-types=AWS::EC2::Instance --page-size-hint 250 --max-pages 4 --summary-top 10 --max-resources 100
|
|
335
|
+
```
|