Skip to content

No output when creating muting rules #1568

@ghost

Description

Description

When I create a muting rule with newrelic-cli, the rule is properly created but output JSON is empty.
Muting rule Id should be returned as it is with curl command.

Go Version

Go not installed, use of newrelic-cli

$ newrelic --version
newrelic version 0.78.17

Current behavior

When I run this command (generated from NerdGraph API Explorer), returned JSON is empty

NEW_RELIC_REGION=eu NEW_RELIC_API_KEY=XXXXX newrelic nerdgraph query 'mutation {
  alertsMutingRuleCreate(
    accountId: 00000
    rule: {name: "dev-paris deployment 2", description: "Muting rule created with newrelic-cli", enabled: true, condition: {conditions: {attribute: "conditionId", operator: IN, values: ["XXXX", "YYYY"]}, operator: AND}}
  ) {
    id
  }
}' 
{}

Expected behavior

Get the same output than curl command:

NEW_RELIC_REGION=eu NEW_RELIC_API_KEY=XXXXX newrelic nerdgraph query 'mutation {
  alertsMutingRuleCreate(
    accountId: 000000
    rule: {name: "dev-paris deployment 2", description: "Muting rule created with newrelic-cli", enabled: true, condition: {conditions: {attribute: "conditionId", operator: IN, values: ["XXXX", "YYYY"]}, operator: AND}}
  ) {
    id
  }
}' 
{"data":{"alertsMutingRuleCreate":{"id":"XXXXX"}}}

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create alertsMutingRuleCreate query in nergraph API explorer
  2. Copy as newrelic-cli
  3. Run command

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions