Project

General

Profile

Actions

Bug #8957

closed

Rudder Directive Rest API does not parse json parameters correctly

Added by Florian Heigl about 8 years ago. Updated about 8 years ago.

Status:
Released
Priority:
1 (highest)
Category:
API
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

I run pretty much this:

curl -s -k -X PUT -H "X-API-Token: zzzz" \
-H "Content-Type: application/json" \
"https://localhost/rudder/api/latest/directives" \
-d @${o}

The file in -d looks like this:

@ cat jsonthing {
"id": "some_specific_uuid",
"displayName": "varname",
"shortDescription": "This in an example Directive to use in Rudder api documentation",
"longDescription": "",
"enabled": true,
"system": false,
"parameters": {
"section": {
"name": "sections",
"sections": [ {
"section": {
"name": "Variable definition",
"vars": [ {
"var": {
"name": "GENERIC_VARIABLE_CONTENT",
"value": "REPLACE_THIS_TO_TEST"
}
}, {
"var": {
"name": "GENERIC_VARIABLE_NAME",
"value": "var_meepmeep"
}
}
]
}
}
]
}
},
"techniqueName": "genericVariableDefinition"

}@

{"action": "createDirective","id": "dff2e53b-5cbe-4c74-a07f-95775e7cc804","result": "success","data": {"directives": [{"id": "dff2e53b-5cbe-4c74-a07f-95775e7cc804","displayName": "varname","shortDescription": "This in an example Directive to use in Rudder api documentation","longDescription": "","techniqueName": "genericVariableDefinition","techniqueVersion": "2.0","parameters": {"section": {"name": "sections","sections": [{"section": {"name": "Variable definition","vars": [{"var": {"name": "GENERIC_VARIABLE_CONTENT","value": "733f9f34d2cd421afd5ef85295f9c8d5"}},{"var": {"name": "GENERIC_VARIABLE_NAME","value": "var_meepmeep"}}]}}]}},"priority": 5,"isEnabled": true,"isSystem": false}]}}

The UUID returned from the directive creation is NOT the one I gave.

If I try to pass in the ID via another parameter I find that it gets worse.

I add:
-d "id=myuuid" \
and it'll say:

{"action": "createDirective","id": "b162f3c1-a725-4468-a7e9-f1956b6d21e1","result": "error","errorDetails": "Could not get create a Directive details because there is no value as display name."}

So 1) it again doesn't read the id 2) it doesn't read anything else either.
Maybe my -d call here is wrong.

In any case, it seems there is absolutely no way to use this as documented.
Could you please look into it?

It blocks all my progress tbh.


Subtasks 1 (0 open1 closed)

Bug #9194: Two level of 'directives' in directive APIReleasedFrançois ARMAND2016-09-30Actions
Actions #1

Updated by Vincent MEMBRÉ about 8 years ago

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

Updated by Vincent MEMBRÉ about 8 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder/pull/1192
Actions #4

Updated by François ARMAND about 8 years ago

  • Status changed from Pending technical review to 12
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
Actions #5

Updated by Vincent MEMBRÉ about 8 years ago

  • Status changed from 12 to Pending release
  • % Done changed from 0 to 100
Actions #6

Updated by Vincent MEMBRÉ about 8 years ago

  • Subject changed from Web API doesn't process uuid for newly added directive to Rudder Directive Rest API does not parse json parameters correctly
Actions #7

Updated by Vincent MEMBRÉ about 8 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 3.1.15/14 and 3.2.8/7 which were released today.

Actions

Also available in: Atom PDF