@opscompass/skills 0.1.0 → 0.2.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 +9 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
- package/skills/opscompass-oracle-licensing/.opscompass-runtime/tools/opsc-cli-context.js +24 -0
- package/skills/opscompass-oracle-licensing/.opscompass-runtime/tools/opsc-cli.js +90 -0
- package/skills/opscompass-oracle-licensing/SKILL.md +11 -5
- package/skills/opscompass-oracle-licensing/references/evidence-model.md +6 -2
- package/skills/opscompass-oracle-licensing/references/report-structure.md +7 -3
- package/skills/opscompass-oracle-licensing/scripts/oracle-assessment.js +284 -0
- package/skills/opscompass-oracle-licensing/scripts/oracle-assessment.tool.js +32 -0
- package/skills/opscompass-oracle-licensing/scripts/tools.js +2 -2
- package/skills/opscompass-resources/SKILL.md +37 -11
- package/skills/opscompass-resources/references/resources-commands.md +15 -1
- package/skills/opscompass-resources/scripts/build-resources-command.tool.js +6 -1
- package/skills/opscompass-resources/scripts/build_resources_command.js +39 -3
- package/skills/opscompass-resources/scripts/opscompass-resources.tool.js +1 -0
- package/skills/opscompass-oracle-licensing/api/entitlement-compliance/entitlement-compliance.json +0 -189
- package/skills/opscompass-oracle-licensing/api/entitlement-deployment/entitlement-deployment +0 -26
- package/skills/opscompass-oracle-licensing/api/entitlement-usage/entitlement-usage.json +0 -114
- package/skills/opscompass-oracle-licensing/assets/mock-entitlements/deployment-details.json +0 -61
- package/skills/opscompass-oracle-licensing/assets/mock-entitlements/license-usage-map.json +0 -70
- package/skills/opscompass-oracle-licensing/assets/mock-entitlements/overall-compliance.json +0 -36
- package/skills/opscompass-oracle-licensing/scripts/fake-entitlements-api.tool.js +0 -31
- package/skills/opscompass-oracle-licensing/scripts/fake_entitlements_api.js +0 -72
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
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-
|
|
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`, `get-compliance`, and read-only `get-drift`. Use when users need to identify licensing risk, sprawl, misconfiguration, drift, and workload hosting context for Oracle, SQL Server, Azure SQL, AWS RDS, AWS EC2, VMware vCenter, or Nutanix resources.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# OpsCompass Resources
|
|
@@ -10,24 +10,29 @@ description: Analyze Oracle and SQL Server workloads across cloud and on-prem in
|
|
|
10
10
|
## Overview
|
|
11
11
|
|
|
12
12
|
Use this skill for a narrow workflow centered on Oracle and SQL Server risk analysis across cloud and on-prem infrastructure:
|
|
13
|
+
|
|
13
14
|
- `opscompass resources list` to find matching resources
|
|
14
15
|
- `opscompass resources get-latest-configuration` to inspect full configuration for resource `--id` values from the list results
|
|
15
16
|
- `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
|
|
17
|
+
- `opscompass resources get-drift` to inspect drift/change records for resource `--id` values from the list results (with optional `--status`, `--concern`, and `--type` filters)
|
|
16
18
|
|
|
17
19
|
Translate user intent into exact commands, run them, and return concise risk-oriented summaries.
|
|
18
20
|
|
|
19
21
|
This skill is primarily for:
|
|
22
|
+
|
|
20
23
|
- Oracle license risk analysis
|
|
21
24
|
- SQL Server and Oracle sprawl analysis
|
|
22
25
|
- tracing workloads to AWS, Azure, VMware, or Nutanix infrastructure
|
|
23
26
|
- identifying misconfiguration and placement context from latest configuration data
|
|
24
27
|
|
|
25
28
|
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:
|
|
29
|
+
|
|
26
30
|
- `--resource-creation-date-beginning` for "created on or after" questions
|
|
27
31
|
- `--resource-creation-date-end` for "created before" questions
|
|
28
32
|
- both flags together for date-range questions
|
|
29
33
|
|
|
30
34
|
For Oracle specifically, licensing risk is a workload-plus-infrastructure problem, not just a database-config problem. The answer is stronger when it establishes:
|
|
35
|
+
|
|
31
36
|
- the Oracle workload identity
|
|
32
37
|
- where it is hosted
|
|
33
38
|
- the underlying compute or core exposure
|
|
@@ -52,9 +57,10 @@ Standalone dev defaults inspection: `opscompassdev defaults list-defaults`. For
|
|
|
52
57
|
3. If filtering is needed, add only the `list` filters needed (start minimal, then refine).
|
|
53
58
|
4. Build and run `opscompass resources list`.
|
|
54
59
|
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
|
|
60
|
+
6. Iterate the ids needed for the user's objective and run relevant follow-up actions:
|
|
56
61
|
- `opscompass resources get-latest-configuration --company ... --id ...`
|
|
57
62
|
- `opscompass resources get-compliance --company ... --id ... --status ...`
|
|
63
|
+
- `opscompass resources get-drift --company ... --id ... --status new`
|
|
58
64
|
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
65
|
8. Summarize the result(s) and include the exact command(s).
|
|
60
66
|
|
|
@@ -70,29 +76,33 @@ When the user says `Oracle` in this skill, interpret it as Oracle database workl
|
|
|
70
76
|
|
|
71
77
|
## Filter Selection
|
|
72
78
|
|
|
73
|
-
Use `references/resources-commands.md` for the supported `list` filters and
|
|
79
|
+
Use `references/resources-commands.md` for the supported `list` filters and follow-up actions.
|
|
74
80
|
Use `scripts/build_resources_command.js` to generate valid commands for:
|
|
81
|
+
|
|
75
82
|
- `list`
|
|
76
83
|
- `get-latest-configuration` (by numeric `--id`)
|
|
77
84
|
- `get-compliance` (by numeric `--id` plus `--status`)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Use `scripts/
|
|
82
|
-
Use `scripts/
|
|
83
|
-
|
|
85
|
+
- `get-drift` (by numeric `--id` plus optional `--status`, `--concern`, and `--type`)
|
|
86
|
+
When using `scripts/build_resources_command.js` for compliance or drift, pass follow-up filters as `--param key=value`. The final printed commands use native flags such as `--status ...`, `--concern ...`, and `--type ...`.
|
|
87
|
+
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.
|
|
88
|
+
Use `scripts/summarize_resources_list.js` to summarize large `resources list` JSON output.
|
|
89
|
+
Use `scripts/summarize_latest_configuration.js` to summarize one or many `get-latest-configuration` JSON results into model-friendly summaries across resource types.
|
|
90
|
+
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.
|
|
91
|
+
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
92
|
|
|
85
93
|
Prefer tools/scripts this way:
|
|
94
|
+
|
|
86
95
|
- embedded host with approved resource/default tools -> use those tools with the host context rather than substituting standalone shell commands
|
|
87
96
|
- standalone, one or a few resources -> `scripts/build_resources_command.js` plus actual execution of the generated command
|
|
88
97
|
- standalone, many matching resources -> `scripts/list_and_fetch_latest_configs.js`
|
|
89
98
|
- many raw list rows already collected -> `scripts/summarize_resources_list.js`
|
|
90
99
|
- many config payloads already collected -> `scripts/summarize_latest_configuration.js`
|
|
91
100
|
|
|
92
|
-
Important: in this skill, `get-latest-configuration` and `get-
|
|
101
|
+
Important: in this skill, `get-latest-configuration`, `get-compliance`, and `get-drift` are follow-up actions after `list`.
|
|
93
102
|
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-
|
|
103
|
+
Use the numeric OpsCompass resource `--id` for follow-up actions. Do not use `--resource-id` or `--resource-ids` for `get-latest-configuration`, `get-compliance`, or `get-drift`; those represent cloud platform resource identifiers such as ARNs or Azure resource ids and are not the same thing.
|
|
95
104
|
Do not use `opscompass resources show` in this skill.
|
|
105
|
+
For drift workflows, start with `resources list --unacknowledged-changes true`, page with `--skip` when needed, then inspect selected resources with `get-drift --status new` or another user-requested status. The CLI supports resource-scoped drift retrieval with statuses `new`, `inprogress`, `acknowledged`, and `resolved`, but it does not expose a company-wide drift listing, created/deleted drift classification, deleted-resource enumeration, or any action to acknowledge, resolve, or clear drift from the Dashboard.
|
|
96
106
|
For Oracle resources, version/edition are available in `get-latest-configuration` output under `document.version` and `document.edition`.
|
|
97
107
|
If the user asks "Do I have any Oracle?" or "Show me my Oracle," default to `--resource-types databases/oracle`.
|
|
98
108
|
For Oracle resources, `get-compliance` should usually be interpreted as Oracle license compliance rather than generic infrastructure/security compliance.
|
|
@@ -111,6 +121,7 @@ For Nutanix vCPU mapping, inspect `document.numSockets`, `document.numCoresPerSo
|
|
|
111
121
|
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
122
|
|
|
113
123
|
For `--resource-types`, this skill is intentionally limited to these OpsCompass-formatted values:
|
|
124
|
+
|
|
114
125
|
- `AWS::EC2::Instance`
|
|
115
126
|
- `Microsoft.Sql/servers`
|
|
116
127
|
- `AWS::RDS::DBInstance`
|
|
@@ -130,6 +141,7 @@ For `--resource-types`, this skill is intentionally limited to these OpsCompass-
|
|
|
130
141
|
- `vcenter/virtualMachine`
|
|
131
142
|
|
|
132
143
|
Common user intents this skill should handle:
|
|
144
|
+
|
|
133
145
|
- "What Oracle licensing risk do I have?" -> treat as Oracle workload plus infrastructure analysis; use Oracle compliance/config plus hosting context
|
|
134
146
|
- "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
147
|
- "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`
|
|
@@ -147,6 +159,8 @@ Common user intents this skill should handle:
|
|
|
147
159
|
- "List resources for account/provider/region" -> `--accounts`, `--cloud-providers`, `--region-ids`
|
|
148
160
|
- "List resources with open compliance issues" -> `--open-compliance-issues true`
|
|
149
161
|
- "List resources with unacknowledged changes" -> `--unacknowledged-changes true`
|
|
162
|
+
- "Show the unacknowledged drift for those resources" -> iterate returned ids with `resources get-drift --status new`
|
|
163
|
+
- "Acknowledge or clear drift from the Dashboard" -> explain that the current CLI exposes read-only drift retrieval but no acknowledge/resolve mutation action
|
|
150
164
|
- "List resources by tag or type" -> `--tags`, `--resource-types` (restricted to the approved set above)
|
|
151
165
|
- "List EC2 instances" -> `resources list ... --resource-types AWS::EC2::Instance`
|
|
152
166
|
- "List Nutanix clusters" -> `resources list ... --resource-types Nutanix/Cluster`
|
|
@@ -177,8 +191,10 @@ Common user intents this skill should handle:
|
|
|
177
191
|
- `opscompass resources list`
|
|
178
192
|
- `opscompass resources get-latest-configuration`
|
|
179
193
|
- `opscompass resources get-compliance`
|
|
194
|
+
- `opscompass resources get-drift`
|
|
180
195
|
- Choose follow-up actions with this priority:
|
|
181
196
|
- Oracle license/compliance question -> `get-compliance` plus `get-latest-configuration`, then correlate to infrastructure when possible
|
|
197
|
+
- drift/change question -> `list --unacknowledged-changes true`, then `get-drift --status new` or the requested status for selected resource ids; do not claim the CLI can acknowledge or clear drift
|
|
182
198
|
- Oracle or SQL Server hosting/sprawl/misconfiguration question -> `get-latest-configuration` first, then correlate to infrastructure
|
|
183
199
|
- VMware or Nutanix question -> `get-latest-configuration`, not `get-compliance`
|
|
184
200
|
- generic inventory question -> `list`, then only fetch follow-up data if needed to answer the question
|
|
@@ -235,6 +251,8 @@ Common user intents this skill should handle:
|
|
|
235
251
|
- 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
252
|
- 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
253
|
- If `get-compliance` fails, report the real command failure or stderr and state that the detailed compliance answer is partial because retrieval failed.
|
|
254
|
+
- For `get-drift`, report finding count and key fields per change record, including id, status, concern, type, `changeTime`, `changeUrl`, and `userDetected` when present. If the output omits before/after values or created/deleted classification, state that the CLI result does not expose those details.
|
|
255
|
+
- If the user asks to acknowledge, resolve, clear, or remove drift from the Dashboard, state that the current CLI supports resource-scoped `get-drift` retrieval and drift-status filtering only; do not invent a mutation command. If the user asks for dashboard totals such as deleted-resource drift, state that `resources list` only returns current resource rows and the CLI does not expose deleted-resource drift enumeration.
|
|
238
256
|
- 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
257
|
- 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
258
|
- 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.
|
|
@@ -286,6 +304,10 @@ opscompass resources list --company acme --resource-creation-date-beginning "202
|
|
|
286
304
|
opscompass resources list --company acme --accounts 406219038857 --unacknowledged-changes true
|
|
287
305
|
```
|
|
288
306
|
|
|
307
|
+
```bash
|
|
308
|
+
opscompass resources get-drift --company acme --id 9403537 --status new
|
|
309
|
+
```
|
|
310
|
+
|
|
289
311
|
```bash
|
|
290
312
|
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
313
|
```
|
|
@@ -298,6 +320,10 @@ node scripts/build_resources_command.js --action get-latest-configuration --comp
|
|
|
298
320
|
node scripts/build_resources_command.js --action get-compliance --company opscompassdemo --id 7180543 --param status=open
|
|
299
321
|
```
|
|
300
322
|
|
|
323
|
+
```bash
|
|
324
|
+
node scripts/build_resources_command.js --action get-drift --company opscompassdemo --id 9403537 --param status=new --param type=configuration_alert
|
|
325
|
+
```
|
|
326
|
+
|
|
301
327
|
```bash
|
|
302
328
|
opscompass resources list --company opscompassdemo --resource-types databases/oracle
|
|
303
329
|
# then use returned ids (for example 9403537) with:
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# OpsCompass Resources `list` + Follow-up Details Reference
|
|
2
2
|
|
|
3
|
-
Use this file to map workload and infrastructure questions to `opscompass resources list` flags and then inspect selected resources by iterating their ids with follow-up actions like `get-latest-configuration` and `get-
|
|
3
|
+
Use this file to map workload and infrastructure questions to `opscompass resources list` flags and then inspect selected resources by iterating their ids with follow-up actions like `get-latest-configuration`, `get-compliance`, and read-only `get-drift`.
|
|
4
4
|
|
|
5
5
|
This skill is primarily for:
|
|
6
|
+
|
|
6
7
|
- Oracle license risk analysis
|
|
7
8
|
- Oracle and SQL Server sprawl analysis
|
|
8
9
|
- tracing workloads to AWS, Azure, VMware, or Nutanix infrastructure
|
|
9
10
|
- identifying misconfiguration from latest configuration data
|
|
10
11
|
|
|
11
12
|
For Oracle licensing and sprawl work, date-bounded inventory is a standard workflow. Use `resources list` with:
|
|
13
|
+
|
|
12
14
|
- `--resource-creation-date-beginning` for created-on-or-after questions
|
|
13
15
|
- `--resource-creation-date-end` for created-before questions
|
|
14
16
|
- both flags together for date-range questions
|
|
@@ -44,6 +46,14 @@ For Oracle licensing and sprawl work, date-bounded inventory is a standard workf
|
|
|
44
46
|
- Required for this skill: resolved `--company`, numeric `--id` (from `list` output), and `--status`.
|
|
45
47
|
- Builder syntax note: when using `scripts/build_resources_command.js` for compliance, pass `--param status=...` to the builder. The final printed `opscompass resources get-compliance ...` command will use `--status ...`.
|
|
46
48
|
- Allowed `get-compliance --status` values: `open`, `remediated`, `policy-exception`, `mitigation`.
|
|
49
|
+
- `get-drift`: Drift/change records for one resource.
|
|
50
|
+
- Required for this skill: resolved `--company` and numeric `--id` (from `list` output). The CLI rejects company-wide `get-drift` without an id.
|
|
51
|
+
- Optional filters are `--status`, `--concern`, and `--type`.
|
|
52
|
+
- Builder syntax note: when using `scripts/build_resources_command.js` for drift, pass filters as `--param status=new`, `--param concern=...`, or `--param type=configuration_alert`. The final printed `opscompass resources get-drift ...` command will use native flags.
|
|
53
|
+
- Allowed `get-drift --status` values: `new`, `inprogress`, `acknowledged`, `resolved`.
|
|
54
|
+
- Allowed `get-drift --type` values: `configuration_alert`, `security_alert`.
|
|
55
|
+
- For drift summaries, focus on id, status, concern, type, `changeTime`, `changeUrl`, and `userDetected` when present. The current CLI output may not include before/after values or created/deleted classification.
|
|
56
|
+
- The CLI exposes resource-scoped drift retrieval and drift-status filtering, but no company-wide drift listing, deleted-resource drift enumeration, or acknowledge/resolve/clear mutation action in this skill. If a user asks for Dashboard-only deleted-resource totals or clearing drift from the Dashboard, report that limitation instead of inventing a command.
|
|
47
57
|
- For compliance summaries, focus on `checkName`, `checkSeverity`, `errorMessage`, `recommendedAction`, and framework/control names.
|
|
48
58
|
- For Oracle DBs, interpret `get-compliance` results primarily as Oracle license compliance findings unless the user explicitly frames the request differently.
|
|
49
59
|
- For Oracle DB compliance workflows, also inspect `document.version`, `document.edition`, `document.productUsageConcerns`, and concerning `document.parameters` from `get-latest-configuration` so the answer has license context and feature-usage evidence.
|
|
@@ -121,6 +131,8 @@ For Oracle licensing and sprawl work, date-bounded inventory is a standard workf
|
|
|
121
131
|
- "Are these Oracle databases on Nutanix?" -> do not stop at `cloud_provider: "mlss"`; continue workload-to-infrastructure correlation through Nutanix resources
|
|
122
132
|
- "resources with open compliance issues" -> `--open-compliance-issues true`
|
|
123
133
|
- "resources with unacknowledged changes" -> `--unacknowledged-changes true`
|
|
134
|
+
- "show unacknowledged drift details" -> list with `--unacknowledged-changes true`, then iterate selected ids with `get-drift --status new`
|
|
135
|
+
- "acknowledge or clear drift" -> unsupported by the current CLI/skill; only drift retrieval/filtering is available
|
|
124
136
|
|
|
125
137
|
## Allowed `--resource-types` in this skill
|
|
126
138
|
|
|
@@ -150,12 +162,14 @@ For Oracle licensing and sprawl work, date-bounded inventory is a standard workf
|
|
|
150
162
|
- For large result sets, page deliberately and summarize the aggregate result instead of inspecting one oversized raw response.
|
|
151
163
|
- Choose follow-up actions with this priority:
|
|
152
164
|
- Oracle license/compliance question -> `get-compliance` plus `get-latest-configuration`, then correlate to infrastructure when possible
|
|
165
|
+
- drift/change question -> `list --unacknowledged-changes true`, page with `--skip` as needed, then `get-drift --status new` or the requested status for selected resource ids; report that deleted-resource drift totals may be visible in the Dashboard without being enumerable through this CLI workflow
|
|
153
166
|
- Oracle or SQL Server hosting/sprawl/misconfiguration question -> `get-latest-configuration` first, then correlate to infrastructure
|
|
154
167
|
- VMware or Nutanix question -> `get-latest-configuration`, not `get-compliance`
|
|
155
168
|
- generic inventory question -> `list`, then only fetch follow-up data if needed
|
|
156
169
|
- For Oracle licensing or sprawl questions scoped to time, start with a date-bounded `resources list` rather than a broad list.
|
|
157
170
|
- When the user wants full details, pick a resource `id` from the list output and run `get-latest-configuration`.
|
|
158
171
|
- When the user wants compliance findings, pick a resource `id` from the list output and run `get-compliance --status ...`.
|
|
172
|
+
- When the user wants drift/change records, pick a resource `id` from the list output and run `get-drift --status ...`; do not claim the CLI can acknowledge or clear the records.
|
|
159
173
|
- If the conversation was previously focused on VMware or Nutanix and the user pivots to Oracle or SQL Server, re-evaluate intent from scratch and default to `databases/oracle` or `databases/mssqlserver` rather than continuing the prior infrastructure framing.
|
|
160
174
|
- For multiple resources, iterate through the list ids and run `get-latest-configuration` per resource.
|
|
161
175
|
- For multiple compliance checks, iterate through list ids and run `get-compliance --status ...` per resource.
|
|
@@ -10,7 +10,12 @@ export const buildResourcesCommandTool = {
|
|
|
10
10
|
properties: {
|
|
11
11
|
action: {
|
|
12
12
|
type: "string",
|
|
13
|
-
enum: [
|
|
13
|
+
enum: [
|
|
14
|
+
"list",
|
|
15
|
+
"get-latest-configuration",
|
|
16
|
+
"get-compliance",
|
|
17
|
+
"get-drift",
|
|
18
|
+
],
|
|
14
19
|
},
|
|
15
20
|
company: { type: "string" },
|
|
16
21
|
id: { type: "string" },
|
|
@@ -51,6 +51,7 @@ const ALLOWED_ACTIONS = new Set([
|
|
|
51
51
|
"list",
|
|
52
52
|
"get-latest-configuration",
|
|
53
53
|
"get-compliance",
|
|
54
|
+
"get-drift",
|
|
54
55
|
]);
|
|
55
56
|
const ALLOWED_COMPLIANCE_STATUSES = new Set([
|
|
56
57
|
"open",
|
|
@@ -58,6 +59,21 @@ const ALLOWED_COMPLIANCE_STATUSES = new Set([
|
|
|
58
59
|
"policy-exception",
|
|
59
60
|
"mitigation",
|
|
60
61
|
]);
|
|
62
|
+
const ALLOWED_DRIFT_STATUSES = {
|
|
63
|
+
new: true,
|
|
64
|
+
inprogress: true,
|
|
65
|
+
acknowledged: true,
|
|
66
|
+
resolved: true,
|
|
67
|
+
};
|
|
68
|
+
const ALLOWED_DRIFT_TYPES = {
|
|
69
|
+
configuration_alert: true,
|
|
70
|
+
security_alert: true,
|
|
71
|
+
};
|
|
72
|
+
const ALLOWED_DRIFT_PARAMS = {
|
|
73
|
+
status: true,
|
|
74
|
+
concern: true,
|
|
75
|
+
type: true,
|
|
76
|
+
};
|
|
61
77
|
const sorted = (values) => [...values].sort();
|
|
62
78
|
const shellQuote = (value) => /^[A-Za-z0-9_./:-]+$/.test(value)
|
|
63
79
|
? value
|
|
@@ -121,6 +137,26 @@ export function validateArgs(args, paramMap) {
|
|
|
121
137
|
throw new Error(`invalid value '${status}' for --param status=... (allowed: ${sorted(ALLOWED_COMPLIANCE_STATUSES).join(", ")}).`);
|
|
122
138
|
return;
|
|
123
139
|
}
|
|
140
|
+
if (args.action === "get-drift") {
|
|
141
|
+
if (!args.resourceNumericId)
|
|
142
|
+
throw new Error("resources get-drift requires --id.");
|
|
143
|
+
for (const key of mapEntries(paramMap).map(([key]) => key))
|
|
144
|
+
if (!Object.hasOwn(ALLOWED_DRIFT_PARAMS, key))
|
|
145
|
+
throw new Error("resources get-drift only supports --param status=..., --param concern=..., and --param type=....");
|
|
146
|
+
const statuses = mapGet(paramMap, "status") ?? [];
|
|
147
|
+
if (statuses.length > 1)
|
|
148
|
+
throw new Error("resources get-drift accepts at most one --param status=...");
|
|
149
|
+
const status = statuses[0]?.trim();
|
|
150
|
+
if (status && !Object.hasOwn(ALLOWED_DRIFT_STATUSES, status))
|
|
151
|
+
throw new Error(`invalid value '${status}' for --param status=... (allowed: ${Object.keys(ALLOWED_DRIFT_STATUSES).sort().join(", ")}).`);
|
|
152
|
+
const types = mapGet(paramMap, "type") ?? [];
|
|
153
|
+
if (types.length > 1)
|
|
154
|
+
throw new Error("resources get-drift accepts at most one --param type=...");
|
|
155
|
+
const type = types[0]?.trim();
|
|
156
|
+
if (type && !Object.hasOwn(ALLOWED_DRIFT_TYPES, type))
|
|
157
|
+
throw new Error(`invalid value '${type}' for --param type=... (allowed: ${Object.keys(ALLOWED_DRIFT_TYPES).sort().join(", ")}).`);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
124
160
|
if (args.resourceNumericId)
|
|
125
161
|
throw new Error("resources list does not support top-level --id.");
|
|
126
162
|
for (const key of mapEntries(paramMap).map(([key]) => key))
|
|
@@ -160,9 +196,9 @@ export function buildCommand(args, paramMap, context = resolveCliContext()) {
|
|
|
160
196
|
"--company",
|
|
161
197
|
args.company,
|
|
162
198
|
];
|
|
163
|
-
if (["get-latest-configuration", "get-compliance"].includes(args.action)) {
|
|
199
|
+
if (["get-latest-configuration", "get-compliance", "get-drift"].includes(args.action)) {
|
|
164
200
|
command.push("--id", args.resourceNumericId);
|
|
165
|
-
if (
|
|
201
|
+
if (["get-compliance", "get-drift"].includes(args.action))
|
|
166
202
|
for (const [key, values] of mapEntries(paramMap))
|
|
167
203
|
for (const value of values)
|
|
168
204
|
command.push(`--${key}`, value);
|
|
@@ -205,7 +241,7 @@ function parseArgs(argv) {
|
|
|
205
241
|
args.param.push(argv[i]);
|
|
206
242
|
}
|
|
207
243
|
else if (flag === "--help" || flag === "-h") {
|
|
208
|
-
console.log("Build an opscompass resources list/get-latest-configuration/get-compliance command.");
|
|
244
|
+
console.log("Build an opscompass resources list/get-latest-configuration/get-compliance/get-drift command.");
|
|
209
245
|
process.exit(0);
|
|
210
246
|
}
|
|
211
247
|
else
|
package/skills/opscompass-oracle-licensing/api/entitlement-compliance/entitlement-compliance.json
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"Product": "Oracle Active Data Guard",
|
|
4
|
-
"Metric": "Processor",
|
|
5
|
-
"Limitation": "Full Use",
|
|
6
|
-
"Limited To": "",
|
|
7
|
-
"Licensed": 0,
|
|
8
|
-
"Used": 16,
|
|
9
|
-
"Available": 0,
|
|
10
|
-
"Potential risk": "$0.00",
|
|
11
|
-
"Comments": "(GoldenGate)"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"Product": "Oracle Advanced Compression",
|
|
15
|
-
"Metric": "Named User Plus",
|
|
16
|
-
"Limitation": "Limited Use",
|
|
17
|
-
"Limited To": "Test / Dev",
|
|
18
|
-
"Licensed": 400,
|
|
19
|
-
"Used": 0,
|
|
20
|
-
"Available": 400,
|
|
21
|
-
"Potential risk": "$0.00",
|
|
22
|
-
"Comments": ""
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"Product": "Oracle Advanced Compression",
|
|
26
|
-
"Metric": "Processor",
|
|
27
|
-
"Limitation": "Full Use",
|
|
28
|
-
"Limited To": "",
|
|
29
|
-
"Licensed": 16,
|
|
30
|
-
"Used": 16,
|
|
31
|
-
"Available": 0,
|
|
32
|
-
"Potential risk": "$0.00",
|
|
33
|
-
"Comments": ""
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"Product": "Oracle Advanced Security",
|
|
37
|
-
"Metric": "Processor",
|
|
38
|
-
"Limitation": "Full Use",
|
|
39
|
-
"Limited To": "",
|
|
40
|
-
"Licensed": 16,
|
|
41
|
-
"Used": 32,
|
|
42
|
-
"Available": -16,
|
|
43
|
-
"Potential risk": "$292,800.00",
|
|
44
|
-
"Comments": ""
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"Product": "Oracle Advanced Security",
|
|
48
|
-
"Metric": "Named User Plus",
|
|
49
|
-
"Limitation": "Limited Use",
|
|
50
|
-
"Limited To": "Test / Dev",
|
|
51
|
-
"Licensed": 400,
|
|
52
|
-
"Used": 400,
|
|
53
|
-
"Available": 0,
|
|
54
|
-
"Potential risk": "$0.00",
|
|
55
|
-
"Comments": ""
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"Product": "Oracle Database Enterprise Edition",
|
|
59
|
-
"Metric": "Named User Plus",
|
|
60
|
-
"Limitation": "Limited Use",
|
|
61
|
-
"Limited To": "Test / Dev",
|
|
62
|
-
"Licensed": 400,
|
|
63
|
-
"Used": 400,
|
|
64
|
-
"Available": 0,
|
|
65
|
-
"Potential risk": "$0.00",
|
|
66
|
-
"Comments": ""
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"Product": "Oracle Database Enterprise Edition",
|
|
70
|
-
"Metric": "Processor",
|
|
71
|
-
"Limitation": "Full Use",
|
|
72
|
-
"Limited To": "",
|
|
73
|
-
"Licensed": 16,
|
|
74
|
-
"Used": 32,
|
|
75
|
-
"Available": -16,
|
|
76
|
-
"Potential risk": "$927,200.00",
|
|
77
|
-
"Comments": ""
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"Product": "Oracle Database Vault",
|
|
81
|
-
"Metric": "Processor",
|
|
82
|
-
"Limitation": "Full Use",
|
|
83
|
-
"Limited To": "",
|
|
84
|
-
"Licensed": 16,
|
|
85
|
-
"Used": 32,
|
|
86
|
-
"Available": -16,
|
|
87
|
-
"Potential risk": "$224,480.00",
|
|
88
|
-
"Comments": ""
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"Product": "Oracle Database Vault",
|
|
92
|
-
"Metric": "Named User Plus",
|
|
93
|
-
"Limitation": "Limited Use",
|
|
94
|
-
"Limited To": "Test / Dev",
|
|
95
|
-
"Licensed": 400,
|
|
96
|
-
"Used": 400,
|
|
97
|
-
"Available": 0,
|
|
98
|
-
"Potential risk": "$0.00",
|
|
99
|
-
"Comments": ""
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"Product": "Oracle Diagnostics Pack",
|
|
103
|
-
"Metric": "Named User Plus",
|
|
104
|
-
"Limitation": "Limited Use",
|
|
105
|
-
"Limited To": "Test / Dev",
|
|
106
|
-
"Licensed": 400,
|
|
107
|
-
"Used": 400,
|
|
108
|
-
"Available": 0,
|
|
109
|
-
"Potential risk": "$0.00",
|
|
110
|
-
"Comments": ""
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"Product": "Oracle Diagnostics Pack",
|
|
114
|
-
"Metric": "Processor",
|
|
115
|
-
"Limitation": "Full Use",
|
|
116
|
-
"Limited To": "",
|
|
117
|
-
"Licensed": 16,
|
|
118
|
-
"Used": 16,
|
|
119
|
-
"Available": 0,
|
|
120
|
-
"Potential risk": "$0.00",
|
|
121
|
-
"Comments": ""
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"Product": "Oracle GoldenGate",
|
|
125
|
-
"Metric": "Named User Plus",
|
|
126
|
-
"Limitation": "Limited Use",
|
|
127
|
-
"Limited To": "Test / Dev",
|
|
128
|
-
"Licensed": 400,
|
|
129
|
-
"Used": 400,
|
|
130
|
-
"Available": 0,
|
|
131
|
-
"Potential risk": "$0.00",
|
|
132
|
-
"Comments": ""
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"Product": "Oracle GoldenGate",
|
|
136
|
-
"Metric": "Processor",
|
|
137
|
-
"Limitation": "Full Use",
|
|
138
|
-
"Limited To": "",
|
|
139
|
-
"Licensed": 16,
|
|
140
|
-
"Used": 16,
|
|
141
|
-
"Available": 0,
|
|
142
|
-
"Potential risk": "$0.00",
|
|
143
|
-
"Comments": ""
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"Product": "Oracle Partitioning",
|
|
147
|
-
"Metric": "Processor",
|
|
148
|
-
"Limitation": "Full Use",
|
|
149
|
-
"Limited To": "",
|
|
150
|
-
"Licensed": 16,
|
|
151
|
-
"Used": 16,
|
|
152
|
-
"Available": 0,
|
|
153
|
-
"Potential risk": "$0.00",
|
|
154
|
-
"Comments": ""
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"Product": "Oracle Partitioning",
|
|
158
|
-
"Metric": "Named User Plus",
|
|
159
|
-
"Limitation": "Limited Use",
|
|
160
|
-
"Limited To": "Test / Dev",
|
|
161
|
-
"Licensed": 400,
|
|
162
|
-
"Used": 400,
|
|
163
|
-
"Available": 0,
|
|
164
|
-
"Potential risk": "$0.00",
|
|
165
|
-
"Comments": ""
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"Product": "Oracle Real Application Clusters",
|
|
169
|
-
"Metric": "Named User Plus",
|
|
170
|
-
"Limitation": "Limited Use",
|
|
171
|
-
"Limited To": "Test / Dev",
|
|
172
|
-
"Licensed": 400,
|
|
173
|
-
"Used": 400,
|
|
174
|
-
"Available": 0,
|
|
175
|
-
"Potential risk": "$0.00",
|
|
176
|
-
"Comments": ""
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"Product": "Oracle Real Application Clusters",
|
|
180
|
-
"Metric": "Processor",
|
|
181
|
-
"Limitation": "Full Use",
|
|
182
|
-
"Limited To": "",
|
|
183
|
-
"Licensed": 16,
|
|
184
|
-
"Used": 32,
|
|
185
|
-
"Available": -16,
|
|
186
|
-
"Potential risk": "$448,960.00",
|
|
187
|
-
"Comments": ""
|
|
188
|
-
}
|
|
189
|
-
]
|
package/skills/opscompass-oracle-licensing/api/entitlement-deployment/entitlement-deployment
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{"Server":"NTX3-HOST06-DC3","VM":"NTX-APPLICATIONPROD-LX02","Instance":"TRKP1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"3/5/25"},
|
|
3
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-INTERFACEDEV-LX01","Instance":"INVD1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"4/11/25"},
|
|
4
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-ARRAYDEV-LX01","Instance":"INVQ2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"3/14/25"},
|
|
5
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-CAPACITORDEV-LX01","Instance":"DWHS01","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"4/11/25"},
|
|
6
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-MONITORDEV-LX01","Instance":"HISTDR2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"5/3/18"},
|
|
7
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-ALARMDEV-LX02","Instance":"INVT2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"4/9/25"},
|
|
8
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-CARDDEV-LX01","Instance":"MEND2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"1/1/25"},
|
|
9
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-DRIVERDEV-LX01","Instance":"HISTQA","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"2/26/25"},
|
|
10
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-CIRCUITDEV-LX01","Instance":"REPD1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"2/24/25"},
|
|
11
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-BANDWIDTHDEV-LX01","Instance":"RMANCP1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"3/3/25"},
|
|
12
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-MONITORDEV-LX01","Instance":"TRK2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"2/13/25"},
|
|
13
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-ALARMDEV-LX02","Instance":"INVT1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"4/9/25"},
|
|
14
|
-
{"Server":"NTX5-HOST01-DC1","VM":"NTX-MONITORDEV-LX01","Instance":"INVT2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"4/9/25"},
|
|
15
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-APPLICATIONDEV-LX02","Instance":"DWHS02","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"4/11/25"},
|
|
16
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-PROGRAMDEV-LX02","Instance":"INVD2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"4/11/25"},
|
|
17
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-FIREWALLDEV-LX02","Instance":"HISTDR1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"5/3/18"},
|
|
18
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-CAPACITORDEV-LX02","Instance":"INVQ1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"3/14/25"},
|
|
19
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-ALARMDEV-LX02","Instance":"MEND1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"1/1/25"},
|
|
20
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-APPLICATIONDEV-LX02","Instance":"RMANCP2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"3/3/25"},
|
|
21
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-CARDDEV-LX02","Instance":"TRK1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"2/13/25"},
|
|
22
|
-
{"Server":"NTX5-HOST02-DC1","VM":"NTX-ARRAYDEV-LX02","Instance":"REPD2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"2/23/25"},
|
|
23
|
-
{"Server":"NTX6-HOST01-DC1","VM":"NTX-FIREWALLPROD-LX01","Instance":"INVP2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"2/2/13"},
|
|
24
|
-
{"Server":"NTX6-HOST01-DC1","VM":"NTX-PIXELPROD-LX01","Instance":"TRKP2","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"3/5/25"},
|
|
25
|
-
{"Server":"NTX6-HOST02-DC1","VM":"NTX-SYSTEMPROD-LX02","Instance":"INVP1","Edition":"Enterprise Edition","Version":"19.0.0.0.0","DB Created":"2/2/13"}
|
|
26
|
-
]
|