Project

General

Profile

Actions

Bug #5786

closed

You cannot pass 'include' / 'exclude' targets as json for Rule API

Added by Vincent MEMBRÉ about 10 years ago. Updated about 10 years ago.

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

Description

When defining a Rule, defining include/exclude targets is not easy.

You have to put a whole string to manage that target ... instead of using a json object.

We should definitely correct this.

To be more precise, this is the supported use cases:

JSON in a file (notice the content-type):

curl -H "X-API-Token: HRLeYGfBX9TZQnF0aq6Ab7U2M7HbRJO8" -k  -X POST -H "Content-Type: application/json"  http://localhost:8082/rudder-web/api/latest/rules/19050b37-cb8c-4449-8696-68bf6e575cf6\?prettify\=true -d @update.json

JSON in the line (notice the content-type):

curl -H "X-API-Token: HRLeYGfBX9TZQnF0aq6Ab7U2M7HbRJO8" -k  -X POST -H "Content-Type: application/json"  http://localhost:8082/rudder-web/api/latest/rules/19050b37-cb8c-4449-8696-68bf6e575cf6\?prettify\=true -d '{"targets":["special:all", "group:b92a4f59-da85-455e-ab3d-1fd48e43a5f8"]}'

Simple list of groups:

curl -H "X-API-Token: HRLeYGfBX9TZQnF0aq6Ab7U2M7HbRJO8" -k  -X POST  http://localhost:8082/rudder-web/api/latest/rules/19050b37-cb8c-4449-8696-68bf6e575cf6\?prettify\=true -d "targets=special:all" -d "targets=group:b92a4f59-da85-455e-ab3d-1fd48e43a5f8"

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #5931: Api does not fail on bad JSONReleasedFrançois ARMANDActions
Actions #1

Updated by Vincent MEMBRÉ about 10 years ago

  • Subject changed from You can pass 'include' / 'exclude' targets as json for Rule API to You cannot pass 'include' / 'exclude' targets as json for Rule API
Actions #2

Updated by François ARMAND about 10 years ago

  • Description updated (diff)
Actions #3

Updated by François ARMAND about 10 years ago

  • Status changed from New to Pending release
  • % Done changed from 0 to 100
Actions #5

Updated by Vincent MEMBRÉ about 10 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.10.8 and 2.11.5, which were released today (16/12/14)

Actions

Also available in: Atom PDF