Actions
Bug #3756
closedModifying the group of a Rule by API need to use the data "ruleTarget" instead of "targets"
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
When getting information from a group with the API, we've got:
{ "action":"ruleDetails", "id":"e8cf66a9-f891-48c4-8adb-c86dfc1451d6", "result":"success", "data":{ "rules":[{ "id":"e8cf66a9-f891-48c4-8adb-c86dfc1451d6", "displayName":"Rule to Remove (renamed)", "shortDescription":"", "longDescription":"", "directives":["b3d2a48b-18b9-49c1-804d-91a2f797ab6a"], "targets":[], "enabled":true, "system":false }] }
But if we want to modify the targets (the group, indeed), we have to use ruleTarget instead of targets:
curl -H "X-API-Token:cEMKWn38wzgpIZPwmipe1NPeAmfzwroR" -H "X-API-Version: 1.0" -X POST http://localhost/rudder/api/rules/e8cf66a9-f891-48c4-8adb-c86dfc1451d6?prettify=true -d "targets=group:db58aaa7-f51c-42a5-af32-4d1e3bf95b10" { "action":"updateRule", "id":"e8cf66a9-f891-48c4-8adb-c86dfc1451d6", "result":"success", "data":{ "rules":[{ "id":"e8cf66a9-f891-48c4-8adb-c86dfc1451d6", "displayName":"Rule to Remove (renamed)", "shortDescription":"Little comment", "longDescription":"Big comment with strange characters: œ$%!\\/\r\nEnd of comment", "directives":["b3d2a48b-18b9-49c1-804d-91a2f797ab6a"], "targets":[], "enabled":true, "system":false }] }
curl -H "X-API-Token:cEMKWn38wzgpIZPwmipe1NPeAmfzwroR" -H "X-API-Version: 1.0" -X POST http://localhost/rudder/api/rules/e8cf66a9-f891-48c4-8adb-c86dfc1451d6?prettify=true -d "ruleTarget=group:db58aaa7-f51c-42a5-af32-4d1e3bf95b10" { "action":"updateRule", "id":"e8cf66a9-f891-48c4-8adb-c86dfc1451d6", "result":"success", "data":{ "rules":[{ "id":"e8cf66a9-f891-48c4-8adb-c86dfc1451d6", "displayName":"Rule to Remove (renamed)", "shortDescription":"Little comment", "longDescription":"Big comment with strange characters: œ$%!\\/\r\nEnd of comment", "directives":["b3d2a48b-18b9-49c1-804d-91a2f797ab6a"], "targets":["group:db58aaa7-f51c-42a5-af32-4d1e3bf95b10"], "enabled":true, "system":false }] }
Updated by Vincent MEMBRÉ over 11 years ago
- Status changed from New to Pending technical review
- Assignee changed from Vincent MEMBRÉ to François ARMAND
- Pull Request set to https://github.com/Normation/rudder/pull/268
Pull request here : https://github.com/Normation/rudder/pull/268
Updated by Vincent MEMBRÉ over 11 years ago
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
Applied in changeset c5aeb0cd6f1160d93d1e622823881f22f7545e25.
Updated by Anonymous over 11 years ago
Applied in changeset 1215d862df45bbf37b5c477653cf220f827fef8e.
Updated by Nicolas PERRON over 11 years ago
- Status changed from Pending release to Released
Actions