From 632d7727e0c5a30a179dc29d73aae44a6d9debf1 Mon Sep 17 00:00:00 2001 From: Mike Bombard <37379633+mbomb67@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:41:58 -0400 Subject: [PATCH 1/4] Add the POC Onboarding Toolkit (slice 1) and the cb-poc-onboarding skill Eight MCP tool actions an agent uses to take a new appliance through the POC Test Plan: onb_status (inventory plus next steps with links), onb_ui_link (admin page and object links so secrets are entered in the UI), onb_recent_errors (grouped log tail with hints), onb_failure_trace (order or job down to the failed job), onb_verify_resource_handler (the real Verify Connection error with a technology hint), onb_playbook (the skill text over MCP), onb_install (Synchronous flags and egress checks after import) and onb_set_item_status (done or not applicable per test plan item). Packaged with the three testing tools they reuse as PKG-8aaadefz, with a setup runbook and the skill's bootstrap, handler, phase, troubleshooting and test-plan references. Co-Authored-By: Claude Fable 5.1 --- .claude/skills/cb-poc-onboarding/SKILL.md | 73 +++ .../cb-poc-onboarding/references/bootstrap.md | 67 +++ .../cb-poc-onboarding/references/phases.md | 86 +++ .../references/resource-handlers.md | 49 ++ .../references/test-plan-map.md | 66 +++ .../references/troubleshooting.md | 33 ++ CATALOG.md | 23 +- catalog.json | 279 +++++++++- docs/poc-onboarding-setup.md | 69 +++ .../MTA-1985b88g/MTA-1985b88g_metadata.json | 19 + mcp_tool_actions/MTA-1985b88g/README.md | 21 + .../MTA-6zxrhdls/MTA-6zxrhdls_metadata.json | 39 ++ mcp_tool_actions/MTA-6zxrhdls/README.md | 23 + .../MTA-92b836jb/MTA-92b836jb_metadata.json | 39 ++ mcp_tool_actions/MTA-92b836jb/README.md | 23 + .../MTA-hwg74btd/MTA-hwg74btd_metadata.json | 115 ++++ mcp_tool_actions/MTA-hwg74btd/README.md | 27 + .../MTA-jzscq0mk/MTA-jzscq0mk_metadata.json | 39 ++ mcp_tool_actions/MTA-jzscq0mk/README.md | 22 + .../MTA-p72v9y76/MTA-p72v9y76_metadata.json | 77 +++ mcp_tool_actions/MTA-p72v9y76/README.md | 25 + .../MTA-r5v1eblg/MTA-r5v1eblg_metadata.json | 39 ++ mcp_tool_actions/MTA-r5v1eblg/README.md | 23 + .../MTA-zpohocjt/MTA-zpohocjt_metadata.json | 39 ++ mcp_tool_actions/MTA-zpohocjt/README.md | 23 + mcp_tool_actions/README.md | 8 + .../PKG-8aaadefz/PKG-8aaadefz_metadata.json | 22 + packages/PKG-8aaadefz/README.md | 19 + packages/README.md | 1 + .../OHK-1am7i73s/OHK-1am7i73s_metadata.json | 35 ++ plugins/OHK-1am7i73s/OHK-1am7i73s_script.py | 110 ++++ .../OHK-1gp25bmt/OHK-1gp25bmt_metadata.json | 35 ++ plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py | 258 +++++++++ .../OHK-4vwq70dg/OHK-4vwq70dg_metadata.json | 115 ++++ plugins/OHK-4vwq70dg/OHK-4vwq70dg_script.py | 298 +++++++++++ .../OHK-5885tete/OHK-5885tete_metadata.json | 75 +++ plugins/OHK-5885tete/OHK-5885tete_script.py | 220 ++++++++ .../OHK-5zg1dkcr/OHK-5zg1dkcr_metadata.json | 13 + plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py | 497 ++++++++++++++++++ .../OHK-j60flmb3/OHK-j60flmb3_metadata.json | 35 ++ plugins/OHK-j60flmb3/OHK-j60flmb3_script.py | 258 +++++++++ .../OHK-s7cdvkpr/OHK-s7cdvkpr_metadata.json | 35 ++ plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py | 303 +++++++++++ .../OHK-y95w8ai0/OHK-y95w8ai0_metadata.json | 35 ++ plugins/OHK-y95w8ai0/OHK-y95w8ai0_script.py | 226 ++++++++ plugins/README.md | 8 + 46 files changed, 3938 insertions(+), 6 deletions(-) create mode 100644 .claude/skills/cb-poc-onboarding/SKILL.md create mode 100644 .claude/skills/cb-poc-onboarding/references/bootstrap.md create mode 100644 .claude/skills/cb-poc-onboarding/references/phases.md create mode 100644 .claude/skills/cb-poc-onboarding/references/resource-handlers.md create mode 100644 .claude/skills/cb-poc-onboarding/references/test-plan-map.md create mode 100644 .claude/skills/cb-poc-onboarding/references/troubleshooting.md create mode 100644 docs/poc-onboarding-setup.md create mode 100644 mcp_tool_actions/MTA-1985b88g/MTA-1985b88g_metadata.json create mode 100644 mcp_tool_actions/MTA-1985b88g/README.md create mode 100644 mcp_tool_actions/MTA-6zxrhdls/MTA-6zxrhdls_metadata.json create mode 100644 mcp_tool_actions/MTA-6zxrhdls/README.md create mode 100644 mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json create mode 100644 mcp_tool_actions/MTA-92b836jb/README.md create mode 100644 mcp_tool_actions/MTA-hwg74btd/MTA-hwg74btd_metadata.json create mode 100644 mcp_tool_actions/MTA-hwg74btd/README.md create mode 100644 mcp_tool_actions/MTA-jzscq0mk/MTA-jzscq0mk_metadata.json create mode 100644 mcp_tool_actions/MTA-jzscq0mk/README.md create mode 100644 mcp_tool_actions/MTA-p72v9y76/MTA-p72v9y76_metadata.json create mode 100644 mcp_tool_actions/MTA-p72v9y76/README.md create mode 100644 mcp_tool_actions/MTA-r5v1eblg/MTA-r5v1eblg_metadata.json create mode 100644 mcp_tool_actions/MTA-r5v1eblg/README.md create mode 100644 mcp_tool_actions/MTA-zpohocjt/MTA-zpohocjt_metadata.json create mode 100644 mcp_tool_actions/MTA-zpohocjt/README.md create mode 100644 packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json create mode 100644 packages/PKG-8aaadefz/README.md create mode 100644 plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json create mode 100644 plugins/OHK-1am7i73s/OHK-1am7i73s_script.py create mode 100644 plugins/OHK-1gp25bmt/OHK-1gp25bmt_metadata.json create mode 100644 plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py create mode 100644 plugins/OHK-4vwq70dg/OHK-4vwq70dg_metadata.json create mode 100644 plugins/OHK-4vwq70dg/OHK-4vwq70dg_script.py create mode 100644 plugins/OHK-5885tete/OHK-5885tete_metadata.json create mode 100644 plugins/OHK-5885tete/OHK-5885tete_script.py create mode 100644 plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_metadata.json create mode 100644 plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py create mode 100644 plugins/OHK-j60flmb3/OHK-j60flmb3_metadata.json create mode 100644 plugins/OHK-j60flmb3/OHK-j60flmb3_script.py create mode 100644 plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_metadata.json create mode 100644 plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py create mode 100644 plugins/OHK-y95w8ai0/OHK-y95w8ai0_metadata.json create mode 100644 plugins/OHK-y95w8ai0/OHK-y95w8ai0_script.py diff --git a/.claude/skills/cb-poc-onboarding/SKILL.md b/.claude/skills/cb-poc-onboarding/SKILL.md new file mode 100644 index 00000000..fd24ea5a --- /dev/null +++ b/.claude/skills/cb-poc-onboarding/SKILL.md @@ -0,0 +1,73 @@ +--- +name: cb-poc-onboarding +description: Walk a customer from a freshly deployed CloudBolt appliance to one that passes the CloudBolt POC Test Plan, over the CloudBolt MCP server. Reads status, hands the user a direct UI link for every step that involves a secret, verifies resource handlers and reads the appliance's own logs when something fails, drives the Custom Server order through MCP, records each test-plan item as done or not applicable, and reports a scorecard. +when_to_use: When the user says "onboard CloudBolt", "set up CloudBolt for a POC", "get this appliance ready", "connect my first cloud", "why did my resource handler fail", "walk me through the POC test plan", or asks for the next step on a new CloudBolt instance. Also when a CloudBolt MCP server is connected and the user asks what is configured. Not for authoring content (the cb-scaffold-* skills) or for testing content changes (cb-test-content). +--- + +# cb-poc-onboarding + +Take a new CloudBolt appliance through the POC Test Plan with the connected CloudBolt MCP server. The procedure is tool-neutral: every step is an MCP tool call, a link the user opens, or a question. Any agent with the same MCP connection can follow it; clients without skill support get this text from the `onb_playbook` tool. + +## Required reading + +Before the first phase, read [references/bootstrap.md](references/bootstrap.md). Read the other references when their phase starts: [resource-handlers.md](references/resource-handlers.md) (Phase 1), [phases.md](references/phases.md) (Phases 2 to 9), [troubleshooting.md](references/troubleshooting.md) (on any failure), [test-plan-map.md](references/test-plan-map.md) (what each item needs and whether it can be skipped). + +## Hard rules + +1. **Secrets never pass through the agent.** Passwords, access keys, client secrets, service-account JSON, API tokens: the user enters them in the UI. Give the exact link from `onb_ui_link` and list the non-secret values to type. Never ask for a secret in chat, never accept one that is pasted (say so and move on), never put one in a tool call. +2. **Root cause before retry.** When anything fails: read the tool's `error_message`; for an order or job call `onb_failure_trace`, then `fetch_job_log` on the job it names; for a UI failure call `onb_recent_errors` for the last few minutes; then apply [troubleshooting.md](references/troubleshooting.md). State the cause and the fix before anyone retries. +3. **Status first.** Start every phase with `onb_status`. Never assume what is configured; the appliance is the source of truth. +4. **Echo and confirm every write.** Before a tool that changes the appliance or orders infrastructure, state what will change and wait for a clear yes. For `order_catalog_item` follow the server's echo-and-confirm text verbatim. +5. **Every step is skippable.** When the customer cannot or does not want to do an item (no SMTP, no LDAP, no SSO, no DNS record, no Terraform or Ansible), offer to skip it, record it with `onb_set_item_status` as `not_applicable` with the reason, and move on. The scorecard reports it as not applicable, never as failed. +6. **Record progress.** When an item's evidence exists (a successful order, a verified handler, a user who logged in), record it `done` with `onb_set_item_status`. The scorecard is built from these records plus live evidence. +7. **Scope is the test plan.** Up to two resource handlers, one or two environments each, the Custom Server blueprint, the test-plan items. Anything more is a follow-up to propose at the end, not a step. +8. **Two response shapes.** A synchronous tool answers inline: read `outputs`. An asynchronous tool answers `{"success": true, "ids": ["JOB-..."]}`: poll `fetch_job` on that id every five seconds and read its `outputs`. `onb_verify_resource_handler` and `onb_install` are asynchronous by design. If a tool that should be synchronous answers with a job id, `onb_install` has not run; run it and tell the user to reconnect the client. +9. **Reconnect after install.** Tool lists are cached per client session. After `onb_install` changes anything, the user reconnects the MCP client before the next phase. +10. **Links, not hostnames.** Every URL comes from a tool (`onb_ui_link`, `onb_status`, the built-in `fetch_*_link` tools). Never compose an appliance URL from memory. + +## Tools + +Built-in CloudBolt MCP tools used here: `fetch_identity`, `fetch_dashboard_link`, `fetch_catalog_items`, `fetch_orderable_groups`, `fetch_blueprint_schema`, `fetch_orderable_environments`, `fetch_blueprint_item_parameters`, `fetch_blueprint_parameter_options`, `order_catalog_item`, `fetch_order`, `approve_order`, `fetch_job`, `fetch_server_list`, `fetch_server_actions`, `run_server_action`, `fetch_groups`, `fetch_environment_list`, `fetch_environment_details`, `set_server_power_schedule`. + +Toolkit tools (the POC Onboarding Toolkit package, `custom_` prefix when they appear as first-class tools; otherwise `run_mcp_tool_action(mcp_tool_name, parameters)`): + +| Tool | Mode | Use it to | +|---|---|---| +| `onb_status` | sync | See everything configured, recorded items, and `nextSteps` with links | +| `onb_ui_link` | sync | Get the UI link for a global id or a named page (`new_resource_handler:aws`, `email_settings`, `user_edit:USR-...`) | +| `onb_recent_errors` | sync | Read the last minutes of application, jobengine, authentication or mcp log, grouped, with hints | +| `onb_failure_trace` | sync | Walk a failed order or job down to the job that failed, with hints and the id for `fetch_job_log` | +| `onb_verify_resource_handler` | async | Run Verify Connection on a handler and get the real error plus a technology hint | +| `onb_playbook` | sync | Fetch this skill's text by section for clients without skills | +| `onb_install` | async | Finish the toolkit install (synchronous flags, enabled, egress checks) | +| `onb_set_item_status` | sync | Record a test-plan item or prerequisite as done, skipped, not_applicable or pending | +| `sync_from_source_control_repo`, `fetch_job_log`, `manage_blueprint_permissions` | sync | Reused from the testing toolkit: sync content, read a job's log, restore blueprint entitlements | + +## The loop + +Phases follow the customer's natural order: self-service first (handlers, environments, the first order, parameters), then groups, RBAC and governance, then lifecycle, then extensibility, then the wrap-up. Reorder only when a step depends on another (SMTP before approval emails, a group before a non-admin login) and say why. + +For every phase: + +1. `onb_status`. Summarize what exists and the `nextSteps` relevant to this phase in two or three sentences. +2. For each step: if a toolkit or built-in tool does it, echo, confirm, call it, read the result. If only the UI can do it (anything with a secret; environment import, OS builds and order-form trimming until those tools ship), give the `onb_ui_link` link, the non-secret values to enter, and the documentation link from [test-plan-map.md](references/test-plan-map.md). Then verify the outcome with a tool (`onb_verify_resource_handler`, `onb_status`, `fetch_environment_details`). +3. On failure, rule 2. Stop after three attempts at one step, record the item `pending` with what is known, and continue with steps that do not depend on it. +4. Record the phase's items with `onb_set_item_status`. +5. Close the phase with a short report: what is now configured, what was recorded (done, not applicable), what is pending, and the first step of the next phase. + +| Phase | Covers | Reference | +|---|---|---| +| 0 Bootstrap | MCP connection, admin check, toolkit install, prerequisites P1 to P12 | bootstrap.md | +| 1 Handlers | Up to two resource handlers, verified | resource-handlers.md | +| 2 Environments | One or two environments per handler, image, network, trimmed order form, hostname template | phases.md | +| 3 First order | Custom Server ordered through MCP in each environment, lifecycle actions | phases.md | +| 4 Self-service | Parameters, generated options, tags, cross-cloud visibility | phases.md | +| 5 RBAC and governance | Groups, roles, users, entitlements, approvals, quota | phases.md | +| 6 Authentication | LDAP, LDAP mapping, SSO, branded portal | phases.md | +| 7 Lifecycle | Power schedule, expiration, decommission, onboarding discovered servers | phases.md | +| 8 Extensibility | Content Library items, scripts, webhook, recurring job, rule, CIT | phases.md | +| 9 Wrap-up | Scorecard from recorded items and live evidence | phases.md | + +## Wrap-up report + +List every test-plan item with its weight and status (done, not applicable with reason, pending), group totals, and the prerequisites. Then the follow-ups the customer asked about that were out of scope. The score column is the customer's judgement; the agent supplies the evidence (order ids, job ids, object names) next to each item. diff --git a/.claude/skills/cb-poc-onboarding/references/bootstrap.md b/.claude/skills/cb-poc-onboarding/references/bootstrap.md new file mode 100644 index 00000000..a86c3a90 --- /dev/null +++ b/.claude/skills/cb-poc-onboarding/references/bootstrap.md @@ -0,0 +1,67 @@ +# Phase 0: Bootstrap + +Goal: the agent is connected to the appliance as a CloudBolt admin with write scope, the POC Onboarding Toolkit is installed and synchronous, and the prerequisites sheet is reviewed. + +## 1. Connection + +1. Call `fetch_identity`. It must return a user with `superAdmin` or `cmpAdmin` true. If it fails, the client is not connected or not authenticated: the appliance's MCP endpoint is `https:///mcp` (no trailing slash), Streamable HTTP, OAuth 2.1 with browser login. In Claude Code: `claude mcp add --transport http cloudbolt https:///mcp`, then `/mcp`, choose the server, authenticate as the admin. Other clients: add the same URL as a remote MCP server and complete the OAuth login. +2. The token must carry `write` scope. If every write or custom tool fails with a scope error, the client requested `read` only; reconnect and grant write when the consent page asks. +3. The API token on the user profile page and the `/api/v3/cmp/apiToken/` token do not work for `/mcp`; only the OAuth login does. +4. `fetch_dashboard_link` gives the portal base URL; confirm with the user that it is the appliance they mean. + +## 2. Toolkit install (one-time manual step, then agent-driven) + +Call `fetch_mcp_tool_actions`. If `onb_status` is missing, the toolkit is not installed. The sync tool cannot install itself, so the user does one of these in the UI, once: + +**A. Content Package Manager** (when the extension is installed): Admin > Content Packages > Import from repository > repository `https://github.com/mbomb67/cloudbolt-as-code.git`, branch `main`, package **POC Onboarding Toolkit** (`PKG-8aaadefz`) > Sync. One step; every tool and its plugin arrives together. + +**B. Source Control Repository**: Admin > All Admin > CloudBolt > Source Code Repositories > Add: label of their choice, URL `https://github.com/mbomb67/cloudbolt-as-code.git`, auth method none (public repository), leave the path fields at their defaults. Then Actions > MCP Tool Actions > Create from Repository, branch `main`, and pick each metadata file under `mcp_tool_actions/`: + +| Tool | Folder | +|---|---| +| `onb_install` | `mcp_tool_actions/MTA-6zxrhdls` | +| `onb_status` | `mcp_tool_actions/MTA-1985b88g` | +| `onb_ui_link` | `mcp_tool_actions/MTA-zpohocjt` | +| `onb_recent_errors` | `mcp_tool_actions/MTA-hwg74btd` | +| `onb_failure_trace` | `mcp_tool_actions/MTA-jzscq0mk` | +| `onb_verify_resource_handler` | `mcp_tool_actions/MTA-r5v1eblg` | +| `onb_playbook` | `mcp_tool_actions/MTA-92b836jb` | +| `onb_set_item_status` | `mcp_tool_actions/MTA-p72v9y76` | +| `sync_from_source_control_repo` | `mcp_tool_actions/MTA-543b19sa` | +| `fetch_job_log` | `mcp_tool_actions/MTA-8j9c0tb0` | +| `manage_blueprint_permissions` | `mcp_tool_actions/MTA-ntmcnvv7` | + +The dialog takes one item at a time; the one-call REST alternative is in [docs/poc-onboarding-setup.md](../../../../docs/poc-onboarding-setup.md). + +**C. No internet from the appliance**: build one zip per tool with `python tools/package_zip.py mcp_tool_actions/MTA-...` from a clone and upload each at Actions > MCP Tool Actions > Import. + +After the import, the tools exist but every one is asynchronous (the importer leaves Synchronous Action off). Run `onb_install` (it is asynchronous itself, so it works now): `run_mcp_tool_action("onb_install", {})`, poll the job id with `fetch_job`, read `outputs.changed`, `outputs.missing`, `outputs.egress`. Then tell the user to reconnect the MCP client (tool lists are cached per session) and call `fetch_mcp_tool_actions` again: all eleven names must be present. Check: `run_mcp_tool_action("onb_status", {})` answers inline. + +Later toolkit updates: `sync_from_source_control_repo` with `sync_branch: main` and the folders above as `sync_paths`, then `onb_install`, then reconnect. + +## 3. First status + +Call `onb_status`. Read it to the user as a short inventory: licence and days left, SMTP and proxy, Content Library reachable or not, handlers and environments, Custom Server blueprint, groups and users, LDAP or SSO, and the toolkit. Then the `nextSteps`. + +## 4. Prerequisites review + +Walk the prerequisites with the user and record each with `onb_set_item_status` (`done`, or `not_applicable` with a reason): + +| Id | Prerequisite | Evidence or skip | +|---|---|---| +| P1 | CMP license key installed | `onb_status.license.installed` and `daysLeft` | +| P2 | Appliance deployed and initial configuration done | `fetch_identity` works; `setupWizard.hasResourceHandler` is not required yet | +| P3 | Up to two resource handlers, one or two environments each | Phases 1 and 2 | +| P4 | Custom Server deployed once in each environment | Phase 3 | +| P5 | Outbound 443 to content.cloudbolt.app | `onb_status.contentLibrary.reachable`; if false, `onb_install.egress` and the proxy link; skip only if the customer accepts no Content Library items (Phase 8 shrinks) | +| P6 | Web proxy configured if required | `preferences.proxy.configured`; not applicable when no proxy is needed | +| P7 | SMTP configured | `preferences.smtp.configured`; link `email_settings` (password entered there), test with link `email_test`; not applicable when the POC has no relay, which also makes 2.4.1 email notification and 4.2.3, 4.2.6 partial | +| P8 | DNS A record for the portal | Needed for 2.2.1 only; not applicable otherwise | +| P9 | SSO application and an SSO SME on the call | Needed for 2.1.3 only | +| P10 | AD or LDAP service account and the DN of a mapping group | Needed for 2.1.1 and 2.1.2 | +| P11 | Ansible or Ansible Automation Platform ready | Needed for 3.2.2 and 4.3.5 (both weight 0) | +| P12 | Terraform scripts in a git repository | Needed for 4.3.4 (weight 0) | + +Also confirm the two clouds for the POC (the Prerequisites sheet names POC Cloud 1 and 2) and that the user has the minimum-permission credentials for each ready, without asking what they are. + +Then start Phase 1 ([resource-handlers.md](resource-handlers.md)). diff --git a/.claude/skills/cb-poc-onboarding/references/phases.md b/.claude/skills/cb-poc-onboarding/references/phases.md new file mode 100644 index 00000000..a2bec10d --- /dev/null +++ b/.claude/skills/cb-poc-onboarding/references/phases.md @@ -0,0 +1,86 @@ +# Phases 2 to 9 + +Each phase: `onb_status` first, do the steps, record the items with `onb_set_item_status`, close with a short report. Where a step says "UI", give the user the `onb_ui_link` link and the documentation link, then verify with a tool. Steps marked **toolkit later** will become tools in later toolkit versions; until then they are UI steps. + +## Phase 2: Environments (P3, 1.1.4, 1.2.1) + +One or two environments per handler, each able to build the Custom Server with the fewest questions on the order form. + +1. **Import environments** (UI, toolkit later). Link `handler_import_locations:RH-...`. What an environment maps to: AWS a region plus one VPC (its subnets are imported with it); Azure a location inside the subscription (import subscriptions first on the handler page when the handler was created at tenant level); vCenter a cluster; SCVMM a host cluster; GCP a project; Nutanix a cluster; OpenStack a location. Pick one, two at most, per handler. Verify with `onb_status`: each handler lists its environments. +2. **Network** (UI). AWS and Azure: the environment's Networks tab, Sync subnets, then pick one subnet for NIC 1. vCenter: on the handler, sync networks, then on the environment add one network to NIC 1. Verify: `onb_status` env `networks` is at least 1. +3. **Image and OS build** (UI, toolkit later). On the handler's images (templates, AMIs) page, import one Linux and, if the POC uses Windows, one Windows image into an OS build, in the environment's region or location, and attach the OS build to the environment. For 1.2.1, use the same OS build name on both handlers (one "Windows 2022" or "Ubuntu 22.04" build with one image per handler) so one blueprint deploys to both clouds. Verify: env `osBuilds` is at least 1. +4. **Trim the order form** (UI, toolkit later). Environment > Parameters tab and the technology tab. A required parameter with exactly one option disappears from the order form; an optional one must be removed instead. Aim for the minimal form: + + | Technology | Show the user | Pin to one value | Remove | + |---|---|---|---| + | AWS | `instance_type` (2 or 3 sizes), the subnet only if more than one is wanted | `key_name`, `sec_groups`, `delete_ebs_volumes_on_termination`, `ebs_volume_type` | `aws_availability_zone`, `aws_elastic_ip`, `iops`, `aws_host`, `aws_host_group` | + | Azure | `node_size` (constrain to 2 or 3), `password_arm` for Windows | `resource_group_arm` (one POC group), `storage_account_type_arm`, `create_public_ip`, `availability_set_arm` or `availability_zone_arm` (none) | `spot_instance_arm`, eviction fields, `max_price_arm`, `platform_fault_domain_count`, `custom_storage_account_arm`, `storage_account_arm`, `encryption_at_host`, `security_type_arm`, `security_encryption_type_arm`, `os_disk_size_arm`, `resource_group_arm_template`, `enable_accelerated_networking` | + | vCenter | `cpu_cnt`, `mem_size` (short option lists) | `vmware_datastore`, `vmware_disk_type` | `vmware_resourcepool`, `nsx_scope`, `nsx_edge` | + + Keep every special field (`aws_region`, `vpc_id`, `node_location`, `vmware_cluster`) and the size field; provisioning fails without them. Azure Windows needs `password_arm` on the form. +5. **Hostname template** (UI) for 1.1.4: on the environment's Parameters tab add `hostname_template`, for example `poc-{{ group.name|slice:":3" }}-{{ os_build.os_family.name|slice:":3" }}-#` without the spaces the Markdown shows; the order form previews it. Documentation: [hostname specification](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/hostname-specification). +6. Record P3 `done` when every handler has a verified connection and at least one environment with an image and a network. + +## Phase 3: First order (P4, 1.1.1, 1.1.3, 1.2.3, 3.2.3) + +Fully through MCP. For each environment: + +1. `fetch_catalog_items` with `name: "Custom Server"`. If the blueprint is missing or not orderable, `onb_status.customServerBlueprint` has the restore link. +2. `fetch_orderable_groups` with the blueprint id. One group: use it. Several: ask. None: the user's group has no deploy permission; `manage_blueprint_permissions` with `grant_action: list` shows who has, and the user decides who should. +3. `fetch_blueprint_schema`. For the server item, `fetch_orderable_environments`, then `fetch_blueprint_item_parameters` for the chosen environment, then `fetch_blueprint_parameter_options` for each parameter with dynamic options. Choose the smallest size. +4. Echo the whole order verbatim (group, resource name, item slug, environment, OS build, every parameter) and wait for yes. +5. `order_catalog_item`. Poll `fetch_order`; if `PENDING`, the group requires approval: `approve_order` (or that is test 2.4.1). Then `fetch_job` on the provision job. +6. On `FAILURE`: `onb_failure_trace` with the order id, then [troubleshooting.md](troubleshooting.md). +7. Record P4 and 1.1.1 `done` with the order id. For 1.1.3, add a post-provision action first (Phase 8 brings the Hello World scripts; a Content Library action works too) and order once more. +8. `fetch_server_list` with `group_name` shows both clouds' servers in one list (1.2.3). `fetch_server_actions` on one server, then `run_server_action` for power off, on and reboot, polling each job (3.2.3; `set_server_power_schedule` is Phase 7). Documentation: [lifecycle actions](https://academy.university.cloudbolt.io/guides/019403d1-422e-7471-826c-4a6c12820e2a/tasks/0193e483-6d74-7c94-a8c4-464683bd3b51). + +## Phase 4: Self-service (1.1.2, 1.2.2, 2.5.1, 4.3.1) + +1. **A user-defined parameter** (UI, toolkit later): `onb_ui_link new_parameter`, create for example `application_tier` (single select: web, app, db), add it to the environment or the blueprint with those options, order again and check the value on the server (1.1.2). [Parameters](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/parameters). +2. **Generated options** (4.3.1): Phase 8 syncs a sample generated-options action from this repository; or write a three-line `generate_options_for_` orchestration action in the UI. [Generated options](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/options-generated-using-orchestration-actions). +3. **Tags** (1.2.2, 2.5.1): on each handler's Tags tab map `Group`, `Owner`, `OS Family` and a `cost_center` parameter to cloud tags; add `cost_center` to the group with a value; order; check the tags in both clouds. [Tags](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/tags). + +## Phase 5: RBAC and governance (2.3.1 to 2.3.4, 2.4.1, 2.4.2, 2.5.2) + +1. **Groups and users** (UI, toolkit later): `onb_ui_link groups` to add a POC group (and a child group); `new_user` for two local test users, a requestor and an approver, with roles on the group; the passwords are set on each user's `user_edit:USR-...` page by the admin, never in chat. `fetch_groups` and `fetch_group_details` confirm memberships. [Groups and permissions](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/groups-permissions). +2. **Visibility** (2.3.1): the requestor logs in and sees only their own servers; change the role to Resource Admin and they see the group's. The user does the logins; the agent confirms the memberships. +3. **Blueprint entitlement** (2.3.2): `manage_blueprint_permissions` to grant one group DEPLOY on a blueprint and `fetch_orderable_groups` to prove the other group cannot order it. [Blueprint group permissions](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/group-permissions-for-blueprints). +4. **Environment entitlement** (2.3.3): assign one environment to one group (UI, environment page); `fetch_orderable_environments` as each user proves it. [Ordering servers and environments](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ordering-servers-environments). +5. **Custom role** (2.3.4): `onb_ui_link roles`, create a role with a few permissions, assign it; the user logs in to check. [Custom roles](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/groups-permissions/a/h2__322854237). +6. **Approvals** (2.4.1, 2.4.2): the requestor orders (through the UI or `order_catalog_item` as that user); `fetch_orders_pending_my_approval` and `approve_order` as the approver. For the day-2 case, the Resize VM server action needs "Requires approval" ticked (UI, `server_actions`; toolkit later); `run_server_action` returns an order instead of a job. +7. **Quota** (2.5.2): `onb_ui_link group_quotas:GRP-...`, set 3 servers; the fourth order is refused. [Quotas](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/groups-permissions/a/h2_878037613). + +## Phase 6: Authentication (2.1.1, 2.1.2, 2.1.3, 2.2.1) + +1. **LDAP utility** (UI; the service-account password is entered there): `onb_ui_link new_ldap`; pre-brief server, port (389 or 636), protocol, base DN, bind account DN. After save, `ldap_verify:`; on failure `onb_recent_errors` with `onb_log: authentication`. The user logs in with an AD account (2.1.1). [LDAP authentication](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ldap-authentication). +2. **LDAP mapping** (UI, toolkit later): `ldap_mappings:`, map the AD group DN from P10 to the POC group with a role; an AD member logs in and lands in the group (2.1.2). [User permission synchronization](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/user-permission-and-attribute-synchronization/a/h2_1939259882). +3. **SSO** (2.1.3): UI only with the customer's SSO SME: `onb_ui_link sso`, metadata exchange, assign users, log in. Skip and record not applicable when P9 is not met. [SSO and SAML](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/single-sign-on-and-saml). +4. **Branded portal** (2.2.1): needs the DNS record from P8; `onb_ui_link portals`; logos and colours are a UI job. [Branded portals](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/branded-portals). + +## Phase 7: Lifecycle (3.1.1 to 3.1.4, 3.2.1) + +1. **Power schedule** (3.1.1): add the `power_schedule` parameter to an environment (UI, Parameters tab), order a server choosing a schedule, or set one directly with `set_server_power_schedule` and read it back with `fetch_server_power_schedule`. [Power scheduling](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/power-scheduling-servers/a/h2_1163015685). +2. **Expiration** (3.1.2): add `expiration_date` to the environment with a constraint (for example at most 30 days out), order with a date, and confirm the Expire Servers recurring job is enabled (`onb_ui_link recurring_jobs`). [Server expiration](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/server-expiration). +3. **Self-service decommission** (3.1.3): the owner deletes the server from the portal, or the agent runs the Delete action with `run_server_action` and polls the job. +4. **Onboard existing servers** (3.1.4): the handler's Servers tab shows discovered servers in Unassigned; `fetch_server_list` with `group_name: Unassigned`, then `run_server_action` with the Change Attributes action to set group and owner; a group member then sees them in `fetch_server_list`. +5. **Resize** (3.2.1): the Resize VM server action (Content Library if absent, Phase 8); `run_server_action`, poll, and confirm the size in the cloud console. + +## Phase 8: Extensibility (1.1.3, 4.1.2, 4.2.1 to 4.2.6, 4.3.1 to 4.3.3) + +All Content Library installs need P5. Installs are UI steps (`onb_ui_link content_library`; toolkit later). + +1. **Jupyter Notebooks UI extension** (4.2.1): Content Library > UI Extensions > install, then follow its documentation cell; Admin > Admin Extensions shows it. [Forge Jupyter XUI](https://cloudboltsoftware.github.io/cloudbolt-forge/sites/NewJupyterXUI/jupyter.html), [UI extensions](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ui-extensions). +2. **Recurring job** (4.2.2): install "Cleanup zip files from tmp", create a zip under /var/tmp on the appliance, set the cron schedule, run it (the testing toolkit's `run_recurring_job` if installed). [Recurring jobs](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/recurring-jobs). +3. **Rules** (4.2.3): `onb_ui_link rules`, enable "Email Group Admins when quota usage over threshold", set a group quota below its server count, execute rules, check the email (needs P7). [Rules](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/rules). +4. **CIT** (4.2.4): `onb_ui_link cit_tests`, build a test from the successful Custom Server order, run it. [Continuous infrastructure testing](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/continuous-infrastructure-testing). +5. **Inbound webhook** (4.2.5): sync a sample echo webhook from this repository (`sync_from_source_control_repo` with the `webhooks/IWH-...` path) or create the documented sample; the user posts JSON with curl or Postman and gets it back. [Inbound webhooks](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/inbound-webhooks/). +6. **Email template** (4.2.6): `onb_ui_link email_templates`, edit Order Complete, order, read the email (needs P7). [Email templates](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/customizing-email-templates). +7. **Scripts** (1.1.3, 4.3.2, 4.3.3, 4.1.2): a Hello World Remote Script (PowerShell for Windows, Bash for Linux) as a build item on a copy of the Custom Server blueprint, ordered again; the Ad-Hoc Script server action from the Content Library for 4.1.2. Guest credentials live on the OS build or server (UI). [Remote scripts](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/remote-scripts). +8. **Generated options** (4.3.1): see Phase 4. +9. Terraform (4.3.4) and Ansible (3.2.2, 4.3.5) carry weight 0: do them only if P11 or P12 are met and time allows; otherwise record not applicable. + +## Phase 9: Wrap-up + +1. `onb_status` for live evidence (orders, handlers, environments, groups, LDAP). +2. For every item in [test-plan-map.md](test-plan-map.md), pair the recorded status (`onb_status.pocItems`) with the evidence. Items with no record and no evidence are `pending`. +3. Report the table by category with weights, the prerequisites, the pending items with their blocker and owner, and the follow-ups raised during the week. The customer fills the workbook's score column from it. diff --git a/.claude/skills/cb-poc-onboarding/references/resource-handlers.md b/.claude/skills/cb-poc-onboarding/references/resource-handlers.md new file mode 100644 index 00000000..65c183c9 --- /dev/null +++ b/.claude/skills/cb-poc-onboarding/references/resource-handlers.md @@ -0,0 +1,49 @@ +# Phase 1: Resource handlers + +Goal: up to two resource handlers (the POC clouds), each verified. Covers prerequisite P3 (first half). The user creates each handler in the UI because the form takes the credentials; the agent prepares, links, verifies and diagnoses. + +## Per handler + +1. **Pre-brief.** From the table below, tell the user the non-secret values to have ready, the minimum-permissions document to apply to the credential first, and the ports the appliance needs open. Do not ask for the secret values. +2. **Link.** `onb_ui_link` with `new_resource_handler:` and send the URL. The user fills the form, including the credential, and saves. The form runs Verify Connection itself and, on failure, shows only "Unable to connect to handler with the information provided." +3. **Verify.** Ask whether the save succeeded. + - Saved: `onb_status` to find the new `RH-` id, then `onb_verify_resource_handler` with `onb_handler` set to it; poll `fetch_job`. `verified: true` means done; record nothing yet (P3 completes with the environments). `verified: false`: read `error` and `hints`, explain the cause, send `links.edit` for the fix, and verify again after the user saves. + - Not saved (the form rejected it): `onb_recent_errors` with `onb_contains: "Failed to validate connection"` and `onb_minutes: 10`. The group's `traceback` and `hints` hold the cloud API's error. Explain it, then send the same `new_resource_handler:` link again. +4. **Repeat** for the second cloud. Stop at two handlers; the test plan needs no more. + +## Technologies + +| Technology | Page key | Non-secret values to prepare | Secret entered in the UI | Minimum permissions | Ports from the appliance | +|---|---|---|---|---|---| +| AWS | `new_resource_handler:aws` | Handler name; access key id; optionally an IAM role ARN to assume; the regions to use | Secret access key | [AWS minimum permissions](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/aws/a/h2__2010883827) (EC2 describe, run, terminate, tags, VPC and subnet describe, key pairs; S3 and IAM pass-role only if used) | 443 to the regional EC2, STS and SSM endpoints | +| Azure | `new_resource_handler:azure_arm` | Handler name; tenant id; application (client) id; subscription id or the choice to import subscriptions after; locations to use | Client secret value (not the secret id) | [Azure minimum permissions](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/azure-resource-manager/a/h3_736726059) (Reader on the subscription plus Virtual Machine Contributor and Network Contributor on the POC resource group, or Contributor on the subscription for a POC) | 443 to login.microsoftonline.com and management.azure.com | +| vCenter | `new_resource_handler:vmware` | Handler name; vCenter FQDN; port 443; username in user@domain form; whether to verify the vCenter certificate (off for a self-signed POC, or add the CA under Admin > SSL Certificates) | Password | [vCenter minimum permissions](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/minimum-required-permissions-in-vcenter-vmware) on the datacenter, cluster, datastore, network and folder used | 443 to vCenter and to every ESX host (console and ISO uploads) | +| SCVMM | `new_resource_handler:scvmm` | Server FQDN, WinRM port (5985 or 5986), domain and username | Password | SCVMM administrator role | 5985 or 5986 to the SCVMM server | +| GCP | `new_resource_handler:gcp` | Handler name, project | Service-account JSON key file (uploaded) | Compute Admin and Service Account User on the project | 443 to googleapis.com | +| Nutanix | `new_resource_handler:acropolis` | Prism Element or Central address, port 9440, username | Password | Cluster admin | 9440 to Prism | +| OpenStack | `new_resource_handler:openstack` | Auth URL ending in /v3, domain, project, username | Password | Member role on the project | 5000 and the service endpoints | + +The POC test plan documents AWS, Azure and vCenter; the other rows are enough to get a handler created and verified, and the environment guidance in [phases.md](phases.md) is generic for them. + +## Reading verification errors + +`onb_verify_resource_handler.hints` and `onb_recent_errors.groups[].hints` already map the frequent errors to a fix. The pattern to explain to the user: + +| Error says | It means | Fix | +|---|---|---| +| `InvalidClientTokenId`, `SignatureDoesNotMatch`, `AuthFailure` (AWS) | The key id or secret is wrong, often a trailing space | Re-enter both on the edit link | +| `UnauthorizedOperation`, `AccessDenied` (AWS) | A permission is missing | Apply the minimum permissions policy to the IAM identity | +| `AADSTS7000215` (Azure) | The client secret is invalid or expired | New secret on the app registration; paste the value, not the id | +| `AADSTS700016`, `AADSTS90002` (Azure) | Application or tenant id is wrong | Check both ids on the app registration overview | +| `AuthorizationFailed`, `SubscriptionNotFound` (Azure) | No role on the subscription, or wrong subscription id | Assign Reader plus the roles in the permissions document | +| `Cannot complete login due to an incorrect user name or password` (vCenter) | Credentials | user@domain form; re-enter the password | +| `Permission to perform this operation was denied` (vCenter) | vCenter role lacks a privilege | Compare with the vCenter permissions document | +| `CERTIFICATE_VERIFY_FAILED`, `SSLError` | TLS inspection or a self-signed certificate | Add the CA under Admin > SSL Certificates (`onb_ui_link ssl_certificates`) or disable verification on the handler for the POC | +| `Name or service not known` | DNS on the appliance | Fix the appliance's resolver or use the IP | +| `Connection refused`, `timed out`, `EndpointConnectionError` | Firewall or proxy | Open 443 outbound to the endpoint, or set the web proxy (`onb_ui_link proxy`) | + +Hand the user the fix and the edit link, then verify again. After three failed rounds on one handler, record P3 as `pending` with the last error and continue with the other cloud. + +## Hand-off to Phase 2 + +Both handlers verified (or one, if the POC has one cloud): `onb_status` shows each with `lastVerify.ok: true`. Continue with the environments in [phases.md](phases.md). diff --git a/.claude/skills/cb-poc-onboarding/references/test-plan-map.md b/.claude/skills/cb-poc-onboarding/references/test-plan-map.md new file mode 100644 index 00000000..00becdf2 --- /dev/null +++ b/.claude/skills/cb-poc-onboarding/references/test-plan-map.md @@ -0,0 +1,66 @@ +# POC test plan map + +Every item of the CloudBolt CMP POC Test Plan with its weight (the workbook multiplies a 0 to 5 score by it), the phase that covers it, how the agent does or verifies it, the evidence to record, the documentation link, and whether the customer may record it as not applicable. Prerequisites are in [bootstrap.md](bootstrap.md). + +Status values for `onb_set_item_status`: `done`, `pending`, `skipped`, `not_applicable` (reason required for the last two). + +## Self-service (weights total 35) + +| Id | Item | Weight | Phase | How | Evidence | Docs | Skippable | +|---|---|---|---|---|---|---|---| +| 1.1.1 | Provision a blueprint from the catalog as a non-admin | 5 | 3, 5 | MCP order flow; the requestor user orders too | Order id, server | [Blueprints](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/blueprints) | No | +| 1.1.2 | User-defined parameter at order time | 5 | 4 | Parameter on env or blueprint (UI), order through MCP | Parameter name, order id, value on server | [Parameters](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/parameters) | No | +| 1.1.3 | Post-provisioning automation from the blueprint | 5 | 8 | Hello World build item, order again | Order id, job output | — | No | +| 1.1.4 | Hostname template with preview | 5 | 2 | `hostname_template` on the environment (UI) | Hostname of the built server | [Hostname specification](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/hostname-specification) | No | +| 1.2.1 | One blueprint deploys to two clouds | 5 | 2, 3 | Shared OS build with one image per handler; two orders | Two order ids, two servers | — | Yes, single-cloud POC | +| 1.2.2 | Cross-cloud tagging consistency | 5 | 4 | Tag mappings on both handlers (UI); order; check tags | Tags on both servers | [Tags](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/tags) | Yes, single-cloud POC | +| 1.2.3 | Unified visibility across clouds | 5 | 3 | `fetch_server_list` by group | The list | — | Yes, single-cloud POC | + +## RBAC and governance (weights total 39) + +| Id | Item | Weight | Phase | How | Evidence | Docs | Skippable | +|---|---|---|---|---|---|---|---| +| 2.1.1 | LDAP or AD authentication | 3 | 6 | LDAP utility (UI, password there), verify, AD login | Login in authentication log | [LDAP](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ldap-authentication) | Yes, when P10 unmet | +| 2.1.2 | Group and role from AD group membership | 3 | 6 | LDAP mapping (UI) | AD user's group and role | [User permission sync](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/user-permission-and-attribute-synchronization/a/h2_1939259882) | Yes, when P10 unmet | +| 2.1.3 | SAML2 SSO | 2 | 6 | UI with the SSO SME | SSO login | [SSO](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/single-sign-on-and-saml) | Yes, when P9 unmet | +| 2.2.1 | Branded portal per tenant | 3 | 6 | Portal (UI) on the DNS record | Portal URL loads branded | [Branded portals](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/branded-portals) | Yes, when P8 unmet | +| 2.3.1 | Visibility constrained by group role | 4 | 5 | Requestor vs Resource Admin logins | What each user sees | [Groups and permissions](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/groups-permissions) | No | +| 2.3.2 | Blueprint entitlement by group | 4 | 5 | `manage_blueprint_permissions`, `fetch_orderable_groups` | Which group can order | [Blueprint permissions](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/group-permissions-for-blueprints) | No | +| 2.3.3 | Environment entitlement by group | 4 | 5 | Environment group (UI), `fetch_orderable_environments` | Which group sees it | [Ordering environments](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ordering-servers-environments) | No | +| 2.3.4 | Custom role | 3 | 5 | Role (UI), assignment, login | Permissions seen | [Custom roles](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/groups-permissions/a/h2__322854237) | No | +| 2.4.1 | Order approval | 3 | 5 | Requestor orders, `approve_order` as approver | Order id, approval | — | No | +| 2.4.2 | Approval on a day-2 action | 3 | 5 | Resize VM requires approval (UI), `run_server_action` returns an order | Order id | — | No | +| 2.5.1 | Tagging policy from a parameter | 5 | 4 | `cost_center` parameter on the group, tag mapping | Tag in the cloud | [Tags](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/tags) | No | +| 2.5.2 | Group quota | 2 | 5 | Quota 3 servers (UI), fourth order refused | Refused order | [Quotas](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/groups-permissions/a/h2_878037613) | No | + +## Resource management (weights total 26) + +| Id | Item | Weight | Phase | How | Evidence | Docs | Skippable | +|---|---|---|---|---|---|---|---| +| 3.1.1 | Power schedules | 5 | 7 | `power_schedule` parameter, `set_server_power_schedule` | Schedule read back, power events | [Power scheduling](https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/power-scheduling-servers/a/h2_1163015685) | No | +| 3.1.2 | Leases (expiration) | 5 | 7 | `expiration_date` with constraint, Expire Servers job | Expiration on server, job enabled | [Server expiration](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/server-expiration) | No | +| 3.1.3 | Self-service decommission | 4 | 7 | Owner deletes, or `run_server_action` Delete | Job id, server gone | — | No | +| 3.1.4 | Onboard existing cloud resources | 5 | 7 | Change Attributes on Unassigned servers | Servers in the group | — | Yes, when no existing VMs | +| 3.2.1 | Resize | 4 | 7 | Resize VM action | Job id, new size | — | No | +| 3.2.2 | Configuration update through Ansible | 0 | 8 | Ansible day-2 action | Job output | [Ansible](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ansible) | Yes, weight 0 | +| 3.2.3 | Lifecycle actions | 3 | 3 | `run_server_action` stop, start, reboot | Job ids | [Lifecycle actions](https://academy.university.cloudbolt.io/guides/019403d1-422e-7471-826c-4a6c12820e2a/tasks/0193e483-6d74-7c94-a8c4-464683bd3b51) | No | + +## Extensibility (weights total 42) + +| Id | Item | Weight | Phase | How | Evidence | Docs | Skippable | +|---|---|---|---|---|---|---|---| +| 4.1.1 | No in-guest agents | 5 | — | Architecture statement; the workbook pre-scores it | — | — | No | +| 4.1.2 | Agentless in-guest script | 5 | 8 | Ad-Hoc Script server action | Script output | — | No | +| 4.2.1 | UI extension from the Content Library | 5 | 8 | Jupyter XUI install (UI) | Extension launches | [UI extensions](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ui-extensions) | Yes, when P5 unmet | +| 4.2.2 | Recurring job on a schedule | 4 | 8 | Cleanup tmp job, cron, run | Job id, file gone | [Recurring jobs](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/recurring-jobs) | Yes, when P5 unmet | +| 4.2.3 | Rule-based automation | 3 | 8 | Quota rule enabled, executed | Email received | [Rules](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/rules) | Partial without P7 | +| 4.2.4 | Continuous infrastructure testing | 3 | 8 | CIT from a successful order | Test run | [CIT](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/continuous-infrastructure-testing) | No | +| 4.2.5 | Inbound webhook | 4 | 8 | Echo webhook, curl POST | Response JSON | [Inbound webhooks](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/inbound-webhooks/) | No | +| 4.2.6 | Customizable notification templates | 0 | 8 | Edit Order Complete template | Email body | [Email templates](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/customizing-email-templates) | Yes, without P7 | +| 4.3.1 | Python generated options | 5 | 4 | Generated-options action on a parameter | Dropdown contents | [Generated options](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/options-generated-using-orchestration-actions) | No | +| 4.3.2 | PowerShell build item | 4 | 8 | Hello World on a Windows blueprint | Job output | [Remote scripts](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/remote-scripts) | Yes, when no Windows image | +| 4.3.3 | Bash build item | 4 | 8 | Hello World on a Linux blueprint | Job output | [Remote scripts](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/remote-scripts) | Yes, when no Linux image | +| 4.3.4 | Terraform-backed blueprint | 0 | 8 | Terraform blueprint | Plan and apply logs | [Terraform](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/terraform-integration-through-cmp-blueprints) | Yes, weight 0 | +| 4.3.5 | Ansible Automation Platform | 0 | 8 | AAP configuration manager | Job template run | [AAP](https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/ansible-automation-platform) | Yes, weight 0 | + +Possible points per category are five times the weight total: 175, 195, 130, 210, for 710 in all. diff --git a/.claude/skills/cb-poc-onboarding/references/troubleshooting.md b/.claude/skills/cb-poc-onboarding/references/troubleshooting.md new file mode 100644 index 00000000..c82ab40b --- /dev/null +++ b/.claude/skills/cb-poc-onboarding/references/troubleshooting.md @@ -0,0 +1,33 @@ +# Troubleshooting: root cause before retry + +Order of investigation for any failure: + +1. The tool's own `error_message` and `outputs.error`. +2. An order or job: `onb_failure_trace` with the `ORD-` or `JOB-` id. Read `failedJobs[].errors`, `progressTail`, `hints`, then `fetch_job_log` with `log_job_id` set to the job it names and `log_file_tail: 200` for the traceback. +3. Anything that failed in the UI or with no job: `onb_recent_errors` with `onb_minutes: 10` (add `onb_contains` for a handler name, hostname or error text; `onb_log: jobengine` for provisioning, `authentication` for logins, `mcp` for tool calls). +4. The table below. +5. Explain the cause and the fix in two sentences, give the link, and only then let the user retry. + +| Symptom | First tool | Usual cause | Fix | +|---|---|---|---| +| Handler form: "Unable to connect to handler with the information provided" | `onb_recent_errors` with `onb_contains: Failed to validate connection` | Credentials, permissions, TLS, DNS, firewall or proxy; the traceback names which | See the error table in [resource-handlers.md](resource-handlers.md) | +| `onb_verify_resource_handler` returns `verified: false` | its `hints` | Same causes, for a handler that was saved | Edit link, verify again | +| Handler verified but no regions, locations or clusters offered | the import-locations page | Credentials can authenticate but not list (describe) resources; an Azure subscription not yet imported as a child handler | Apply the permissions document; import subscriptions first on Azure | +| Order form offers no OS build or no network for an environment | `fetch_environment_details`, `onb_status` env counts | The OS build's image is in another region or location; no subnet or network attached | Import an image for that region and attach the OS build; sync subnets or attach a network (sc_nic_0) | +| Order refused before submission with a missing deployment item | the schema | The order payload left out an item | Include every item from `fetch_blueprint_schema`, with `"parameters": {}` when it has none | +| Order `DENIED` or no orderable group or environment | `fetch_orderable_groups`, `fetch_orderable_environments` | Entitlement: the group cannot deploy the blueprint or use the environment | Fix the entitlement on the blueprint or environment, or `manage_blueprint_permissions` | +| Order `PENDING` for long | `fetch_order` | Awaiting approval | `approve_order` as an approver, or that is the test (2.4.1) | +| Provision job fails: `is required for Azure windows servers` | `onb_failure_trace` hints | Windows on Azure needs `password_arm` | Add the parameter to the environment or order form | +| `vmware_datastore parameter must be specified`, `Memory and CPU are required` | `onb_failure_trace` hints | vCenter environment missing pinned parameters | Set datastore, cpu_cnt, mem_size options on the environment | +| `InvalidKeyPair`, `key_name` | `onb_failure_trace` hints | AWS key pair named on the environment does not exist in the region | Pin an existing key pair | +| `InsufficientInstanceCapacity`, `QuotaExceeded` | `onb_failure_trace` hints | Cloud account quota or capacity | Smaller size or another region or zone | +| Guest script step fails (`WinRM`, `SSH`, refused, timed out) | `fetch_job_log` | Credentials on the OS build or server; port 22 or 5985/5986 blocked from the appliance | Fix credentials on the OS build; open the port | +| LDAP user cannot log in | `onb_recent_errors` with `onb_log: authentication` | Bind DN or password, base DN, port 389 vs 636, group DN typo in the mapping | Verify the utility (`onb_ui_link ldap_verify:`), fix the mapping | +| Content Library item install fails, library page empty | `onb_status.contentLibrary`, `onb_recent_errors` with `onb_contains: content.cloudbolt.app` | No egress to content.cloudbolt.app, proxy not set, SSL inspection | Set the proxy (`onb_ui_link proxy`), add the inspecting CA (`ssl_certificates`) | +| A `custom_onb_*` tool is missing from the client | `fetch_mcp_tool_actions` | Client cached the tool list; tool not synced; tool disabled; caller not admin; token without write scope | Reconnect the client; sync and `onb_install`; check the admin flag and scope | +| A toolkit tool answers `{"success": true, "ids": [...]}` | `fetch_job` on the id | Synchronous Action still off on that tool | Run `onb_install`, reconnect; meanwhile poll the job | +| `Parameters not allowed [name]` from `run_mcp_tool_action` | the tool's edit form | A stored default hides the input (every BOOL does after an edit-form save) | Clear the default on the edit form or re-sync the tool | +| `onb_playbook` fails | its `error` | No egress to raw.githubusercontent.com | Open the `browserUrl` in a browser and read the section there | +| Email never arrives (approval, completion, test) | `onb_ui_link email_test`, `onb_recent_errors` with `onb_contains: smtp` | SMTP host, port, TLS or credentials | Fix on `email_settings` (password entered there); or record P7 as not applicable | + +When the cause is outside CloudBolt (a cloud permission, a firewall rule, a DNS record), say so, name the owner on the customer side, and record the item `pending` with that note so the scorecard shows what is waiting on whom. diff --git a/CATALOG.md b/CATALOG.md index ab52ca39..c793edfb 100644 --- a/CATALOG.md +++ b/CATALOG.md @@ -5,15 +5,15 @@ Every piece of content in this repo, grouped by type. Names and descriptions com | Type | Count | |---|---| -| [Packages](#packages) | 6 | +| [Packages](#packages) | 7 | | [Blueprints](#blueprints) | 28 | | [Resource actions](#resource-actions) | 37 | | [Server actions](#server-actions) | 3 | | [Orchestration actions](#orchestration-actions) | 21 | | [Recurring jobs](#recurring-jobs) | 5 | | [Webhooks](#webhooks) | 5 | -| [MCP tool actions](#mcp-tool-actions) | 9 | -| [Plugins](#plugins) | 148 | +| [MCP tool actions](#mcp-tool-actions) | 17 | +| [Plugins](#plugins) | 156 | | [Shared modules](#shared-modules) | 21 | | [UI extensions](#ui-extensions) | 11 | | [Parameters](#parameters) | 2 | @@ -30,6 +30,7 @@ Named sets of content that the Content Package Manager extension (`extensions/XU | Data Disk Blueprints | [PKG-t1k7drin](packages/PKG-t1k7drin/README.md) | Deploys Windows Server and Oracle Linux VMs with order-time data disks through the Windows, Oracle Linux, and disk map blueprints, with the Post-Provision orchestration actions that attach the disk map's disks and prepare them inside the guest. | 1.0.0 | [Attach Data Disks from Disk Map](orchestration_actions/HPA-n67skws4/README.md) (orchestration action), [Configure Data Disks from Disk Map (Windows)](orchestration_actions/HPA-42uy9dyo/README.md) (orchestration action), [Configure Data Disks from Disk Map (Oracle Linux)](orchestration_actions/HPA-4ptcwgg4/README.md) (orchestration action), [Windows Server with Data Disks](blueprints/BP-9ph7xcok/README.md) (blueprint), [Oracle Linux Server with Data Disks](blueprints/BP-rgdg9gho/README.md) (blueprint), [Server with Data Disks](blueprints/BP-g9zwqjoa/README.md) (blueprint) | | Data Disks from a Disk Map | [PKG-zny1ynfs](packages/PKG-zny1ynfs/README.md) | Adds order-time data disks to Windows Server and Oracle Linux VMs through an environment disk_map parameter, a form function that turns it into a disk table, and Post-Provision orchestration actions that attach the disks and prepare them inside the guest. | 1.0.0 | [Server with Data Disks](blueprints/BP-g9zwqjoa/README.md) (blueprint), [Attach Data Disks from Disk Map](orchestration_actions/HPA-n67skws4/README.md) (orchestration action), [Configure Data Disks from Disk Map (Oracle Linux)](orchestration_actions/HPA-4ptcwgg4/README.md) (orchestration action), [Configure Data Disks from Disk Map (Windows)](orchestration_actions/HPA-42uy9dyo/README.md) (orchestration action), [Data Disks](parameters/CF-q3bexgap/README.md) (parameter) | | HCP Terraform | [PKG-0bo7vlxp](packages/PKG-0bo7vlxp/README.md) | Provisions VMs and no-code modules through HCP Terraform in a workspace per deployment, optionally followed by Ansible job templates, with their day-2 actions, the form options webhook, and the UI extension that adds Terraform tabs. | 1.0.0 | [HCP Terraform VM](blueprints/BP-b0qm83lh/README.md) (blueprint), [HCP Terraform No-Code Module](blueprints/BP-00meiwwz/README.md) (blueprint), [HCP Terraform No-Code + Ansible](blueprints/BP-uh9v24v3/README.md) (blueprint), [Form Options](webhooks/IWH-yj93is5z/) (webhook), [HCP Terraform Workspace](extensions/XUI-ax1sluwi/README.md) (UI extension) | +| POC Onboarding Toolkit | [PKG-8aaadefz](packages/PKG-8aaadefz/README.md) | Installs the MCP tools the POC onboarding skill drives: appliance status with next steps, admin UI links, log and failure diagnosis, resource handler verification, the playbook text, the install step and POC item tracking, plus the repository sync, job log and blueprint permission tools they reuse. | 0.1.0 | [POC Onboarding: Install](mcp_tool_actions/MTA-6zxrhdls/README.md) (MCP tool action), [POC Onboarding: Status](mcp_tool_actions/MTA-1985b88g/README.md) (MCP tool action), [POC Onboarding: UI Link](mcp_tool_actions/MTA-zpohocjt/README.md) (MCP tool action), [POC Onboarding: Recent Errors](mcp_tool_actions/MTA-hwg74btd/README.md) (MCP tool action), [POC Onboarding: Failure Trace](mcp_tool_actions/MTA-jzscq0mk/README.md) (MCP tool action), [POC Onboarding: Verify Resource Handler](mcp_tool_actions/MTA-r5v1eblg/README.md) (MCP tool action), [POC Onboarding: Playbook](mcp_tool_actions/MTA-92b836jb/README.md) (MCP tool action), [POC Onboarding: Set Item Status](mcp_tool_actions/MTA-p72v9y76/README.md) (MCP tool action), [Sync From Source Control Repo](mcp_tool_actions/MTA-543b19sa/README.md) (MCP tool action), [Fetch Job Log](mcp_tool_actions/MTA-8j9c0tb0/README.md) (MCP tool action), [Manage Blueprint Permissions](mcp_tool_actions/MTA-ntmcnvv7/README.md) (MCP tool action) | | Runbooks | [PKG-v20qv308](packages/PKG-v20qv308/README.md) | Adds Run Task and Run Workflow, actions that run any Remote Script that fits a VM or an ordered workflow of CloudBolt actions on it, with base, example and installer task scripts, the Runbooks page for building workflows, base actions and file archives, and an example blueprint that runs a workflow. | 1.0.0 | [Runbook Task Template (Windows)](plugins/OHK-lhm2916o/) (plugin), [Runbook Task Template (Linux)](plugins/OHK-iub9a2jg/) (plugin), [Manage Windows Service](plugins/OHK-01kmavro/) (plugin), [Manage Linux Service](plugins/OHK-5yh12jiq/) (plugin), [Run Installer from File Archive (Linux)](plugins/OHK-hgv6wp65/) (plugin), [Run Installer from File Archive (Windows)](plugins/OHK-ow68kerl/) (plugin), [Runbook Tasks](webhooks/IWH-cdf543g3/) (webhook), [Runbook Workflows](webhooks/IWH-xjlrmvc8/) (webhook), [Run Task](server_actions/SVA-4sin3s0q/README.md) (server action), [Run Workflow](server_actions/SVA-j7rbsh39/README.md) (server action), [Runbooks](extensions/XUI-jbm5ac9e/README.md) (UI extension), [VM with Workflow](blueprints/BP-vy9ytey6/README.md) (blueprint) | | Windows AD Domain Join | [PKG-nf407lm5](packages/PKG-nf407lm5/README.md) | Joins provisioned Windows servers to Active Directory in the OU picked from a type-ahead domain_ou parameter, taking the domain and its LDAP Utility from the OU, and deletes the computer object at decommission. | 1.0.0 | [Delete Windows Computer Object from AD](orchestration_actions/HPA-q181uofy/README.md) (orchestration action), [Join Windows Server to AD Domain](orchestration_actions/HPA-jjp1vlfi/README.md) (orchestration action), [Suggest Domain OUs](orchestration_actions/HPA-0zcrvpwu/README.md) (orchestration action), [Domain OU](parameters/CF-8pif9mbf/README.md) (parameter) | @@ -185,6 +186,14 @@ Actions published as tools on CloudBolt's MCP server for AI agents to call. Each | Fetch Job Log | [MTA-8j9c0tb0](mcp_tool_actions/MTA-8j9c0tb0/README.md) | Returns a job's status, output, errors, progress log, child jobs, failed descendants, and sync results in one call so a failed job can be diagnosed. | `fetch_job_log` | yes | [Fetch Job Log](plugins/OHK-2p0rhzup/) | | Manage Blueprint Permissions | [MTA-ntmcnvv7](mcp_tool_actions/MTA-ntmcnvv7/README.md) | Lists, grants, or revokes a group's DEPLOY or MANAGE permission on a blueprint, so a repository sync's loss of group permissions can be snapshotted and restored. | `manage_blueprint_permissions` | yes | [Manage Blueprint Permissions](plugins/OHK-mgta9oez/) | | Order Counts by Blueprint | [MTA-lp8lgi7e](mcp_tool_actions/MTA-lp8lgi7e/) | Return the number of orders placed for each blueprint, optionally filtered by order status. | `order_counts_by_blueprint` | yes | [Order Counts by Blueprint](plugins/OHK-yjblxbwg/) | +| POC Onboarding: Failure Trace | [MTA-jzscq0mk](mcp_tool_actions/MTA-jzscq0mk/README.md) | Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback. | `onb_failure_trace` | yes | [POC Onboarding: Failure Trace](plugins/OHK-y95w8ai0/) | +| POC Onboarding: Install | [MTA-6zxrhdls](mcp_tool_actions/MTA-6zxrhdls/README.md) | Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version. | `onb_install` | yes | [POC Onboarding: Install](plugins/OHK-j60flmb3/) | +| POC Onboarding: Playbook | [MTA-92b836jb](mcp_tool_actions/MTA-92b836jb/README.md) | Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure. | `onb_playbook` | yes | [POC Onboarding: Playbook](plugins/OHK-1am7i73s/) | +| POC Onboarding: Recent Errors | [MTA-hwg74btd](mcp_tool_actions/MTA-hwg74btd/README.md) | Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most. | `onb_recent_errors` | yes | [POC Onboarding: Recent Errors](plugins/OHK-4vwq70dg/) | +| POC Onboarding: Set Item Status | [MTA-p72v9y76](mcp_tool_actions/MTA-p72v9y76/README.md) | Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read. | `onb_set_item_status` | yes | [POC Onboarding: Set Item Status](plugins/OHK-5885tete/) | +| POC Onboarding: Status | [MTA-1985b88g](mcp_tool_actions/MTA-1985b88g/README.md) | Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links. | `onb_status` | yes | [POC Onboarding: Status](plugins/OHK-5zg1dkcr/) | +| POC Onboarding: UI Link | [MTA-zpohocjt](mcp_tool_actions/MTA-zpohocjt/README.md) | Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited. | `onb_ui_link` | yes | [POC Onboarding: UI Link](plugins/OHK-1gp25bmt/) | +| POC Onboarding: Verify Resource Handler | [MTA-r5v1eblg](mcp_tool_actions/MTA-r5v1eblg/README.md) | Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool. | `onb_verify_resource_handler` | yes | [POC Onboarding: Verify Resource Handler](plugins/OHK-s7cdvkpr/) | | Run Blueprint Discovery | [MTA-9oihpumd](mcp_tool_actions/MTA-9oihpumd/README.md) | Launches the Sync Resources job for one blueprint so its discovery plugin runs on demand. | `run_blueprint_discovery` | yes | [Run Blueprint Discovery](plugins/OHK-dwh5kqxq/) | | Run CIT Tests | [MTA-gnx1ckno](mcp_tool_actions/MTA-gnx1ckno/README.md) | Starts a functionaltest job for the named CIT tests and returns its job id. | `run_cit_tests` | yes | [Run CIT Tests](plugins/OHK-ieb4qio7/) | | Run Recurring Job | [MTA-thkvyt0v](mcp_tool_actions/MTA-thkvyt0v/README.md) | Runs a recurring job immediately, like Run Now on the Recurring Jobs page. | `run_recurring_job` | yes | [Run Recurring Job](plugins/OHK-qduf79xu/) | @@ -294,6 +303,14 @@ Python and remote-script actions. Plugins that belong to a blueprint or action a | Node Size - Generate Options by Region, OS Image, Security, Networking and Storage (Azure SKU capabilities) | [OHK-kujhsds0](plugins/OHK-kujhsds0/README.md) | Generates node_size options filtered by live Azure SKU capabilities for the selected region, image, security, networking, and storage settings. | CloudBolt Plug-in | standalone | | OpenShift Project Landing Zone | [OHK-prew0osh](plugins/OHK-prew0osh/) | Creates an OpenShift project with quota, limits, network policies, and an optional role binding, then pins a CloudBolt environment to it. | CloudBolt Plug-in | [OpenShift Project Landing Zone](blueprints/BP-tikkhf2y/README.md) | | Order Counts by Blueprint | [OHK-yjblxbwg](plugins/OHK-yjblxbwg/) | | CloudBolt Plug-in | [Order Counts by Blueprint](mcp_tool_actions/MTA-lp8lgi7e/) | +| POC Onboarding: Failure Trace | [OHK-y95w8ai0](plugins/OHK-y95w8ai0/) | Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback. | CloudBolt Plug-in | [POC Onboarding: Failure Trace](mcp_tool_actions/MTA-jzscq0mk/README.md) | +| POC Onboarding: Install | [OHK-j60flmb3](plugins/OHK-j60flmb3/) | Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version. | CloudBolt Plug-in | [POC Onboarding: Install](mcp_tool_actions/MTA-6zxrhdls/README.md) | +| POC Onboarding: Playbook | [OHK-1am7i73s](plugins/OHK-1am7i73s/) | Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure. | CloudBolt Plug-in | [POC Onboarding: Playbook](mcp_tool_actions/MTA-92b836jb/README.md) | +| POC Onboarding: Recent Errors | [OHK-4vwq70dg](plugins/OHK-4vwq70dg/) | Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most. | CloudBolt Plug-in | [POC Onboarding: Recent Errors](mcp_tool_actions/MTA-hwg74btd/README.md) | +| POC Onboarding: Set Item Status | [OHK-5885tete](plugins/OHK-5885tete/) | Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read. | CloudBolt Plug-in | [POC Onboarding: Set Item Status](mcp_tool_actions/MTA-p72v9y76/README.md) | +| POC Onboarding: Status | [OHK-5zg1dkcr](plugins/OHK-5zg1dkcr/) | Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links. | CloudBolt Plug-in | [POC Onboarding: Status](mcp_tool_actions/MTA-1985b88g/README.md) | +| POC Onboarding: UI Link | [OHK-1gp25bmt](plugins/OHK-1gp25bmt/) | Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited. | CloudBolt Plug-in | [POC Onboarding: UI Link](mcp_tool_actions/MTA-zpohocjt/README.md) | +| POC Onboarding: Verify Resource Handler | [OHK-s7cdvkpr](plugins/OHK-s7cdvkpr/) | Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool. | CloudBolt Plug-in | [POC Onboarding: Verify Resource Handler](mcp_tool_actions/MTA-r5v1eblg/README.md) | | Remove Resource Group from Environments | [OHK-vm5p34w3](plugins/OHK-vm5p34w3/) | Removes the deleted resource group's resource_group_arm option from environments on the same subscription. | CloudBolt Plug-in | [Azure Resource Group - Bicep](blueprints/BP-p7zmh96m/README.md) | | Remove Servers from Ansible Automation Platform | [OHK-8v830go3](plugins/OHK-8v830go3/) | Removes the host records a deployment's servers hold in Ansible Automation Platform inventories through CloudBolt's own connector method, before the infrastructure is destroyed; a missing host or unreachable AAP is a warning, never a blocker. | CloudBolt Plug-in | standalone | | Request AWS EKS Namespace Quota Change | [OHK-arour20h](plugins/OHK-arour20h/) | Moves an EKS namespace landing zone to a different size tier after approval and mirrors the new quota into its environment. | CloudBolt Plug-in | [Request Namespace Quota Change](resource_actions/RSA-mwegogck/) | diff --git a/catalog.json b/catalog.json index 74b8edc1..0fdb7863 100644 --- a/catalog.json +++ b/catalog.json @@ -875,6 +875,23 @@ "blueprints/BP-b0qm83lh" ] }, + { + "id": "MTA-1985b88g", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Status", + "description": "Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links.", + "path": "mcp_tool_actions/MTA-1985b88g", + "readme": "mcp_tool_actions/MTA-1985b88g/README.md", + "uses": [ + "plugins/OHK-5zg1dkcr" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_status", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "MTA-543b19sa", "type": "mcp_tool_actions", @@ -887,7 +904,27 @@ ], "used_by": [], "enabled": true, - "mcp_tool_name": "sync_from_source_control_repo" + "mcp_tool_name": "sync_from_source_control_repo", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, + { + "id": "MTA-6zxrhdls", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Install", + "description": "Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version.", + "path": "mcp_tool_actions/MTA-6zxrhdls", + "readme": "mcp_tool_actions/MTA-6zxrhdls/README.md", + "uses": [ + "plugins/OHK-j60flmb3" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_install", + "packages": [ + "packages/PKG-8aaadefz" + ] }, { "id": "MTA-8j9c0tb0", @@ -901,7 +938,27 @@ ], "used_by": [], "enabled": true, - "mcp_tool_name": "fetch_job_log" + "mcp_tool_name": "fetch_job_log", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, + { + "id": "MTA-92b836jb", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Playbook", + "description": "Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure.", + "path": "mcp_tool_actions/MTA-92b836jb", + "readme": "mcp_tool_actions/MTA-92b836jb/README.md", + "uses": [ + "plugins/OHK-1am7i73s" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_playbook", + "packages": [ + "packages/PKG-8aaadefz" + ] }, { "id": "MTA-9oihpumd", @@ -945,6 +1002,23 @@ "enabled": true, "mcp_tool_name": "run_cit_tests" }, + { + "id": "MTA-hwg74btd", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Recent Errors", + "description": "Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most.", + "path": "mcp_tool_actions/MTA-hwg74btd", + "readme": "mcp_tool_actions/MTA-hwg74btd/README.md", + "uses": [ + "plugins/OHK-4vwq70dg" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_recent_errors", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "MTA-js655cf3", "type": "mcp_tool_actions", @@ -959,6 +1033,23 @@ "enabled": true, "mcp_tool_name": "cancel_jobs" }, + { + "id": "MTA-jzscq0mk", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Failure Trace", + "description": "Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback.", + "path": "mcp_tool_actions/MTA-jzscq0mk", + "readme": "mcp_tool_actions/MTA-jzscq0mk/README.md", + "uses": [ + "plugins/OHK-y95w8ai0" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_failure_trace", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "MTA-lp8lgi7e", "type": "mcp_tool_actions", @@ -985,7 +1076,44 @@ ], "used_by": [], "enabled": true, - "mcp_tool_name": "manage_blueprint_permissions" + "mcp_tool_name": "manage_blueprint_permissions", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, + { + "id": "MTA-p72v9y76", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Set Item Status", + "description": "Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read.", + "path": "mcp_tool_actions/MTA-p72v9y76", + "readme": "mcp_tool_actions/MTA-p72v9y76/README.md", + "uses": [ + "plugins/OHK-5885tete" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_set_item_status", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, + { + "id": "MTA-r5v1eblg", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Verify Resource Handler", + "description": "Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool.", + "path": "mcp_tool_actions/MTA-r5v1eblg", + "readme": "mcp_tool_actions/MTA-r5v1eblg/README.md", + "uses": [ + "plugins/OHK-s7cdvkpr" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_verify_resource_handler", + "packages": [ + "packages/PKG-8aaadefz" + ] }, { "id": "MTA-thkvyt0v", @@ -1001,6 +1129,23 @@ "enabled": true, "mcp_tool_name": "run_recurring_job" }, + { + "id": "MTA-zpohocjt", + "type": "mcp_tool_actions", + "name": "POC Onboarding: UI Link", + "description": "Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited.", + "path": "mcp_tool_actions/MTA-zpohocjt", + "readme": "mcp_tool_actions/MTA-zpohocjt/README.md", + "uses": [ + "plugins/OHK-1gp25bmt" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_ui_link", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "HPA-0zcrvpwu", "type": "orchestration_actions", @@ -1349,6 +1494,30 @@ "extensions/XUI-ax1sluwi" ] }, + { + "id": "PKG-8aaadefz", + "type": "packages", + "name": "POC Onboarding Toolkit", + "description": "Installs the MCP tools the POC onboarding skill drives: appliance status with next steps, admin UI links, log and failure diagnosis, resource handler verification, the playbook text, the install step and POC item tracking, plus the repository sync, job log and blueprint permission tools they reuse.", + "path": "packages/PKG-8aaadefz", + "readme": "packages/PKG-8aaadefz/README.md", + "uses": [], + "used_by": [], + "version": "0.1.0", + "contents": [ + "mcp_tool_actions/MTA-6zxrhdls", + "mcp_tool_actions/MTA-1985b88g", + "mcp_tool_actions/MTA-zpohocjt", + "mcp_tool_actions/MTA-hwg74btd", + "mcp_tool_actions/MTA-jzscq0mk", + "mcp_tool_actions/MTA-r5v1eblg", + "mcp_tool_actions/MTA-92b836jb", + "mcp_tool_actions/MTA-p72v9y76", + "mcp_tool_actions/MTA-543b19sa", + "mcp_tool_actions/MTA-8j9c0tb0", + "mcp_tool_actions/MTA-ntmcnvv7" + ] + }, { "id": "PKG-bo8ensty", "type": "packages", @@ -1516,6 +1685,32 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-1am7i73s", + "type": "plugins", + "name": "POC Onboarding: Playbook", + "description": "Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure.", + "path": "plugins/OHK-1am7i73s", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-92b836jb" + ], + "plugin_type": "CloudBolt Plug-in" + }, + { + "id": "OHK-1gp25bmt", + "type": "plugins", + "name": "POC Onboarding: UI Link", + "description": "Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited.", + "path": "plugins/OHK-1gp25bmt", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-zpohocjt" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-1m6n3gq9", "type": "plugins", @@ -1712,6 +1907,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-4vwq70dg", + "type": "plugins", + "name": "POC Onboarding: Recent Errors", + "description": "Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most.", + "path": "plugins/OHK-4vwq70dg", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-hwg74btd" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-4w05hdd3", "type": "plugins", @@ -1785,6 +1993,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-5885tete", + "type": "plugins", + "name": "POC Onboarding: Set Item Status", + "description": "Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read.", + "path": "plugins/OHK-5885tete", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-p72v9y76" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-597w4hvq", "type": "plugins", @@ -1838,6 +2059,19 @@ "packages/PKG-v20qv308" ] }, + { + "id": "OHK-5zg1dkcr", + "type": "plugins", + "name": "POC Onboarding: Status", + "description": "Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links.", + "path": "plugins/OHK-5zg1dkcr", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-1985b88g" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-67bw7wgu", "type": "plugins", @@ -2699,6 +2933,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-j60flmb3", + "type": "plugins", + "name": "POC Onboarding: Install", + "description": "Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version.", + "path": "plugins/OHK-j60flmb3", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-6zxrhdls" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-jzkblrv7", "type": "plugins", @@ -3168,6 +3415,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-s7cdvkpr", + "type": "plugins", + "name": "POC Onboarding: Verify Resource Handler", + "description": "Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool.", + "path": "plugins/OHK-s7cdvkpr", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-r5v1eblg" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-sf6w5pfn", "type": "plugins", @@ -3486,6 +3746,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-y95w8ai0", + "type": "plugins", + "name": "POC Onboarding: Failure Trace", + "description": "Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback.", + "path": "plugins/OHK-y95w8ai0", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-jzscq0mk" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-y9d1uwhw", "type": "plugins", diff --git a/docs/poc-onboarding-setup.md b/docs/poc-onboarding-setup.md new file mode 100644 index 00000000..08377d29 --- /dev/null +++ b/docs/poc-onboarding-setup.md @@ -0,0 +1,69 @@ +# POC Onboarding — Setup + +Get an AI agent ready to take a new CloudBolt appliance through the POC Test Plan. After these steps the agent does the rest: it reads what is configured, sends you a link for every step that needs a password or key, verifies each resource handler, reads the appliance's own logs when something fails, orders the Custom Server blueprint through MCP, and keeps the scorecard. The procedure the agent follows is [.claude/skills/cb-poc-onboarding/SKILL.md](../.claude/skills/cb-poc-onboarding/SKILL.md); agents without skill support fetch the same text with the `onb_playbook` tool. + +## 1. Appliance + +1. CloudBolt 2026.2.48 or later, licensed, reachable at `https://`. The MCP server is on by default at `https:///mcp`. +2. An account that is a CloudBolt admin (super admin or CB admin). Every onboarding tool refuses other callers. +3. Outbound HTTPS from the appliance to `github.com` and `raw.githubusercontent.com` (to fetch the toolkit and the playbook) and to `content.cloudbolt.app` (Content Library). Set the web proxy under Admin > Miscellaneous Settings if one is required. + +## 2. Connect the agent + +Claude Code: + +```bash +claude mcp add --transport http cloudbolt https:///mcp +``` + +Then `/mcp`, choose the server, and sign in to CloudBolt in the browser window as the admin. Grant the `write` scope when asked; without it no custom tool runs. Any Streamable HTTP MCP client with OAuth support connects the same way with the same URL. Check: ask "Who am I according to CloudBolt?" and the answer names your admin user. + +## 3. Install the toolkit (once) + +Pick one: + +**A. Content Package Manager** (when the extension from this repository is installed): Admin > Content Packages > Import from repository > `https://github.com/mbomb67/cloudbolt-as-code.git`, branch `main`, package **POC Onboarding Toolkit** > Sync. + +**B. Source Code Repository plus one API call.** Admin > All Admin > CloudBolt > Source Code Repositories > Add: any label, URL `https://github.com/mbomb67/cloudbolt-as-code.git`, no authentication (public repository), default paths. Note its `SCR-` id (`GET https:///api/v3/cmp/sourceCodeRepos/`). Then: + +```bash +CB_API_TOKEN=$(curl -sS -X POST "https:///api/v3/cmp/apiToken/" \ + -H "Content-Type: application/json" \ + -d '{"username": "", "password": ""}' | python -c "import json,sys; print(json.load(sys.stdin)['token'])") + +curl -sS -X POST "https:///api/v3/cmp/sourceCodeRepos//syncFromRepo/" \ + -H "Authorization: Bearer $CB_API_TOKEN" -H "Content-Type: application/json" \ + -d '{"branch": "main", "refreshIfExists": true, "objectsToSync": {"mcp_tool_actions": [ + "MTA-6zxrhdls/MTA-6zxrhdls_metadata.json", "MTA-1985b88g/MTA-1985b88g_metadata.json", + "MTA-zpohocjt/MTA-zpohocjt_metadata.json", "MTA-hwg74btd/MTA-hwg74btd_metadata.json", + "MTA-jzscq0mk/MTA-jzscq0mk_metadata.json", "MTA-r5v1eblg/MTA-r5v1eblg_metadata.json", + "MTA-92b836jb/MTA-92b836jb_metadata.json", "MTA-p72v9y76/MTA-p72v9y76_metadata.json", + "MTA-543b19sa/MTA-543b19sa_metadata.json", "MTA-8j9c0tb0/MTA-8j9c0tb0_metadata.json", + "MTA-ntmcnvv7/MTA-ntmcnvv7_metadata.json"]}}' +``` + +The response is a sync job; `GET /api/v3/cmp/jobs//` lists each tool with `success` after a few seconds. The UI alternative is Actions > MCP Tool Actions > Create from Repository, one tool at a time. + +**C. No internet from the appliance.** From a clone, `python tools/package_zip.py mcp_tool_actions/MTA-6zxrhdls` and the other ten folders, then Actions > MCP Tool Actions > Import for each zip. + +## 4. Finish the install + +Ask the agent: "Run onb_install and tell me what changed." The importer leaves Synchronous Action off on every tool; `onb_install` turns it on where it belongs, enables every tool, checks outbound access, and reports. Then reconnect the MCP client (tool lists are cached per session). Check: "Run onb_status" answers inline with the appliance inventory. + +## 5. Start + +Say "Onboard CloudBolt for a POC" (in Claude Code with this repository open, `/cb-poc-onboarding`). Have the [POC Test Plan](https://docs.cloudbolt.io) prerequisites at hand: the licence, the two clouds you will connect, credentials with the minimum permissions for each (the agent never asks for them; it sends you to the page where they are entered), and whether SMTP, LDAP, SSO or a DNS record for a branded portal are available. Anything that is not available is recorded as not applicable, not as a failure. + +## 6. Updating the toolkit + +Ask the agent to sync the `mcp_tool_actions/` folders above from `main` (`sync_from_source_control_repo`), run `onb_install`, and reconnect. With the Content Package Manager, Sync the package instead. + +## Troubleshooting + +| Symptom | Cause | Fix | +|---|---|---| +| A tool is missing from the agent's list | Cached tool list, or not imported | Reconnect the client; check Actions > MCP Tool Actions | +| Every custom tool fails with a scope error | Token has `read` only | Reconnect and grant `write` | +| A tool answers with a job id instead of a result | Synchronous Action off | Run `onb_install`, reconnect | +| `onb_playbook` fails | No egress to raw.githubusercontent.com | Open the `browserUrl` it returns | +| Tools refuse with "Only CloudBolt admins" | The signed-in user is not an admin | Sign in as a super admin or CB admin | diff --git a/mcp_tool_actions/MTA-1985b88g/MTA-1985b88g_metadata.json b/mcp_tool_actions/MTA-1985b88g/MTA-1985b88g_metadata.json new file mode 100644 index 00000000..19577d32 --- /dev/null +++ b/mcp_tool_actions/MTA-1985b88g/MTA-1985b88g_metadata.json @@ -0,0 +1,19 @@ +{ + "action_input_default_values": [], + "action_inputs": [], + "dependencies": { + "hook": "plugins/OHK-5zg1dkcr" + }, + "enabled": true, + "id": "MTA-1985b88g", + "is_synchronous": true, + "label": "POC Onboarding: Status", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": true, + "mcp_tool_description": "Report what the appliance has configured for a proof of concept in one call: licence, portal URL, SMTP, proxy, Content Library reachability, Setup Wizard step states, every resource handler with its environments (OS builds, networks, groups, lifecycle parameters, last verify result), the Custom Server blueprint and its orders, groups and users, LDAP and SSO, which onboarding tools are installed and synchronous, the POC items recorded as done or not applicable, and nextSteps with a UI link for each. Call it at the start of every onboarding phase and after any change, before deciding what to do next. Read-only; requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_status", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-1985b88g/README.md b/mcp_tool_actions/MTA-1985b88g/README.md new file mode 100644 index 00000000..ed153144 --- /dev/null +++ b/mcp_tool_actions/MTA-1985b88g/README.md @@ -0,0 +1,21 @@ +# POC Onboarding: Status + +MCP Tool Action published to agents as `custom_onb_status`. Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-1985b88g | POC Onboarding: Status | +| Plugin | [OHK-5zg1dkcr](../../plugins/OHK-5zg1dkcr/) | POC Onboarding: Status | + +## Inputs +None. + +## Output +One report: appliance, license, preferences (smtp, proxy), contentLibrary, setupWizard, resourceHandlers[] with environments[], customServerBlueprint, groupsAndUsers, authentication, toolkit, pocItems, install, nextSteps[]. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Synchronous: the result comes back inline. +- The only network call is a HEAD against the Content Library host with a five-second timeout. diff --git a/mcp_tool_actions/MTA-6zxrhdls/MTA-6zxrhdls_metadata.json b/mcp_tool_actions/MTA-6zxrhdls/MTA-6zxrhdls_metadata.json new file mode 100644 index 00000000..27bf573b --- /dev/null +++ b/mcp_tool_actions/MTA-6zxrhdls/MTA-6zxrhdls_metadata.json @@ -0,0 +1,39 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "install applies the flags; status only reports.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-1gtvntvk", + "label": "Action: install (default) or status", + "name": "onb_action", + "placeholder": "install", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-j60flmb3" + }, + "enabled": true, + "id": "MTA-6zxrhdls", + "is_synchronous": false, + "label": "POC Onboarding: Install", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": true, + "mcp_read_only_hint": false, + "mcp_tool_description": "Finish installing the POC onboarding toolkit after its folders were synced or its content package imported: turn Synchronous Action on for the tools that answer inline (the importer leaves it off and the API cannot set it), enable every tool, check outbound access to the Content Library and to GitHub, and record the toolkit version. Idempotent; run it after every toolkit sync, then reconnect the MCP client because tool lists are cached per session. Runs as a job: poll the returned id with fetch_job. onb_action=status reports without changing anything. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_install", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-6zxrhdls/README.md b/mcp_tool_actions/MTA-6zxrhdls/README.md new file mode 100644 index 00000000..26e4bca6 --- /dev/null +++ b/mcp_tool_actions/MTA-6zxrhdls/README.md @@ -0,0 +1,23 @@ +# POC Onboarding: Install + +MCP Tool Action published to agents as `custom_onb_install`. Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-6zxrhdls | POC Onboarding: Install | +| Plugin | [OHK-j60flmb3](../../plugins/OHK-j60flmb3/) | POC Onboarding: Install | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_action` | string | install applies the flags; status only reports. | + +## Output +tools{} (present, enabled, isSynchronous, wantsSynchronous, before), missing[], changed[], egress (contentLibrary, playbook), notes[]. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Asynchronous: the call returns a job id; poll it with `fetch_job` and read `outputs`. +- Asynchronous by design so it works before any Synchronous flag is set. diff --git a/mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json b/mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json new file mode 100644 index 00000000..b5f38653 --- /dev/null +++ b/mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json @@ -0,0 +1,39 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "index, bootstrap, resource-handlers, phases, troubleshooting or test-plan-map.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-hd5n4peq", + "label": "Section (default index)", + "name": "onb_section", + "placeholder": "index", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-1am7i73s" + }, + "enabled": true, + "id": "MTA-92b836jb", + "is_synchronous": true, + "label": "POC Onboarding: Playbook", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": true, + "mcp_read_only_hint": true, + "mcp_tool_description": "Return the POC onboarding playbook text: the procedure an agent follows to take a fresh CloudBolt appliance through a proof of concept with these tools. Sections: index (the skill: hard rules and the phase loop), bootstrap, resource-handlers, phases, troubleshooting, test-plan-map. Call it first when you have no cb-poc-onboarding skill loaded and the user asks to onboard, set up or POC CloudBolt; follow the text it returns. The text is fetched from GitHub through the appliance's proxy settings; when that fails the response gives the URL to open in a browser. Read-only.", + "mcp_tool_name": "onb_playbook", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-92b836jb/README.md b/mcp_tool_actions/MTA-92b836jb/README.md new file mode 100644 index 00000000..706fba03 --- /dev/null +++ b/mcp_tool_actions/MTA-92b836jb/README.md @@ -0,0 +1,23 @@ +# POC Onboarding: Playbook + +MCP Tool Action published to agents as `custom_onb_playbook`. Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-92b836jb | POC Onboarding: Playbook | +| Plugin | [OHK-1am7i73s](../../plugins/OHK-1am7i73s/) | POC Onboarding: Playbook | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_section` | string | index, bootstrap, resource-handlers, phases, troubleshooting or test-plan-map. | + +## Output +text (Markdown), source, browserUrl, sections[]. + +## Notes +- Any authenticated caller; the text is public. +- Synchronous: the result comes back inline. +- Needs outbound HTTPS to raw.githubusercontent.com; onb_install checks it. diff --git a/mcp_tool_actions/MTA-hwg74btd/MTA-hwg74btd_metadata.json b/mcp_tool_actions/MTA-hwg74btd/MTA-hwg74btd_metadata.json new file mode 100644 index 00000000..36a36ae7 --- /dev/null +++ b/mcp_tool_actions/MTA-hwg74btd/MTA-hwg74btd_metadata.json @@ -0,0 +1,115 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "Only entries whose message or traceback contains this text.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-np7k0su9", + "label": "Substring filter (case-insensitive)", + "name": "onb_contains", + "placeholder": "Failed to validate connection", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "Cap on the number of groups returned.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-ve8ahqo9", + "label": "Max groups returned (default 50, max 200)", + "name": "onb_limit", + "placeholder": "50", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "INT", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "application, jobengine, authentication, mcp or saml2.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-nrv9upth", + "label": "Log (default application)", + "name": "onb_log", + "placeholder": "application", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "DEBUG, INFO, WARNING, ERROR or CRITICAL.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-bhwyx6uq", + "label": "Minimum level (default WARNING)", + "name": "onb_min_level", + "placeholder": "WARNING", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "How far back to look; 0 scans the whole 8 MB tail.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-n8zz7r4l", + "label": "Minutes back (default 30, 0 = whole tail)", + "name": "onb_minutes", + "placeholder": "30", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "INT", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-4vwq70dg" + }, + "enabled": true, + "id": "MTA-hwg74btd", + "is_synchronous": true, + "label": "POC Onboarding: Recent Errors", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": true, + "mcp_tool_description": "Read the last minutes of a CloudBolt log (application by default; also jobengine, authentication, mcp, saml2) and return the WARNING-and-above entries grouped by exception and message, newest first, with tracebacks, secrets redacted, and a hint for each known pattern (failed handler verification, missing egress, proxy, SSL inspection, LDAP bind, missing image, subnet or key pair). Call it right after something failed in the UI: the resource handler form hides the real error but logs it under 'Failed to validate connection'. Use onb_log=jobengine for provisioning jobs and onb_contains to narrow by handler name or text. Only the last 8 MB of the file are read. Read-only; requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_recent_errors", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-hwg74btd/README.md b/mcp_tool_actions/MTA-hwg74btd/README.md new file mode 100644 index 00000000..3d08849a --- /dev/null +++ b/mcp_tool_actions/MTA-hwg74btd/README.md @@ -0,0 +1,27 @@ +# POC Onboarding: Recent Errors + +MCP Tool Action published to agents as `custom_onb_recent_errors`. Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-hwg74btd | POC Onboarding: Recent Errors | +| Plugin | [OHK-4vwq70dg](../../plugins/OHK-4vwq70dg/) | POC Onboarding: Recent Errors | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_log` | string | application, jobengine, authentication, mcp or saml2. | +| `onb_minutes` | integer | How far back to look; 0 scans the whole 8 MB tail. | +| `onb_contains` | string | Only entries whose message or traceback contains this text. | +| `onb_limit` | integer | Cap on the number of groups returned. | +| `onb_min_level` | string | DEBUG, INFO, WARNING, ERROR or CRITICAL. | + +## Output +groups[] with level, logger, where, count, firstSeen, lastSeen, sample, traceback[] and hints[]; entriesScanned, entriesMatched, secretsRedacted. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Synchronous: the result comes back inline. +- Log timestamps are appliance-local; the window is computed in the appliance's local time. diff --git a/mcp_tool_actions/MTA-jzscq0mk/MTA-jzscq0mk_metadata.json b/mcp_tool_actions/MTA-jzscq0mk/MTA-jzscq0mk_metadata.json new file mode 100644 index 00000000..347a0328 --- /dev/null +++ b/mcp_tool_actions/MTA-jzscq0mk/MTA-jzscq0mk_metadata.json @@ -0,0 +1,39 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "The order or job to trace.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-hyi8pqno", + "label": "Order (ORD-) or job (JOB-) global id", + "name": "onb_target_id", + "placeholder": "ORD-abc12345", + "relevant-osfamilies": [], + "required": true, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-y95w8ai0" + }, + "enabled": true, + "id": "MTA-jzscq0mk", + "is_synchronous": true, + "label": "POC Onboarding: Failure Trace", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": true, + "mcp_tool_description": "Given an order (ORD-) or job (JOB-) global id, return every failed job under it with its errors, output, the tail of its progress messages, its failed children and a hint for the provisioning failures a new appliance hits most (no image in the region, no subnet, missing key pair, Windows password, datastore not pinned, permissions, TLS, connectivity). Call it when fetch_order or fetch_job reports FAILURE; then pass the job id it names to fetch_job_log with log_file_tail for the full traceback. Read-only; requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_failure_trace", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-jzscq0mk/README.md b/mcp_tool_actions/MTA-jzscq0mk/README.md new file mode 100644 index 00000000..e226b45e --- /dev/null +++ b/mcp_tool_actions/MTA-jzscq0mk/README.md @@ -0,0 +1,22 @@ +# POC Onboarding: Failure Trace + +MCP Tool Action published to agents as `custom_onb_failure_trace`. Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-jzscq0mk | POC Onboarding: Failure Trace | +| Plugin | [OHK-y95w8ai0](../../plugins/OHK-y95w8ai0/) | POC Onboarding: Failure Trace | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_target_id` | string, required | The order or job to trace. | + +## Output +target, failedJobs[] (errors, output, progressTail, hints, url), hints[], next. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Synchronous: the result comes back inline. diff --git a/mcp_tool_actions/MTA-p72v9y76/MTA-p72v9y76_metadata.json b/mcp_tool_actions/MTA-p72v9y76/MTA-p72v9y76_metadata.json new file mode 100644 index 00000000..ff4a65d1 --- /dev/null +++ b/mcp_tool_actions/MTA-p72v9y76/MTA-p72v9y76_metadata.json @@ -0,0 +1,77 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "Item id from the POC test plan, or P1 to P12 for the prerequisites.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-z5tvygfh", + "label": "Test plan item (2.1.3) or prerequisite (P7)", + "name": "onb_item_id", + "placeholder": "2.1.3", + "relevant-osfamilies": [], + "required": true, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "Why the item is skipped or not applicable, or any note; the scorecard prints it.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-3snidlcl", + "label": "Reason (required for skipped/not_applicable)", + "name": "onb_item_note", + "placeholder": "Customer POC has no SMTP relay", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "done, skipped, not_applicable or pending.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-lhg78kcq", + "label": "Status (default done)", + "name": "onb_item_status", + "placeholder": "done", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-5885tete" + }, + "enabled": true, + "id": "MTA-p72v9y76", + "is_synchronous": true, + "label": "POC Onboarding: Set Item Status", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": false, + "mcp_tool_description": "Record the state of one POC test plan item (1.1.1 to 4.3.5) or prerequisite (P1 to P12): done, skipped, not_applicable or pending, with a note. Use not_applicable, with the reason, when the customer cannot or does not want to exercise an item in this POC (no SMTP, no LDAP, no SSO, no DNS record for a branded portal, no Terraform or Ansible); the scorecard then reports it as not applicable instead of failed. Returns every recorded item and a summary. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_set_item_status", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-p72v9y76/README.md b/mcp_tool_actions/MTA-p72v9y76/README.md new file mode 100644 index 00000000..754be319 --- /dev/null +++ b/mcp_tool_actions/MTA-p72v9y76/README.md @@ -0,0 +1,25 @@ +# POC Onboarding: Set Item Status + +MCP Tool Action published to agents as `custom_onb_set_item_status`. Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-p72v9y76 | POC Onboarding: Set Item Status | +| Plugin | [OHK-5885tete](../../plugins/OHK-5885tete/) | POC Onboarding: Set Item Status | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_item_id` | string, required | Item id from the POC test plan, or P1 to P12 for the prerequisites. | +| `onb_item_status` | string | done, skipped, not_applicable or pending. | +| `onb_item_note` | string | Why the item is skipped or not applicable, or any note; the scorecard prints it. | + +## Output +item, status, note, items{} (every recorded item), summary. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Synchronous: the result comes back inline. +- State lives in the poc_onboarding_state parameter (namespace poc_onboarding), created on first use. diff --git a/mcp_tool_actions/MTA-r5v1eblg/MTA-r5v1eblg_metadata.json b/mcp_tool_actions/MTA-r5v1eblg/MTA-r5v1eblg_metadata.json new file mode 100644 index 00000000..e6ec83f9 --- /dev/null +++ b/mcp_tool_actions/MTA-r5v1eblg/MTA-r5v1eblg_metadata.json @@ -0,0 +1,39 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "The handler to verify, by global id or name.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-7f2q5v3a", + "label": "Resource handler (RH- id or name)", + "name": "onb_handler", + "placeholder": "RH-abc12345", + "relevant-osfamilies": [], + "required": true, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-s7cdvkpr" + }, + "enabled": true, + "id": "MTA-r5v1eblg", + "is_synchronous": false, + "label": "POC Onboarding: Verify Resource Handler", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": true, + "mcp_read_only_hint": false, + "mcp_tool_description": "Run Verify Connection on a resource handler (RH- id or name) and return the cloud API's real error text, which the UI form replaces with 'Unable to connect to handler with the information provided'. Adds a hint for AWS, Azure, vCenter, SCVMM, GCP, Nutanix and OpenStack errors (bad key, expired secret, wrong tenant, missing role or privilege, TLS, DNS, firewall, proxy), the link to the minimum-permissions document and the handler's edit and verify links, and records the result so onb_status shows it. Runs as a job: poll the returned id with fetch_job and read outputs. Call it after the user creates or edits a handler in the UI; when it fails, give the user the edit link and the hint, never ask for the credentials in chat. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_verify_resource_handler", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-r5v1eblg/README.md b/mcp_tool_actions/MTA-r5v1eblg/README.md new file mode 100644 index 00000000..b56a292c --- /dev/null +++ b/mcp_tool_actions/MTA-r5v1eblg/README.md @@ -0,0 +1,23 @@ +# POC Onboarding: Verify Resource Handler + +MCP Tool Action published to agents as `custom_onb_verify_resource_handler`. Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-r5v1eblg | POC Onboarding: Verify Resource Handler | +| Plugin | [OHK-s7cdvkpr](../../plugins/OHK-s7cdvkpr/) | POC Onboarding: Verify Resource Handler | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_handler` | string, required | The handler to verify, by global id or name. | + +## Output +verified (true/false), error, hints[], links (detail, edit, verifyDialog, importLocations, permissionsDoc), next. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Asynchronous: the call returns a job id; poll it with `fetch_job` and read `outputs`. +- Asynchronous by design: the check calls the cloud API. The result is also stored for onb_status. diff --git a/mcp_tool_actions/MTA-zpohocjt/MTA-zpohocjt_metadata.json b/mcp_tool_actions/MTA-zpohocjt/MTA-zpohocjt_metadata.json new file mode 100644 index 00000000..53dfa5ef --- /dev/null +++ b/mcp_tool_actions/MTA-zpohocjt/MTA-zpohocjt_metadata.json @@ -0,0 +1,39 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "A global id such as RH-abc12345, or a page key such as email_settings or user_edit:USR-abc12345. An unknown key returns the list of pages.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-pe0hyuuy", + "label": "Global id or page key", + "name": "onb_link_target", + "placeholder": "new_resource_handler:aws", + "relevant-osfamilies": [], + "required": true, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-1gp25bmt" + }, + "enabled": true, + "id": "MTA-zpohocjt", + "is_synchronous": true, + "label": "POC Onboarding: UI Link", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": true, + "mcp_tool_description": "Return the absolute CloudBolt UI link for a global id (RH-, ENV-, GRP-, USR-, BP-, ORD-, JOB-, SVR-, RSC-, MTA-, CF-, SCR-, IDD-) or for a named admin page, optionally with an argument after a colon: new_resource_handler:aws (also azure_arm, vmware, scvmm, gcp, acropolis, openstack), handler_edit:RH-id, handler_verify:RH-id, handler_import_locations:RH-id, environment_parameters:ENV-id, new_ldap, ldap_verify:id, ldap_mappings:id, email_settings, email_test, proxy, ssl_certificates, parameters, new_parameter, os_builds, groups, group_quotas:GRP-id, users, new_user, user_edit:USR-id, roles, portals, catalog, content_library, source_code_repos, mcp_tool_actions, rules, recurring_jobs, cit_tests, inbound_webhooks, ui_extensions, application_log, setup_wizard, dashboard. Use it whenever the user must do something in the UI, above all when a password, key or secret has to be entered: never ask for secrets in chat, send the link. Read-only; requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_ui_link", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-zpohocjt/README.md b/mcp_tool_actions/MTA-zpohocjt/README.md new file mode 100644 index 00000000..ca464c6c --- /dev/null +++ b/mcp_tool_actions/MTA-zpohocjt/README.md @@ -0,0 +1,23 @@ +# POC Onboarding: UI Link + +MCP Tool Action published to agents as `custom_onb_ui_link`. Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited. +Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8aaadefz/README.md)) that the `cb-poc-onboarding` skill drives; procedure in [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +## Contents +| Role | ID | Name | +|---|---|---| +| MCP Tool Action | MTA-zpohocjt | POC Onboarding: UI Link | +| Plugin | [OHK-1gp25bmt](../../plugins/OHK-1gp25bmt/) | POC Onboarding: UI Link | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_link_target` | string, required | A global id such as RH-abc12345, or a page key such as email_settings or user_edit:USR-abc12345. An unknown key returns the list of pages. | + +## Output +url (absolute when the default portal has a domain), plus model/pk/label for an object or page/meaning for a named page. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Synchronous: the result comes back inline. +- Pages that take an argument accept a global id or a numeric pk after the colon. diff --git a/mcp_tool_actions/README.md b/mcp_tool_actions/README.md index c59c040c..d4fd00d5 100644 --- a/mcp_tool_actions/README.md +++ b/mcp_tool_actions/README.md @@ -10,6 +10,14 @@ Actions published as tools on CloudBolt's MCP server for AI agents to call. Each | Fetch Job Log | [MTA-8j9c0tb0](MTA-8j9c0tb0/README.md) | Returns a job's status, output, errors, progress log, child jobs, failed descendants, and sync results in one call so a failed job can be diagnosed. | `fetch_job_log` | yes | [Fetch Job Log](../plugins/OHK-2p0rhzup/) | | Manage Blueprint Permissions | [MTA-ntmcnvv7](MTA-ntmcnvv7/README.md) | Lists, grants, or revokes a group's DEPLOY or MANAGE permission on a blueprint, so a repository sync's loss of group permissions can be snapshotted and restored. | `manage_blueprint_permissions` | yes | [Manage Blueprint Permissions](../plugins/OHK-mgta9oez/) | | Order Counts by Blueprint | [MTA-lp8lgi7e](MTA-lp8lgi7e/) | Return the number of orders placed for each blueprint, optionally filtered by order status. | `order_counts_by_blueprint` | yes | [Order Counts by Blueprint](../plugins/OHK-yjblxbwg/) | +| POC Onboarding: Failure Trace | [MTA-jzscq0mk](MTA-jzscq0mk/README.md) | Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback. | `onb_failure_trace` | yes | [POC Onboarding: Failure Trace](../plugins/OHK-y95w8ai0/) | +| POC Onboarding: Install | [MTA-6zxrhdls](MTA-6zxrhdls/README.md) | Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version. | `onb_install` | yes | [POC Onboarding: Install](../plugins/OHK-j60flmb3/) | +| POC Onboarding: Playbook | [MTA-92b836jb](MTA-92b836jb/README.md) | Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure. | `onb_playbook` | yes | [POC Onboarding: Playbook](../plugins/OHK-1am7i73s/) | +| POC Onboarding: Recent Errors | [MTA-hwg74btd](MTA-hwg74btd/README.md) | Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most. | `onb_recent_errors` | yes | [POC Onboarding: Recent Errors](../plugins/OHK-4vwq70dg/) | +| POC Onboarding: Set Item Status | [MTA-p72v9y76](MTA-p72v9y76/README.md) | Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read. | `onb_set_item_status` | yes | [POC Onboarding: Set Item Status](../plugins/OHK-5885tete/) | +| POC Onboarding: Status | [MTA-1985b88g](MTA-1985b88g/README.md) | Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links. | `onb_status` | yes | [POC Onboarding: Status](../plugins/OHK-5zg1dkcr/) | +| POC Onboarding: UI Link | [MTA-zpohocjt](MTA-zpohocjt/README.md) | Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited. | `onb_ui_link` | yes | [POC Onboarding: UI Link](../plugins/OHK-1gp25bmt/) | +| POC Onboarding: Verify Resource Handler | [MTA-r5v1eblg](MTA-r5v1eblg/README.md) | Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool. | `onb_verify_resource_handler` | yes | [POC Onboarding: Verify Resource Handler](../plugins/OHK-s7cdvkpr/) | | Run Blueprint Discovery | [MTA-9oihpumd](MTA-9oihpumd/README.md) | Launches the Sync Resources job for one blueprint so its discovery plugin runs on demand. | `run_blueprint_discovery` | yes | [Run Blueprint Discovery](../plugins/OHK-dwh5kqxq/) | | Run CIT Tests | [MTA-gnx1ckno](MTA-gnx1ckno/README.md) | Starts a functionaltest job for the named CIT tests and returns its job id. | `run_cit_tests` | yes | [Run CIT Tests](../plugins/OHK-ieb4qio7/) | | Run Recurring Job | [MTA-thkvyt0v](MTA-thkvyt0v/README.md) | Runs a recurring job immediately, like Run Now on the Recurring Jobs page. | `run_recurring_job` | yes | [Run Recurring Job](../plugins/OHK-qduf79xu/) | diff --git a/packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json b/packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json new file mode 100644 index 00000000..f502658a --- /dev/null +++ b/packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json @@ -0,0 +1,22 @@ +{ + "contents": [ + "mcp_tool_actions/MTA-6zxrhdls", + "mcp_tool_actions/MTA-1985b88g", + "mcp_tool_actions/MTA-zpohocjt", + "mcp_tool_actions/MTA-hwg74btd", + "mcp_tool_actions/MTA-jzscq0mk", + "mcp_tool_actions/MTA-r5v1eblg", + "mcp_tool_actions/MTA-92b836jb", + "mcp_tool_actions/MTA-p72v9y76", + "mcp_tool_actions/MTA-543b19sa", + "mcp_tool_actions/MTA-8j9c0tb0", + "mcp_tool_actions/MTA-ntmcnvv7" + ], + "description": "Installs the MCP tools the POC onboarding skill drives: appliance status with next steps, admin UI links, log and failure diagnosis, resource handler verification, the playbook text, the install step and POC item tracking, plus the repository sync, job log and blueprint permission tools they reuse.", + "id": "PKG-8aaadefz", + "last_updated": "2026-10-19", + "metadata_version": "2026.1.0", + "minimum_version_required": "", + "name": "POC Onboarding Toolkit", + "version": "0.1.0" +} diff --git a/packages/PKG-8aaadefz/README.md b/packages/PKG-8aaadefz/README.md new file mode 100644 index 00000000..cd7d2f54 --- /dev/null +++ b/packages/PKG-8aaadefz/README.md @@ -0,0 +1,19 @@ +# POC Onboarding Toolkit + +Installs the MCP tools the POC onboarding skill drives: appliance status with next steps, admin UI links, log and failure diagnosis, resource handler verification, the playbook text, the install step and POC item tracking, plus the repository sync, job log and blueprint permission tools they reuse. + +Content package `PKG-8aaadefz`, version 0.1.0. Sync it from the Content Packages admin page (Content Package Manager UI extension). After the first import run the `onb_install` tool (asynchronous; poll the job) to turn Synchronous Action on for the inline tools, then reconnect the MCP client. Setup for a customer appliance: [docs/poc-onboarding-setup.md](../../docs/poc-onboarding-setup.md); the procedure the agent follows: [.claude/skills/cb-poc-onboarding/SKILL.md](../../.claude/skills/cb-poc-onboarding/SKILL.md). + +| Type | Name | Folder | +|---|---|---| +| MCP tool action | POC Onboarding: Install | [mcp_tool_actions/MTA-6zxrhdls](../../mcp_tool_actions/MTA-6zxrhdls/) | +| MCP tool action | POC Onboarding: Status | [mcp_tool_actions/MTA-1985b88g](../../mcp_tool_actions/MTA-1985b88g/) | +| MCP tool action | POC Onboarding: UI Link | [mcp_tool_actions/MTA-zpohocjt](../../mcp_tool_actions/MTA-zpohocjt/) | +| MCP tool action | POC Onboarding: Recent Errors | [mcp_tool_actions/MTA-hwg74btd](../../mcp_tool_actions/MTA-hwg74btd/) | +| MCP tool action | POC Onboarding: Failure Trace | [mcp_tool_actions/MTA-jzscq0mk](../../mcp_tool_actions/MTA-jzscq0mk/) | +| MCP tool action | POC Onboarding: Verify Resource Handler | [mcp_tool_actions/MTA-r5v1eblg](../../mcp_tool_actions/MTA-r5v1eblg/) | +| MCP tool action | POC Onboarding: Playbook | [mcp_tool_actions/MTA-92b836jb](../../mcp_tool_actions/MTA-92b836jb/) | +| MCP tool action | POC Onboarding: Set Item Status | [mcp_tool_actions/MTA-p72v9y76](../../mcp_tool_actions/MTA-p72v9y76/) | +| MCP tool action | Sync From Source Control Repo | [mcp_tool_actions/MTA-543b19sa](../../mcp_tool_actions/MTA-543b19sa/) | +| MCP tool action | Fetch Job Log | [mcp_tool_actions/MTA-8j9c0tb0](../../mcp_tool_actions/MTA-8j9c0tb0/) | +| MCP tool action | Manage Blueprint Permissions | [mcp_tool_actions/MTA-ntmcnvv7](../../mcp_tool_actions/MTA-ntmcnvv7/) | diff --git a/packages/README.md b/packages/README.md index 1699c64d..21cfee5f 100644 --- a/packages/README.md +++ b/packages/README.md @@ -9,5 +9,6 @@ Named sets of content that the Content Package Manager extension (`extensions/XU | Data Disk Blueprints | [PKG-t1k7drin](PKG-t1k7drin/README.md) | Deploys Windows Server and Oracle Linux VMs with order-time data disks through the Windows, Oracle Linux, and disk map blueprints, with the Post-Provision orchestration actions that attach the disk map's disks and prepare them inside the guest. | 1.0.0 | [Attach Data Disks from Disk Map](../orchestration_actions/HPA-n67skws4/README.md) (orchestration action), [Configure Data Disks from Disk Map (Windows)](../orchestration_actions/HPA-42uy9dyo/README.md) (orchestration action), [Configure Data Disks from Disk Map (Oracle Linux)](../orchestration_actions/HPA-4ptcwgg4/README.md) (orchestration action), [Windows Server with Data Disks](../blueprints/BP-9ph7xcok/README.md) (blueprint), [Oracle Linux Server with Data Disks](../blueprints/BP-rgdg9gho/README.md) (blueprint), [Server with Data Disks](../blueprints/BP-g9zwqjoa/README.md) (blueprint) | | Data Disks from a Disk Map | [PKG-zny1ynfs](PKG-zny1ynfs/README.md) | Adds order-time data disks to Windows Server and Oracle Linux VMs through an environment disk_map parameter, a form function that turns it into a disk table, and Post-Provision orchestration actions that attach the disks and prepare them inside the guest. | 1.0.0 | [Server with Data Disks](../blueprints/BP-g9zwqjoa/README.md) (blueprint), [Attach Data Disks from Disk Map](../orchestration_actions/HPA-n67skws4/README.md) (orchestration action), [Configure Data Disks from Disk Map (Oracle Linux)](../orchestration_actions/HPA-4ptcwgg4/README.md) (orchestration action), [Configure Data Disks from Disk Map (Windows)](../orchestration_actions/HPA-42uy9dyo/README.md) (orchestration action), [Data Disks](../parameters/CF-q3bexgap/README.md) (parameter) | | HCP Terraform | [PKG-0bo7vlxp](PKG-0bo7vlxp/README.md) | Provisions VMs and no-code modules through HCP Terraform in a workspace per deployment, optionally followed by Ansible job templates, with their day-2 actions, the form options webhook, and the UI extension that adds Terraform tabs. | 1.0.0 | [HCP Terraform VM](../blueprints/BP-b0qm83lh/README.md) (blueprint), [HCP Terraform No-Code Module](../blueprints/BP-00meiwwz/README.md) (blueprint), [HCP Terraform No-Code + Ansible](../blueprints/BP-uh9v24v3/README.md) (blueprint), [Form Options](../webhooks/IWH-yj93is5z/) (webhook), [HCP Terraform Workspace](../extensions/XUI-ax1sluwi/README.md) (UI extension) | +| POC Onboarding Toolkit | [PKG-8aaadefz](PKG-8aaadefz/README.md) | Installs the MCP tools the POC onboarding skill drives: appliance status with next steps, admin UI links, log and failure diagnosis, resource handler verification, the playbook text, the install step and POC item tracking, plus the repository sync, job log and blueprint permission tools they reuse. | 0.1.0 | [POC Onboarding: Install](../mcp_tool_actions/MTA-6zxrhdls/README.md) (MCP tool action), [POC Onboarding: Status](../mcp_tool_actions/MTA-1985b88g/README.md) (MCP tool action), [POC Onboarding: UI Link](../mcp_tool_actions/MTA-zpohocjt/README.md) (MCP tool action), [POC Onboarding: Recent Errors](../mcp_tool_actions/MTA-hwg74btd/README.md) (MCP tool action), [POC Onboarding: Failure Trace](../mcp_tool_actions/MTA-jzscq0mk/README.md) (MCP tool action), [POC Onboarding: Verify Resource Handler](../mcp_tool_actions/MTA-r5v1eblg/README.md) (MCP tool action), [POC Onboarding: Playbook](../mcp_tool_actions/MTA-92b836jb/README.md) (MCP tool action), [POC Onboarding: Set Item Status](../mcp_tool_actions/MTA-p72v9y76/README.md) (MCP tool action), [Sync From Source Control Repo](../mcp_tool_actions/MTA-543b19sa/README.md) (MCP tool action), [Fetch Job Log](../mcp_tool_actions/MTA-8j9c0tb0/README.md) (MCP tool action), [Manage Blueprint Permissions](../mcp_tool_actions/MTA-ntmcnvv7/README.md) (MCP tool action) | | Runbooks | [PKG-v20qv308](PKG-v20qv308/README.md) | Adds Run Task and Run Workflow, actions that run any Remote Script that fits a VM or an ordered workflow of CloudBolt actions on it, with base, example and installer task scripts, the Runbooks page for building workflows, base actions and file archives, and an example blueprint that runs a workflow. | 1.0.0 | [Runbook Task Template (Windows)](../plugins/OHK-lhm2916o/) (plugin), [Runbook Task Template (Linux)](../plugins/OHK-iub9a2jg/) (plugin), [Manage Windows Service](../plugins/OHK-01kmavro/) (plugin), [Manage Linux Service](../plugins/OHK-5yh12jiq/) (plugin), [Run Installer from File Archive (Linux)](../plugins/OHK-hgv6wp65/) (plugin), [Run Installer from File Archive (Windows)](../plugins/OHK-ow68kerl/) (plugin), [Runbook Tasks](../webhooks/IWH-cdf543g3/) (webhook), [Runbook Workflows](../webhooks/IWH-xjlrmvc8/) (webhook), [Run Task](../server_actions/SVA-4sin3s0q/README.md) (server action), [Run Workflow](../server_actions/SVA-j7rbsh39/README.md) (server action), [Runbooks](../extensions/XUI-jbm5ac9e/README.md) (UI extension), [VM with Workflow](../blueprints/BP-vy9ytey6/README.md) (blueprint) | | Windows AD Domain Join | [PKG-nf407lm5](PKG-nf407lm5/README.md) | Joins provisioned Windows servers to Active Directory in the OU picked from a type-ahead domain_ou parameter, taking the domain and its LDAP Utility from the OU, and deletes the computer object at decommission. | 1.0.0 | [Delete Windows Computer Object from AD](../orchestration_actions/HPA-q181uofy/README.md) (orchestration action), [Join Windows Server to AD Domain](../orchestration_actions/HPA-jjp1vlfi/README.md) (orchestration action), [Suggest Domain OUs](../orchestration_actions/HPA-0zcrvpwu/README.md) (orchestration action), [Domain OU](../parameters/CF-8pif9mbf/README.md) (parameter) | diff --git a/plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json b/plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json new file mode 100644 index 00000000..dab88050 --- /dev/null +++ b/plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json @@ -0,0 +1,35 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "index, bootstrap, resource-handlers, phases, troubleshooting or test-plan-map.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-hd5n4peq", + "label": "Section (default index)", + "name": "onb_section", + "placeholder": "index", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_section" + ], + "description": "Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure.", + "id": "OHK-1am7i73s", + "max_retries": 0, + "name": "POC Onboarding: Playbook", + "resource_technologies": [], + "script_filename": "OHK-1am7i73s_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-1am7i73s/OHK-1am7i73s_script.py b/plugins/OHK-1am7i73s/OHK-1am7i73s_script.py new file mode 100644 index 00000000..054c40e6 --- /dev/null +++ b/plugins/OHK-1am7i73s/OHK-1am7i73s_script.py @@ -0,0 +1,110 @@ +""" +POC Onboarding: Playbook (MCP Tool Action plugin). + +Returns the POC onboarding skill text (the SKILL.md and its reference +sections) from the public cloudbolt-as-code repository, so an MCP client +with no skill support (a desktop chat app, a web UI) receives the same +procedure the Claude Code skill follows. The appliance fetches the Markdown +over HTTPS through CloudBolt's proxy and SSL settings; when GitHub is not +reachable the response says so and gives the URL to open in a browser. +Read-only, synchronous. Any authenticated caller. + +Every declared input is read from its rendered template token in +_read_inputs(); keep each one referenced that way or CloudBolt's token scan +deletes the input when the script is saved. +""" +import html + +PLAYBOOK_REPO = "mbomb67/cloudbolt-as-code" +PLAYBOOK_REF = "main" +PLAYBOOK_DIR = ".claude/skills/cb-poc-onboarding" +SECTIONS = { + "index": ("SKILL.md", "The skill itself: hard rules, the phase loop, when to call which tool"), + "bootstrap": ("references/bootstrap.md", "Phase 0: connect the MCP client, install the toolkit, first status"), + "resource-handlers": ("references/resource-handlers.md", "Phase 1: per-technology handler creation, verification and diagnosis"), + "phases": ("references/phases.md", "Phases 2 to 9: environments, first order, self-service, RBAC, lifecycle, extensibility, wrap-up"), + "troubleshooting": ("references/troubleshooting.md", "Root-cause playbook: which tool for which failure, common causes and fixes"), + "test-plan-map": ("references/test-plan-map.md", "Every POC test plan item with its phase, evidence, documentation link and whether it can be skipped"), +} +MAX_CHARS = 80000 +TIMEOUT = 10 + + +def _text(value): + return html.unescape(value or "").strip() + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _read_inputs(): + raw = {"onb_section": """{{ onb_section }}"""} + return {"section": (_text(raw["onb_section"]) or "index").lower()} + + +def _url(path): + return "https://raw.githubusercontent.com/{}/{}/{}/{}".format(PLAYBOOK_REPO, PLAYBOOK_REF, PLAYBOOK_DIR, path) + + +def _browser_url(path): + return "https://github.com/{}/blob/{}/{}/{}".format(PLAYBOOK_REPO, PLAYBOOK_REF, PLAYBOOK_DIR, path) + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + + section = _read_inputs()["section"] + if section not in SECTIONS: + return _failure( + "Unknown section '{}'. Sections: {}.".format( + section, "; ".join("{} ({})".format(k, v[1]) for k, v in SECTIONS.items()) + ) + ) + path, meaning = SECTIONS[section] + url = _url(path) + outputs = { + "section": section, + "meaning": meaning, + "source": url, + "browserUrl": _browser_url(path), + "ref": PLAYBOOK_REF, + "sections": [{"section": k, "meaning": v[1]} for k, v in SECTIONS.items()], + } + try: + from utilities.helpers import cb_request + + response = cb_request("GET", url, timeout=TIMEOUT) + except Exception as exc: + outputs["error"] = str(exc)[:500] + outputs["note"] = ( + "The appliance could not reach raw.githubusercontent.com (proxy, firewall or SSL inspection). " + "Open browserUrl in a browser and paste the text, or clone the repository and read the file." + ) + return _failure("Could not fetch the playbook section '{}': {}".format(section, str(exc)[:300])) + if response.status_code != 200: + outputs["httpStatus"] = response.status_code + return _failure("GitHub answered HTTP {} for {}.".format(response.status_code, url)) + text = response.text + outputs["truncated"] = len(text) > MAX_CHARS + outputs["text"] = text[:MAX_CHARS] + outputs["characters"] = len(text) + return _success("Playbook section '{}' ({} characters).".format(section, len(text)), outputs) diff --git a/plugins/OHK-1gp25bmt/OHK-1gp25bmt_metadata.json b/plugins/OHK-1gp25bmt/OHK-1gp25bmt_metadata.json new file mode 100644 index 00000000..4c6ce400 --- /dev/null +++ b/plugins/OHK-1gp25bmt/OHK-1gp25bmt_metadata.json @@ -0,0 +1,35 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "A global id such as RH-abc12345, or a page key such as email_settings or user_edit:USR-abc12345. An unknown key returns the list of pages.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-pe0hyuuy", + "label": "Global id or page key", + "name": "onb_link_target", + "placeholder": "new_resource_handler:aws", + "relevant_osfamilies": [], + "required": true, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_link_target" + ], + "description": "Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited.", + "id": "OHK-1gp25bmt", + "max_retries": 0, + "name": "POC Onboarding: UI Link", + "resource_technologies": [], + "script_filename": "OHK-1gp25bmt_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py b/plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py new file mode 100644 index 00000000..ecbd7524 --- /dev/null +++ b/plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py @@ -0,0 +1,258 @@ +""" +POC Onboarding: UI Link (MCP Tool Action plugin). + +Turns a CloudBolt global id (RH-, ENV-, GRP-, USR-, BP-, ORD-, JOB-, SVR-, +RSC-, MTA-, ...) or a named admin page into an absolute UI link, so the agent +can send the user to the exact page where a secret must be entered or a +handler, environment, group or parameter is edited. Named pages take an +optional argument after a colon, for example new_resource_handler:aws or +group_quotas:GRP-abc12345. Read-only, synchronous. Admin only. + +Every declared input is read from its rendered template token in +_read_inputs(); keep each one referenced that way or CloudBolt's token scan +deletes the input when the script is saved. +""" +import html +import importlib +import re + +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") + +# prefix -> [(module, class)]; the first model holding the global id wins. +REGISTRY = { + "SVR": [("infrastructure.models", "Server")], + "ENV": [("infrastructure.models", "Environment")], + "GRP": [("accounts.models", "Group")], + "USR": [("accounts.models", "UserProfile")], + "JOB": [("jobs.models", "Job")], + "ORD": [("orders.models", "Order")], + "BP": [("servicecatalog.models", "ServiceBlueprint")], + "RSC": [("resources.models", "Resource")], + "RES": [("resources.models", "Resource")], + "RH": [("resourcehandlers.models", "ResourceHandler")], + "NET": [("resourcehandlers.models", "ResourceNetwork")], + "OSB": [("externalcontent.models", "OSBuild")], + "APP": [("externalcontent.models", "Application")], + "IMG": [("externalcontent.models", "OSBuildAttribute")], + "RJB": [("jobs.models", "RecurringJob")], + "SVA": [("cbhooks.models", "ServerAction")], + "RSA": [("cbhooks.models", "ResourceAction")], + "OHK": [("cbhooks.models", "OrchestrationHook")], + "MTA": [("cbhooks.models", "MCPToolAction")], + "CIT": [("cscv.models", "CITTest")], + "SCR": [("source_code_repos.models", "SourceCodeRepo")], + "IDD": [("utilities.models", "LDAPUtility")], + "CON": [("utilities.models", "ConnectionInfo")], + "CF": [("infrastructure.models", "CustomField")], +} + +# Fallback paths for models whose get_absolute_url is missing or not a detail page. +FALLBACK_PATHS = { + "ResourceHandler": "/admin/resourcehandlers/{pk}/", + "Environment": "/environments/{pk}/", + "Group": "/groups/{pk}/", + "UserProfile": "/users/{pk}/", + "Job": "/jobs/{pk}/", + "Order": "/orders/{pk}/", + "ServiceBlueprint": "/catalog/{pk}/", + "Server": "/servers/{pk}/", + "Resource": "/resources/{pk}/", + "LDAPUtility": "/admin/ldap_settings/{pk}/", + "MCPToolAction": "/actions/mcp_tool_action/{pk}/", + "CustomField": "/admin/customfields/{pk}/", + "SourceCodeRepo": "/source_code_repos/{pk}/", + "ConnectionInfo": "/admin/connectioninfo/{pk}/edit/", +} + +# Named pages. {arg} is the text after the colon in the target. +PAGES = { + "dashboard": ("/dashboard/", "CloudBolt dashboard"), + "setup_wizard": ("/setup/", "First-run Setup Wizard"), + "resource_handlers": ("/admin/resourcehandlers/", "Resource handler list"), + "new_resource_handler": ("/admin/resourcehandlers/add/", "Add a resource handler (pick the technology)"), + "new_resource_handler:{arg}": ( + "/admin/resourcehandlers/add_by_tech/{arg}/", + "Add a resource handler of one technology (aws, azure_arm, vmware, scvmm, gcp, acropolis, openstack)", + ), + "handler_verify:{arg}": ("/admin/resourcehandlers/{pk}/verify_connection/", "Verify Connection dialog of a handler (RH- id)"), + "handler_edit:{arg}": ("/admin/resourcehandlers/{pk}/edit/", "Edit a handler, including its credentials (RH- id)"), + "handler_import_locations:{arg}": ("/admin/resourcehandlers/{pk}/import_locations/", "Import locations, regions or clusters as environments (RH- id)"), + "environments": ("/environments/", "Environment list"), + "environment_parameters:{arg}": ("/environments/{pk}/#tab-parameters", "An environment's Parameters tab (ENV- id)"), + "ldap": ("/admin/ldap_settings/", "LDAP utilities"), + "new_ldap": ("/admin/ldap_settings/add/", "Add an LDAP utility (service account password is entered here)"), + "ldap_verify:{arg}": ("/admin/ldap_settings/{pk}/verify_connection/", "Verify an LDAP utility (IDD- id or pk)"), + "ldap_mappings:{arg}": ("/admin/ldap_settings/{pk}/group_mappings/add/", "Add an LDAP group mapping (IDD- id or pk)"), + "sso": ("/admin/sso/", "SSO providers"), + "email_settings": ("/admin/email_settings/edit/", "SMTP settings (password is entered here)"), + "email_test": ("/admin/email_test/", "Send a test email"), + "email_templates": ("/admin/email/", "Email templates"), + "proxy": ("/admin/edit_web_proxy/", "Outbound web proxy"), + "misc_settings": ("/admin/misc_settings/", "Miscellaneous settings"), + "ssl_certificates": ("/admin/ssl_certificates/", "Trusted SSL certificates"), + "parameters": ("/admin/customfields/", "Parameters (custom fields)"), + "new_parameter": ("/admin/customfields/add/", "Add a parameter"), + "os_builds": ("/admin/osbuilds/", "OS builds"), + "groups": ("/groups/", "Groups (add a group from here)"), + "group_quotas:{arg}": ("/groups/{pk}/quotas/edit/", "Edit a group's quotas (GRP- id)"), + "users": ("/users/", "Users"), + "new_user": ("/users/create/", "Create a local user"), + "user_edit:{arg}": ("/users/{pk}/edit/", "Edit a user, including setting a password (USR- id)"), + "roles": ("/roles/", "Roles"), + "portals": ("/portals/", "Branded portals"), + "catalog": ("/catalog/", "Service catalog"), + "content_library": ("/library/", "Content Library"), + "source_code_repos": ("/source_code_repos/", "Source Control Repositories"), + "mcp_tool_actions": ("/actions/mcp_tool_actions/", "MCP Tool Actions"), + "server_actions": ("/actions/server_actions/", "Server actions"), + "resource_actions": ("/actions/resource_actions/", "Resource actions"), + "orchestration_actions": ("/actions/orchestration_actions/", "Orchestration actions"), + "rules": ("/actions/rules/", "Rules"), + "recurring_jobs": ("/recurring_jobs/", "Recurring jobs"), + "cit_tests": ("/cit/", "Continuous Infrastructure Testing"), + "inbound_webhooks": ("/actions/inbound_web_hooks/", "Inbound webhooks"), + "ui_extensions": ("/admin/extensions/", "UI extensions"), + "application_log": ("/admin/view_application_log", "Last 10 KB of application.log"), + "jobs": ("/jobs/", "Job list"), + "orders": ("/orders/", "Order list"), +} + + +def _text(value): + return html.unescape(value or "").strip() + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _portal_url(): + try: + from portals.models import PortalConfig + + portal = PortalConfig.get_current_portal() + url = portal.site_url if portal else None + except Exception: + url = None + return (url or "").rstrip("/") + + +def _read_inputs(): + raw = {"onb_link_target": """{{ onb_link_target }}"""} + return {"target": _text(raw["onb_link_target"])} + + +def _resolve_object(global_id): + prefix = global_id.split("-", 1)[0].upper() + candidates = REGISTRY.get(prefix) + if not candidates: + return None, None, "Unsupported global id prefix '{}'. Supported: {}.".format(prefix, ", ".join(sorted(REGISTRY))) + for module_path, class_name in candidates: + try: + model = getattr(importlib.import_module(module_path), class_name) + except Exception: + continue + obj = model.objects.filter(global_id=global_id).first() + if obj is not None: + return obj, class_name, None + return None, None, "No object with global id '{}' exists on this appliance.".format(global_id) + + +def _object_path(obj, class_name): + fallback = FALLBACK_PATHS.get(class_name) + if fallback: + return fallback.format(pk=obj.pk) + try: + return obj.get_absolute_url() + except Exception: + return None + + +def _pk_for(arg): + """A page argument may be a global id (resolved to its pk) or a bare pk.""" + arg = _text(arg) + if arg.isdigit(): + return int(arg), None + if GLOBAL_ID_RE.match(arg): + obj, _class_name, error = _resolve_object(arg) + if error: + return None, error + return obj.pk, None + return None, "'{}' is neither a global id nor a numeric id.".format(arg) + + +def _pages_help(): + return [{"page": key, "meaning": meaning} for key, (_path, meaning) in PAGES.items()] + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + if not profile.is_cbadmin: + return _failure("Only CloudBolt admins may resolve admin UI links.") + + target = _read_inputs()["target"] + base = _portal_url() + if not target: + return _failure("onb_link_target is required: a global id such as RH-abc12345, or a page key. Pages: {}.".format( + ", ".join(PAGES))) + + outputs = {"target": target, "portalUrl": base or None} + if GLOBAL_ID_RE.match(target): + obj, class_name, error = _resolve_object(target) + if error: + return _failure(error) + path = _object_path(obj, class_name) + if not path: + return _failure("Found {} {} but it has no UI page.".format(class_name, target)) + outputs.update( + { + "model": class_name, + "pk": obj.pk, + "label": getattr(obj, "name", None) or getattr(obj, "label", None) or getattr(obj, "hostname", None), + "url": base + path, + } + ) + return _success("{} {} -> {}".format(class_name, target, outputs["url"]), outputs) + + key, _sep, arg = target.partition(":") + key = key.strip().lower() + arg = arg.strip() + if arg and (key + ":{arg}") in PAGES: + path, meaning = PAGES[key + ":{arg}"] + if "{pk}" in path: + pk, error = _pk_for(arg) + if error: + return _failure(error) + path = path.format(pk=pk) + else: + if not re.match(r"^[a-z0-9_]+$", arg): + return _failure("'{}' is not a valid argument for {}.".format(arg, key)) + path = path.format(arg=arg) + elif not arg and key in PAGES: + path, meaning = PAGES[key] + else: + return _failure( + "Unknown page '{}'. Pass a global id or one of: {}.".format(target, ", ".join(PAGES)) + ) + outputs.update({"page": key, "argument": arg or None, "meaning": meaning, "url": base + path}) + if not base: + outputs["note"] = "The default portal has no domain, so the URL is relative; prefix it with the appliance's https address." + return _success("{} -> {}".format(target, outputs["url"]), outputs) diff --git a/plugins/OHK-4vwq70dg/OHK-4vwq70dg_metadata.json b/plugins/OHK-4vwq70dg/OHK-4vwq70dg_metadata.json new file mode 100644 index 00000000..04087183 --- /dev/null +++ b/plugins/OHK-4vwq70dg/OHK-4vwq70dg_metadata.json @@ -0,0 +1,115 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "Only entries whose message or traceback contains this text.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-np7k0su9", + "label": "Substring filter (case-insensitive)", + "name": "onb_contains", + "placeholder": "Failed to validate connection", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "Cap on the number of groups returned.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-ve8ahqo9", + "label": "Max groups returned (default 50, max 200)", + "name": "onb_limit", + "placeholder": "50", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "INT", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "application, jobengine, authentication, mcp or saml2.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-nrv9upth", + "label": "Log (default application)", + "name": "onb_log", + "placeholder": "application", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "DEBUG, INFO, WARNING, ERROR or CRITICAL.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-bhwyx6uq", + "label": "Minimum level (default WARNING)", + "name": "onb_min_level", + "placeholder": "WARNING", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "How far back to look; 0 scans the whole 8 MB tail.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-n8zz7r4l", + "label": "Minutes back (default 30, 0 = whole tail)", + "name": "onb_minutes", + "placeholder": "30", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "INT", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_log", + "onb_minutes", + "onb_contains", + "onb_limit", + "onb_min_level" + ], + "description": "Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most.", + "id": "OHK-4vwq70dg", + "max_retries": 0, + "name": "POC Onboarding: Recent Errors", + "resource_technologies": [], + "script_filename": "OHK-4vwq70dg_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-4vwq70dg/OHK-4vwq70dg_script.py b/plugins/OHK-4vwq70dg/OHK-4vwq70dg_script.py new file mode 100644 index 00000000..e371bb7c --- /dev/null +++ b/plugins/OHK-4vwq70dg/OHK-4vwq70dg_script.py @@ -0,0 +1,298 @@ +""" +POC Onboarding: Recent Errors (MCP Tool Action plugin). + +Reads the tail of a CloudBolt log (application, jobengine, authentication, +mcp, saml2) and returns the WARNING-and-above entries of the last N minutes +grouped by exception and message, newest first, with secrets redacted and a +hint for the patterns a new appliance hits most (failed handler +verification, missing egress, proxy, SSL inspection, LDAP bind). The agent +calls it right after something failed in the UI, since the handler form +masks the real error but logs it. Read-only, synchronous. Admin only. + +Only the last 8 MB of the file are read, so the call stays fast on a busy +appliance. CloudBolt 2026.2+ writes one JSON object per line; older plain +text lines are parsed too. + +Every declared input is read from its rendered template token in +_read_inputs(); keep each one referenced that way or CloudBolt's token scan +deletes the input when the script is saved. +""" +import html +import json +import os +import re +from collections import OrderedDict +from datetime import datetime, timedelta + +from django.conf import settings + +LOG_FILES = { + "application": "application.log", + "jobengine": "jobengine.log", + "authentication": "authentication.log", + "mcp": "mcp.log", + "saml2": "saml2.log", +} +LEVEL_RANKS = {"DEBUG": 10, "INFO": 20, "WARNING": 30, "ERROR": 40, "CRITICAL": 50} +TAIL_BYTES = 8 * 1024 * 1024 +DEFAULT_MINUTES = 30 +MAX_MINUTES = 7 * 24 * 60 +DEFAULT_LIMIT = 50 +MAX_LIMIT = 200 +SAMPLE_CHARS = 1500 +TEXT_LINE_RE = re.compile(r"^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})[,.]\d+\s+\[?(\w+)\]?\s*(.*)$") + +REDACTIONS = [ + (re.compile(r"(?i)(password|passwd|secret|token|api[_-]?key|client_secret|authentication_key)(\W{0,3}[:=]\W{0,3})(\S+)"), r"\1\2[redacted]"), + (re.compile(r"(?i)bearer\s+[A-Za-z0-9._~+/=-]+"), "Bearer [redacted]"), + (re.compile(r"AKIA[0-9A-Z]{16}"), "AKIA[redacted]"), + (re.compile(r"(?i)(aws_secret_access_key\W{0,3}[:=]\W{0,3})\S+"), r"\1[redacted]"), +] + +HINTS = [ + (re.compile(r"Failed to validate connection", re.I), "A resource handler form failed Verify Connection; the exception under this line is the real cause. Fix the credentials or permissions, then run onb_verify_resource_handler."), + (re.compile(r"InvalidClientTokenId|SignatureDoesNotMatch|AuthFailure", re.I), "AWS rejected the access key or secret. Re-enter them on the handler's edit page."), + (re.compile(r"UnauthorizedOperation|AccessDenied(Exception)?", re.I), "The AWS credentials lack a permission. Compare the IAM policy with CloudBolt's minimum AWS permissions document."), + (re.compile(r"AADSTS7000215", re.I), "Azure says the client secret is invalid (expired or mistyped). Create a new secret on the app registration and re-enter it."), + (re.compile(r"AADSTS700016|AADSTS90002", re.I), "Azure cannot find the application or tenant: check the tenant id and client (application) id."), + (re.compile(r"AuthorizationFailed|does not have authorization to perform action", re.I), "The Azure service principal has no role on the subscription. Assign Reader plus the roles in CloudBolt's Azure permissions document."), + (re.compile(r"Cannot complete login due to an incorrect user name or password", re.I), "vCenter rejected the username or password. Use user@domain form and re-enter the password."), + (re.compile(r"CERTIFICATE_VERIFY_FAILED|certificate verify failed|SSLError", re.I), "TLS verification failed. Add the CA to Admin > SSL Certificates, or turn off SSL verification for a POC."), + (re.compile(r"Name or service not known|nodename nor servname|getaddrinfo failed", re.I), "DNS on the appliance cannot resolve the endpoint hostname."), + (re.compile(r"Connection refused|timed out|ConnectTimeout|EndpointConnectionError|Max retries exceeded", re.I), "The appliance cannot reach the endpoint on its port: check outbound firewall rules and the web proxy under Admin > Miscellaneous Settings."), + (re.compile(r"ProxyError|407 Proxy", re.I), "The outbound proxy refused the request; check the proxy host, port and credentials."), + (re.compile(r"content\.cloudbolt\.app", re.I), "Content Library access failed; the appliance needs HTTPS to content.cloudbolt.app, directly or through the proxy."), + (re.compile(r"INVALID_CREDENTIALS|ldap.*bind|SERVER_DOWN", re.I), "LDAP bind failed: check the service account DN and password, the port (389 or 636) and the protocol on the LDAP utility."), + (re.compile(r"is required for Azure windows servers|password_arm", re.I), "Azure Windows builds need the password_arm parameter on the order form or environment."), + (re.compile(r"vmware_datastore parameter must be specified", re.I), "Pin a vmware_datastore value on the vCenter environment."), + (re.compile(r"Memory and CPU are required", re.I), "The vCenter environment needs cpu_cnt and mem_size options."), + (re.compile(r"No (image|template|AMI).*(region|location)|not available in", re.I), "The OS build has no image in this environment's region or location; import one for that region."), +] + + +def _text(value): + return html.unescape(value or "").strip() + + +def _int(value, default, low, high): + text = _text(value) + if not text: + return default + try: + number = int(float(text)) + except ValueError: + return default + return max(low, min(high, number)) + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _read_inputs(): + raw = { + "onb_log": """{{ onb_log }}""", + "onb_minutes": """{{ onb_minutes }}""", + "onb_contains": """{{ onb_contains }}""", + "onb_limit": """{{ onb_limit }}""", + "onb_min_level": """{{ onb_min_level }}""", + } + return { + "log": (_text(raw["onb_log"]) or "application").lower(), + "minutes": _int(raw["onb_minutes"], DEFAULT_MINUTES, 0, MAX_MINUTES), + "contains": _text(raw["onb_contains"]).lower(), + "limit": _int(raw["onb_limit"], DEFAULT_LIMIT, 1, MAX_LIMIT), + "min_level": (_text(raw["onb_min_level"]) or "WARNING").upper(), + } + + +def _log_dir(): + return os.path.join(getattr(settings, "VARDIR", "/var/"), "log", "cloudbolt") + + +def _tail_lines(path): + size = os.path.getsize(path) + with open(path, "rb") as handle: + if size > TAIL_BYTES: + handle.seek(size - TAIL_BYTES) + data = handle.read() + data = data.split(b"\n", 1)[1] if b"\n" in data else b"" + else: + data = handle.read() + return data.decode("utf-8", errors="replace").splitlines(), size + + +def _parse(line): + """Return (time, level, logger, module, lineno, message, traceback) or None.""" + stripped = line.strip() + if not stripped: + return None + if stripped.startswith("{") and stripped.endswith("}"): + try: + entry = json.loads(stripped) + except ValueError: + return None + if not isinstance(entry, dict): + return None + when = _parse_time(entry.get("asctime")) + message = str(entry.get("message") or "") + traceback = entry.get("exc_info") or entry.get("exc_text") or entry.get("stack_info") or "" + return ( + when, + str(entry.get("levelname") or "").upper(), + str(entry.get("name") or ""), + str(entry.get("module") or ""), + entry.get("lineno"), + message, + str(traceback), + ) + match = TEXT_LINE_RE.match(stripped) + if match: + return (_parse_time(match.group(1)), match.group(2).upper(), "", "", None, match.group(3), "") + return None + + +def _parse_time(value): + if not value: + return None + try: + return datetime.strptime(str(value).split(",", 1)[0].split(".", 1)[0], "%Y-%m-%d %H:%M:%S") + except (ValueError, TypeError): + return None + + +def _redact(text): + count = 0 + for pattern, replacement in REDACTIONS: + text, n = pattern.subn(replacement, text) + count += n + return text, count + + +def _group_key(level, logger, message): + first = message.strip().splitlines()[0] if message.strip() else "" + normalized = re.sub(r"0x[0-9a-f]+|\b\d+\b|[A-Z]{2,4}-[a-z0-9]{8}", "#", first)[:120] + return "{}|{}|{}".format(level, logger, normalized) + + +def _hints_for(text): + hints = [] + for pattern, hint in HINTS: + if pattern.search(text) and hint not in hints: + hints.append(hint) + return hints + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + if not profile.is_cbadmin: + return _failure("Only CloudBolt admins may read appliance logs.") + + inputs = _read_inputs() + filename = LOG_FILES.get(inputs["log"]) + if not filename: + return _failure("Unknown log '{}'. Allowed: {}.".format(inputs["log"], ", ".join(LOG_FILES))) + if inputs["min_level"] not in LEVEL_RANKS: + return _failure("Unknown level '{}'. Allowed: {}.".format(inputs["min_level"], ", ".join(LEVEL_RANKS))) + path = os.path.join(_log_dir(), filename) + if not os.path.exists(path): + return _failure("Log file does not exist: {}".format(path)) + + try: + lines, size = _tail_lines(path) + except OSError as exc: + return _failure("Could not read {}: {}".format(path, exc)) + + # Log timestamps are naive appliance-local time, so compare with naive local now. + cutoff = datetime.now() - timedelta(minutes=inputs["minutes"]) if inputs["minutes"] else None + min_rank = LEVEL_RANKS[inputs["min_level"]] + groups = OrderedDict() + scanned = matched = redacted = 0 + last_entry = None + for line in lines: + parsed = _parse(line) + if parsed is None: + # Continuation of a traceback: attach to the previous matching entry. + if last_entry is not None and line.startswith((" ", "\t", "Traceback")): + last_entry["traceback"].append(line.rstrip()) + continue + scanned += 1 + when, level, logger, module, lineno, message, traceback = parsed + last_entry = None + rank = LEVEL_RANKS.get(level) + if rank is None or rank < min_rank: + continue + if cutoff is not None and (when is None or when < cutoff): + continue + if inputs["contains"] and inputs["contains"] not in (message + " " + traceback).lower(): + continue + matched += 1 + message, n1 = _redact(message) + traceback, n2 = _redact(traceback) + redacted += n1 + n2 + key = _group_key(level, logger, message) + group = groups.get(key) + if group is None: + group = groups[key] = { + "level": level, + "logger": logger or None, + "where": "{}:{}".format(module, lineno) if module else None, + "count": 0, + "firstSeen": when.isoformat() if when else None, + "lastSeen": None, + "sample": "", + "traceback": [], + } + group["count"] += 1 + group["lastSeen"] = when.isoformat() if when else group["lastSeen"] + group["sample"] = message[:SAMPLE_CHARS] + group["traceback"] = traceback.splitlines()[-25:] if traceback else group["traceback"] + last_entry = group + + rows = list(groups.values()) + rows.sort(key=lambda g: g["lastSeen"] or "", reverse=True) + rows = rows[: inputs["limit"]] + for row in rows: + row["traceback"] = row["traceback"][-25:] + row["hints"] = _hints_for(row["sample"] + "\n" + "\n".join(row["traceback"])) + + outputs = { + "log": inputs["log"], + "path": path, + "fileBytes": size, + "tailBytesRead": min(size, TAIL_BYTES), + "windowMinutes": inputs["minutes"], + "minLevel": inputs["min_level"], + "contains": inputs["contains"] or None, + "entriesScanned": scanned, + "entriesMatched": matched, + "secretsRedacted": redacted, + "groups": rows, + } + if matched == 0: + outputs["note"] = ( + "No entries matched. Widen onb_minutes, lower onb_min_level to INFO, or try onb_log=jobengine " + "for provisioning jobs and onb_log=authentication for logins." + ) + message = "{} matching entr{} in {} group(s) from {} (last {} minutes).".format( + matched, "y" if matched == 1 else "ies", len(rows), filename, inputs["minutes"] + ) + return _success(message, outputs) diff --git a/plugins/OHK-5885tete/OHK-5885tete_metadata.json b/plugins/OHK-5885tete/OHK-5885tete_metadata.json new file mode 100644 index 00000000..8a67de4a --- /dev/null +++ b/plugins/OHK-5885tete/OHK-5885tete_metadata.json @@ -0,0 +1,75 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "Item id from the POC test plan, or P1 to P12 for the prerequisites.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-z5tvygfh", + "label": "Test plan item (2.1.3) or prerequisite (P7)", + "name": "onb_item_id", + "placeholder": "2.1.3", + "relevant_osfamilies": [], + "required": true, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "Why the item is skipped or not applicable, or any note; the scorecard prints it.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-3snidlcl", + "label": "Reason (required for skipped/not_applicable)", + "name": "onb_item_note", + "placeholder": "Customer POC has no SMTP relay", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "done, skipped, not_applicable or pending.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-lhg78kcq", + "label": "Status (default done)", + "name": "onb_item_status", + "placeholder": "done", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_item_id", + "onb_item_status", + "onb_item_note" + ], + "description": "Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read.", + "id": "OHK-5885tete", + "max_retries": 0, + "name": "POC Onboarding: Set Item Status", + "resource_technologies": [], + "script_filename": "OHK-5885tete_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-5885tete/OHK-5885tete_script.py b/plugins/OHK-5885tete/OHK-5885tete_script.py new file mode 100644 index 00000000..66df7b78 --- /dev/null +++ b/plugins/OHK-5885tete/OHK-5885tete_script.py @@ -0,0 +1,220 @@ +""" +POC Onboarding: Set Item Status (MCP Tool Action plugin). + +Records the state of one POC test plan item or prerequisite: done, skipped, +not_applicable or pending, with a note saying why. A customer who cannot use +SMTP, LDAP, SSO, a branded portal, Terraform or Ansible in the POC records +the item as not applicable, and the scorecard reports it that way instead +of as a failure. The record lives in a namespaced CustomField on the +appliance (the same pattern the Content Package Manager uses), so it +survives client reconnects and is visible to onb_status. Synchronous. +Admin only. + +Every declared input is read from its rendered template token in +_read_inputs(); keep each one referenced that way or CloudBolt's token scan +deletes the input when the script is saved. +""" +import html +import json +import re +from datetime import datetime, timezone + +STATE_NAMESPACE = "poc_onboarding" +STATE_FIELD = "poc_onboarding_state" +STATUSES = ("pending", "done", "skipped", "not_applicable") +ITEM_RE = re.compile(r"^(P\d{1,2}|\d\.\d\.\d)$") + +# Test plan items and prerequisites, with the weight the scorecard applies. +KNOWN_ITEMS = { + "P1": ("CMP license key received and installed", None), + "P2": ("Appliance deployed, initial configuration done", None), + "P3": ("Up to two resource handlers, one or two environments each", None), + "P4": ("Custom Server deployed once in each environment", None), + "P5": ("Outbound 443 to content.cloudbolt.app", None), + "P6": ("Web proxy configured, if one is required", None), + "P7": ("SMTP configured", None), + "P8": ("DNS A record for the CloudBolt portal", None), + "P9": ("SSO application and SSO SME available", None), + "P10": ("AD/LDAP service account and group DN", None), + "P11": ("Ansible or Ansible Automation Platform prerequisites", None), + "P12": ("Terraform scripts in a git repository", None), + "1.1.1": ("Provision a standardized blueprint from the self-service catalog", 5), + "1.1.2": ("User-defined parameters during provisioning", 5), + "1.1.3": ("Post-provisioning automation from a catalog blueprint", 5), + "1.1.4": ("Hostname naming convention with preview", 5), + "1.2.1": ("One blueprint deploys to two clouds", 5), + "1.2.2": ("Cross-cloud tagging policy", 5), + "1.2.3": ("Unified visibility of servers across clouds", 5), + "2.1.1": ("LDAP or Active Directory authentication", 3), + "2.1.2": ("Group and role assignment from AD group membership", 3), + "2.1.3": ("SAML2 single sign-on", 2), + "2.2.1": ("Per-tenant branded portal", 3), + "2.3.1": ("Resource visibility constrained by group role", 4), + "2.3.2": ("Blueprint entitlement by group", 4), + "2.3.3": ("Environment entitlement by group", 4), + "2.3.4": ("Custom role", 3), + "2.4.1": ("Basic order approval", 3), + "2.4.2": ("Approval on a day-2 action", 3), + "2.5.1": ("Tagging policy from a parameter", 5), + "2.5.2": ("Group quota", 2), + "3.1.1": ("Power schedules", 5), + "3.1.2": ("Leases (expiration dates)", 5), + "3.1.3": ("Self-service decommission", 4), + "3.1.4": ("Onboard existing cloud resources", 5), + "3.2.1": ("Resize a VM", 4), + "3.2.2": ("Configuration update through Ansible", 0), + "3.2.3": ("Lifecycle actions (start, stop, reboot)", 3), + "4.1.1": ("Agentless", 5), + "4.1.2": ("Agentless in-guest script execution", 5), + "4.2.1": ("UI extension from the Content Library", 5), + "4.2.2": ("Recurring job on a custom schedule", 4), + "4.2.3": ("Rule-based automation", 3), + "4.2.4": ("Continuous infrastructure testing", 3), + "4.2.5": ("Inbound webhook", 4), + "4.2.6": ("Customizable notification templates", 0), + "4.3.1": ("Python generated options for a parameter", 5), + "4.3.2": ("PowerShell in-guest script as a build item", 4), + "4.3.3": ("Bash in-guest script as a build item", 4), + "4.3.4": ("Terraform-backed blueprint", 0), + "4.3.5": ("Ansible Automation Platform configuration", 0), +} + + +def _text(value): + return html.unescape(value or "").strip() + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _read_inputs(): + raw = { + "onb_item_id": """{{ onb_item_id }}""", + "onb_item_status": """{{ onb_item_status }}""", + "onb_item_note": """{{ onb_item_note }}""", + } + return { + "item": _text(raw["onb_item_id"]).upper(), + "status": _text(raw["onb_item_status"]).lower().replace("-", "_").replace(" ", "_"), + "note": _text(raw["onb_item_note"])[:1000], + } + + +def _state_field(create=False): + from infrastructure.models import CustomField, Namespace + + if not create: + return CustomField.objects.filter(name=STATE_FIELD).first() + namespace, _ = Namespace.objects.get_or_create(name=STATE_NAMESPACE) + field, _ = CustomField.objects.get_or_create( + name=STATE_FIELD, + defaults=dict( + label="POC Onboarding State", + description="State recorded by the POC onboarding MCP tools: item statuses, handler verify results, install details.", + type="TXT", + namespace=namespace, + ), + ) + return field + + +def _update_state(mutate): + from django.db import transaction + from infrastructure.models import CustomField + from orders.models import CustomFieldValue + + field = _state_field(create=True) + with transaction.atomic(): + list(CustomField.objects.select_for_update().filter(pk=field.pk)) + cfv = CustomFieldValue.objects.filter(field=field).order_by("id").first() + if cfv is None: + cfv = CustomFieldValue(field=field) + state = {} + else: + try: + state = json.loads(cfv.txt_value or "") + except ValueError: + state = {} + if not isinstance(state, dict): + state = {} + mutate(state) + cfv.value = json.dumps(state, indent=2) + cfv.save() + return state + + +def _summary(items): + counts = {status: 0 for status in STATUSES} + for entry in items.values(): + status = (entry or {}).get("status") + if status in counts: + counts[status] += 1 + return counts + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + if not profile.is_cbadmin: + return _failure("Only CloudBolt admins may record POC item statuses.") + + inputs = _read_inputs() + item = inputs["item"] + if not item: + return _failure("onb_item_id is required: a test plan item such as 2.1.3 or a prerequisite such as P7.") + if not ITEM_RE.match(item): + return _failure("'{}' is not a test plan item id (1.1.1 to 4.3.5) or a prerequisite (P1 to P12).".format(item)) + status = inputs["status"] or "done" + if status not in STATUSES: + return _failure("onb_item_status must be one of: {}.".format(", ".join(STATUSES))) + if status in ("skipped", "not_applicable") and not inputs["note"]: + return _failure("Give onb_item_note a short reason when an item is skipped or not applicable; the scorecard prints it.") + + title, weight = KNOWN_ITEMS.get(item, (None, None)) + when = datetime.now(timezone.utc).isoformat() + username = getattr(getattr(profile, "user", None), "username", None) + + def mutate(state): + items = state.setdefault("items", {}) + items[item] = { + "status": status, + "note": inputs["note"], + "title": title, + "weight": weight, + "updatedAt": when, + "updatedBy": username, + } + + state = _update_state(mutate) + items = state.get("items") or {} + outputs = { + "item": item, + "title": title, + "weight": weight, + "status": status, + "note": inputs["note"], + "recordedAt": when, + "items": items, + "summary": _summary(items), + } + if title is None: + outputs["note"] = "'{}' is not in the current test plan; it was recorded anyway.".format(item) + return _success("{} recorded as {}.".format(item, status), outputs) diff --git a/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_metadata.json b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_metadata.json new file mode 100644 index 00000000..60141e9b --- /dev/null +++ b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_metadata.json @@ -0,0 +1,13 @@ +{ + "action_inputs": [], + "action_inputs_sequence": [], + "description": "Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links.", + "id": "OHK-5zg1dkcr", + "max_retries": 0, + "name": "POC Onboarding: Status", + "resource_technologies": [], + "script_filename": "OHK-5zg1dkcr_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py new file mode 100644 index 00000000..1392776e --- /dev/null +++ b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py @@ -0,0 +1,497 @@ +""" +POC Onboarding: Status (MCP Tool Action plugin). + +Reports what the appliance has configured for a proof of concept in one +read: licence, portal URL, SMTP, proxy, Content Library reachability, the +Setup Wizard's derived step states, every resource handler with its +environments (OS builds, networks, groups, lifecycle parameters, last +verify result), the Custom Server blueprint, groups and users, LDAP and SSO, +which onboarding tools are installed and synchronous, the POC items the +agent has recorded as done or not applicable, and the next steps with the +UI link for each. Read-only, no inputs, synchronous. Admin only. + +The only network call is a HEAD against the Content Library host with a +five-second timeout; everything else is the ORM. +""" +import json +from datetime import date, datetime, timezone + +from django.conf import settings + +TOOLKIT_VERSION = "0.1.0" +STATE_NAMESPACE = "poc_onboarding" +STATE_FIELD = "poc_onboarding_state" +TOOLKIT_TOOLS = [ + "onb_status", + "onb_ui_link", + "onb_recent_errors", + "onb_failure_trace", + "onb_verify_resource_handler", + "onb_playbook", + "onb_install", + "onb_set_item_status", + "sync_from_source_control_repo", + "fetch_job_log", + "manage_blueprint_permissions", +] +ENV_PARAM_FLAGS = ["hostname_template", "expiration_date", "power_schedule"] +MAX_GROUPS = 25 + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _portal_url(): + try: + from portals.models import PortalConfig + + portal = PortalConfig.get_current_portal() + url = portal.site_url if portal else None + except Exception: + url = None + return (url or "").rstrip("/") + + +def _iso(value): + if isinstance(value, (datetime, date)): + return value.isoformat() + return value + + +def _load_state(): + try: + from infrastructure.models import CustomField + from orders.models import CustomFieldValue + + field = CustomField.objects.filter(name=STATE_FIELD).first() + if field is None: + return {} + cfv = CustomFieldValue.objects.filter(field=field).order_by("id").first() + if cfv is None: + return {} + data = json.loads(cfv.txt_value or "") + return data if isinstance(data, dict) else {} + except Exception: + return {} + + +def _appliance(base): + info = getattr(settings, "VERSION_INFO", {}) or {} + return { + "portalUrl": base or None, + "version": info.get("VERSION"), + "build": info.get("BUILD"), + "toolkitVersion": TOOLKIT_VERSION, + } + + +def _license(): + try: + from product_license.models import ProductLicense + except Exception: + return {"known": False} + try: + lic = ProductLicense.objects.order_by("-expiration_date", "-id").first() + except Exception as exc: + return {"known": False, "error": str(exc)[:200]} + if lic is None: + return {"known": True, "installed": False} + days_left = None + if lic.expiration_date: + days_left = (lic.expiration_date - date.today()).days + return { + "known": True, + "installed": True, + "company": lic.company, + "productType": getattr(lic, "product_type", None), + "licenseType": getattr(lic, "license_type", None), + "expirationDate": _iso(lic.expiration_date), + "daysLeft": days_left, + } + + +def _preferences(base): + from utilities.models import GlobalPreferences + + gp = GlobalPreferences.get() + smtp_host = (gp.smtp_host or "").strip() + return { + "smtp": { + "configured": bool(smtp_host), + "host": smtp_host or None, + "editUrl": base + "/admin/email_settings/edit/", + "testUrl": base + "/admin/email_test/", + }, + "proxy": { + "configured": gp.web_proxy_id is not None, + "editUrl": base + "/admin/edit_web_proxy/", + }, + } + + +def _content_library(): + try: + from utilities.cb_http import get_content_library_connection + from utilities.helpers import cb_request + except Exception as exc: + return {"reachable": None, "error": str(exc)[:200]} + try: + ci = get_content_library_connection("blueprints", raise_error=False) + except Exception as exc: + return {"reachable": None, "error": str(exc)[:200]} + if ci is None: + return {"reachable": None, "note": "No Content Library connection is defined on this appliance."} + url = "{}://{}:{}/".format(ci.protocol or "https", ci.ip, ci.port or 443) + try: + response = cb_request("HEAD", url, timeout=5) + return {"reachable": True, "url": url, "httpStatus": response.status_code} + except Exception as exc: + return { + "reachable": False, + "url": url, + "error": str(exc)[:300], + "hint": ( + "The appliance needs outbound HTTPS to content.cloudbolt.app. Configure the web " + "proxy under Admin > Miscellaneous Settings if one is required, or add the " + "inspecting CA under Admin > SSL Certificates." + ), + } + + +def _setup_wizard(base): + try: + from quick_setup.models import QuickSetup + except Exception: + return {"available": False} + try: + wizard = QuickSetup.get() + optional = {} + for key, _field in wizard.OPTIONAL_KEYS: + optional[key] = wizard.effective_status(key) + return { + "available": True, + "url": base + "/setup/", + "hasResourceHandler": bool(wizard.has_resource_handler), + "hasContentBlueprint": bool(wizard.has_content_blueprint), + "optional": optional, + } + except Exception as exc: + return {"available": False, "error": str(exc)[:200]} + + +def _environment_row(env, base): + try: + network_count = len(env.networks()) + except Exception: + network_count = None + flags = list(env.custom_fields.filter(name__in=ENV_PARAM_FLAGS).values_list("name", flat=True)) + return { + "id": env.global_id, + "pk": env.id, + "name": env.name, + "osBuilds": env.os_builds.count(), + "networks": network_count, + "groups": env.groups_served.count(), + "lifecycleParameters": sorted(flags), + "url": base + "/environments/{}/".format(env.id), + "parametersUrl": base + "/environments/{}/#tab-parameters".format(env.id), + } + + +def _handlers(base, state): + from resourcehandlers.models import ResourceHandler + + verify_state = state.get("handlers") or {} + rows = [] + for handler in ResourceHandler.objects.all().order_by("id"): + try: + handler = handler.cast() + except Exception: + pass + tech = handler.resource_technology + envs = [_environment_row(env, base) for env in handler.environment_set.all().order_by("id")] + rows.append( + { + "id": handler.global_id, + "pk": handler.id, + "name": handler.name, + "technology": tech.name if tech else None, + "technologySlug": tech.slug if tech else None, + "endpoint": handler.ip, + "environments": envs, + "lastVerify": (verify_state.get(handler.global_id) or {}).get("lastVerify"), + "url": base + "/admin/resourcehandlers/{}/".format(handler.id), + "verifyUrl": base + "/admin/resourcehandlers/{}/verify_connection/".format(handler.id), + "importLocationsUrl": base + "/admin/resourcehandlers/{}/import_locations/".format(handler.id), + } + ) + return rows + + +def _custom_server(base): + from orders.models import BlueprintOrderItem + from servicecatalog.models import ServiceBlueprint + + name = getattr(settings, "DEFAULT_NEW_SERVER_BLUEPRINT_NAME", "Custom Server") + blueprint = ServiceBlueprint.objects.filter(name=name).order_by("id").first() + if blueprint is None: + return { + "name": name, + "exists": False, + "restoreUrl": base + "/recreate_new_server/", + "hint": "The shipped Custom Server blueprint is missing; the restore URL recreates it.", + } + successful = ( + BlueprintOrderItem.objects.filter(blueprint=blueprint, order__status="SUCCESS") + .values("order") + .distinct() + .count() + ) + failed = ( + BlueprintOrderItem.objects.filter(blueprint=blueprint, order__status="FAILURE") + .values("order") + .distinct() + .count() + ) + try: + url = base + blueprint.get_absolute_url() + except Exception: + url = None + return { + "name": name, + "exists": True, + "id": blueprint.global_id, + "pk": blueprint.id, + "status": blueprint.status, + "isOrderable": bool(blueprint.is_orderable), + "anyGroupCanDeploy": bool(blueprint.any_group_can_deploy), + "successfulOrders": successful, + "failedOrders": failed, + "url": url, + } + + +def _groups_users(base): + from accounts.models import Group, UserProfile + + try: + groups_qs = Group.without_unassigned.all() + except AttributeError: + groups_qs = Group.objects.exclude(name="Unassigned") + groups = [ + {"id": g.global_id, "pk": g.id, "name": g.name, "url": base + "/groups/{}/".format(g.id)} + for g in groups_qs.order_by("name")[:MAX_GROUPS] + ] + total_groups = groups_qs.count() + users = UserProfile.objects.count() + admins = UserProfile.objects.filter(super_admin=True).count() + return { + "groups": groups, + "groupCount": total_groups, + "groupsUrl": base + "/groups/", + "userCount": users, + "superAdminCount": admins, + "usersUrl": base + "/users/", + "newUserUrl": base + "/users/create/", + } + + +def _auth(base): + from utilities.models import LDAPUtility + + ldap_rows = [] + for ldap in LDAPUtility.objects.all().order_by("id"): + ldap_rows.append( + { + "id": getattr(ldap, "global_id", None), + "pk": ldap.id, + "name": getattr(ldap, "name", None) or getattr(ldap, "ldap_domain", None), + "server": ldap.ip, + "port": ldap.port, + "protocol": ldap.protocol, + "url": base + "/admin/ldap_settings/{}/".format(ldap.id), + "verifyUrl": base + "/admin/ldap_settings/{}/verify_connection/".format(ldap.id), + } + ) + sso_count = None + try: + from authentication.sso.models import BaseSSOProvider + + sso_count = BaseSSOProvider.objects.count() + except Exception: + pass + return { + "ldapUtilities": ldap_rows, + "newLdapUrl": base + "/admin/ldap_settings/add/", + "ssoProviders": sso_count, + } + + +def _toolkit(base): + from cbhooks.models import MCPToolAction + + present = {} + for action in MCPToolAction.objects.filter(mcp_tool_name__in=TOOLKIT_TOOLS): + present[action.mcp_tool_name] = { + "id": action.global_id, + "enabled": bool(action.enabled), + "isSynchronous": bool(action.is_synchronous), + "editUrl": base + "/actions/mcp_tool_actions/{}/edit/".format(action.id), + } + missing = [name for name in TOOLKIT_TOOLS if name not in present] + return {"tools": present, "missing": missing, "listUrl": base + "/actions/mcp_tool_actions/"} + + +def _next_steps(report, base): + steps = [] + items = report["pocItems"] + + def skipped(item_id): + return (items.get(item_id) or {}).get("status") in ("skipped", "not_applicable", "done") + + if report["toolkit"]["missing"]: + steps.append( + { + "step": "Sync the missing onboarding tools, then run onb_install and reconnect the MCP client.", + "tools": report["toolkit"]["missing"], + "url": report["toolkit"]["listUrl"], + } + ) + handlers = report["resourceHandlers"] + if not handlers: + steps.append( + { + "step": "Create the first resource handler in the UI (credentials are entered there), then run onb_verify_resource_handler.", + "item": "P3", + "url": base + "/admin/resourcehandlers/add/", + } + ) + for handler in handlers: + verify = handler.get("lastVerify") or {} + if not verify.get("ok"): + steps.append( + { + "step": "Verify the connection of resource handler '{}' with onb_verify_resource_handler.".format( + handler["name"] + ), + "item": "P3", + "handler": handler["id"], + "url": handler["url"], + } + ) + if not handler["environments"]: + steps.append( + { + "step": "Import one or two environments for '{}' (Import locations on the handler page).".format( + handler["name"] + ), + "item": "P3", + "handler": handler["id"], + "url": handler["importLocationsUrl"], + } + ) + for env in handler["environments"]: + if env["osBuilds"] == 0: + steps.append( + { + "step": "Add an OS build with an image for environment '{}'.".format(env["name"]), + "item": "P4", + "environment": env["id"], + "url": handler["url"], + } + ) + if env["networks"] == 0: + steps.append( + { + "step": "Attach a network (sc_nic_0) to environment '{}'.".format(env["name"]), + "item": "P4", + "environment": env["id"], + "url": env["url"], + } + ) + custom = report["customServerBlueprint"] + if not custom.get("exists"): + steps.append({"step": "Restore the Custom Server blueprint.", "item": "P4", "url": custom.get("restoreUrl")}) + elif not custom.get("isOrderable") or custom.get("status") != "ACTIVE": + steps.append({"step": "Enable the Custom Server blueprint so it can be ordered.", "item": "P4", "url": custom.get("url")}) + elif handlers and any(h["environments"] for h in handlers) and custom.get("successfulOrders", 0) == 0: + steps.append( + { + "step": "Order the Custom Server blueprint through MCP: fetch_catalog_items, fetch_orderable_groups, fetch_blueprint_schema, order_catalog_item.", + "item": "P4", + "url": custom.get("url"), + } + ) + if report["groupsAndUsers"]["groupCount"] == 0: + steps.append({"step": "Create a POC group and a non-admin test user.", "item": "2.3.1", "url": base + "/groups/"}) + if not report["preferences"]["smtp"]["configured"] and not skipped("P7"): + steps.append( + { + "step": "Configure SMTP (needed for approval and completion emails), or record P7 as not applicable with onb_set_item_status.", + "item": "P7", + "url": report["preferences"]["smtp"]["editUrl"], + } + ) + if report["contentLibrary"].get("reachable") is False and not skipped("P5"): + steps.append( + { + "step": "Restore outbound access to the Content Library (proxy or SSL inspection), or record P5 as not applicable.", + "item": "P5", + "url": report["preferences"]["proxy"]["editUrl"], + } + ) + return steps[:10] + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + if not profile.is_cbadmin: + return _failure("Only CloudBolt admins may read the onboarding status.") + + base = _portal_url() + state = _load_state() + report = { + "generatedAt": datetime.now(timezone.utc).isoformat(), + "appliance": _appliance(base), + "license": _license(), + "preferences": _preferences(base), + "contentLibrary": _content_library(), + "setupWizard": _setup_wizard(base), + "resourceHandlers": _handlers(base, state), + "customServerBlueprint": _custom_server(base), + "groupsAndUsers": _groups_users(base), + "authentication": _auth(base), + "toolkit": _toolkit(base), + "pocItems": state.get("items") or {}, + "install": state.get("install"), + } + report["nextSteps"] = _next_steps(report, base) + if not base: + report["note"] = ( + "The default portal has no domain, so URLs are relative; prefix them with the appliance's https address." + ) + handler_count = len(report["resourceHandlers"]) + env_count = sum(len(h["environments"]) for h in report["resourceHandlers"]) + message = "{} resource handler(s), {} environment(s), {} next step(s).".format( + handler_count, env_count, len(report["nextSteps"]) + ) + return _success(message, report) diff --git a/plugins/OHK-j60flmb3/OHK-j60flmb3_metadata.json b/plugins/OHK-j60flmb3/OHK-j60flmb3_metadata.json new file mode 100644 index 00000000..69123b6c --- /dev/null +++ b/plugins/OHK-j60flmb3/OHK-j60flmb3_metadata.json @@ -0,0 +1,35 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "install applies the flags; status only reports.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-1gtvntvk", + "label": "Action: install (default) or status", + "name": "onb_action", + "placeholder": "install", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_action" + ], + "description": "Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version.", + "id": "OHK-j60flmb3", + "max_retries": 0, + "name": "POC Onboarding: Install", + "resource_technologies": [], + "script_filename": "OHK-j60flmb3_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py b/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py new file mode 100644 index 00000000..f3bff107 --- /dev/null +++ b/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py @@ -0,0 +1,258 @@ +""" +POC Onboarding: Install (MCP Tool Action plugin). + +Finishes the toolkit install after a Source Control Repos sync or a +Content Package import: turns Synchronous Action on for the tools that +answer inline (the importer leaves it off and the REST API refuses to set +it, CMPITK-1391), makes sure every tool is enabled, checks outbound access +to the Content Library and to GitHub (where the playbook text lives), and +records the toolkit version so onb_status can report it. Idempotent: run it +after every toolkit sync. Runs as a job (asynchronous) so it works before +any Synchronous flag is set. Admin only. + +Every declared input is read from its rendered template token in +_read_inputs(); keep each one referenced that way or CloudBolt's token scan +deletes the input when the script is saved. +""" +import html +import json +from datetime import datetime, timezone + +TOOLKIT_VERSION = "0.1.0" +STATE_NAMESPACE = "poc_onboarding" +STATE_FIELD = "poc_onboarding_state" + +# mcp_tool_name -> should answer inline (True) or run as a job (False). +TOOLS = { + "onb_status": True, + "onb_ui_link": True, + "onb_recent_errors": True, + "onb_failure_trace": True, + "onb_playbook": True, + "onb_set_item_status": True, + "onb_verify_resource_handler": False, + "onb_install": False, + # Reused testing tools that ship in the same package. + "sync_from_source_control_repo": True, + "fetch_job_log": True, + "manage_blueprint_permissions": True, +} +PLAYBOOK_URL = "https://raw.githubusercontent.com/mbomb67/cloudbolt-as-code/main/.claude/skills/cb-poc-onboarding/SKILL.md" + + +def _text(value): + return html.unescape(value or "").strip() + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _portal_url(): + try: + from portals.models import PortalConfig + + portal = PortalConfig.get_current_portal() + url = portal.site_url if portal else None + except Exception: + url = None + return (url or "").rstrip("/") + + +def _progress(job, message): + if job is None: + return + try: + from common.methods import set_progress + + set_progress(message) + except Exception: + pass + + +def _read_inputs(): + raw = {"onb_action": """{{ onb_action }}"""} + return {"action": (_text(raw["onb_action"]) or "install").lower()} + + +def _state_field(create=False): + from infrastructure.models import CustomField, Namespace + + if not create: + return CustomField.objects.filter(name=STATE_FIELD).first() + namespace, _ = Namespace.objects.get_or_create(name=STATE_NAMESPACE) + field, _ = CustomField.objects.get_or_create( + name=STATE_FIELD, + defaults=dict( + label="POC Onboarding State", + description="State recorded by the POC onboarding MCP tools: item statuses, handler verify results, install details.", + type="TXT", + namespace=namespace, + ), + ) + return field + + +def _update_state(mutate): + from django.db import transaction + from infrastructure.models import CustomField + from orders.models import CustomFieldValue + + field = _state_field(create=True) + with transaction.atomic(): + list(CustomField.objects.select_for_update().filter(pk=field.pk)) + cfv = CustomFieldValue.objects.filter(field=field).order_by("id").first() + if cfv is None: + cfv = CustomFieldValue(field=field) + state = {} + else: + try: + state = json.loads(cfv.txt_value or "") + except ValueError: + state = {} + if not isinstance(state, dict): + state = {} + mutate(state) + cfv.value = json.dumps(state, indent=2) + cfv.save() + return state + + +def _egress(): + checks = {} + try: + from utilities.helpers import cb_request + except Exception as exc: + return {"error": str(exc)[:200]} + try: + from utilities.cb_http import get_content_library_connection + + ci = get_content_library_connection("blueprints", raise_error=False) + if ci is None: + checks["contentLibrary"] = {"reachable": None, "note": "No Content Library connection is defined."} + else: + url = "{}://{}:{}/".format(ci.protocol or "https", ci.ip, ci.port or 443) + try: + response = cb_request("HEAD", url, timeout=8) + checks["contentLibrary"] = {"reachable": True, "url": url, "httpStatus": response.status_code} + except Exception as exc: + checks["contentLibrary"] = {"reachable": False, "url": url, "error": str(exc)[:300]} + except Exception as exc: + checks["contentLibrary"] = {"reachable": None, "error": str(exc)[:300]} + try: + response = cb_request("HEAD", PLAYBOOK_URL, timeout=8) + checks["playbook"] = {"reachable": response.status_code == 200, "url": PLAYBOOK_URL, "httpStatus": response.status_code} + except Exception as exc: + checks["playbook"] = {"reachable": False, "url": PLAYBOOK_URL, "error": str(exc)[:300]} + return checks + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + if not profile.is_cbadmin: + return _failure("Only CloudBolt admins may install the onboarding toolkit.") + + action = _read_inputs()["action"] + if action not in ("install", "status"): + return _failure("onb_action must be 'install' (default) or 'status'.") + + from cbhooks.models import MCPToolAction + + base = _portal_url() + present = {a.mcp_tool_name: a for a in MCPToolAction.objects.filter(mcp_tool_name__in=list(TOOLS))} + rows = {} + changed = [] + for name, wants_sync in TOOLS.items(): + tool = present.get(name) + if tool is None: + rows[name] = {"present": False} + continue + before = {"enabled": bool(tool.enabled), "isSynchronous": bool(tool.is_synchronous)} + if action == "install": + updates = [] + if bool(tool.is_synchronous) != wants_sync: + tool.is_synchronous = wants_sync + updates.append("isSynchronous={}".format(wants_sync)) + if not tool.enabled: + tool.enabled = True + updates.append("enabled=True") + if updates: + tool.save() + changed.append({"tool": name, "changes": updates}) + rows[name] = { + "present": True, + "id": tool.global_id, + "enabled": bool(tool.enabled), + "isSynchronous": bool(tool.is_synchronous), + "wantsSynchronous": wants_sync, + "before": before, + "editUrl": base + "/actions/mcp_tool_actions/{}/edit/".format(tool.id), + } + missing = [name for name, row in rows.items() if not row["present"]] + + _progress(job, "Checking outbound access to the Content Library and GitHub") + egress = _egress() + + outputs = { + "action": action, + "toolkitVersion": TOOLKIT_VERSION, + "tools": rows, + "missing": missing, + "changed": changed, + "egress": egress, + "mcpToolActionsUrl": base + "/actions/mcp_tool_actions/", + } + if action == "install": + try: + when = datetime.now(timezone.utc).isoformat() + + def mutate(state): + state["install"] = { + "toolkitVersion": TOOLKIT_VERSION, + "when": when, + "by": getattr(getattr(profile, "user", None), "username", None), + "missing": missing, + "egress": egress, + } + + _update_state(mutate) + except Exception as exc: + outputs["stateNote"] = "Could not record the install: {}".format(str(exc)[:200]) + notes = [] + if changed: + notes.append( + "Synchronous Action was changed on {} tool(s). Reconnect the MCP client now: tool lists and " + "behaviour are cached per session.".format(len(changed)) + ) + if missing: + notes.append( + "Missing tools: {}. Sync them from the repository (mcp_tool_actions folders) or import the " + "POC Onboarding Toolkit content package, then run onb_install again.".format(", ".join(missing)) + ) + if egress.get("playbook", {}).get("reachable") is False: + notes.append("GitHub is not reachable from the appliance, so onb_playbook will fail; read the skill from the repository instead.") + if egress.get("contentLibrary", {}).get("reachable") is False: + notes.append("The Content Library is not reachable; the extensibility phase will need the proxy or SSL settings fixed first.") + outputs["notes"] = notes + message = "Toolkit {}: {} present, {} missing, {} changed.".format( + TOOLKIT_VERSION, len(TOOLS) - len(missing), len(missing), len(changed) + ) + return _success(message, outputs) diff --git a/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_metadata.json b/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_metadata.json new file mode 100644 index 00000000..7ecd191b --- /dev/null +++ b/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_metadata.json @@ -0,0 +1,35 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "The handler to verify, by global id or name.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-7f2q5v3a", + "label": "Resource handler (RH- id or name)", + "name": "onb_handler", + "placeholder": "RH-abc12345", + "relevant_osfamilies": [], + "required": true, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_handler" + ], + "description": "Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool.", + "id": "OHK-s7cdvkpr", + "max_retries": 0, + "name": "POC Onboarding: Verify Resource Handler", + "resource_technologies": [], + "script_filename": "OHK-s7cdvkpr_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py b/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py new file mode 100644 index 00000000..d71a170b --- /dev/null +++ b/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py @@ -0,0 +1,303 @@ +""" +POC Onboarding: Verify Resource Handler (MCP Tool Action plugin). + +Calls the handler's own Verify Connection and returns the real exception +text, which the UI form replaces with "Unable to connect to handler with +the information provided." and the REST verify endpoint drops. Adds a +technology-specific hint for the error, the link to the minimum-permissions +document, and the links to the handler's edit and verify pages; records the +result so onb_status can show it. Runs as a job (asynchronous) because the +check calls the cloud API. Admin only. + +Every declared input is read from its rendered template token in +_read_inputs(); keep each one referenced that way or CloudBolt's token scan +deletes the input when the script is saved. +""" +import html +import json +import re +from datetime import datetime, timezone + +STATE_NAMESPACE = "poc_onboarding" +STATE_FIELD = "poc_onboarding_state" +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") + +PERMISSION_DOCS = { + "aws": "https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/aws/a/h2__2010883827", + "aws_govcloud": "https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/aws/a/h2__2010883827", + "aws_china": "https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/aws/a/h2__2010883827", + "azure_arm": "https://docs.cloudbolt.io/articles/cloudbolt-latest-docs/azure-resource-manager/a/h3_736726059", + "vmware": "https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/minimum-required-permissions-in-vcenter-vmware", +} +DEFAULT_DOC = "https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/resource-handlers" + +GENERIC_HINTS = [ + (re.compile(r"CERTIFICATE_VERIFY_FAILED|certificate verify failed|SSLError", re.I), "TLS verification failed. Add the endpoint's CA under Admin > SSL Certificates, or turn off SSL verification on the handler for the POC."), + (re.compile(r"Name or service not known|nodename nor servname|getaddrinfo failed", re.I), "The appliance cannot resolve the endpoint hostname in DNS."), + (re.compile(r"Connection refused|timed out|ConnectTimeout|EndpointConnectionError|Max retries exceeded|Network is unreachable", re.I), "The appliance cannot reach the endpoint on its port. Check outbound firewall rules (443 to the cloud endpoint) and the web proxy under Admin > Miscellaneous Settings."), + (re.compile(r"ProxyError|407 Proxy", re.I), "The outbound proxy refused the request; check its host, port and credentials."), +] +TECH_HINTS = { + "aws": [ + (re.compile(r"InvalidClientTokenId|SignatureDoesNotMatch|AuthFailure", re.I), "AWS rejected the access key id or secret access key. Re-enter both on the handler's edit page; a key copied with a trailing space fails the same way."), + (re.compile(r"UnauthorizedOperation|AccessDenied|not authorized", re.I), "The IAM identity lacks a permission CloudBolt needs (ec2:Describe* at least). Attach the policy from the minimum permissions document."), + (re.compile(r"ExpiredToken|RequestExpired", re.I), "The credentials or session token have expired; the appliance clock may also be wrong."), + (re.compile(r"AssumeRole|role_arn|sts", re.I), "The assume-role step failed; check the role ARN, its trust policy and the external id."), + ], + "azure_arm": [ + (re.compile(r"AADSTS7000215", re.I), "The client secret is invalid or expired. Create a new secret on the app registration (Certificates & secrets) and paste the secret value, not its id."), + (re.compile(r"AADSTS700016|AADSTS90002|was not found in the directory", re.I), "Entra cannot find the application or tenant: check the tenant id and the application (client) id."), + (re.compile(r"AuthorizationFailed|does not have authorization|SubscriptionNotFound", re.I), "The service principal has no role on the subscription, or the subscription id is wrong. Assign Reader plus the roles in the Azure permissions document."), + (re.compile(r"InvalidAuthenticationTokenTenant", re.I), "The token was issued by a different tenant than the one that owns the subscription."), + ], + "vmware": [ + (re.compile(r"Cannot complete login due to an incorrect user name or password|incorrect user name", re.I), "vCenter rejected the username or password. Use the user@domain form and re-enter the password."), + (re.compile(r"Permission to perform this operation was denied|NoPermission", re.I), "The vCenter role lacks a privilege CloudBolt needs; compare with the vCenter minimum permissions document."), + (re.compile(r"Connection refused|timed out", re.I), "Port 443 from the appliance to vCenter (and to every ESX host, for console and uploads) must be open."), + ], + "scvmm": [ + (re.compile(r"WinRM|5985|5986|Negotiate|Kerberos|NTLM", re.I), "CloudBolt talks to SCVMM over WinRM; check the port (5985 or 5986), the authentication type and that the account is an SCVMM administrator."), + ], + "gcp": [ + (re.compile(r"invalid_grant|Invalid JWT|private key", re.I), "The service account JSON is invalid or its key was revoked; download a fresh key file and re-upload it."), + (re.compile(r"PERMISSION_DENIED|403", re.I), "The service account lacks a role on the project (Compute Admin at least)."), + ], + "acropolis": [ + (re.compile(r"401|Unauthorized|AUTHENTICATION_REQUIRED", re.I), "Prism rejected the credentials; use a Prism Element or Central account with cluster admin rights."), + ], + "openstack": [ + (re.compile(r"Unauthorized|401|The request you have made requires authentication", re.I), "Keystone rejected the credentials; check the domain, project and user, and that the auth URL ends in /v3."), + ], +} + + +def _text(value): + return html.unescape(value or "").strip() + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _portal_url(): + try: + from portals.models import PortalConfig + + portal = PortalConfig.get_current_portal() + url = portal.site_url if portal else None + except Exception: + url = None + return (url or "").rstrip("/") + + +def _progress(job, message): + if job is None: + return + try: + from common.methods import set_progress + + set_progress(message) + except Exception: + pass + + +def _read_inputs(): + raw = {"onb_handler": """{{ onb_handler }}"""} + return {"handler": _text(raw["onb_handler"])} + + +def _state_field(create=False): + from infrastructure.models import CustomField, Namespace + + if not create: + return CustomField.objects.filter(name=STATE_FIELD).first() + namespace, _ = Namespace.objects.get_or_create(name=STATE_NAMESPACE) + field, _ = CustomField.objects.get_or_create( + name=STATE_FIELD, + defaults=dict( + label="POC Onboarding State", + description="State recorded by the POC onboarding MCP tools: item statuses, handler verify results, install details.", + type="TXT", + namespace=namespace, + ), + ) + return field + + +def _load_state(): + from orders.models import CustomFieldValue + + field = _state_field() + if field is None: + return {} + cfv = CustomFieldValue.objects.filter(field=field).order_by("id").first() + if cfv is None: + return {} + try: + data = json.loads(cfv.txt_value or "") + except ValueError: + return {} + return data if isinstance(data, dict) else {} + + +def _update_state(mutate): + from django.db import transaction + from infrastructure.models import CustomField + from orders.models import CustomFieldValue + + field = _state_field(create=True) + with transaction.atomic(): + list(CustomField.objects.select_for_update().filter(pk=field.pk)) + cfv = CustomFieldValue.objects.filter(field=field).order_by("id").first() + if cfv is None: + cfv = CustomFieldValue(field=field) + state = {} + else: + try: + state = json.loads(cfv.txt_value or "") + except ValueError: + state = {} + if not isinstance(state, dict): + state = {} + mutate(state) + cfv.value = json.dumps(state, indent=2) + cfv.save() + return state + + +def _resolve_handler(ref): + from resourcehandlers.models import ResourceHandler + + handler = None + if GLOBAL_ID_RE.match(ref): + handler = ResourceHandler.objects.filter(global_id=ref).first() + elif ref.isdigit(): + handler = ResourceHandler.objects.filter(id=int(ref)).first() + if handler is None: + matches = list(ResourceHandler.objects.filter(name__iexact=ref)) + if len(matches) > 1: + return None, "Several resource handlers are named '{}'; pass the RH- global id.".format(ref) + handler = matches[0] if matches else None + if handler is None: + available = ", ".join( + "{} ({})".format(h.global_id, h.name) for h in ResourceHandler.objects.all().order_by("id") + ) or "none" + return None, "No resource handler matches '{}'. Available: {}.".format(ref, available) + try: + handler = handler.cast() + except Exception: + pass + return handler, None + + +def _hints(slug, error_text): + hints = [] + family = "aws" if (slug or "").startswith("aws") else slug + for pattern, hint in TECH_HINTS.get(family, []) + GENERIC_HINTS: + if pattern.search(error_text) and hint not in hints: + hints.append(hint) + if not hints: + hints.append( + "The error text above is the cloud API's own message. Re-check the credentials on the edit page, " + "then the minimum permissions document, then outbound connectivity from the appliance." + ) + return hints + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + if not profile.is_cbadmin: + return _failure("Only CloudBolt admins may verify resource handlers.") + + ref = _read_inputs()["handler"] + if not ref: + return _failure("onb_handler is required: the handler's RH- global id or its name.") + handler, error = _resolve_handler(ref) + if error: + return _failure(error) + + base = _portal_url() + tech = handler.resource_technology + slug = tech.slug if tech else "" + links = { + "detail": base + "/admin/resourcehandlers/{}/".format(handler.id), + "edit": base + "/admin/resourcehandlers/{}/edit/".format(handler.id), + "verifyDialog": base + "/admin/resourcehandlers/{}/verify_connection/".format(handler.id), + "importLocations": base + "/admin/resourcehandlers/{}/import_locations/".format(handler.id), + "permissionsDoc": PERMISSION_DOCS.get(slug, DEFAULT_DOC), + } + outputs = { + "handler": { + "id": handler.global_id, + "pk": handler.id, + "name": handler.name, + "technology": tech.name if tech else None, + "technologySlug": slug or None, + "endpoint": handler.ip, + "environments": handler.environment_set.count(), + }, + "links": links, + } + + _progress(job, "Verifying connection of {} ({})".format(handler.name, tech.name if tech else "unknown technology")) + if not getattr(handler, "can_verify_connection", True): + outputs.update({"verified": None, "note": "This technology does not support Verify Connection."}) + return _success("{} does not support verification.".format(handler.name), outputs) + + when = datetime.now(timezone.utc).isoformat() + try: + handler.verify_connection() + result = {"ok": True, "when": when, "error": None} + outputs.update({"verified": True, "checkedAt": when}) + message = "Connection to '{}' verified.".format(handler.name) + outputs["next"] = ( + "Import one or two environments for this handler (Import locations on the handler page), " + "then add an OS build with an image for each environment." + ) + except Exception as exc: # the cloud wrapper raises its own exception types + error_text = "{}: {}".format(type(exc).__name__, str(exc))[:3000] + result = {"ok": False, "when": when, "error": error_text} + outputs.update( + { + "verified": False, + "checkedAt": when, + "error": error_text, + "hints": _hints(slug, error_text), + } + ) + message = "Connection to '{}' failed: {}".format(handler.name, error_text[:300]) + outputs["next"] = ( + "Give the user the edit link to fix credentials (never ask for the secret in chat), then run this tool again. " + "For appliance-side context call onb_recent_errors with onb_contains='{}'.".format(handler.name) + ) + + try: + def mutate(state): + handlers = state.setdefault("handlers", {}) + entry = handlers.setdefault(handler.global_id, {}) + entry["name"] = handler.name + entry["lastVerify"] = result + + _update_state(mutate) + except Exception as exc: + outputs["stateNote"] = "Could not record the result for onb_status: {}".format(str(exc)[:200]) + + return _success(message, outputs) diff --git a/plugins/OHK-y95w8ai0/OHK-y95w8ai0_metadata.json b/plugins/OHK-y95w8ai0/OHK-y95w8ai0_metadata.json new file mode 100644 index 00000000..2d98c534 --- /dev/null +++ b/plugins/OHK-y95w8ai0/OHK-y95w8ai0_metadata.json @@ -0,0 +1,35 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "The order or job to trace.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-hyi8pqno", + "label": "Order (ORD-) or job (JOB-) global id", + "name": "onb_target_id", + "placeholder": "ORD-abc12345", + "relevant_osfamilies": [], + "required": true, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_target_id" + ], + "description": "Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback.", + "id": "OHK-y95w8ai0", + "max_retries": 0, + "name": "POC Onboarding: Failure Trace", + "resource_technologies": [], + "script_filename": "OHK-y95w8ai0_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-y95w8ai0/OHK-y95w8ai0_script.py b/plugins/OHK-y95w8ai0/OHK-y95w8ai0_script.py new file mode 100644 index 00000000..0590b529 --- /dev/null +++ b/plugins/OHK-y95w8ai0/OHK-y95w8ai0_script.py @@ -0,0 +1,226 @@ +""" +POC Onboarding: Failure Trace (MCP Tool Action plugin). + +Given an order (ORD-) or job (JOB-) global id, returns every failed job +under it with its errors, output, the tail of its progress messages, its +failed children and a hint for the provisioning failures a new appliance +hits most (no image in the region, no subnet, missing key pair, Windows +password, datastore not pinned). The built-in fetch_order and fetch_job +tools stop at the top-level status; this tool walks down to the job that +actually failed and tells the agent which job id to pass to fetch_job_log +for the full traceback. Read-only, synchronous. Admin only. + +Every declared input is read from its rendered template token in +_read_inputs(); keep each one referenced that way or CloudBolt's token scan +deletes the input when the script is saved. +""" +import html +import re + +PROGRESS_TAIL = 15 +MAX_DEPTH = 6 +MAX_FAILED = 25 + +HINTS = [ + (re.compile(r"is required for Azure windows servers|password_arm", re.I), "Azure Windows builds need the password_arm parameter; add it to the environment or order form."), + (re.compile(r"vmware_datastore parameter must be specified", re.I), "Pin a vmware_datastore value on the vCenter environment's VMware Parameters tab."), + (re.compile(r"Memory and CPU are required", re.I), "The vCenter environment needs cpu_cnt and mem_size options."), + (re.compile(r"InvalidAMIID|image.*not found|No (image|template|AMI)|not available in (this )?(region|location)", re.I), "The OS build has no image for this environment's region or location; import one on the handler's images page and attach the OS build to the environment."), + (re.compile(r"subnet|sc_nic_0|No network", re.I), "No network or subnet is attached to the environment; add one on the environment's Networks tab (sc_nic_0)."), + (re.compile(r"InvalidKeyPair|key pair|key_name", re.I), "The key pair named in key_name does not exist in this region; pin an existing one on the environment."), + (re.compile(r"InsufficientInstanceCapacity|QuotaExceeded|exceeds quota|OperationNotAllowed.*quota", re.I), "The cloud account's quota or capacity blocked the build; pick a smaller size or another region."), + (re.compile(r"UnauthorizedOperation|AuthorizationFailed|AccessDenied|Permission to perform this operation was denied", re.I), "The handler's credentials lack a permission for this step; compare with CloudBolt's minimum permissions document for the technology."), + (re.compile(r"CERTIFICATE_VERIFY_FAILED|SSLError", re.I), "TLS verification failed; add the CA under Admin > SSL Certificates or disable verification for the POC."), + (re.compile(r"timed out|Connection refused|EndpointConnectionError|Max retries exceeded", re.I), "The appliance could not reach the endpoint; check firewall rules and the web proxy."), + (re.compile(r"TemplateSyntaxError|VariableDoesNotExist", re.I), "A plugin script has a template token outside a declared input (AGENTS.md cardinal rule 3)."), + (re.compile(r"ModuleNotFoundError|ImportError", re.I), "A plugin imports a module that is not on the appliance; check shared modules and installed packages."), + (re.compile(r"hostname.*(exists|in use|duplicate)|Duplicate hostname", re.I), "The generated hostname collides; adjust the hostname template or sequence."), + (re.compile(r"Remote script|WinRM|SSH.*(refused|timed out|authentication)", re.I), "Guest connectivity failed; check credentials on the OS build or server, and that port 22 or 5985/5986 is reachable from the appliance."), +] + + +def _text(value): + return html.unescape(value or "").strip() + + +def _failure(message): + return { + "status": "FAILURE", + "output_message": "", + "error_message": message, + "outputs": {"error": message}, + } + + +def _success(message, outputs): + return {"status": "SUCCESS", "output_message": message, "error_message": "", "outputs": outputs} + + +def _caller(job, kwargs): + profile = kwargs.get("profile") + if profile is None and job is not None: + profile = job.owner + return profile + + +def _portal_url(): + try: + from portals.models import PortalConfig + + portal = PortalConfig.get_current_portal() + url = portal.site_url if portal else None + except Exception: + url = None + return (url or "").rstrip("/") + + +def _read_inputs(): + raw = {"onb_target_id": """{{ onb_target_id }}"""} + return {"target": _text(raw["onb_target_id"])} + + +def _iso(value): + return value.isoformat() if value else None + + +def _hints_for(text): + hints = [] + for pattern, hint in HINTS: + if pattern.search(text) and hint not in hints: + hints.append(hint) + return hints + + +def _progress_tail(job): + from jobs.models import ProgressMessage + + rows = list(ProgressMessage.objects.filter(job=job).order_by("-id")[:PROGRESS_TAIL]) + rows.reverse() + return [ + {"time": _iso(row.date), "message": (row.message or "")[:500], "detail": (row.detailed_message or "")[:1500]} + for row in rows + ] + + +def _summary(job, base, with_progress=True): + text = "{}\n{}".format(job.errors or "", job.output or "") + row = { + "id": job.global_id, + "pk": job.id, + "type": job.type, + "label": job.label or "", + "status": job.status, + "startDate": _iso(job.start_date), + "endDate": _iso(job.end_date), + "errors": (job.errors or "")[:4000], + "output": (job.output or "")[:2000], + "url": base + "/jobs/{}/".format(job.id), + "hints": _hints_for(text), + } + if with_progress: + row["progressTail"] = _progress_tail(job) + return row + + +def _failed_descendants(job, base, depth=0, seen=None): + seen = seen if seen is not None else set() + rows = [] + if depth >= MAX_DEPTH: + return rows + for child in job.children_jobs.all().order_by("id"): + if child.id in seen: + continue + seen.add(child.id) + if child.status == "FAILURE": + rows.append(_summary(child, base, with_progress=False)) + rows.extend(_failed_descendants(child, base, depth + 1, seen)) + if len(rows) >= MAX_FAILED: + break + return rows[:MAX_FAILED] + + +def _trace_order(order, base): + try: + jobs = list(order.list_of_jobs(recursive=True) or []) + except TypeError: + jobs = list(order.list_of_jobs() or []) + failed = [_summary(j, base) for j in sorted(jobs, key=lambda j: j.id) if j.status == "FAILURE"][:MAX_FAILED] + outputs = { + "target": { + "id": order.global_id, + "pk": order.id, + "kind": "order", + "status": order.status, + "deniedReason": getattr(order, "denied_reason", None) or None, + "url": base + "/orders/{}/".format(order.id), + }, + "totalJobs": len(jobs), + "failedJobs": failed, + } + if order.status == "PENDING": + outputs["note"] = "The order is awaiting approval; approve it with approve_order (the caller must be an approver) and poll again." + elif order.status == "DENIED": + outputs["note"] = "The order was denied; see deniedReason." + elif order.status in ("ACTIVE", "RUNNING") and not failed: + outputs["note"] = "The order is still running; nothing has failed yet." + elif order.status == "SUCCESS" and not failed: + outputs["note"] = "The order succeeded and no job under it failed." + return outputs + + +def _trace_job(job, base): + outputs = { + "target": dict(_summary(job, base), kind="job"), + "failedJobs": _failed_descendants(job, base), + } + if job.status != "FAILURE" and not outputs["failedJobs"]: + outputs["note"] = "Neither this job nor any job under it has failed (status {}).".format(job.status) + return outputs + + +def run(job, *args, **kwargs): + profile = _caller(job, kwargs) + if profile is None: + return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") + if not profile.is_cbadmin: + return _failure("Only CloudBolt admins may read failure traces.") + + target = _read_inputs()["target"] + if not target: + return _failure("onb_target_id is required: an order id such as ORD-abc12345 or a job id such as JOB-abc12345.") + base = _portal_url() + prefix = target.split("-", 1)[0].upper() + + if prefix == "ORD": + from orders.models import Order + + order = Order.objects.filter(global_id=target).first() + if order is None: + return _failure("Order '{}' not found.".format(target)) + outputs = _trace_order(order, base) + elif prefix == "JOB": + from jobs.models import Job + + found = Job.objects.filter(global_id=target).first() + if found is None: + return _failure("Job '{}' not found.".format(target)) + outputs = _trace_job(found, base) + else: + return _failure("onb_target_id must start with ORD- or JOB-, got '{}'.".format(target)) + + failed_ids = [row["id"] for row in outputs["failedJobs"]] + if outputs["target"].get("kind") == "job" and outputs["target"].get("status") == "FAILURE": + failed_ids.insert(0, outputs["target"]["id"]) + all_hints = [] + for row in outputs["failedJobs"] + [outputs["target"]]: + for hint in row.get("hints") or []: + if hint not in all_hints: + all_hints.append(hint) + outputs["hints"] = all_hints + if failed_ids: + outputs["next"] = ( + "For the traceback, call fetch_job_log with log_job_id={} and log_file_tail=200; for appliance-wide " + "context call onb_recent_errors with onb_log=jobengine.".format(failed_ids[0]) + ) + message = "{}: {} failed job(s).".format(target, len(failed_ids)) + return _success(message, outputs) diff --git a/plugins/README.md b/plugins/README.md index b159f45c..afc6388b 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -103,6 +103,14 @@ Python and remote-script actions. Plugins that belong to a blueprint or action a | Node Size - Generate Options by Region, OS Image, Security, Networking and Storage (Azure SKU capabilities) | [OHK-kujhsds0](OHK-kujhsds0/README.md) | Generates node_size options filtered by live Azure SKU capabilities for the selected region, image, security, networking, and storage settings. | CloudBolt Plug-in | standalone | | OpenShift Project Landing Zone | [OHK-prew0osh](OHK-prew0osh/) | Creates an OpenShift project with quota, limits, network policies, and an optional role binding, then pins a CloudBolt environment to it. | CloudBolt Plug-in | [OpenShift Project Landing Zone](../blueprints/BP-tikkhf2y/README.md) | | Order Counts by Blueprint | [OHK-yjblxbwg](OHK-yjblxbwg/) | | CloudBolt Plug-in | [Order Counts by Blueprint](../mcp_tool_actions/MTA-lp8lgi7e/) | +| POC Onboarding: Failure Trace | [OHK-y95w8ai0](OHK-y95w8ai0/) | Walks an order or job down to the jobs that actually failed and returns their errors, output, progress tail, failed children and a hint for the common provisioning failures, naming the job id to pass to fetch_job_log for the traceback. | CloudBolt Plug-in | [POC Onboarding: Failure Trace](../mcp_tool_actions/MTA-jzscq0mk/README.md) | +| POC Onboarding: Install | [OHK-j60flmb3](OHK-j60flmb3/) | Finishes the toolkit install after a sync or package import: sets Synchronous Action on the inline tools, enables every tool, checks outbound access to the Content Library and GitHub, and records the toolkit version. | CloudBolt Plug-in | [POC Onboarding: Install](../mcp_tool_actions/MTA-6zxrhdls/README.md) | +| POC Onboarding: Playbook | [OHK-1am7i73s](OHK-1am7i73s/) | Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure. | CloudBolt Plug-in | [POC Onboarding: Playbook](../mcp_tool_actions/MTA-92b836jb/README.md) | +| POC Onboarding: Recent Errors | [OHK-4vwq70dg](OHK-4vwq70dg/) | Reads the tail of a CloudBolt log and returns the recent WARNING-and-above entries grouped by exception and message, secrets redacted, each group with a hint for the failures a new appliance hits most. | CloudBolt Plug-in | [POC Onboarding: Recent Errors](../mcp_tool_actions/MTA-hwg74btd/README.md) | +| POC Onboarding: Set Item Status | [OHK-5885tete](OHK-5885tete/) | Records a POC test plan item or prerequisite as done, skipped, not applicable or pending with a reason, in a namespaced CustomField store that onb_status and the scorecard read. | CloudBolt Plug-in | [POC Onboarding: Set Item Status](../mcp_tool_actions/MTA-p72v9y76/README.md) | +| POC Onboarding: Status | [OHK-5zg1dkcr](OHK-5zg1dkcr/) | Reports the appliance's POC readiness in one read: licence, portal, SMTP, proxy, Content Library, Setup Wizard, resource handlers with environments and last verify result, the Custom Server blueprint, groups, users, LDAP, SSO, installed onboarding tools, recorded POC items, and the next steps with UI links. | CloudBolt Plug-in | [POC Onboarding: Status](../mcp_tool_actions/MTA-1985b88g/README.md) | +| POC Onboarding: UI Link | [OHK-1gp25bmt](OHK-1gp25bmt/) | Turns a CloudBolt global id or a named admin page (new resource handler per technology, LDAP, SMTP, user edit, environment parameters, group quotas, and more) into an absolute UI link so the agent can send the user to the exact page where a secret is entered or an object is edited. | CloudBolt Plug-in | [POC Onboarding: UI Link](../mcp_tool_actions/MTA-zpohocjt/README.md) | +| POC Onboarding: Verify Resource Handler | [OHK-s7cdvkpr](OHK-s7cdvkpr/) | Runs a resource handler's Verify Connection and returns the real exception text with a technology-specific hint, the minimum-permissions document and the handler's edit and verify links, recording the result for the status tool. | CloudBolt Plug-in | [POC Onboarding: Verify Resource Handler](../mcp_tool_actions/MTA-r5v1eblg/README.md) | | Remove Resource Group from Environments | [OHK-vm5p34w3](OHK-vm5p34w3/) | Removes the deleted resource group's resource_group_arm option from environments on the same subscription. | CloudBolt Plug-in | [Azure Resource Group - Bicep](../blueprints/BP-p7zmh96m/README.md) | | Remove Servers from Ansible Automation Platform | [OHK-8v830go3](OHK-8v830go3/) | Removes the host records a deployment's servers hold in Ansible Automation Platform inventories through CloudBolt's own connector method, before the infrastructure is destroyed; a missing host or unreachable AAP is a warning, never a blocker. | CloudBolt Plug-in | standalone | | Request AWS EKS Namespace Quota Change | [OHK-arour20h](OHK-arour20h/) | Moves an EKS namespace landing zone to a different size tier after approval and mirrors the new quota into its environment. | CloudBolt Plug-in | [Request Namespace Quota Change](../resource_actions/RSA-mwegogck/) | From 46e082f733ae3ed46677e0a1ca073329768cd950 Mon Sep 17 00:00:00 2001 From: Mike Bombard <37379633+mbomb67@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:45:12 -0400 Subject: [PATCH 2/4] Let onb_playbook read the skill from a named branch or tag, and report an unpublished playbook as such A 404 from GitHub meant the skill was not yet on main, not that GitHub was unreachable; onb_install now says so and onb_playbook takes onb_ref. Co-Authored-By: Claude Fable 5.1 --- .../MTA-92b836jb/MTA-92b836jb_metadata.json | 19 +++++++++ mcp_tool_actions/MTA-92b836jb/README.md | 4 +- .../OHK-1am7i73s/OHK-1am7i73s_metadata.json | 22 +++++++++- plugins/OHK-1am7i73s/OHK-1am7i73s_script.py | 40 ++++++++++++++----- plugins/OHK-j60flmb3/OHK-j60flmb3_script.py | 8 +++- 5 files changed, 80 insertions(+), 13 deletions(-) diff --git a/mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json b/mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json index b5f38653..81daf05e 100644 --- a/mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json +++ b/mcp_tool_actions/MTA-92b836jb/MTA-92b836jb_metadata.json @@ -1,6 +1,25 @@ { "action_input_default_values": [], "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "Git branch or tag of cloudbolt-as-code to read the skill from; a release tag pins the playbook version.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-99exixzx", + "label": "Branch or tag (default main)", + "name": "onb_ref", + "placeholder": "main", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + }, { "allow-multiple": false, "available-all-servers": false, diff --git a/mcp_tool_actions/MTA-92b836jb/README.md b/mcp_tool_actions/MTA-92b836jb/README.md index 706fba03..d2a1d56e 100644 --- a/mcp_tool_actions/MTA-92b836jb/README.md +++ b/mcp_tool_actions/MTA-92b836jb/README.md @@ -13,11 +13,13 @@ Part of the POC Onboarding Toolkit ([packages/PKG-8aaadefz](../../packages/PKG-8 | Input | Type | Meaning | |---|---|---| | `onb_section` | string | index, bootstrap, resource-handlers, phases, troubleshooting or test-plan-map. | +| `onb_ref` | string | Git branch or tag of cloudbolt-as-code to read the skill from; a release tag pins the playbook version. | ## Output -text (Markdown), source, browserUrl, sections[]. +text (Markdown), source, browserUrl, ref, sections[]. ## Notes - Any authenticated caller; the text is public. - Synchronous: the result comes back inline. - Needs outbound HTTPS to raw.githubusercontent.com; onb_install checks it. +- Until the skill is on main, pass onb_ref with the branch that carries it. diff --git a/plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json b/plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json index dab88050..dcd43391 100644 --- a/plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json +++ b/plugins/OHK-1am7i73s/OHK-1am7i73s_metadata.json @@ -1,5 +1,24 @@ { "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "Git branch or tag of cloudbolt-as-code to read the skill from; a release tag pins the playbook version.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-99exixzx", + "label": "Branch or tag (default main)", + "name": "onb_ref", + "placeholder": "main", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + }, { "allow_multiple": false, "available_all_servers": false, @@ -21,7 +40,8 @@ } ], "action_inputs_sequence": [ - "onb_section" + "onb_section", + "onb_ref" ], "description": "Returns a section of the POC onboarding skill text from the public cloudbolt-as-code repository, so MCP clients without skill support follow the same procedure.", "id": "OHK-1am7i73s", diff --git a/plugins/OHK-1am7i73s/OHK-1am7i73s_script.py b/plugins/OHK-1am7i73s/OHK-1am7i73s_script.py index 054c40e6..27323e09 100644 --- a/plugins/OHK-1am7i73s/OHK-1am7i73s_script.py +++ b/plugins/OHK-1am7i73s/OHK-1am7i73s_script.py @@ -14,6 +14,7 @@ deletes the input when the script is saved. """ import html +import re PLAYBOOK_REPO = "mbomb67/cloudbolt-as-code" PLAYBOOK_REF = "main" @@ -54,17 +55,26 @@ def _caller(job, kwargs): return profile +REF_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$") + + def _read_inputs(): - raw = {"onb_section": """{{ onb_section }}"""} - return {"section": (_text(raw["onb_section"]) or "index").lower()} + raw = { + "onb_section": """{{ onb_section }}""", + "onb_ref": """{{ onb_ref }}""", + } + return { + "section": (_text(raw["onb_section"]) or "index").lower(), + "ref": _text(raw["onb_ref"]) or PLAYBOOK_REF, + } -def _url(path): - return "https://raw.githubusercontent.com/{}/{}/{}/{}".format(PLAYBOOK_REPO, PLAYBOOK_REF, PLAYBOOK_DIR, path) +def _url(path, ref): + return "https://raw.githubusercontent.com/{}/{}/{}/{}".format(PLAYBOOK_REPO, ref, PLAYBOOK_DIR, path) -def _browser_url(path): - return "https://github.com/{}/blob/{}/{}/{}".format(PLAYBOOK_REPO, PLAYBOOK_REF, PLAYBOOK_DIR, path) +def _browser_url(path, ref): + return "https://github.com/{}/blob/{}/{}/{}".format(PLAYBOOK_REPO, ref, PLAYBOOK_DIR, path) def run(job, *args, **kwargs): @@ -72,21 +82,25 @@ def run(job, *args, **kwargs): if profile is None: return _failure("No calling user profile was supplied. Run this tool through the MCP server as an authenticated user.") - section = _read_inputs()["section"] + inputs = _read_inputs() + section = inputs["section"] + ref = inputs["ref"] if section not in SECTIONS: return _failure( "Unknown section '{}'. Sections: {}.".format( section, "; ".join("{} ({})".format(k, v[1]) for k, v in SECTIONS.items()) ) ) + if not REF_RE.match(ref) or "/" in ref: + return _failure("onb_ref must be a branch or tag name without a slash, got '{}'.".format(ref)) path, meaning = SECTIONS[section] - url = _url(path) + url = _url(path, ref) outputs = { "section": section, "meaning": meaning, "source": url, - "browserUrl": _browser_url(path), - "ref": PLAYBOOK_REF, + "browserUrl": _browser_url(path, ref), + "ref": ref, "sections": [{"section": k, "meaning": v[1]} for k, v in SECTIONS.items()], } try: @@ -100,6 +114,12 @@ def run(job, *args, **kwargs): "Open browserUrl in a browser and paste the text, or clone the repository and read the file." ) return _failure("Could not fetch the playbook section '{}': {}".format(section, str(exc)[:300])) + if response.status_code == 404: + outputs["httpStatus"] = 404 + return _failure( + "The playbook section '{}' is not published on ref '{}' of {} (HTTP 404). Pass onb_ref with the branch " + "or tag that carries the skill, or read it from the repository.".format(section, ref, PLAYBOOK_REPO) + ) if response.status_code != 200: outputs["httpStatus"] = response.status_code return _failure("GitHub answered HTTP {} for {}.".format(response.status_code, url)) diff --git a/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py b/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py index f3bff107..66ab6a7b 100644 --- a/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py +++ b/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py @@ -157,7 +157,13 @@ def _egress(): checks["contentLibrary"] = {"reachable": None, "error": str(exc)[:300]} try: response = cb_request("HEAD", PLAYBOOK_URL, timeout=8) - checks["playbook"] = {"reachable": response.status_code == 200, "url": PLAYBOOK_URL, "httpStatus": response.status_code} + row = {"reachable": True, "url": PLAYBOOK_URL, "httpStatus": response.status_code} + if response.status_code == 404: + row["published"] = False + row["note"] = "GitHub is reachable but the skill is not published on the main branch yet; onb_playbook needs onb_ref until it is." + else: + row["published"] = response.status_code == 200 + checks["playbook"] = row except Exception as exc: checks["playbook"] = {"reachable": False, "url": PLAYBOOK_URL, "error": str(exc)[:300]} return checks From f0e1829e401ac69aed28ed357c1678b2986176a3 Mon Sep 17 00:00:00 2001 From: Mike Bombard <37379633+mbomb67@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:45:41 -0400 Subject: [PATCH 3/4] Point the verify tool's next step at the right fix for connectivity errors Co-Authored-By: Claude Fable 5.1 --- plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py b/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py index d71a170b..d41656e3 100644 --- a/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py +++ b/plugins/OHK-s7cdvkpr/OHK-s7cdvkpr_script.py @@ -285,8 +285,10 @@ def run(job, *args, **kwargs): ) message = "Connection to '{}' failed: {}".format(handler.name, error_text[:300]) outputs["next"] = ( - "Give the user the edit link to fix credentials (never ask for the secret in chat), then run this tool again. " - "For appliance-side context call onb_recent_errors with onb_contains='{}'.".format(handler.name) + "Explain the error and the first hint to the user. Credentials and permissions are fixed on links.edit " + "(never ask for the secret in chat); connectivity, DNS, proxy and TLS are fixed on the appliance or network " + "side. Then run this tool again. For appliance-side context call onb_recent_errors with " + "onb_contains='{}'.".format(handler.name) ) try: From c8fb49258932b5e839de23634884ab2d13a1d97f Mon Sep 17 00:00:00 2001 From: Mike Bombard <37379633+mbomb67@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:46:12 -0400 Subject: [PATCH 4/4] Name the failed verify error in the status tool's next step Co-Authored-By: Claude Fable 5.1 --- plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py index 1392776e..b29c676b 100644 --- a/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py +++ b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py @@ -385,7 +385,18 @@ def skipped(item_id): ) for handler in handlers: verify = handler.get("lastVerify") or {} - if not verify.get("ok"): + if verify and not verify.get("ok"): + steps.append( + { + "step": "Fix the connection of resource handler '{}': the last verify failed with '{}'. Re-run onb_verify_resource_handler afterwards.".format( + handler["name"], (verify.get("error") or "")[:160] + ), + "item": "P3", + "handler": handler["id"], + "url": handler["url"] + "edit/", + } + ) + elif not verify: steps.append( { "step": "Verify the connection of resource handler '{}' with onb_verify_resource_handler.".format(