From 2fd27940da733f2f3cd50468e9a93c55c0e57393 Mon Sep 17 00:00:00 2001 From: Mike Bombard <37379633+mbomb67@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:43:47 -0400 Subject: [PATCH 1/3] Add the environment tools of the POC Onboarding Toolkit (slice 2) onb_handler_locations lists regions, locations or clusters (and an AWS region's VPCs) with what is already imported; onb_import_environments creates environments the way the Import locations dialog does and brings subnets or cluster networks with them; onb_trim_environment pins and removes technology parameters so the Custom Server order form shows only the size, network and password a POC needs; onb_import_os_build imports an AMI, Azure image or vCenter template into an OS build that one blueprint can use across clouds; onb_configure_custom_server makes the shipped blueprint orderable with a hostname template; and onb_remove_environment undoes a wrong import. Package 0.2.0. Co-Authored-By: Claude Fable 5.1 --- CATALOG.md | 18 +- catalog.json | 190 +++++++++- .../MTA-0dr8xi4i/MTA-0dr8xi4i_metadata.json | 115 ++++++ mcp_tool_actions/MTA-0dr8xi4i/README.md | 27 ++ .../MTA-89dxppus/MTA-89dxppus_metadata.json | 58 +++ mcp_tool_actions/MTA-89dxppus/README.md | 24 ++ .../MTA-i1kmy5fd/MTA-i1kmy5fd_metadata.json | 77 ++++ mcp_tool_actions/MTA-i1kmy5fd/README.md | 24 ++ .../MTA-i6p4j2l7/MTA-i6p4j2l7_metadata.json | 77 ++++ mcp_tool_actions/MTA-i6p4j2l7/README.md | 26 ++ .../MTA-iyknuxox/MTA-iyknuxox_metadata.json | 115 ++++++ mcp_tool_actions/MTA-iyknuxox/README.md | 28 ++ .../MTA-pz5o2gjl/MTA-pz5o2gjl_metadata.json | 39 ++ mcp_tool_actions/MTA-pz5o2gjl/README.md | 23 ++ mcp_tool_actions/README.md | 6 + .../PKG-8aaadefz/PKG-8aaadefz_metadata.json | 10 +- packages/PKG-8aaadefz/README.md | 10 +- packages/README.md | 2 +- .../OHK-0nuhjdxl/OHK-0nuhjdxl_metadata.json | 55 +++ plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_script.py | 272 ++++++++++++++ plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py | 2 +- .../OHK-1wmzl7sp/OHK-1wmzl7sp_metadata.json | 35 ++ plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_script.py | 91 +++++ plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py | 6 + .../OHK-8j06wtoe/OHK-8j06wtoe_metadata.json | 75 ++++ plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py | 320 ++++++++++++++++ .../OHK-ilstyopk/OHK-ilstyopk_metadata.json | 75 ++++ plugins/OHK-ilstyopk/OHK-ilstyopk_script.py | 211 +++++++++++ plugins/OHK-j60flmb3/OHK-j60flmb3_script.py | 6 + .../OHK-k2p8ll4p/OHK-k2p8ll4p_metadata.json | 115 ++++++ plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py | 335 +++++++++++++++++ .../OHK-qn4k1pme/OHK-qn4k1pme_metadata.json | 115 ++++++ plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py | 344 ++++++++++++++++++ plugins/README.md | 6 + 34 files changed, 2921 insertions(+), 11 deletions(-) create mode 100644 mcp_tool_actions/MTA-0dr8xi4i/MTA-0dr8xi4i_metadata.json create mode 100644 mcp_tool_actions/MTA-0dr8xi4i/README.md create mode 100644 mcp_tool_actions/MTA-89dxppus/MTA-89dxppus_metadata.json create mode 100644 mcp_tool_actions/MTA-89dxppus/README.md create mode 100644 mcp_tool_actions/MTA-i1kmy5fd/MTA-i1kmy5fd_metadata.json create mode 100644 mcp_tool_actions/MTA-i1kmy5fd/README.md create mode 100644 mcp_tool_actions/MTA-i6p4j2l7/MTA-i6p4j2l7_metadata.json create mode 100644 mcp_tool_actions/MTA-i6p4j2l7/README.md create mode 100644 mcp_tool_actions/MTA-iyknuxox/MTA-iyknuxox_metadata.json create mode 100644 mcp_tool_actions/MTA-iyknuxox/README.md create mode 100644 mcp_tool_actions/MTA-pz5o2gjl/MTA-pz5o2gjl_metadata.json create mode 100644 mcp_tool_actions/MTA-pz5o2gjl/README.md create mode 100644 plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_metadata.json create mode 100644 plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_script.py create mode 100644 plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_metadata.json create mode 100644 plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_script.py create mode 100644 plugins/OHK-8j06wtoe/OHK-8j06wtoe_metadata.json create mode 100644 plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py create mode 100644 plugins/OHK-ilstyopk/OHK-ilstyopk_metadata.json create mode 100644 plugins/OHK-ilstyopk/OHK-ilstyopk_script.py create mode 100644 plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_metadata.json create mode 100644 plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py create mode 100644 plugins/OHK-qn4k1pme/OHK-qn4k1pme_metadata.json create mode 100644 plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py diff --git a/CATALOG.md b/CATALOG.md index c793edfb..62b799e9 100644 --- a/CATALOG.md +++ b/CATALOG.md @@ -12,8 +12,8 @@ Every piece of content in this repo, grouped by type. Names and descriptions com | [Orchestration actions](#orchestration-actions) | 21 | | [Recurring jobs](#recurring-jobs) | 5 | | [Webhooks](#webhooks) | 5 | -| [MCP tool actions](#mcp-tool-actions) | 17 | -| [Plugins](#plugins) | 156 | +| [MCP tool actions](#mcp-tool-actions) | 23 | +| [Plugins](#plugins) | 162 | | [Shared modules](#shared-modules) | 21 | | [UI extensions](#ui-extensions) | 11 | | [Parameters](#parameters) | 2 | @@ -30,7 +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) | +| 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 and location import, environment creation, order-form trimming, OS build import, Custom Server setup, the playbook text, the install step and POC item tracking, plus the repository sync, job log and blueprint permission tools they reuse. | 0.2.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), [POC Onboarding: Handler Locations](mcp_tool_actions/MTA-89dxppus/README.md) (MCP tool action), [POC Onboarding: Import Environments](mcp_tool_actions/MTA-i6p4j2l7/README.md) (MCP tool action), [POC Onboarding: Trim Environment Order Form](mcp_tool_actions/MTA-iyknuxox/README.md) (MCP tool action), [POC Onboarding: Import OS Build](mcp_tool_actions/MTA-0dr8xi4i/README.md) (MCP tool action), [POC Onboarding: Configure Custom Server](mcp_tool_actions/MTA-i1kmy5fd/README.md) (MCP tool action), [POC Onboarding: Remove Environment](mcp_tool_actions/MTA-pz5o2gjl/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) | @@ -186,12 +186,18 @@ 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: Configure Custom Server | [MTA-i1kmy5fd](mcp_tool_actions/MTA-i1kmy5fd/README.md) | Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments. | `onb_configure_custom_server` | yes | [POC Onboarding: Configure Custom Server](plugins/OHK-ilstyopk/) | | 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: Handler Locations | [MTA-89dxppus](mcp_tool_actions/MTA-89dxppus/README.md) | Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs. | `onb_handler_locations` | yes | [POC Onboarding: Handler Locations](plugins/OHK-0nuhjdxl/) | +| POC Onboarding: Import Environments | [MTA-i6p4j2l7](mcp_tool_actions/MTA-i6p4j2l7/README.md) | Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them. | `onb_import_environments` | yes | [POC Onboarding: Import Environments](plugins/OHK-8j06wtoe/) | +| POC Onboarding: Import OS Build | [MTA-0dr8xi4i](mcp_tool_actions/MTA-0dr8xi4i/README.md) | Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments. | `onb_import_os_build` | yes | [POC Onboarding: Import OS Build](plugins/OHK-k2p8ll4p/) | | 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: Remove Environment | [MTA-pz5o2gjl](mcp_tool_actions/MTA-pz5o2gjl/README.md) | Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it. | `onb_remove_environment` | yes | [POC Onboarding: Remove Environment](plugins/OHK-1wmzl7sp/) | | 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: Trim Environment Order Form | [MTA-iyknuxox](mcp_tool_actions/MTA-iyknuxox/README.md) | Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form. | `onb_trim_environment` | yes | [POC Onboarding: Trim Environment Order Form](plugins/OHK-qn4k1pme/) | | 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/) | @@ -303,12 +309,18 @@ 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: Configure Custom Server | [OHK-ilstyopk](plugins/OHK-ilstyopk/) | Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments. | CloudBolt Plug-in | [POC Onboarding: Configure Custom Server](mcp_tool_actions/MTA-i1kmy5fd/README.md) | | 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: Handler Locations | [OHK-0nuhjdxl](plugins/OHK-0nuhjdxl/) | Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs. | CloudBolt Plug-in | [POC Onboarding: Handler Locations](mcp_tool_actions/MTA-89dxppus/README.md) | +| POC Onboarding: Import Environments | [OHK-8j06wtoe](plugins/OHK-8j06wtoe/) | Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them. | CloudBolt Plug-in | [POC Onboarding: Import Environments](mcp_tool_actions/MTA-i6p4j2l7/README.md) | +| POC Onboarding: Import OS Build | [OHK-k2p8ll4p](plugins/OHK-k2p8ll4p/) | Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments. | CloudBolt Plug-in | [POC Onboarding: Import OS Build](mcp_tool_actions/MTA-0dr8xi4i/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: Remove Environment | [OHK-1wmzl7sp](plugins/OHK-1wmzl7sp/) | Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it. | CloudBolt Plug-in | [POC Onboarding: Remove Environment](mcp_tool_actions/MTA-pz5o2gjl/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: Trim Environment Order Form | [OHK-qn4k1pme](plugins/OHK-qn4k1pme/) | Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form. | CloudBolt Plug-in | [POC Onboarding: Trim Environment Order Form](mcp_tool_actions/MTA-iyknuxox/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) | diff --git a/catalog.json b/catalog.json index 0fdb7863..ccec0d8e 100644 --- a/catalog.json +++ b/catalog.json @@ -875,6 +875,23 @@ "blueprints/BP-b0qm83lh" ] }, + { + "id": "MTA-0dr8xi4i", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Import OS Build", + "description": "Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments.", + "path": "mcp_tool_actions/MTA-0dr8xi4i", + "readme": "mcp_tool_actions/MTA-0dr8xi4i/README.md", + "uses": [ + "plugins/OHK-k2p8ll4p" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_import_os_build", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "MTA-1985b88g", "type": "mcp_tool_actions", @@ -926,6 +943,23 @@ "packages/PKG-8aaadefz" ] }, + { + "id": "MTA-89dxppus", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Handler Locations", + "description": "Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs.", + "path": "mcp_tool_actions/MTA-89dxppus", + "readme": "mcp_tool_actions/MTA-89dxppus/README.md", + "uses": [ + "plugins/OHK-0nuhjdxl" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_handler_locations", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "MTA-8j9c0tb0", "type": "mcp_tool_actions", @@ -1019,6 +1053,57 @@ "packages/PKG-8aaadefz" ] }, + { + "id": "MTA-i1kmy5fd", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Configure Custom Server", + "description": "Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments.", + "path": "mcp_tool_actions/MTA-i1kmy5fd", + "readme": "mcp_tool_actions/MTA-i1kmy5fd/README.md", + "uses": [ + "plugins/OHK-ilstyopk" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_configure_custom_server", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, + { + "id": "MTA-i6p4j2l7", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Import Environments", + "description": "Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them.", + "path": "mcp_tool_actions/MTA-i6p4j2l7", + "readme": "mcp_tool_actions/MTA-i6p4j2l7/README.md", + "uses": [ + "plugins/OHK-8j06wtoe" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_import_environments", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, + { + "id": "MTA-iyknuxox", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Trim Environment Order Form", + "description": "Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form.", + "path": "mcp_tool_actions/MTA-iyknuxox", + "readme": "mcp_tool_actions/MTA-iyknuxox/README.md", + "uses": [ + "plugins/OHK-qn4k1pme" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_trim_environment", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "MTA-js655cf3", "type": "mcp_tool_actions", @@ -1098,6 +1183,23 @@ "packages/PKG-8aaadefz" ] }, + { + "id": "MTA-pz5o2gjl", + "type": "mcp_tool_actions", + "name": "POC Onboarding: Remove Environment", + "description": "Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it.", + "path": "mcp_tool_actions/MTA-pz5o2gjl", + "readme": "mcp_tool_actions/MTA-pz5o2gjl/README.md", + "uses": [ + "plugins/OHK-1wmzl7sp" + ], + "used_by": [], + "enabled": true, + "mcp_tool_name": "onb_remove_environment", + "packages": [ + "packages/PKG-8aaadefz" + ] + }, { "id": "MTA-r5v1eblg", "type": "mcp_tool_actions", @@ -1498,12 +1600,12 @@ "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.", + "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 and location import, environment creation, order-form trimming, OS build import, Custom Server setup, 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", + "version": "0.2.0", "contents": [ "mcp_tool_actions/MTA-6zxrhdls", "mcp_tool_actions/MTA-1985b88g", @@ -1513,6 +1615,12 @@ "mcp_tool_actions/MTA-r5v1eblg", "mcp_tool_actions/MTA-92b836jb", "mcp_tool_actions/MTA-p72v9y76", + "mcp_tool_actions/MTA-89dxppus", + "mcp_tool_actions/MTA-i6p4j2l7", + "mcp_tool_actions/MTA-iyknuxox", + "mcp_tool_actions/MTA-0dr8xi4i", + "mcp_tool_actions/MTA-i1kmy5fd", + "mcp_tool_actions/MTA-pz5o2gjl", "mcp_tool_actions/MTA-543b19sa", "mcp_tool_actions/MTA-8j9c0tb0", "mcp_tool_actions/MTA-ntmcnvv7" @@ -1659,6 +1767,19 @@ "packages/PKG-v20qv308" ] }, + { + "id": "OHK-0nuhjdxl", + "type": "plugins", + "name": "POC Onboarding: Handler Locations", + "description": "Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs.", + "path": "plugins/OHK-0nuhjdxl", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-89dxppus" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-0ql0870k", "type": "plugins", @@ -1740,6 +1861,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-1wmzl7sp", + "type": "plugins", + "name": "POC Onboarding: Remove Environment", + "description": "Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it.", + "path": "plugins/OHK-1wmzl7sp", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-pz5o2gjl" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-29uent0x", "type": "plugins", @@ -2185,6 +2319,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-8j06wtoe", + "type": "plugins", + "name": "POC Onboarding: Import Environments", + "description": "Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them.", + "path": "plugins/OHK-8j06wtoe", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-i6p4j2l7" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-8px9e3ws", "type": "plugins", @@ -2906,6 +3053,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-ilstyopk", + "type": "plugins", + "name": "POC Onboarding: Configure Custom Server", + "description": "Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments.", + "path": "plugins/OHK-ilstyopk", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-i1kmy5fd" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-iub9a2jg", "type": "plugins", @@ -2962,6 +3122,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-k2p8ll4p", + "type": "plugins", + "name": "POC Onboarding: Import OS Build", + "description": "Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments.", + "path": "plugins/OHK-k2p8ll4p", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-0dr8xi4i" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-kdne1t5s", "type": "plugins", @@ -3374,6 +3547,19 @@ ], "plugin_type": "CloudBolt Plug-in" }, + { + "id": "OHK-qn4k1pme", + "type": "plugins", + "name": "POC Onboarding: Trim Environment Order Form", + "description": "Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form.", + "path": "plugins/OHK-qn4k1pme", + "readme": null, + "uses": [], + "used_by": [ + "mcp_tool_actions/MTA-iyknuxox" + ], + "plugin_type": "CloudBolt Plug-in" + }, { "id": "OHK-r1imfgdx", "type": "plugins", diff --git a/mcp_tool_actions/MTA-0dr8xi4i/MTA-0dr8xi4i_metadata.json b/mcp_tool_actions/MTA-0dr8xi4i/MTA-0dr8xi4i_metadata.json new file mode 100644 index 00000000..e530607b --- /dev/null +++ b/mcp_tool_actions/MTA-0dr8xi4i/MTA-0dr8xi4i_metadata.json @@ -0,0 +1,115 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "ENV- ids or names, one per line; default every environment of the handler.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-1v0brxec", + "label": "Environments to attach (optional)", + "name": "onb_environments", + "placeholder": "ENV-abc12345", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "TXT", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "The handler, 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 + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "AWS AMI id or exact name; Azure template name or publisher:offer:sku[:version]; vCenter template name.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-fdogpsml", + "label": "Image: AMI id/name, Azure urn, template name", + "name": "onb_image", + "placeholder": "ami-0123456789abcdef0", + "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": "Name of the OS build to create or reuse.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-9ra5g3on", + "label": "OS build name (reused when it exists)", + "name": "onb_os_build_name", + "placeholder": "Ubuntu 22.04", + "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": "Region or location of the image when it cannot be read from the environments.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-khdtrqfs", + "label": "AWS region to list VPCs for (optional)", + "name": "onb_region", + "placeholder": "us-east-1", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-k2p8ll4p" + }, + "enabled": true, + "id": "MTA-0dr8xi4i", + "is_synchronous": false, + "label": "POC Onboarding: Import OS Build", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": true, + "mcp_read_only_hint": false, + "mcp_tool_description": "Import one image into an OS build and attach the build to the handler's environments, as the handler's images page does. onb_image is an AMI id or exact AMI name (AWS), a template name or publisher:offer:sku[:version] (Azure; the images must be cached, run Sync Images on the handler page if none are), or a template name (vCenter; cached by the 'Fetch and Cache available VMWare template' recurring job). An existing OS build with onb_os_build_name is reused, so call it once per handler with the same name and one blueprint deploys to both clouds. onb_environments limits the attachment (default: every environment of the handler); onb_region names the image's region or location when it cannot be read from the environments. Runs as a job: poll the returned id with fetch_job. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_import_os_build", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-0dr8xi4i/README.md b/mcp_tool_actions/MTA-0dr8xi4i/README.md new file mode 100644 index 00000000..cf815b42 --- /dev/null +++ b/mcp_tool_actions/MTA-0dr8xi4i/README.md @@ -0,0 +1,27 @@ +# POC Onboarding: Import OS Build + +MCP Tool Action published to agents as `custom_onb_import_os_build`. Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments. +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-0dr8xi4i | POC Onboarding: Import OS Build | +| Plugin | [OHK-k2p8ll4p](../../plugins/OHK-k2p8ll4p/) | POC Onboarding: Import OS Build | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_handler` | string, required | The handler, by global id or name. | +| `onb_image` | string, required | AWS AMI id or exact name; Azure template name or publisher:offer:sku[:version]; vCenter template name. | +| `onb_os_build_name` | string, required | Name of the OS build to create or reuse. | +| `onb_environments` | text | ENV- ids or names, one per line; default every environment of the handler. | +| `onb_region` | string | Region or location of the image when it cannot be read from the environments. | + +## Output +osBuild (id, name, osFamily, reused, url), image, location, attachedToEnvironments[], 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 lookup calls the cloud API. diff --git a/mcp_tool_actions/MTA-89dxppus/MTA-89dxppus_metadata.json b/mcp_tool_actions/MTA-89dxppus/MTA-89dxppus_metadata.json new file mode 100644 index 00000000..4ce31cc8 --- /dev/null +++ b/mcp_tool_actions/MTA-89dxppus/MTA-89dxppus_metadata.json @@ -0,0 +1,58 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "The handler, 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 + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "AWS only: also list the VPCs of this region, with the default VPC flagged.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-khdtrqfs", + "label": "AWS region to list VPCs for (optional)", + "name": "onb_region", + "placeholder": "us-east-1", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-0nuhjdxl" + }, + "enabled": true, + "id": "MTA-89dxppus", + "is_synchronous": false, + "label": "POC Onboarding: Handler Locations", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": true, + "mcp_read_only_hint": true, + "mcp_tool_description": "List what a resource handler can turn into environments: AWS regions (pass onb_region to also list that region's VPCs), Azure locations, vCenter, SCVMM or Nutanix clusters, GCP projects, OpenStack locations. Each entry says whether an environment already exists for it, and the handler's existing environments are listed with their location. Call it after the handler is verified, before onb_import_environments, and let the user pick one or two locations. Runs as a job: poll the returned id with fetch_job and read outputs. Read-only on the appliance; requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_handler_locations", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-89dxppus/README.md b/mcp_tool_actions/MTA-89dxppus/README.md new file mode 100644 index 00000000..430ce93f --- /dev/null +++ b/mcp_tool_actions/MTA-89dxppus/README.md @@ -0,0 +1,24 @@ +# POC Onboarding: Handler Locations + +MCP Tool Action published to agents as `custom_onb_handler_locations`. Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs. +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-89dxppus | POC Onboarding: Handler Locations | +| Plugin | [OHK-0nuhjdxl](../../plugins/OHK-0nuhjdxl/) | POC Onboarding: Handler Locations | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_handler` | string, required | The handler, by global id or name. | +| `onb_region` | string | AWS only: also list the VPCs of this region, with the default VPC flagged. | + +## Output +locationKind, locations[] (name, display, imported), existingEnvironments[], vpcs[] for an AWS region, subscriptions[] for a tenant-level Azure handler, 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 listing calls the cloud API. diff --git a/mcp_tool_actions/MTA-i1kmy5fd/MTA-i1kmy5fd_metadata.json b/mcp_tool_actions/MTA-i1kmy5fd/MTA-i1kmy5fd_metadata.json new file mode 100644 index 00000000..6aa09a7e --- /dev/null +++ b/mcp_tool_actions/MTA-i1kmy5fd/MTA-i1kmy5fd_metadata.json @@ -0,0 +1,77 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "true enables every environment on the server tier; false leaves the tier's environment setting unchanged.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-kgf5l0uv", + "label": "Enable all environments (true/false, default true)", + "name": "onb_all_environments", + "placeholder": "true", + "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": "ENV- ids or names, one per line, that receive the hostname template; left empty the template goes on the server tier.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-1v0brxec", + "label": "Environments to attach (optional)", + "name": "onb_environments", + "placeholder": "ENV-abc12345", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "TXT", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "CloudBolt hostname template, for example poc-# or a template using group and OS build names; see the hostname specification documentation.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-4ciiaerz", + "label": "Hostname template (optional)", + "name": "onb_hostname_template", + "placeholder": "poc-#", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-ilstyopk" + }, + "enabled": true, + "id": "MTA-i1kmy5fd", + "is_synchronous": true, + "label": "POC Onboarding: Configure Custom Server", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": false, + "mcp_tool_description": "Make the shipped Custom Server blueprint orderable for the POC: recreate it from the shipped definition when it is missing, set it ACTIVE and orderable, enable every environment on its server tier (onb_all_environments=false leaves the tier as it is), and set onb_hostname_template on the server tier, or on each environment in onb_environments when given, so the order form previews the generated hostname (test plan 1.1.4). Group entitlement is manage_blueprint_permissions. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_configure_custom_server", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-i1kmy5fd/README.md b/mcp_tool_actions/MTA-i1kmy5fd/README.md new file mode 100644 index 00000000..83c87bc2 --- /dev/null +++ b/mcp_tool_actions/MTA-i1kmy5fd/README.md @@ -0,0 +1,24 @@ +# POC Onboarding: Configure Custom Server + +MCP Tool Action published to agents as `custom_onb_configure_custom_server`. Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments. +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-i1kmy5fd | POC Onboarding: Configure Custom Server | +| Plugin | [OHK-ilstyopk](../../plugins/OHK-ilstyopk/) | POC Onboarding: Configure Custom Server | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_environments` | text | ENV- ids or names, one per line, that receive the hostname template; left empty the template goes on the server tier. | +| `onb_hostname_template` | string | CloudBolt hostname template, for example poc-# or a template using group and OS build names; see the hostname specification documentation. | +| `onb_all_environments` | string | true enables every environment on the server tier; false leaves the tier's environment setting unchanged. | + +## Output +blueprint (id, status, isOrderable, anyGroupCanDeploy, url), serverTiers[], environments[], changes[], 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-i6p4j2l7/MTA-i6p4j2l7_metadata.json b/mcp_tool_actions/MTA-i6p4j2l7/MTA-i6p4j2l7_metadata.json new file mode 100644 index 00000000..03af3c29 --- /dev/null +++ b/mcp_tool_actions/MTA-i6p4j2l7/MTA-i6p4j2l7_metadata.json @@ -0,0 +1,77 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "Prefix for the new environments' names; left empty, CloudBolt's default '(handler) location' name is used.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-sbchc1bq", + "label": "Environment name prefix (optional)", + "name": "onb_env_name", + "placeholder": "POC", + "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": "The handler, 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 + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "One location per line: AWS or |; Azure location name; vCenter, SCVMM or Nutanix cluster name; GCP project id.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-piv7p0wi", + "label": "Locations, one per line", + "name": "onb_locations", + "placeholder": "us-east-1|vpc-0123456789abcdef0\neastus", + "relevant-osfamilies": [], + "required": true, + "show-as-attribute": false, + "show-on-servers": false, + "type": "TXT", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-8j06wtoe" + }, + "enabled": true, + "id": "MTA-i6p4j2l7", + "is_synchronous": false, + "label": "POC Onboarding: Import Environments", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": true, + "mcp_read_only_hint": false, + "mcp_tool_description": "Create one environment per location on a resource handler, exactly as the handler page's Import locations dialog does: one AWS region plus VPC (pass for the region's default VPC or |), one Azure location, one vCenter, SCVMM or Nutanix cluster, one GCP project. Networks come with it: AWS subnets are imported with the environment, Azure subnets are synced, vCenter networks of the cluster are attached to NIC 1. A location that already has an environment is reported as existing. At most four locations per call; a POC needs one or two per handler. Echo the locations to the user and confirm before calling. Runs as a job: poll the returned id with fetch_job. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_import_environments", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-i6p4j2l7/README.md b/mcp_tool_actions/MTA-i6p4j2l7/README.md new file mode 100644 index 00000000..78d43bc5 --- /dev/null +++ b/mcp_tool_actions/MTA-i6p4j2l7/README.md @@ -0,0 +1,26 @@ +# POC Onboarding: Import Environments + +MCP Tool Action published to agents as `custom_onb_import_environments`. Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them. +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-i6p4j2l7 | POC Onboarding: Import Environments | +| Plugin | [OHK-8j06wtoe](../../plugins/OHK-8j06wtoe/) | POC Onboarding: Import Environments | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_handler` | string, required | The handler, by global id or name. | +| `onb_locations` | text, required | One location per line: AWS or |; Azure location name; vCenter, SCVMM or Nutanix cluster name; GCP project id. | +| `onb_env_name` | string | Prefix for the new environments' names; left empty, CloudBolt's default '(handler) location' name is used. | + +## Output +results[] per location: status created, existing or failed; environmentId, name, networks, osBuilds, url, parametersUrl, and for Azure the subnet counts; 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`. +- Azure imports the environment's parameters in its own job after creation; wait a minute before trimming. +- Asynchronous by design: the import calls the cloud API. diff --git a/mcp_tool_actions/MTA-iyknuxox/MTA-iyknuxox_metadata.json b/mcp_tool_actions/MTA-iyknuxox/MTA-iyknuxox_metadata.json new file mode 100644 index 00000000..25e4179b --- /dev/null +++ b/mcp_tool_actions/MTA-iyknuxox/MTA-iyknuxox_metadata.json @@ -0,0 +1,115 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "The environment, by global id or name.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-y593kq80", + "label": "Environment (ENV- id or name)", + "name": "onb_environment", + "placeholder": "ENV-abc12345", + "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": "Field names the profile must not pin or remove.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-9gki8t0i", + "label": "Fields to leave visible (optional)", + "name": "onb_keep", + "placeholder": "sc_nic_0", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "TXT", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "Fields to pin to a given value; the value must be one of the field's options, or a new value for text fields.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-vptyklqu", + "label": "Pins, one field=value per line (optional)", + "name": "onb_pin", + "placeholder": "key_name=poc-keypair\nresource_group_arm=poc-rg", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "TXT", + "value-pattern-string": null + }, + { + "allow-multiple": false, + "available-all-servers": false, + "description": "poc_minimal applies the per-technology trim; report only lists the current order form.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-5zq7thsv", + "label": "Profile: poc_minimal (default) or report", + "name": "onb_profile", + "placeholder": "poc_minimal", + "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": "Field names to remove from the environment in addition to the profile's list.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-jm4m69kl", + "label": "Extra fields to remove (optional)", + "name": "onb_remove", + "placeholder": "create_public_ip", + "relevant-osfamilies": [], + "required": false, + "show-as-attribute": false, + "show-on-servers": false, + "type": "TXT", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-qn4k1pme" + }, + "enabled": true, + "id": "MTA-iyknuxox", + "is_synchronous": true, + "label": "POC Onboarding: Trim Environment Order Form", + "last_updated": null, + "mcp_destructive_hint": false, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": false, + "mcp_tool_description": "Shorten an environment's order form to what a POC user needs. CloudBolt hides a required parameter that has exactly one option, so the poc_minimal profile pins infrastructure choices to one value (AWS key pair, security group, EBS type; Azure resource group, storage type, public IP; vCenter datastore, disk type; the subnet) and removes the optional technology parameters a POC never touches, leaving the size (and on Azure the Windows password) visible. onb_profile=report changes nothing and lists every parameter with whether it shows on the form. onb_keep names fields to leave visible, onb_pin lines field=value choose the pinned value, onb_remove names extra fields to remove. Pinned fields are protected from the handler's sync jobs. Echo the plan to the user and confirm before calling. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_trim_environment", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-iyknuxox/README.md b/mcp_tool_actions/MTA-iyknuxox/README.md new file mode 100644 index 00000000..de6f7937 --- /dev/null +++ b/mcp_tool_actions/MTA-iyknuxox/README.md @@ -0,0 +1,28 @@ +# POC Onboarding: Trim Environment Order Form + +MCP Tool Action published to agents as `custom_onb_trim_environment`. Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form. +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-iyknuxox | POC Onboarding: Trim Environment Order Form | +| Plugin | [OHK-qn4k1pme](../../plugins/OHK-qn4k1pme/) | POC Onboarding: Trim Environment Order Form | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_environment` | string, required | The environment, by global id or name. | +| `onb_profile` | string | poc_minimal applies the per-technology trim; report only lists the current order form. | +| `onb_pin` | text | Fields to pin to a given value; the value must be one of the field's options, or a new value for text fields. | +| `onb_keep` | text | Field names the profile must not pin or remove. | +| `onb_remove` | text | Field names to remove from the environment in addition to the profile's list. | + +## Output +before[] and after[] (every parameter with options, required, hiddenOnOrderForm), actions[] (pinned, removed, left with reason), protectedFromSync[], visibleNow[], next. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Synchronous: the result comes back inline. +- Handler-level fields cannot be removed from one environment; they are pinned instead. +- On Azure node_size, availability_set_arm and azure_authentication_type never hide. diff --git a/mcp_tool_actions/MTA-pz5o2gjl/MTA-pz5o2gjl_metadata.json b/mcp_tool_actions/MTA-pz5o2gjl/MTA-pz5o2gjl_metadata.json new file mode 100644 index 00000000..f938eaf5 --- /dev/null +++ b/mcp_tool_actions/MTA-pz5o2gjl/MTA-pz5o2gjl_metadata.json @@ -0,0 +1,39 @@ +{ + "action_input_default_values": [], + "action_inputs": [ + { + "allow-multiple": false, + "available-all-servers": false, + "description": "The environment, by global id or name.", + "field-dependency-controlling-set": [], + "field-dependency-dependent-set": [], + "global-options": [], + "hide-if-default-value": true, + "id": "CF-y593kq80", + "label": "Environment (ENV- id or name)", + "name": "onb_environment", + "placeholder": "ENV-abc12345", + "relevant-osfamilies": [], + "required": true, + "show-as-attribute": false, + "show-on-servers": false, + "type": "STR", + "value-pattern-string": null + } + ], + "dependencies": { + "hook": "plugins/OHK-1wmzl7sp" + }, + "enabled": true, + "id": "MTA-pz5o2gjl", + "is_synchronous": true, + "label": "POC Onboarding: Remove Environment", + "last_updated": null, + "mcp_destructive_hint": true, + "mcp_idempotent_hint": true, + "mcp_open_world_hint": false, + "mcp_read_only_hint": false, + "mcp_tool_description": "Delete an environment that was imported by mistake (wrong region, wrong cluster, a duplicate). Refuses while any active server lives in it. Echo the environment's name and id to the user and get explicit confirmation before calling: this cannot be undone. Requires a CloudBolt admin caller.", + "mcp_tool_name": "onb_remove_environment", + "mcp_tool_title": "" +} diff --git a/mcp_tool_actions/MTA-pz5o2gjl/README.md b/mcp_tool_actions/MTA-pz5o2gjl/README.md new file mode 100644 index 00000000..395709fc --- /dev/null +++ b/mcp_tool_actions/MTA-pz5o2gjl/README.md @@ -0,0 +1,23 @@ +# POC Onboarding: Remove Environment + +MCP Tool Action published to agents as `custom_onb_remove_environment`. Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it. +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-pz5o2gjl | POC Onboarding: Remove Environment | +| Plugin | [OHK-1wmzl7sp](../../plugins/OHK-1wmzl7sp/) | POC Onboarding: Remove Environment | + +## Inputs +| Input | Type | Meaning | +|---|---|---| +| `onb_environment` | string, required | The environment, by global id or name. | + +## Output +environmentId, name, handler, osBuildsDetached, groupsDetached. + +## Notes +- Admin only: the plugin refuses callers who are not CloudBolt admins. +- Synchronous: the result comes back inline. +- Destructive; the skill confirms with the user first. diff --git a/mcp_tool_actions/README.md b/mcp_tool_actions/README.md index d4fd00d5..85d79dd8 100644 --- a/mcp_tool_actions/README.md +++ b/mcp_tool_actions/README.md @@ -10,12 +10,18 @@ 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: Configure Custom Server | [MTA-i1kmy5fd](MTA-i1kmy5fd/README.md) | Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments. | `onb_configure_custom_server` | yes | [POC Onboarding: Configure Custom Server](../plugins/OHK-ilstyopk/) | | 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: Handler Locations | [MTA-89dxppus](MTA-89dxppus/README.md) | Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs. | `onb_handler_locations` | yes | [POC Onboarding: Handler Locations](../plugins/OHK-0nuhjdxl/) | +| POC Onboarding: Import Environments | [MTA-i6p4j2l7](MTA-i6p4j2l7/README.md) | Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them. | `onb_import_environments` | yes | [POC Onboarding: Import Environments](../plugins/OHK-8j06wtoe/) | +| POC Onboarding: Import OS Build | [MTA-0dr8xi4i](MTA-0dr8xi4i/README.md) | Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments. | `onb_import_os_build` | yes | [POC Onboarding: Import OS Build](../plugins/OHK-k2p8ll4p/) | | 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: Remove Environment | [MTA-pz5o2gjl](MTA-pz5o2gjl/README.md) | Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it. | `onb_remove_environment` | yes | [POC Onboarding: Remove Environment](../plugins/OHK-1wmzl7sp/) | | 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: Trim Environment Order Form | [MTA-iyknuxox](MTA-iyknuxox/README.md) | Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form. | `onb_trim_environment` | yes | [POC Onboarding: Trim Environment Order Form](../plugins/OHK-qn4k1pme/) | | 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/) | diff --git a/packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json b/packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json index f502658a..462f3362 100644 --- a/packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json +++ b/packages/PKG-8aaadefz/PKG-8aaadefz_metadata.json @@ -8,15 +8,21 @@ "mcp_tool_actions/MTA-r5v1eblg", "mcp_tool_actions/MTA-92b836jb", "mcp_tool_actions/MTA-p72v9y76", + "mcp_tool_actions/MTA-89dxppus", + "mcp_tool_actions/MTA-i6p4j2l7", + "mcp_tool_actions/MTA-iyknuxox", + "mcp_tool_actions/MTA-0dr8xi4i", + "mcp_tool_actions/MTA-i1kmy5fd", + "mcp_tool_actions/MTA-pz5o2gjl", "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.", + "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 and location import, environment creation, order-form trimming, OS build import, Custom Server setup, 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" + "version": "0.2.0" } diff --git a/packages/PKG-8aaadefz/README.md b/packages/PKG-8aaadefz/README.md index cd7d2f54..d16eb252 100644 --- a/packages/PKG-8aaadefz/README.md +++ b/packages/PKG-8aaadefz/README.md @@ -1,8 +1,8 @@ # 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. +Installs the MCP tools the POC onboarding skill drives: appliance status with next steps, admin UI links, log and failure diagnosis, resource handler verification and location import, environment creation, order-form trimming, OS build import, Custom Server setup, 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). +Content package `PKG-8aaadefz`, version 0.2.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 | |---|---|---| @@ -14,6 +14,12 @@ Content package `PKG-8aaadefz`, version 0.1.0. Sync it from the Content Packages | 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 | POC Onboarding: Handler Locations | [mcp_tool_actions/MTA-89dxppus](../../mcp_tool_actions/MTA-89dxppus/) | +| MCP tool action | POC Onboarding: Import Environments | [mcp_tool_actions/MTA-i6p4j2l7](../../mcp_tool_actions/MTA-i6p4j2l7/) | +| MCP tool action | POC Onboarding: Trim Environment Order Form | [mcp_tool_actions/MTA-iyknuxox](../../mcp_tool_actions/MTA-iyknuxox/) | +| MCP tool action | POC Onboarding: Import OS Build | [mcp_tool_actions/MTA-0dr8xi4i](../../mcp_tool_actions/MTA-0dr8xi4i/) | +| MCP tool action | POC Onboarding: Configure Custom Server | [mcp_tool_actions/MTA-i1kmy5fd](../../mcp_tool_actions/MTA-i1kmy5fd/) | +| MCP tool action | POC Onboarding: Remove Environment | [mcp_tool_actions/MTA-pz5o2gjl](../../mcp_tool_actions/MTA-pz5o2gjl/) | | 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 21cfee5f..df0f23ff 100644 --- a/packages/README.md +++ b/packages/README.md @@ -9,6 +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) | +| 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 and location import, environment creation, order-form trimming, OS build import, Custom Server setup, the playbook text, the install step and POC item tracking, plus the repository sync, job log and blueprint permission tools they reuse. | 0.2.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), [POC Onboarding: Handler Locations](../mcp_tool_actions/MTA-89dxppus/README.md) (MCP tool action), [POC Onboarding: Import Environments](../mcp_tool_actions/MTA-i6p4j2l7/README.md) (MCP tool action), [POC Onboarding: Trim Environment Order Form](../mcp_tool_actions/MTA-iyknuxox/README.md) (MCP tool action), [POC Onboarding: Import OS Build](../mcp_tool_actions/MTA-0dr8xi4i/README.md) (MCP tool action), [POC Onboarding: Configure Custom Server](../mcp_tool_actions/MTA-i1kmy5fd/README.md) (MCP tool action), [POC Onboarding: Remove Environment](../mcp_tool_actions/MTA-pz5o2gjl/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-0nuhjdxl/OHK-0nuhjdxl_metadata.json b/plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_metadata.json new file mode 100644 index 00000000..401a2d92 --- /dev/null +++ b/plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_metadata.json @@ -0,0 +1,55 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "The handler, 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 + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "AWS only: also list the VPCs of this region, with the default VPC flagged.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-khdtrqfs", + "label": "AWS region to list VPCs for (optional)", + "name": "onb_region", + "placeholder": "us-east-1", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_handler", + "onb_region" + ], + "description": "Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs.", + "id": "OHK-0nuhjdxl", + "max_retries": 0, + "name": "POC Onboarding: Handler Locations", + "resource_technologies": [], + "script_filename": "OHK-0nuhjdxl_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_script.py b/plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_script.py new file mode 100644 index 00000000..c3d622bf --- /dev/null +++ b/plugins/OHK-0nuhjdxl/OHK-0nuhjdxl_script.py @@ -0,0 +1,272 @@ +""" +POC Onboarding: Handler Locations (MCP Tool Action plugin). + +Lists what a resource handler can turn into environments: AWS regions (and +the VPCs of one region when onb_region is given), Azure locations, vCenter +or SCVMM or Nutanix clusters, GCP projects, OpenStack locations. Each entry +says whether an environment already exists for it, and the existing +environments are listed, so the agent can offer the user one or two +locations and then call onb_import_environments. Runs as a job because it +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 re + +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") +SPECIAL_FIELD = { + "aws": "aws_region", + "aws_govcloud": "aws_region", + "aws_china": "aws_region", + "azure_arm": "node_location", + "vmware": "vmware_cluster", + "scvmm": "scvmm_host_cluster", + "gcp": "gcp_project", + "acropolis": "node_location", + "openstack": "node_location", +} +MAX_VPCS = 50 + + +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 }}""", + "onb_region": """{{ onb_region }}""", + } + return {"handler": _text(raw["onb_handler"]), "region": _text(raw["onb_region"])} + + +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 _env_location(env, field): + if not field: + return None + try: + value = env.get_cfv(field) + except Exception: + return None + return str(value) if value is not None else None + + +def _existing_environments(handler, slug, base): + field = SPECIAL_FIELD.get(slug) + rows = [] + for env in handler.environment_set.all().order_by("id"): + row = { + "id": env.global_id, + "name": env.name, + "location": _env_location(env, field), + "url": base + "/environments/{}/".format(env.id), + } + if slug.startswith("aws"): + row["vpc"] = _env_location(env, "vpc_id") + rows.append(row) + return rows + + +def _name_of(item): + if isinstance(item, dict): + return item.get("name") or item.get("ClusterName") or item.get("id") or str(item) + return str(item) + + +def _display_of(item): + if isinstance(item, dict): + return item.get("display") or item.get("display_name") or item.get("displayName") or item.get("ClusterName") or item.get("name") + return str(item) + + +def _rows(total, not_in_cb): + pending = {_name_of(x) for x in not_in_cb} + rows = [] + for item in total: + name = _name_of(item) + row = {"name": name, "display": _display_of(item), "imported": name not in pending} + if isinstance(item, dict) and item.get("uuid"): + row["uuid"] = item["uuid"] + rows.append(row) + rows.sort(key=lambda r: (r["imported"], r["name"])) + return rows + + +def _vpcs(handler, region): + vpcs = handler.get_vpc_dicts_for_region(region) + rows = [] + for vpc in list(vpcs)[:MAX_VPCS]: + if not isinstance(vpc, dict): + rows.append({"id": str(vpc)}) + continue + rows.append( + { + "id": vpc.get("id") or vpc.get("VpcId") or vpc.get("vpc_id"), + "name": vpc.get("name") or vpc.get("Name") or "", + "cidr": vpc.get("cidr") or vpc.get("CidrBlock"), + "isDefault": bool(vpc.get("is_default") or vpc.get("IsDefault") or vpc.get("default")), + } + ) + return rows + + +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 list handler locations.") + + inputs = _read_inputs() + if not inputs["handler"]: + return _failure("onb_handler is required: the handler's RH- global id or its name.") + handler, error = _resolve_handler(inputs["handler"]) + if error: + return _failure(error) + + base = _portal_url() + tech = handler.resource_technology + slug = tech.slug if tech else "" + outputs = { + "handler": {"id": handler.global_id, "name": handler.name, "technology": tech.name if tech else None, "technologySlug": slug}, + "existingEnvironments": _existing_environments(handler, slug, base), + "importLocationsUrl": base + "/admin/resourcehandlers/{}/import_locations/".format(handler.id), + } + _progress(job, "Listing locations of {} ({})".format(handler.name, slug)) + try: + if slug.startswith("aws"): + total, not_in_cb, _only = handler.import_regions_helper() + outputs["locationKind"] = "region" + outputs["locations"] = _rows(total, not_in_cb) + if inputs["region"]: + outputs["region"] = inputs["region"] + outputs["vpcs"] = _vpcs(handler, inputs["region"]) + outputs["next"] = ( + "Call onb_import_environments with onb_locations lines of the form |; " + "without a VPC the default VPC of the region is used." + ) + else: + outputs["next"] = ( + "Pick one or two regions. Call this tool again with onb_region to list that region's VPCs, or call " + "onb_import_environments with the region alone to use its default VPC." + ) + elif slug == "azure_arm": + total, not_in_cb, _only = handler.import_locations_helper() + outputs["locationKind"] = "location" + outputs["locations"] = _rows(total, not_in_cb) + if not (handler.serviceaccount or "").strip(): + try: + subs = handler.get_azure_subscriptions() + outputs["subscriptions"] = [ + {"id": s.get("subscription_id") or s.get("id"), "name": s.get("display_name") or s.get("name")} + for s in list(subs)[:50] + if isinstance(s, dict) + ] + outputs["note"] = ( + "This handler has no subscription of its own; import a subscription first on the handler page " + "(Import Azure Subscriptions), then import locations on the subscription's handler." + ) + except Exception as exc: + outputs["subscriptionsError"] = str(exc)[:300] + outputs["next"] = "Pick one or two locations and call onb_import_environments with them, one per line." + elif slug == "vmware": + total, not_in_cb, _only = handler.import_clusters_helper() + outputs["locationKind"] = "cluster" + outputs["locations"] = _rows(total, not_in_cb) + outputs["next"] = "Pick one cluster and call onb_import_environments with its name." + elif slug == "scvmm": + all_clusters = handler.get_all_clusters() + current = set(handler.current_clusters()) + outputs["locationKind"] = "host cluster" + outputs["locations"] = [ + {"name": c.get("ClusterName"), "display": c.get("ClusterName"), "imported": c.get("ClusterName") in current} + for c in all_clusters + if isinstance(c, dict) + ] + outputs["next"] = "Pick one host cluster and call onb_import_environments with its name." + else: + total, not_in_cb, _only = handler.import_locations_helper() + outputs["locationKind"] = "location" + outputs["locations"] = _rows(total, not_in_cb) + outputs["next"] = "Pick one or two locations and call onb_import_environments with them, one per line." + except AttributeError as exc: + return _failure( + "This technology ({}) does not expose a location list to import from; create the environment on the " + "handler page instead. Detail: {}".format(slug or "unknown", str(exc)[:200]) + ) + except Exception as exc: + return _failure( + "Listing locations of '{}' failed: {}: {}. Run onb_verify_resource_handler; the credentials may " + "authenticate but lack a describe or list permission.".format(handler.name, type(exc).__name__, str(exc)[:600]) + ) + + count = len(outputs.get("locations") or []) + imported = sum(1 for r in outputs.get("locations") or [] if r.get("imported")) + message = "{}: {} {}(s), {} already imported, {} environment(s).".format( + handler.name, count, outputs.get("locationKind", "location"), imported, len(outputs["existingEnvironments"]) + ) + return _success(message, outputs) diff --git a/plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py b/plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py index ecbd7524..f37557c6 100644 --- a/plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py +++ b/plugins/OHK-1gp25bmt/OHK-1gp25bmt_script.py @@ -92,7 +92,7 @@ "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"), + "os_builds": ("/externalcontent/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"), diff --git a/plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_metadata.json b/plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_metadata.json new file mode 100644 index 00000000..989d9ce7 --- /dev/null +++ b/plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_metadata.json @@ -0,0 +1,35 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "The environment, by global id or name.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-y593kq80", + "label": "Environment (ENV- id or name)", + "name": "onb_environment", + "placeholder": "ENV-abc12345", + "relevant_osfamilies": [], + "required": true, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_environment" + ], + "description": "Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it.", + "id": "OHK-1wmzl7sp", + "max_retries": 0, + "name": "POC Onboarding: Remove Environment", + "resource_technologies": [], + "script_filename": "OHK-1wmzl7sp_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_script.py b/plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_script.py new file mode 100644 index 00000000..167cc4da --- /dev/null +++ b/plugins/OHK-1wmzl7sp/OHK-1wmzl7sp_script.py @@ -0,0 +1,91 @@ +""" +POC Onboarding: Remove Environment (MCP Tool Action plugin). + +Deletes an environment that was imported by mistake (wrong region, wrong +cluster, a duplicate) so the POC can start over cleanly. Refuses when any +active server still lives in the environment. 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 + +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") + + +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_environment": """{{ onb_environment }}"""} + return {"environment": _text(raw["onb_environment"])} + + +def _resolve_env(ref): + from infrastructure.models import Environment + + env = None + if GLOBAL_ID_RE.match(ref): + env = Environment.objects.filter(global_id=ref).first() + elif ref.isdigit(): + env = Environment.objects.filter(id=int(ref)).first() + if env is None: + matches = list(Environment.objects.filter(name__iexact=ref)) + if len(matches) > 1: + return None, "Several environments are named '{}'; pass the ENV- global id.".format(ref) + env = matches[0] if matches else None + if env is None: + return None, "No environment matches '{}'.".format(ref) + return env, None + + +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 remove environments.") + + ref = _read_inputs()["environment"] + if not ref: + return _failure("onb_environment is required: the ENV- global id or the environment name.") + env, error = _resolve_env(ref) + if error: + return _failure(error) + + active = env.server_set.exclude(status="HISTORICAL").count() + if active: + return _failure( + "Environment '{}' still has {} active server(s); decommission them first (Delete server action), " + "then remove the environment.".format(env.name, active) + ) + if env.name.lower() == "unassigned": + return _failure("The Unassigned environment is built in and cannot be removed.") + + info = { + "environmentId": env.global_id, + "name": env.name, + "handler": env.resource_handler.name if env.resource_handler else None, + "osBuildsDetached": env.os_builds.count(), + "groupsDetached": env.groups_served.count(), + } + env.delete() + return _success("Environment '{}' removed.".format(info["name"]), info) diff --git a/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py index b29c676b..441a2514 100644 --- a/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py +++ b/plugins/OHK-5zg1dkcr/OHK-5zg1dkcr_script.py @@ -30,6 +30,12 @@ "onb_playbook", "onb_install", "onb_set_item_status", + "onb_handler_locations", + "onb_import_environments", + "onb_trim_environment", + "onb_import_os_build", + "onb_configure_custom_server", + "onb_remove_environment", "sync_from_source_control_repo", "fetch_job_log", "manage_blueprint_permissions", diff --git a/plugins/OHK-8j06wtoe/OHK-8j06wtoe_metadata.json b/plugins/OHK-8j06wtoe/OHK-8j06wtoe_metadata.json new file mode 100644 index 00000000..137adeb4 --- /dev/null +++ b/plugins/OHK-8j06wtoe/OHK-8j06wtoe_metadata.json @@ -0,0 +1,75 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "Prefix for the new environments' names; left empty, CloudBolt's default '(handler) location' name is used.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-sbchc1bq", + "label": "Environment name prefix (optional)", + "name": "onb_env_name", + "placeholder": "POC", + "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": "The handler, 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 + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "One location per line: AWS or |; Azure location name; vCenter, SCVMM or Nutanix cluster name; GCP project id.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-piv7p0wi", + "label": "Locations, one per line", + "name": "onb_locations", + "placeholder": "us-east-1|vpc-0123456789abcdef0\neastus", + "relevant_osfamilies": [], + "required": true, + "show_as_attribute": false, + "show_on_servers": false, + "type": "TXT", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_handler", + "onb_locations", + "onb_env_name" + ], + "description": "Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them.", + "id": "OHK-8j06wtoe", + "max_retries": 0, + "name": "POC Onboarding: Import Environments", + "resource_technologies": [], + "script_filename": "OHK-8j06wtoe_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py b/plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py new file mode 100644 index 00000000..ab2adb46 --- /dev/null +++ b/plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py @@ -0,0 +1,320 @@ +""" +POC Onboarding: Import Environments (MCP Tool Action plugin). + +Creates one environment per listed location on a resource handler, the +same way the handler page's Import locations dialog does +(create_location_specific_env), then brings the networks over: AWS VPC +subnets are imported with the environment, Azure subnets are synced, and +vCenter networks of the cluster are attached to NIC 1. A location that +already has an environment is reported, not duplicated. Runs as a job +because it 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 re + +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") +MAX_LOCATIONS = 4 +MAX_VMWARE_NETWORKS = 20 +SPECIAL_FIELD = { + "aws": "aws_region", + "aws_govcloud": "aws_region", + "aws_china": "aws_region", + "azure_arm": "node_location", + "vmware": "vmware_cluster", + "scvmm": "scvmm_host_cluster", + "gcp": "gcp_project", + "acropolis": "node_location", + "openstack": "node_location", +} + + +def _text(value): + return html.unescape(value or "").strip() + + +def _lines(value): + return [line.strip() for line in re.split(r"[\r\n]+", _text(value)) if line.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 }}""", + "onb_locations": """{{ onb_locations }}""", + "onb_env_name": """{{ onb_env_name }}""", + } + return { + "handler": _text(raw["onb_handler"]), + "locations": _lines(raw["onb_locations"]), + "env_name": _text(raw["onb_env_name"]), + } + + +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: + return None, "No resource handler matches '{}'.".format(ref) + try: + handler = handler.cast() + except Exception: + pass + return handler, None + + +def _find_env(handler, field, value, vpc_id=None): + for env in handler.environment_set.all().order_by("id"): + try: + current = env.get_cfv(field) + except Exception: + current = None + if current is None or str(current) != str(value): + continue + if vpc_id: + try: + if str(env.get_cfv("vpc_id") or "") != vpc_id: + continue + except Exception: + continue + return env + return None + + +def _env_row(env, base, status, **extra): + try: + networks = len(env.networks()) + except Exception: + networks = None + row = { + "environmentId": env.global_id, + "pk": env.id, + "name": env.name, + "status": status, + "networks": networks, + "osBuilds": env.os_builds.count(), + "url": base + "/environments/{}/".format(env.id), + "parametersUrl": base + "/environments/{}/#tab-parameters".format(env.id), + } + row.update(extra) + return row + + +def _pick_vpc(handler, region, wanted): + vpcs = [v for v in handler.get_vpc_dicts_for_region(region) if isinstance(v, dict)] + rows = [] + for vpc in vpcs: + rows.append( + { + "id": vpc.get("id") or vpc.get("VpcId") or vpc.get("vpc_id"), + "name": vpc.get("name") or vpc.get("Name") or "", + "isDefault": bool(vpc.get("is_default") or vpc.get("IsDefault") or vpc.get("default")), + } + ) + if not rows: + return None, "Region {} has no VPC visible to these credentials.".format(region) + if wanted: + for row in rows: + if row["id"] == wanted or (row["name"] and row["name"].lower() == wanted.lower()): + return row, None + return None, "No VPC '{}' in region {}. Available: {}.".format( + wanted, region, ", ".join("{} ({})".format(r["id"], r["name"] or "unnamed") for r in rows) + ) + for row in rows: + if row["isDefault"]: + return row, None + if len(rows) == 1: + return rows[0], None + return None, "Region {} has {} VPCs and none is the default; pass |. Available: {}.".format( + region, len(rows), ", ".join("{} ({})".format(r["id"], r["name"] or "unnamed") for r in rows) + ) + + +def _import_aws(handler, line, prefix, base, job): + region, _sep, wanted_vpc = line.partition("|") + region = region.strip() + wanted_vpc = wanted_vpc.strip() + vpc, error = _pick_vpc(handler, region, wanted_vpc) + if error: + return {"location": line, "status": "failed", "error": error} + existing = _find_env(handler, "aws_region", region, vpc_id=vpc["id"]) + if existing is not None: + return _env_row(existing, base, "existing", location=region, vpc=vpc["id"]) + env_name = "{} {} {}".format(prefix, region, vpc["name"] or vpc["id"]).strip() if prefix else "" + _progress(job, "Creating AWS environment for {} / {}".format(region, vpc["id"])) + env = handler.create_location_specific_env(region, env_name=env_name, vpc_id=vpc["id"], vpc_name=vpc["name"] or "") + return _env_row(env, base, "created", location=region, vpc=vpc["id"]) + + +def _import_azure(handler, location, prefix, base, job): + existing = _find_env(handler, "node_location", location) + if existing is not None: + return _env_row(existing, base, "existing", location=location) + env_name = "{} {}".format(prefix, location).strip() if prefix else "({}) {}".format(handler.name, location) + _progress(job, "Creating Azure environment for {}".format(location)) + env = handler.create_location_specific_env(location, env_name=env_name) + note = "Azure imports the environment's parameters (sizes, resource groups, storage) in a separate job that runs now; give it a minute before trimming the order form." + try: + imported, deleted = handler.sync_subnets(env) + subnets = {"imported": imported, "deleted": deleted} + except Exception as exc: + subnets = {"error": str(exc)[:300]} + return _env_row(env, base, "created", location=location, subnets=subnets, note=note) + + +def _import_vmware(handler, cluster, prefix, base, job): + existing = _find_env(handler, "vmware_cluster", cluster) + if existing is not None: + env = existing + status = "existing" + else: + env_name = "{} {}".format(prefix, cluster).strip() if prefix else "" + _progress(job, "Creating vCenter environment for cluster {}".format(cluster)) + env = handler.create_location_specific_env(cluster, env_name=env_name) + status = "created" + attached = [] + try: + if not env.networks(): + _progress(job, "Syncing vCenter networks") + try: + handler.sync_networks() + except Exception as exc: + attached.append("network sync failed: {}".format(str(exc)[:200])) + for network in list(handler.get_possible_networks(env))[:MAX_VMWARE_NETWORKS]: + env.add_network(network, nic_position=1) + attached.append(network.name) + except Exception as exc: + attached.append("network attach failed: {}".format(str(exc)[:200])) + return _env_row(env, base, status, location=cluster, networksAttached=attached) + + +def _import_generic(handler, slug, location, prefix, base, job): + field = SPECIAL_FIELD.get(slug) + if field: + existing = _find_env(handler, field, location) + if existing is not None: + return _env_row(existing, base, "existing", location=location) + env_name = "{} {}".format(prefix, location).strip() if prefix else "" + extra = {} + if slug == "acropolis": + try: + _total, not_in_cb, _only = handler.import_locations_helper() + for item in not_in_cb: + if isinstance(item, dict) and item.get("name") == location and item.get("uuid"): + extra["cluster_uuid"] = item["uuid"] + except Exception: + pass + _progress(job, "Creating environment for {}".format(location)) + env = handler.create_location_specific_env(location, env_name=env_name, **extra) + return _env_row(env, base, "created", location=location) + + +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 import environments.") + + inputs = _read_inputs() + if not inputs["handler"]: + return _failure("onb_handler is required: the handler's RH- global id or its name.") + if not inputs["locations"]: + return _failure("onb_locations is required: one location per line (AWS: or |).") + if len(inputs["locations"]) > MAX_LOCATIONS: + return _failure("At most {} locations per call; a POC needs one or two environments per handler.".format(MAX_LOCATIONS)) + handler, error = _resolve_handler(inputs["handler"]) + if error: + return _failure(error) + + base = _portal_url() + tech = handler.resource_technology + slug = tech.slug if tech else "" + results = [] + for line in inputs["locations"]: + try: + if slug.startswith("aws"): + results.append(_import_aws(handler, line, inputs["env_name"], base, job)) + elif slug == "azure_arm": + results.append(_import_azure(handler, line, inputs["env_name"], base, job)) + elif slug == "vmware": + results.append(_import_vmware(handler, line, inputs["env_name"], base, job)) + else: + results.append(_import_generic(handler, slug, line, inputs["env_name"], base, job)) + except Exception as exc: + results.append( + { + "location": line, + "status": "failed", + "error": "{}: {}".format(type(exc).__name__, str(exc)[:600]), + "hint": ( + "Check the location name against onb_handler_locations, then onb_recent_errors with " + "onb_minutes=5 for the traceback." + ), + } + ) + + created = sum(1 for r in results if r.get("status") == "created") + existing = sum(1 for r in results if r.get("status") == "existing") + failed = sum(1 for r in results if r.get("status") == "failed") + outputs = { + "handler": {"id": handler.global_id, "name": handler.name, "technologySlug": slug}, + "results": results, + "next": ( + "For each environment: onb_import_os_build to attach an image, then onb_trim_environment to shorten " + "the order form, then onb_configure_custom_server." + ), + } + message = "{}: {} environment(s) created, {} existing, {} failed.".format(handler.name, created, existing, failed) + if failed and not created and not existing: + return {"status": "FAILURE", "output_message": "", "error_message": message, "outputs": outputs} + return _success(message, outputs) diff --git a/plugins/OHK-ilstyopk/OHK-ilstyopk_metadata.json b/plugins/OHK-ilstyopk/OHK-ilstyopk_metadata.json new file mode 100644 index 00000000..21766466 --- /dev/null +++ b/plugins/OHK-ilstyopk/OHK-ilstyopk_metadata.json @@ -0,0 +1,75 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "true enables every environment on the server tier; false leaves the tier's environment setting unchanged.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-kgf5l0uv", + "label": "Enable all environments (true/false, default true)", + "name": "onb_all_environments", + "placeholder": "true", + "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": "ENV- ids or names, one per line, that receive the hostname template; left empty the template goes on the server tier.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-1v0brxec", + "label": "Environments to attach (optional)", + "name": "onb_environments", + "placeholder": "ENV-abc12345", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "TXT", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "CloudBolt hostname template, for example poc-# or a template using group and OS build names; see the hostname specification documentation.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-4ciiaerz", + "label": "Hostname template (optional)", + "name": "onb_hostname_template", + "placeholder": "poc-#", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_environments", + "onb_hostname_template", + "onb_all_environments" + ], + "description": "Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments.", + "id": "OHK-ilstyopk", + "max_retries": 0, + "name": "POC Onboarding: Configure Custom Server", + "resource_technologies": [], + "script_filename": "OHK-ilstyopk_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-ilstyopk/OHK-ilstyopk_script.py b/plugins/OHK-ilstyopk/OHK-ilstyopk_script.py new file mode 100644 index 00000000..8a6db40f --- /dev/null +++ b/plugins/OHK-ilstyopk/OHK-ilstyopk_script.py @@ -0,0 +1,211 @@ +""" +POC Onboarding: Configure Custom Server (MCP Tool Action plugin). + +Makes the shipped Custom Server blueprint orderable for the POC: recreates +it when it is missing, activates it, opens it to every environment (or the +listed ones), and sets a hostname template on the server tier or on the +listed environments so the order form previews the generated name. Group +entitlement stays with manage_blueprint_permissions. 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 + +from django.conf import settings + +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") + + +def _text(value): + return html.unescape(value or "").strip() + + +def _lines(value): + return [line.strip() for line in re.split(r"[\r\n,]+", _text(value)) if line.strip()] + + +def _bool(value, default): + text = _text(value).lower() + if not text: + return default + return text in ("true", "1", "yes", "y", "on") + + +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_environments": """{{ onb_environments }}""", + "onb_hostname_template": """{{ onb_hostname_template }}""", + "onb_all_environments": """{{ onb_all_environments }}""", + } + return { + "environments": _lines(raw["onb_environments"]), + "hostname_template": _text(raw["onb_hostname_template"]), + "all_environments": _bool(raw["onb_all_environments"], True), + } + + +def _resolve_envs(refs): + from infrastructure.models import Environment + + envs = [] + for ref in refs: + env = None + if GLOBAL_ID_RE.match(ref): + env = Environment.objects.filter(global_id=ref).first() + elif ref.isdigit(): + env = Environment.objects.filter(id=int(ref)).first() + if env is None: + matches = list(Environment.objects.filter(name__iexact=ref)) + if len(matches) > 1: + return None, "Several environments are named '{}'; pass the ENV- global id.".format(ref) + env = matches[0] if matches else None + if env is None: + return None, "No environment matches '{}'.".format(ref) + envs.append(env) + return envs, None + + +def _find_or_create_blueprint(name, default_name): + from servicecatalog.models import ServiceBlueprint + + blueprint = ServiceBlueprint.objects.filter(name=name).order_by("-id").first() + created = False + if blueprint is None: + from c2_wrapper import create_blueprint + from initialize.cb_minimal import all_blueprints + + for bp_dict in all_blueprints: + if bp_dict.get("name") == default_name: + blueprint = create_blueprint(bp_dict) + blueprint.name = name + created = True + break + return blueprint, created + + +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 configure the Custom Server blueprint.") + + inputs = _read_inputs() + envs, error = _resolve_envs(inputs["environments"]) + if error: + return _failure(error) + + default_name = getattr(settings, "DEFAULT_NEW_SERVER_BLUEPRINT_NAME", "Custom Server") + name = getattr(settings, "NEW_SERVER_BLUEPRINT_NAME", default_name) or default_name + try: + blueprint, created = _find_or_create_blueprint(name, default_name) + except Exception as exc: + return _failure("Could not find or recreate the '{}' blueprint: {}: {}".format(name, type(exc).__name__, str(exc)[:400])) + if blueprint is None: + return _failure("No '{}' blueprint exists and the shipped definition could not be found.".format(name)) + + changes = [] + if created: + changes.append("recreated from the shipped definition") + if blueprint.status != "ACTIVE": + blueprint.status = "ACTIVE" + changes.append("status set to ACTIVE") + if not blueprint.is_orderable: + blueprint.is_orderable = True + changes.append("made orderable") + if changes: + blueprint.save() + + from servicecatalog.models import ProvisionServerServiceItem + + tiers = list(ProvisionServerServiceItem.objects.filter(blueprint=blueprint).order_by("id")) + tier_rows = [] + for tier in tiers: + tier_changes = [] + if inputs["all_environments"] and not tier.all_environments_enabled: + tier.all_environments_enabled = True + tier_changes.append("all environments enabled") + if inputs["hostname_template"] and not inputs["environments"]: + if (tier.hostname_template or "") != inputs["hostname_template"]: + tier.hostname_template = inputs["hostname_template"] + tier_changes.append("hostname template set on the server tier") + if tier_changes: + tier.save() + tier_rows.append( + { + "id": getattr(tier, "global_id", None), + "name": tier.name, + "allEnvironmentsEnabled": bool(tier.all_environments_enabled), + "hostnameTemplate": tier.hostname_template or None, + "changes": tier_changes, + } + ) + changes.extend(tier_changes) + + env_rows = [] + for env in envs: + row = {"id": env.global_id, "name": env.name} + if inputs["hostname_template"]: + env.set_cfv("hostname_template", inputs["hostname_template"]) + row["hostnameTemplate"] = inputs["hostname_template"] + changes.append("hostname template set on environment '{}'".format(env.name)) + env_rows.append(row) + + base = _portal_url() + try: + url = base + blueprint.get_absolute_url() + except Exception: + url = None + outputs = { + "blueprint": { + "id": blueprint.global_id, + "pk": blueprint.id, + "name": blueprint.name, + "status": blueprint.status, + "isOrderable": bool(blueprint.is_orderable), + "anyGroupCanDeploy": bool(blueprint.any_group_can_deploy), + "url": url, + }, + "serverTiers": tier_rows, + "environments": env_rows, + "changes": changes, + "next": ( + "Order it through MCP: fetch_catalog_items(name='{}'), fetch_orderable_groups, fetch_blueprint_schema, " + "fetch_orderable_environments, order_catalog_item. If anyGroupCanDeploy is false, grant the POC group with " + "manage_blueprint_permissions.".format(blueprint.name) + ), + } + if not tiers: + outputs["note"] = "The blueprint has no server tier; it cannot build a server. Recreate it from the shipped definition." + message = "'{}' is {} and orderable; {} change(s).".format(blueprint.name, blueprint.status, len(changes)) + return _success(message, outputs) diff --git a/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py b/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py index 66ab6a7b..e0e3dd48 100644 --- a/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py +++ b/plugins/OHK-j60flmb3/OHK-j60flmb3_script.py @@ -32,6 +32,12 @@ "onb_set_item_status": True, "onb_verify_resource_handler": False, "onb_install": False, + "onb_handler_locations": False, + "onb_import_environments": False, + "onb_import_os_build": False, + "onb_trim_environment": True, + "onb_configure_custom_server": True, + "onb_remove_environment": True, # Reused testing tools that ship in the same package. "sync_from_source_control_repo": True, "fetch_job_log": True, diff --git a/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_metadata.json b/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_metadata.json new file mode 100644 index 00000000..bda103e4 --- /dev/null +++ b/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_metadata.json @@ -0,0 +1,115 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "ENV- ids or names, one per line; default every environment of the handler.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-1v0brxec", + "label": "Environments to attach (optional)", + "name": "onb_environments", + "placeholder": "ENV-abc12345", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "TXT", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "The handler, 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 + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "AWS AMI id or exact name; Azure template name or publisher:offer:sku[:version]; vCenter template name.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-fdogpsml", + "label": "Image: AMI id/name, Azure urn, template name", + "name": "onb_image", + "placeholder": "ami-0123456789abcdef0", + "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": "Name of the OS build to create or reuse.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-9ra5g3on", + "label": "OS build name (reused when it exists)", + "name": "onb_os_build_name", + "placeholder": "Ubuntu 22.04", + "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": "Region or location of the image when it cannot be read from the environments.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-khdtrqfs", + "label": "AWS region to list VPCs for (optional)", + "name": "onb_region", + "placeholder": "us-east-1", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "STR", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_handler", + "onb_image", + "onb_os_build_name", + "onb_environments", + "onb_region" + ], + "description": "Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments.", + "id": "OHK-k2p8ll4p", + "max_retries": 0, + "name": "POC Onboarding: Import OS Build", + "resource_technologies": [], + "script_filename": "OHK-k2p8ll4p_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py b/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py new file mode 100644 index 00000000..4571ec91 --- /dev/null +++ b/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py @@ -0,0 +1,335 @@ +""" +POC Onboarding: Import OS Build (MCP Tool Action plugin). + +Imports one image (an AWS AMI, an Azure marketplace image, a vCenter +template) into an OS build and attaches that OS build to the handler's +environments, the way the handler's images page does. An OS build name +that already exists is reused, so one build ("Ubuntu 22.04") can carry an +image per handler and a single blueprint deploys to both clouds. Runs as a +job because it 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 re + +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") +LOCATION_FIELD = {"aws": "aws_region", "aws_govcloud": "aws_region", "aws_china": "aws_region", "azure_arm": "node_location"} + + +def _text(value): + return html.unescape(value or "").strip() + + +def _lines(value): + return [line.strip() for line in re.split(r"[\r\n,]+", _text(value)) if line.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 }}""", + "onb_image": """{{ onb_image }}""", + "onb_os_build_name": """{{ onb_os_build_name }}""", + "onb_environments": """{{ onb_environments }}""", + "onb_region": """{{ onb_region }}""", + } + return { + "handler": _text(raw["onb_handler"]), + "image": _text(raw["onb_image"]), + "os_build_name": _text(raw["onb_os_build_name"]), + "environments": _lines(raw["onb_environments"]), + "region": _text(raw["onb_region"]), + } + + +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: + return None, "No resource handler matches '{}'.".format(ref) + try: + handler = handler.cast() + except Exception: + pass + return handler, None + + +def _resolve_envs(handler, refs): + envs = list(handler.environment_set.all().order_by("id")) + if not refs: + return envs, None + chosen = [] + for ref in refs: + match = None + for env in envs: + if env.global_id == ref or str(env.id) == ref or env.name.lower() == ref.lower(): + match = env + break + if match is None: + return None, "No environment '{}' on handler {}. Its environments: {}.".format( + ref, handler.name, ", ".join("{} ({})".format(e.global_id, e.name) for e in envs) or "none" + ) + chosen.append(match) + return chosen, None + + +def _location_of(envs, slug): + field = LOCATION_FIELD.get(slug) + if not field: + return None + for env in envs: + try: + value = env.get_cfv(field) + except Exception: + value = None + if value: + return str(value) + return None + + +def _existing_os_build(name): + from externalcontent.models import OSBuild + + return OSBuild.objects.filter(name__iexact=name).order_by("id").first() + + +def _import_aws(handler, image, region, os_build_name, existing_osb, job): + from resourcehandlers.aws.models import AmazonMachineImage + from resourcehandlers.services import ResourceHandlerBaseService + + _progress(job, "Looking up image {} in {}".format(image, region)) + if image.lower().startswith("ami-"): + discovered, not_in_cb, _only = handler.discover_templates(region, ami_ids=[image]) + else: + discovered = handler.get_ami_dicts_for_region_by_names([image], region) + not_in_cb = discovered + discovered = list(discovered or []) + if not discovered: + return None, "AWS returned no image for '{}' in {}. Pass the AMI id (ami-...) or the exact AMI name.".format(image, region) + image_dict = dict(discovered[0]) + ami_id = image_dict.get("ami_id") or image + already = AmazonMachineImage.objects.filter(resourcehandler=handler, ami_id=ami_id, region=region).order_by("-id").first() + if already is not None and already.os_build is not None: + return already.os_build, None + image_dict.setdefault("region", region) + ResourceHandlerBaseService(handler).create_osbuild_and_attributes(image_dict, os_build_name=os_build_name, os_build=existing_osb) + osba = AmazonMachineImage.objects.filter(resourcehandler=handler, ami_id=ami_id).order_by("-id").first() + if osba is None or osba.os_build is None: + return None, "The image was imported but no OS build attribute for {} was found afterwards.".format(ami_id) + return osba.os_build, None + + +def _azure_match(d, image): + wanted = image.lower() + urn = ":".join(str(d.get(k) or "") for k in ("publisher", "offer", "sku", "version")).lower() + for key in ("template_name", "name", "azure_image_name", "label", "image_id"): + if str(d.get(key) or "").lower() == wanted: + return True + return urn == wanted or urn.rsplit(":", 1)[0] == wanted + + +def _import_azure(handler, image, location, os_build_name, existing_osb, job): + from c2_wrapper import guess_os_family + from resourcehandlers.azure_arm.models import AzureARMImage + + _progress(job, "Looking up image {} in {}".format(image, location)) + available, unimported, _only = handler.discover_templates(locations=[location]) + available = list(available or []) + if not available: + return None, ( + "No Azure images are cached for location {}. Run Sync Images on the handler page (or wait for the " + "images sync job), then retry.".format(location) + ) + match = next((d for d in available if _azure_match(d, image)), None) + if match is None: + sample = ", ".join(str(d.get("template_name") or d.get("name")) for d in available[:15]) + return None, "No image '{}' in {}. Pass the template name or publisher:offer:sku[:version]. Some available: {}.".format( + image, location, sample + ) + template_name = match.get("template_name") or match.get("name") + already = AzureARMImage.objects.filter(resourcehandler=handler, template_name=template_name, region=location).order_by("-id").first() + if already is not None and already.os_build is not None: + return already.os_build, None + d = dict(match) + d.pop("template_name", None) + d.pop("name", None) + d.pop("_state", None) + family = guess_os_family(dict(match)) + osba = handler.add_template( + template_name, + os_build_name=os_build_name, + os_family=family, + os_build=existing_osb, + region=location, + **d, + ) + if osba is None or getattr(osba, "os_build", None) is None: + osba = AzureARMImage.objects.filter(resourcehandler=handler, template_name=template_name, region=location).order_by("-id").first() + if osba is None or osba.os_build is None: + return None, "The image was imported but no OS build attribute for {} was found afterwards.".format(template_name) + return osba.os_build, None + + +def _import_vmware(handler, image, os_build_name, existing_osb, job): + from resourcehandlers.services import ResourceHandlerBaseService + from resourcehandlers.vmware.models import VsphereOSBuildAttribute + + _progress(job, "Looking up template {}".format(image)) + discovered, not_in_cb, _only = handler.discover_templates() + discovered = list(discovered or []) + if not discovered: + return None, ( + "No vCenter templates are cached yet. Run the recurring job 'Fetch and Cache available VMWare template' " + "(Admin > Recurring Jobs) and retry." + ) + match = next((d for d in discovered if str(d.get("name") or "").lower() == image.lower()), None) + if match is None: + sample = ", ".join(str(d.get("name")) for d in discovered[:20]) + return None, "No template named '{}'. Some available: {}.".format(image, sample) + already = VsphereOSBuildAttribute.objects.filter(resourcehandler=handler, template_name=match["name"]).order_by("-id").first() + if already is not None and already.os_build is not None: + return already.os_build, None + ResourceHandlerBaseService(handler).create_osbuild_and_attributes(dict(match), os_build_name=os_build_name, os_build=existing_osb) + osba = VsphereOSBuildAttribute.objects.filter(resourcehandler=handler, template_name=match["name"]).order_by("-id").first() + if osba is None or osba.os_build is None: + return None, "The template was imported but no OS build attribute for {} was found afterwards.".format(match["name"]) + return osba.os_build, None + + +def _import_generic(handler, image, os_build_name, existing_osb, job): + from resourcehandlers.services import ResourceHandlerBaseService + + _progress(job, "Looking up image {}".format(image)) + discovered, not_in_cb, _only = handler.discover_templates() + discovered = list(discovered or []) + match = next( + (d for d in discovered if isinstance(d, dict) and str(d.get("name") or d.get("value") or "").lower() == image.lower()), + None, + ) + if match is None: + sample = ", ".join(str(d.get("name")) for d in discovered[:20] if isinstance(d, dict)) + return None, "No image named '{}'. Some available: {}.".format(image, sample or "none discovered") + ResourceHandlerBaseService(handler).create_osbuild_and_attributes(dict(match), os_build_name=os_build_name, os_build=existing_osb) + osba = handler.os_build_attributes.filter(template_name=match.get("name")).order_by("-id").first() + if osba is None or osba.os_build is None: + return None, "The image was imported but no OS build attribute was found afterwards." + return osba.os_build, None + + +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 import OS builds.") + + inputs = _read_inputs() + for key in ("handler", "image", "os_build_name"): + if not inputs[key]: + return _failure("onb_{} is required.".format(key)) + handler, error = _resolve_handler(inputs["handler"]) + if error: + return _failure(error) + envs, error = _resolve_envs(handler, inputs["environments"]) + if error: + return _failure(error) + if not envs: + return _failure("Handler {} has no environments yet; run onb_import_environments first.".format(handler.name)) + + base = _portal_url() + tech = handler.resource_technology + slug = tech.slug if tech else "" + location = inputs["region"] or _location_of(envs, slug) + if slug in LOCATION_FIELD and not location: + return _failure("Pass onb_region: the region or location of the image (none could be read from the environments).") + existing_osb = _existing_os_build(inputs["os_build_name"]) + + try: + if slug.startswith("aws"): + osb, error = _import_aws(handler, inputs["image"], location, inputs["os_build_name"], existing_osb, job) + elif slug == "azure_arm": + osb, error = _import_azure(handler, inputs["image"], location, inputs["os_build_name"], existing_osb, job) + elif slug == "vmware": + osb, error = _import_vmware(handler, inputs["image"], inputs["os_build_name"], existing_osb, job) + else: + osb, error = _import_generic(handler, inputs["image"], inputs["os_build_name"], existing_osb, job) + except Exception as exc: + return _failure("Importing '{}' on {} failed: {}: {}".format(inputs["image"], handler.name, type(exc).__name__, str(exc)[:600])) + if error: + return _failure(error) + + attached = [] + for env in envs: + if not osb.environments.filter(id=env.id).exists(): + osb.environments.add(env) + attached.append({"id": env.global_id, "name": env.name}) + + outputs = { + "handler": {"id": handler.global_id, "name": handler.name, "technologySlug": slug}, + "image": inputs["image"], + "location": location, + "osBuild": { + "id": osb.global_id, + "name": osb.name, + "osFamily": osb.os_family.name if osb.os_family else None, + "reused": existing_osb is not None and existing_osb.id == osb.id, + "url": base + "/externalcontent/osbuilds/{}/".format(osb.id), + }, + "attachedToEnvironments": attached, + "next": ( + "For a second cloud, call this tool again with the same onb_os_build_name and that handler's image so one " + "blueprint deploys to both. Then onb_trim_environment on each environment." + ), + } + if osb.os_family is None: + outputs["note"] = "The OS family could not be determined; set it on the OS build page so Windows and Linux scripts target the right servers." + return _success("OS build '{}' holds {} and is attached to {} environment(s).".format(osb.name, inputs["image"], len(attached)), outputs) diff --git a/plugins/OHK-qn4k1pme/OHK-qn4k1pme_metadata.json b/plugins/OHK-qn4k1pme/OHK-qn4k1pme_metadata.json new file mode 100644 index 00000000..3c1afe3c --- /dev/null +++ b/plugins/OHK-qn4k1pme/OHK-qn4k1pme_metadata.json @@ -0,0 +1,115 @@ +{ + "action_inputs": [ + { + "allow_multiple": false, + "available_all_servers": false, + "description": "The environment, by global id or name.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-y593kq80", + "label": "Environment (ENV- id or name)", + "name": "onb_environment", + "placeholder": "ENV-abc12345", + "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": "Field names the profile must not pin or remove.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-9gki8t0i", + "label": "Fields to leave visible (optional)", + "name": "onb_keep", + "placeholder": "sc_nic_0", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "TXT", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "Fields to pin to a given value; the value must be one of the field's options, or a new value for text fields.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-vptyklqu", + "label": "Pins, one field=value per line (optional)", + "name": "onb_pin", + "placeholder": "key_name=poc-keypair\nresource_group_arm=poc-rg", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "TXT", + "value_pattern_string": null + }, + { + "allow_multiple": false, + "available_all_servers": false, + "description": "poc_minimal applies the per-technology trim; report only lists the current order form.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-5zq7thsv", + "label": "Profile: poc_minimal (default) or report", + "name": "onb_profile", + "placeholder": "poc_minimal", + "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": "Field names to remove from the environment in addition to the profile's list.", + "field_dependency_controlling_set": [], + "field_dependency_dependent_set": [], + "global_options": [], + "hide_if_default_value": true, + "id": "CF-jm4m69kl", + "label": "Extra fields to remove (optional)", + "name": "onb_remove", + "placeholder": "create_public_ip", + "relevant_osfamilies": [], + "required": false, + "show_as_attribute": false, + "show_on_servers": false, + "type": "TXT", + "value_pattern_string": null + } + ], + "action_inputs_sequence": [ + "onb_environment", + "onb_profile", + "onb_pin", + "onb_keep", + "onb_remove" + ], + "description": "Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form.", + "id": "OHK-qn4k1pme", + "max_retries": 0, + "name": "POC Onboarding: Trim Environment Order Form", + "resource_technologies": [], + "script_filename": "OHK-qn4k1pme_script.py", + "shared": false, + "target_os_families": [], + "type": "CloudBolt Plug-in" +} diff --git a/plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py b/plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py new file mode 100644 index 00000000..3faf95da --- /dev/null +++ b/plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py @@ -0,0 +1,344 @@ +""" +POC Onboarding: Trim Environment Order Form (MCP Tool Action plugin). + +Shortens an environment's order form to what a POC user needs. CloudBolt +hides a required parameter that has exactly one option, so the tool pins +infrastructure choices (key pair, security group, resource group, storage +type, datastore, disk type) to one value and removes the optional +technology parameters a POC never touches, leaving the size and, where +needed, the network and password visible. Pinned fields are protected from +the handler's sync jobs. The report profile only shows the current form. +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 + +GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") +PROFILES = ("poc_minimal", "report") + +# Per technology: fields the user still sees, fields pinned to one value +# (preferred values first; None = first existing option), fields removed. +TRIM = { + "aws": { + "show": ["instance_type"], + "pin": { + "key_name": [], + "sec_groups": ["default"], + "delete_ebs_volumes_on_termination": ["True", "true"], + "ebs_volume_type": ["gp3", "gp2"], + "sc_nic_0": [], + }, + "remove": ["aws_availability_zone", "aws_elastic_ip", "iops", "aws_host", "aws_host_group"], + }, + "azure_arm": { + "show": ["node_size", "password_arm", "azure_authentication_type", "azure_ssh_key"], + "pin": { + "resource_group_arm": [], + "storage_account_type_arm": ["Standard_LRS", "StandardSSD_LRS", "Premium_LRS"], + "create_public_ip": ["False", "false"], + "availability_set_arm": [], + "availability_zone_arm": [], + "sc_nic_0": [], + }, + "remove": [ + "spot_instance_arm", "eviction_type_arm", "eviction_policy_arm", "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", + ], + }, + "vmware": { + "show": ["cpu_cnt", "mem_size"], + "pin": {"vmware_datastore": [], "vmware_disk_type": ["thin", "Thin"], "sc_nic_0": []}, + "remove": ["vmware_resourcepool", "nsx_scope", "nsx_edge"], + }, +} +TRIM["aws_govcloud"] = TRIM["aws"] +TRIM["aws_china"] = TRIM["aws"] +# Fields other fields regenerate their options from; a single option never hides them. +NEVER_HIDDEN = {"azure_arm": ["node_size", "availability_set_arm", "azure_authentication_type"]} + + +def _text(value): + return html.unescape(value or "").strip() + + +def _lines(value): + return [line.strip() for line in re.split(r"[\r\n,]+", _text(value)) if line.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_environment": """{{ onb_environment }}""", + "onb_profile": """{{ onb_profile }}""", + "onb_pin": """{{ onb_pin }}""", + "onb_keep": """{{ onb_keep }}""", + "onb_remove": """{{ onb_remove }}""", + } + pins = {} + for line in _lines(raw["onb_pin"]): + name, sep, value = line.partition("=") + if sep: + pins[name.strip()] = value.strip() + return { + "environment": _text(raw["onb_environment"]), + "profile": (_text(raw["onb_profile"]) or "poc_minimal").lower(), + "pins": pins, + "keep": _lines(raw["onb_keep"]), + "remove": _lines(raw["onb_remove"]), + } + + +def _resolve_env(ref): + from infrastructure.models import Environment + + env = None + if GLOBAL_ID_RE.match(ref): + env = Environment.objects.filter(global_id=ref).first() + elif ref.isdigit(): + env = Environment.objects.filter(id=int(ref)).first() + if env is None: + matches = list(Environment.objects.filter(name__iexact=ref)) + if len(matches) > 1: + return None, "Several environments are named '{}'; pass the ENV- global id.".format(ref) + env = matches[0] if matches else None + if env is None: + return None, "No environment matches '{}'.".format(ref) + return env, None + + +def _option_label(cfv): + try: + value = cfv.value + except Exception: + value = None + if value is None: + return cfv.str_value or "" + if hasattr(value, "name"): + return getattr(value, "name") + return str(value) + + +def _field_rows(env, handler): + """One row per parameter that can appear on this environment's order form.""" + from infrastructure.models import CustomField + + special = set(handler.special_fields() or []) + tech = set(handler.tech_parameter_fields() or []) + base_names = set(getattr(handler, "base_orders_cf_names", []) or []) + env_fields = {cf.name: cf for cf in env.custom_fields.all()} + rh_fields = {cf.name: cf for cf in handler.custom_fields.all()} + names = set(env_fields) | set(rh_fields) + rows = {} + for name in sorted(names): + cf = env_fields.get(name) or rh_fields.get(name) + options = list(env.custom_field_options.filter(field=cf).order_by("id")) + rows[name] = { + "name": name, + "label": cf.label, + "type": cf.type, + "required": bool(cf.required), + "onEnvironment": name in env_fields, + "onHandler": name in rh_fields, + "technologyParameter": name in tech, + "special": name in special, + "baseOrderField": name in base_names, + "options": [_option_label(o) for o in options][:25], + "optionCount": len(options), + "_cf": cf, + "_cfvs": options, + } + return rows + + +def _hidden(row, slug): + if row["special"]: + return True + if row["name"] in NEVER_HIDDEN.get(slug, []): + return False + if row["optionCount"] == 1 and (row["required"] or row["type"] == "BOOL"): + return True + return False + + +def _public(row, slug): + out = {k: v for k, v in row.items() if not k.startswith("_")} + out["hiddenOnOrderForm"] = _hidden(row, slug) + return out + + +def _choose(row, preferred, wanted): + """Pick the CFV to pin: the user's value, then a preferred value, then the first option.""" + cfvs = row["_cfvs"] + labels = [_option_label(c) for c in cfvs] + if wanted: + for cfv, label in zip(cfvs, labels): + if label == wanted or label.lower() == wanted.lower(): + return cfv, None + if row["_cf"].type in ("STR", "INT", "DEC", "TXT") and row["name"] != "sc_nic_0": + return wanted, None # a new option, created by replace_cf_options + return None, "'{}' is not one of the options {} and a new value cannot be created for this field type.".format( + wanted, labels + ) + for pref in preferred: + for cfv, label in zip(cfvs, labels): + if label == pref: + return cfv, None + if cfvs: + return cfvs[0], None + return None, "no options to pin" + + +def _protect(env, names): + data = env.modified_parameters or {} + current = list(data.get("tech_specific_parameters", []) or []) + changed = False + for name in names: + if name not in current: + current.append(name) + changed = True + if changed: + data["tech_specific_parameters"] = current + env.modified_parameters = data + env.save() + + +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 change an environment's parameters.") + + inputs = _read_inputs() + if not inputs["environment"]: + return _failure("onb_environment is required: the ENV- global id or the environment name.") + if inputs["profile"] not in PROFILES: + return _failure("onb_profile must be one of: {}.".format(", ".join(PROFILES))) + env, error = _resolve_env(inputs["environment"]) + if error: + return _failure(error) + if env.resource_handler is None: + return _failure("Environment '{}' has no resource handler.".format(env.name)) + handler = env.resource_handler.cast() + tech = handler.resource_technology + slug = tech.slug if tech else "" + base = _portal_url() + + rows = _field_rows(env, handler) + before = [_public(r, slug) for r in rows.values()] + outputs = { + "environment": {"id": env.global_id, "name": env.name, "url": base + "/environments/{}/".format(env.id), + "parametersUrl": base + "/environments/{}/#tab-parameters".format(env.id)}, + "handler": {"id": handler.global_id, "name": handler.name, "technologySlug": slug}, + "profile": inputs["profile"], + "before": before, + } + if slug in NEVER_HIDDEN: + outputs["note"] = "On {} the fields {} drive other fields' options and stay visible however many options they have.".format( + slug, ", ".join(NEVER_HIDDEN[slug]) + ) + if inputs["profile"] == "report": + visible = [r["name"] for r in before if not r["hiddenOnOrderForm"]] + return _success("{}: {} parameter(s) visible on the order form.".format(env.name, len(visible)), + dict(outputs, visibleNow=visible)) + + table = TRIM.get(slug, {"show": [], "pin": {}, "remove": []}) + keep = set(inputs["keep"]) | set(table["show"]) + pin_plan = {name: prefs for name, prefs in table["pin"].items() if name not in keep} + for name, value in inputs["pins"].items(): + pin_plan[name] = pin_plan.get(name, []) + remove_plan = [n for n in list(table["remove"]) + inputs["remove"] if n not in keep and n not in pin_plan] + + actions = [] + protected = [] + for name in remove_plan: + row = rows.get(name) + if row is None: + continue + if row["onHandler"] and not row["onEnvironment"]: + actions.append({"field": name, "action": "left", "reason": "defined on the handler, not the environment"}) + continue + if row["onHandler"]: + # Removing from the environment leaves the handler's copy; pin instead so it hides. + choice, err = _choose(row, [], None) + if choice is None: + actions.append({"field": name, "action": "left", "reason": err}) + continue + env.replace_cf_options(name, [choice]) + protected.append(name) + actions.append({"field": name, "action": "pinned", "value": _option_label(choice) if hasattr(choice, "value") else str(choice), + "reason": "handler-level field; pinned instead of removed"}) + continue + env.clear_cfv(name) + actions.append({"field": name, "action": "removed"}) + + for name, preferred in pin_plan.items(): + row = rows.get(name) + if row is None: + if name in inputs["pins"]: + actions.append({"field": name, "action": "left", "reason": "not a parameter of this environment or handler"}) + continue + wanted = inputs["pins"].get(name) + if row["optionCount"] == 0 and not wanted: + actions.append({"field": name, "action": "left", "reason": "no options to pin; import parameters first or pass onb_pin"}) + continue + if row["optionCount"] == 1 and not wanted: + protected.append(name) + actions.append({"field": name, "action": "already single", "value": row["options"][0]}) + continue + choice, err = _choose(row, preferred, wanted) + if choice is None: + actions.append({"field": name, "action": "left", "reason": err}) + continue + env.replace_cf_options(name, [choice]) + protected.append(name) + label = _option_label(choice) if hasattr(choice, "value") else str(choice) + entry = {"field": name, "action": "pinned", "value": label} + if not (row["required"] or row["type"] == "BOOL") and name not in NEVER_HIDDEN.get(slug, []): + entry["note"] = "optional field: a single option still shows with a blank choice; remove it with onb_remove if it should disappear" + actions.append(entry) + + if protected: + _protect(env, protected) + + after_rows = _field_rows(env, handler) + after = [_public(r, slug) for r in after_rows.values()] + visible = [r["name"] for r in after if not r["hiddenOnOrderForm"]] + outputs.update({"actions": actions, "protectedFromSync": sorted(set(protected)), "after": after, "visibleNow": visible}) + outputs["next"] = ( + "Order the Custom Server into this environment through MCP and confirm the form shows only {}. " + "Pass onb_keep to bring a field back, onb_pin field=value to change a pin.".format(", ".join(visible) or "the size") + ) + message = "{}: {} action(s); visible now: {}.".format(env.name, len(actions), ", ".join(visible) or "none") + return _success(message, outputs) diff --git a/plugins/README.md b/plugins/README.md index afc6388b..5f536476 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -103,12 +103,18 @@ 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: Configure Custom Server | [OHK-ilstyopk](OHK-ilstyopk/) | Makes the shipped Custom Server blueprint orderable for the POC: recreates it when missing, activates it, enables every environment on its server tier, and sets a hostname template on the tier or on the listed environments. | CloudBolt Plug-in | [POC Onboarding: Configure Custom Server](../mcp_tool_actions/MTA-i1kmy5fd/README.md) | | 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: Handler Locations | [OHK-0nuhjdxl](OHK-0nuhjdxl/) | Lists the regions, locations or clusters a resource handler can turn into environments, flags the ones already imported, lists the existing environments, and for an AWS region lists its VPCs. | CloudBolt Plug-in | [POC Onboarding: Handler Locations](../mcp_tool_actions/MTA-89dxppus/README.md) | +| POC Onboarding: Import Environments | [OHK-8j06wtoe](OHK-8j06wtoe/) | Creates one environment per listed location on a resource handler the way the Import locations dialog does, brings the networks over (AWS subnets with the environment, Azure subnets synced, vCenter cluster networks attached to NIC 1), and reports existing environments instead of duplicating them. | CloudBolt Plug-in | [POC Onboarding: Import Environments](../mcp_tool_actions/MTA-i6p4j2l7/README.md) | +| POC Onboarding: Import OS Build | [OHK-k2p8ll4p](OHK-k2p8ll4p/) | Imports one image (AWS AMI, Azure marketplace image, vCenter template) into an OS build, reusing an existing build of the same name so one build spans handlers, and attaches the build to the handler's environments. | CloudBolt Plug-in | [POC Onboarding: Import OS Build](../mcp_tool_actions/MTA-0dr8xi4i/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: Remove Environment | [OHK-1wmzl7sp](OHK-1wmzl7sp/) | Deletes an environment imported by mistake so the POC can start over; refuses while active servers live in it. | CloudBolt Plug-in | [POC Onboarding: Remove Environment](../mcp_tool_actions/MTA-pz5o2gjl/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: Trim Environment Order Form | [OHK-qn4k1pme](OHK-qn4k1pme/) | Shortens an environment's order form for a POC by pinning infrastructure parameters to one value (which hides a required field) and removing the optional technology parameters, leaving the size and, where needed, the network and password; the report profile only lists the current form. | CloudBolt Plug-in | [POC Onboarding: Trim Environment Order Form](../mcp_tool_actions/MTA-iyknuxox/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) | From 94a08c7a70598b4347600032aafc33b320383c36 Mon Sep 17 00:00:00 2001 From: Mike Bombard <37379633+mbomb67@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:46:08 -0400 Subject: [PATCH 2/3] Constrain sizes to a short list in the trim profile and accept multi-value pins Co-Authored-By: Claude Fable 5.1 --- plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py | 50 ++++++++++++++++----- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py b/plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py index 3faf95da..4be55d6a 100644 --- a/plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py +++ b/plugins/OHK-qn4k1pme/OHK-qn4k1pme_script.py @@ -20,11 +20,14 @@ GLOBAL_ID_RE = re.compile(r"^[A-Z]{2,4}-[A-Za-z0-9]{6,16}$") PROFILES = ("poc_minimal", "report") -# Per technology: fields the user still sees, fields pinned to one value -# (preferred values first; None = first existing option), fields removed. +# Per technology: fields the user still sees (constrained to a short list of +# sizes when those exist among the options), fields pinned to one value +# (preferred values first; an empty list = first existing option), fields +# removed. TRIM = { "aws": { "show": ["instance_type"], + "constrain": {"instance_type": ["t3.small", "t3.medium", "t3.large", "t3a.small", "t3a.medium", "m5.large"]}, "pin": { "key_name": [], "sec_groups": ["default"], @@ -36,6 +39,7 @@ }, "azure_arm": { "show": ["node_size", "password_arm", "azure_authentication_type", "azure_ssh_key"], + "constrain": {"node_size": ["Standard_B2s", "Standard_B2ms", "Standard_D2s_v5", "Standard_D2s_v3", "Standard_B1ms"]}, "pin": { "resource_group_arm": [], "storage_account_type_arm": ["Standard_LRS", "StandardSSD_LRS", "Premium_LRS"], @@ -53,6 +57,7 @@ }, "vmware": { "show": ["cpu_cnt", "mem_size"], + "constrain": {"cpu_cnt": ["1", "2", "4"], "mem_size": ["2", "4", "8"]}, "pin": {"vmware_datastore": [], "vmware_disk_type": ["thin", "Thin"], "sc_nic_0": []}, "remove": ["vmware_resourcepool", "nsx_scope", "nsx_edge"], }, @@ -106,10 +111,11 @@ def _read_inputs(): "onb_remove": """{{ onb_remove }}""", } pins = {} - for line in _lines(raw["onb_pin"]): - name, sep, value = line.partition("=") - if sep: - pins[name.strip()] = value.strip() + for line in re.split(r"[\r\n]+", _text(raw["onb_pin"])): + name, sep, value = line.strip().partition("=") + if sep and name.strip(): + # One value pins the field; several values separated by | constrain it to that list. + pins[name.strip()] = [v.strip() for v in value.split("|") if v.strip()] return { "environment": _text(raw["onb_environment"]), "profile": (_text(raw["onb_profile"]) or "poc_minimal").lower(), @@ -273,15 +279,36 @@ def run(job, *args, **kwargs): return _success("{}: {} parameter(s) visible on the order form.".format(env.name, len(visible)), dict(outputs, visibleNow=visible)) - table = TRIM.get(slug, {"show": [], "pin": {}, "remove": []}) + table = TRIM.get(slug, {"show": [], "constrain": {}, "pin": {}, "remove": []}) keep = set(inputs["keep"]) | set(table["show"]) + constrain_plan = dict(table.get("constrain", {})) pin_plan = {name: prefs for name, prefs in table["pin"].items() if name not in keep} - for name, value in inputs["pins"].items(): - pin_plan[name] = pin_plan.get(name, []) + user_pins = {} + for name, values in inputs["pins"].items(): + if len(values) > 1: + constrain_plan[name] = values + pin_plan.pop(name, None) + else: + pin_plan[name] = pin_plan.get(name, []) + user_pins[name] = values[0] if values else "" remove_plan = [n for n in list(table["remove"]) + inputs["remove"] if n not in keep and n not in pin_plan] actions = [] protected = [] + for name, wanted_values in constrain_plan.items(): + row = rows.get(name) + if row is None or name in inputs["remove"]: + continue + labels = [_option_label(c) for c in row["_cfvs"]] + chosen = [c for c, label in zip(row["_cfvs"], labels) if label in wanted_values] + if len(chosen) < 2 or len(chosen) == len(row["_cfvs"]): + if name in inputs["pins"]: + actions.append({"field": name, "action": "left", "reason": "fewer than two of the requested values exist among the options {}".format(labels[:15])}) + continue + chosen.sort(key=lambda c: wanted_values.index(_option_label(c))) + env.replace_cf_options(name, chosen) + protected.append(name) + actions.append({"field": name, "action": "constrained", "values": [_option_label(c) for c in chosen]}) for name in remove_plan: row = rows.get(name) if row is None: @@ -309,7 +336,7 @@ def run(job, *args, **kwargs): if name in inputs["pins"]: actions.append({"field": name, "action": "left", "reason": "not a parameter of this environment or handler"}) continue - wanted = inputs["pins"].get(name) + wanted = user_pins.get(name) if row["optionCount"] == 0 and not wanted: actions.append({"field": name, "action": "left", "reason": "no options to pin; import parameters first or pass onb_pin"}) continue @@ -338,7 +365,8 @@ def run(job, *args, **kwargs): outputs.update({"actions": actions, "protectedFromSync": sorted(set(protected)), "after": after, "visibleNow": visible}) outputs["next"] = ( "Order the Custom Server into this environment through MCP and confirm the form shows only {}. " - "Pass onb_keep to bring a field back, onb_pin field=value to change a pin.".format(", ".join(visible) or "the size") + "Pass onb_keep to bring a field back, onb_pin field=value to change a pin, onb_pin field=a|b|c to offer " + "exactly those sizes.".format(", ".join(visible) or "the size") ) message = "{}: {} action(s); visible now: {}.".format(env.name, len(actions), ", ".join(visible) or "none") return _success(message, outputs) From b9cdfb2360670212d8cea54f785cbfe5eff01caa Mon Sep 17 00:00:00 2001 From: Mike Bombard <37379633+mbomb67@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:48:51 -0400 Subject: [PATCH 3/3] Import images through the handler's add_template directly and drop the duplicated VPC name from environment names The handler service class is abstract and cannot be instantiated from a plug-in. Co-Authored-By: Claude Fable 5.1 --- plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py | 7 +++++- plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py | 25 +++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py b/plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py index ab2adb46..a0bdd93f 100644 --- a/plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py +++ b/plugins/OHK-8j06wtoe/OHK-8j06wtoe_script.py @@ -189,7 +189,12 @@ def _import_aws(handler, line, prefix, base, job): existing = _find_env(handler, "aws_region", region, vpc_id=vpc["id"]) if existing is not None: return _env_row(existing, base, "existing", location=region, vpc=vpc["id"]) - env_name = "{} {} {}".format(prefix, region, vpc["name"] or vpc["id"]).strip() if prefix else "" + vpc_label = vpc["name"] or vpc["id"] + env_name = "" + if prefix: + env_name = "{} {}".format(prefix, region) + if vpc_label.lower() != region.lower(): + env_name += " " + vpc_label _progress(job, "Creating AWS environment for {} / {}".format(region, vpc["id"])) env = handler.create_location_specific_env(region, env_name=env_name, vpc_id=vpc["id"], vpc_name=vpc["name"] or "") return _env_row(env, base, "created", location=region, vpc=vpc["id"]) diff --git a/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py b/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py index 4571ec91..2dd4570c 100644 --- a/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py +++ b/plugins/OHK-k2p8ll4p/OHK-k2p8ll4p_script.py @@ -142,9 +142,23 @@ def _existing_os_build(name): return OSBuild.objects.filter(name__iexact=name).order_by("id").first() +def _add_template(handler, image_dict, os_build_name, existing_osb): + """What ResourceHandlerBaseService.create_osbuild_and_attributes does, without the abstract service.""" + from c2_wrapper import guess_os_family + + image = dict(image_dict) + if not image.get("os_family"): + image["os_family"] = guess_os_family(image) + image["reported_os"] = image.get("guest_os") + image.pop("os_build_name", None) + if existing_osb is not None: + image.pop("os_build", None) + return handler.add_template(os_build=existing_osb, **image) + return handler.add_template(os_build_name=os_build_name, **image) + + def _import_aws(handler, image, region, os_build_name, existing_osb, job): from resourcehandlers.aws.models import AmazonMachineImage - from resourcehandlers.services import ResourceHandlerBaseService _progress(job, "Looking up image {} in {}".format(image, region)) if image.lower().startswith("ami-"): @@ -161,7 +175,7 @@ def _import_aws(handler, image, region, os_build_name, existing_osb, job): if already is not None and already.os_build is not None: return already.os_build, None image_dict.setdefault("region", region) - ResourceHandlerBaseService(handler).create_osbuild_and_attributes(image_dict, os_build_name=os_build_name, os_build=existing_osb) + _add_template(handler, image_dict, os_build_name, existing_osb) osba = AmazonMachineImage.objects.filter(resourcehandler=handler, ami_id=ami_id).order_by("-id").first() if osba is None or osba.os_build is None: return None, "The image was imported but no OS build attribute for {} was found afterwards.".format(ami_id) @@ -220,7 +234,6 @@ def _import_azure(handler, image, location, os_build_name, existing_osb, job): def _import_vmware(handler, image, os_build_name, existing_osb, job): - from resourcehandlers.services import ResourceHandlerBaseService from resourcehandlers.vmware.models import VsphereOSBuildAttribute _progress(job, "Looking up template {}".format(image)) @@ -238,7 +251,7 @@ def _import_vmware(handler, image, os_build_name, existing_osb, job): already = VsphereOSBuildAttribute.objects.filter(resourcehandler=handler, template_name=match["name"]).order_by("-id").first() if already is not None and already.os_build is not None: return already.os_build, None - ResourceHandlerBaseService(handler).create_osbuild_and_attributes(dict(match), os_build_name=os_build_name, os_build=existing_osb) + _add_template(handler, match, os_build_name, existing_osb) osba = VsphereOSBuildAttribute.objects.filter(resourcehandler=handler, template_name=match["name"]).order_by("-id").first() if osba is None or osba.os_build is None: return None, "The template was imported but no OS build attribute for {} was found afterwards.".format(match["name"]) @@ -246,8 +259,6 @@ def _import_vmware(handler, image, os_build_name, existing_osb, job): def _import_generic(handler, image, os_build_name, existing_osb, job): - from resourcehandlers.services import ResourceHandlerBaseService - _progress(job, "Looking up image {}".format(image)) discovered, not_in_cb, _only = handler.discover_templates() discovered = list(discovered or []) @@ -258,7 +269,7 @@ def _import_generic(handler, image, os_build_name, existing_osb, job): if match is None: sample = ", ".join(str(d.get("name")) for d in discovered[:20] if isinstance(d, dict)) return None, "No image named '{}'. Some available: {}.".format(image, sample or "none discovered") - ResourceHandlerBaseService(handler).create_osbuild_and_attributes(dict(match), os_build_name=os_build_name, os_build=existing_osb) + _add_template(handler, match, os_build_name, existing_osb) osba = handler.os_build_attributes.filter(template_name=match.get("name")).order_by("-id").first() if osba is None or osba.os_build is None: return None, "The image was imported but no OS build attribute was found afterwards."