-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
The New Relic integration CLI commands were implemented with incorrect parameters and endpoints that don't match the actual Cortex API specification.
Issues Found
1. Wrong Parameters in add Command
File: cortexapps_cli/commands/integrations_commands/newrelic.py:12,30
- Missing required parameter:
accountIdis required by API but not present in CLI - Wrong parameter name: CLI uses
--api-keyflag and sendsapiKeyin JSON payload- API expects:
personalKey - CLI sends:
apiKey
- API expects:
- Wrong parameter: CLI has
--hostparameter- API expects:
region(values: "US" or "EU") - CLI has:
host(free-form string)
- API expects:
2. Wrong HTTP Method for add_multiple
File: cortexapps_cli/commands/integrations_commands/newrelic.py:54
- CLI uses:
client.put("api/v1/newrelic/configurations") - API expects:
POST /api/v1/newrelic/configurations - Note: Test file correctly expects POST, but implementation uses PUT
3. Wrong Endpoint for validate Command
File: cortexapps_cli/commands/integrations_commands/newrelic.py:156
- CLI uses:
client.post("api/v1/newrelic/configurations/validate" + alias)- Missing slash before alias
- Wrong path structure
- API expects:
POST /api/v1/newrelic/configuration/validate/{alias}(singular "configuration")
4. Wrong Endpoint for validate_all Command
File: cortexapps_cli/commands/integrations_commands/newrelic.py:169
- CLI uses:
client.post("api/v1/newrelic/configurations") - API expects:
POST /api/v1/newrelic/configuration/validate(singular, with /validate)
Test File Issues
File: tests/test_integrations_newrelic.py
- Line 18: Expects POST (correct) but implementation uses PUT
- Line 53: Wrong endpoint - expects
/configuration/validate/testshould be/configuration/validate/{alias} - Line 58: Endpoint is correct
Root Cause
The New Relic integration commands appear to have been copied from another integration without proper adaptation to the New Relic API specification.
API Documentation Reference
https://docs.cortex.io/api/readme/integrations/new-relic
Required Fixes
- Update
addcommand to include--account-idparameter - Rename
--api-keyto--personal-keyand update JSON payload key - Replace
--hostwith--regionparameter (with US/EU validation) - Change
add_multiplefrom PUT to POST - Fix
validateendpoint path - Fix
validate_allendpoint path - Update all corresponding test expectations
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working