Project

General

Profile

Bug #5786

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

Added by Vincent MEMBRÉ over 5 years ago. Updated over 5 years ago.

Status:
Released
Priority:
N/A
Category:
API
Target version:
Pull Request:
Severity:
User visibility:
Effort required:
Priority:

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

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

Updated by Vincent MEMBRÉ over 5 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
#2

Updated by François ARMAND over 5 years ago

  • Description updated (diff)
#3

Updated by François ARMAND over 5 years ago

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

Updated by Vincent MEMBRÉ over 5 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)

Also available in: Atom PDF