You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/06/03 05:54:05 UTC

[PR] Support the OAP admin-server REST API (`swctl admin ...`) and adapt to OAP 11.0.0 [skywalking-cli]

wu-sheng opened a new pull request, #228:
URL: https://github.com/apache/skywalking-cli/pull/228

   ## Motivation
   
   SkyWalking OAP 11.0.0 introduced an **admin-server** — a second HTTP surface (default port `17128`) separate from the public GraphQL/MQE surface (`12800`) — that bundles the operator-facing feature modules (`status`, `inspect`, `ui-management`, `dsl-debugging`, `receiver-runtime-rule`), all enabled by default. swctl previously spoke **only** GraphQL and had no concept of the admin host, so operators had to `curl` these endpoints by hand. Several long-standing endpoints (cluster status, effective config, TTL, alarm runtime status) also relocated here in 11.0.0 and were never wrapped by swctl.
   
   This PR gives swctl a first-class admin-host REST client and a `swctl admin ...` command tree covering every admin feature module, and adapts the existing commands to the OAP 11.0.0 breaking changes.
   
   ## Admin REST surface (default port 17128)
   
   - New global **`--admin-url`** flag (env `SW_ADMIN_URL`, config key `admin-url`), derived from `--base-url`'s host with port `17128` when unset. `--username`/`--password`/`--authorization`/`--insecure` apply to it the same way.
   - New `pkg/transport` (shared TLS / basic-auth, factored out of the GraphQL client) and `pkg/admin/client` (REST client with a typed error envelope) + `pkg/admin/preflight` (admin-module feature detection via `/debugging/config/dump`, with friendly "module not enabled / admin unreachable" messages).
   - `swctl admin ...` commands, one group per module:
     - `admin preflight`
     - **status**: `admin cluster nodes`, `admin config dump|ttl`, `admin alarm rules|rule`
     - **inspect**: `admin inspect metrics|entities`
     - **ui-management**: `admin ui-template list|get|create|update|disable`
     - **runtime-rule**: `admin runtime-rule list|bundled|get|add|inactivate|delete|dump` (raw-YAML upload, `X-Sw-*`/ETag/304, tar.gz)
     - **dsl-debugging**: `admin dsl-debug status|sessions|session start|get|stop` and `admin oal files|file|rules|rule`
   
   ## OAP 11.0.0 adaptations
   
   - **`alarm list`**: migrate the deprecated `getAlarm` → `queryAlarms`, adding `--layer` and `--rules` filters.
   - **`menu get`**: detect the retired `getMenuItems` query and report a clear message ("OAP 11.0.0+ no longer serves the UI menu …") instead of a raw GraphQL error.
   
   ## E2E
   
   - Bump the e2e OAP to an 11.0.0+ build and switch storage from **Elasticsearch → BanyanDB** (lighter to spin up).
   - `basic`: `layer list` made order-insensitive via `yq sort`; the trace cases migrated to **`trace-v2`** (BanyanDB rejects the v1 trace API: *"BanyanDB Trace Model changed, please use queryTraces"*).
   - New **`admin`** case (static admin REST) and **`live-debugging`** case (OAL live capture driving `admin dsl-debug session` — asserts the captured pipeline is **exactly** the bound metric: correct source → `cpm()` → output, with per-metric gate isolation).
   - New `admin-command-tests` and `live-debugging-tests` CI jobs.
   
   ## Verification
   
   All three e2e suites were run locally against the bumped OAP + BanyanDB and pass: `basic` (27 checks), `admin` (11 checks), `live-debugging` (OAL capture with exact-metric assertions) — plus manual write round-trips against the live backend (ui-template CRUD, runtime-rule add/inactivate/delete lifecycle). `go build` / `go vet` / `go test` / `golangci-lint` (0 issues) / `license-eye` all green.
   
   ## Compatibility
   
   Adds a `>= 0.15.0 → >= 11.0.0` row to the compatibility table — the admin commands and `queryAlarms` require OAP 11.0.0+.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support the OAP admin-server REST API (`swctl admin ...`) and adapt to OAP 11.0.0 [skywalking-cli]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #228:
URL: https://github.com/apache/skywalking-cli/pull/228


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org