Project

General

Profile

Actions

Bug #17388

closed

Bad JSON answer for api PUT /rules

Added by François ARMAND over 4 years ago. Updated over 4 years ago.

Status:
Released
Priority:
N/A
Category:
API
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

The return JSON is missing the array of rules, contrary to what is documented and what is done for directives/groups.
It is also displaying ruleCategories in place of rule:

Actual:

{
  "action": "createRule",
  "id": "e12b9720-66c0-4887-8026-f72cdc423a69",
  "result": "success",
  "data": {
    "ruleCategories": {
      "id": "e12b9720-66c0-4887-8026-f72cdc423a69",
      "displayName": "RTF generated rule",
      "shortDescription": "",
      "longDescription": "",
      "directives": [
        "b078d18e-7a99-4bd5-8386-43eaf4f3669f" 
      ],
      "targets": [
        "policyServer:root" 
      ],
      "enabled": true,
      "system": false,
      "tags": []
    }
  }
}

VS (should):

{
  "action": "createRule",
  "id": "e12b9720-66c0-4887-8026-f72cdc423a69",
  "result": "success",
  "data": {
    "rules": [ {
      "id": "e12b9720-66c0-4887-8026-f72cdc423a69",
      "displayName": "RTF generated rule",
      "shortDescription": "",
      "longDescription": "",
      "directives": [
        "b078d18e-7a99-4bd5-8386-43eaf4f3669f" 
      ],
      "targets": [
        "policyServer:root" 
      ],
      "enabled": true,
      "system": false,
      "tags": []
    }
    ]
  }
}


Subtasks 2 (0 open2 closed)

Bug #17455: API change in rules upmerge breaks rudder 6.1ReleasedVincent MEMBRÉActions
Bug #17456: Parent ticket on rule api need to be backported on 5.0ReleasedVincent MEMBRÉActions
Actions #1

Updated by Vincent MEMBRÉ over 4 years ago

  • Status changed from New to In progress
  • Assignee set to Vincent MEMBRÉ
Actions #2

Updated by Vincent MEMBRÉ over 4 years ago

  • Assignee changed from Vincent MEMBRÉ to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder/pull/2969
Actions #3

Updated by Vincent MEMBRÉ over 4 years ago

  • Description updated (diff)

Corrected the expected json to

{
  "action": "createRule",
  "id": "e12b9720-66c0-4887-8026-f72cdc423a69",
  "result": "success",
  "data": {
    "rules": [ {
      "id": "e12b9720-66c0-4887-8026-f72cdc423a69",
      "displayName": "RTF generated rule",
      "shortDescription": "",
      "longDescription": "",
      "directives": [
        "b078d18e-7a99-4bd5-8386-43eaf4f3669f" 
      ],
      "targets": [
        "policyServer:root" 
      ],
      "enabled": true,
      "system": false,
      "tags": []
    }
    ]
  }
}

Actions #4

Updated by Vincent MEMBRÉ over 4 years ago

  • Status changed from In progress to Pending release
Actions #5

Updated by François ARMAND over 4 years ago

  • Fix check changed from To do to Checked
Actions #6

Updated by Vincent MEMBRÉ over 4 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 5.0.18 and 6.1.2 which were released today.

Actions

Also available in: Atom PDF