mirror of
https://github.com/coralogix/cx-cli.git
synced 2026-09-14 16:15:45 +08:00
d91c36043a
## Context
AIAPP-1842 updates CLI clients to call the current Coralogix OpenAPI v5
endpoint shapes for integrations extensions, contextual data
definitions/tests, and notification testing actions. The previous path
layout caused affected `cx` commands to hit stale URLs.
## Linked Issues
AIAPP-1842
## Design
The change stays inside the command API client layer: each affected
command continues to flow through its existing `run_*` command handler,
builds the same request bodies, and uses the shared HTTP client as
before. Only the path strings produced by `ContextualDataApi`,
`ExtensionsApi`, and `NotificationTestingApi` are changed so the same
command paths reach the updated backend routes.
## Key Decisions
The implementation avoids changing command flags, request payloads,
response parsing, or shared HTTP behavior because the contract mismatch
is isolated to route construction. Notification testing uses the
backend's action-style route names such as `connectors:testConfig` and
`templates:test`, while extensions and contextual data keep
resource-style paths where the API now expects `catalog/{id}`,
`definitions/{id}`, and `test/{id}`.
## Changes
- Updates contextual data definition and test requests to use
`/definitions/{id}` and `/test/{id}`.
- Updates extension get requests to use `/catalog/{id}`.
- Updates notification testing requests for connectors, destinations,
presets, routing conditions, and template rendering to the current
action-style endpoints.
- Updates the notification testing mock test expectation for the
connector test endpoint.
## Testing
- `cargo test --test notification_testing --test contextual_data --test
extensions` passed outside the sandbox so WireMock could bind local
mock-server ports.
## Risks & Rollout
Low risk and limited to the affected CLI commands. The main
compatibility risk is if any environment still serves the old endpoint
paths; rollback is to revert this branch and restore the previous route
strings.
## Out of Scope / Follow-ups
This PR does not add mock coverage for every notification testing action
path; it only updates the existing connector-path assertion that failed
after the endpoint correction.