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 almost 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

Also available in: Atom PDF