Tags are not working for service creation through API call #4049
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
Uh oh!
There was an error while loading. Please reload this page.
REST API is not creating services with its related passed tags arguments.
Trying to create a service and assign a tag to
curl -X POST
http://cmdbweb/api/ipam/services/
-H 'Accept: application/json'
-H 'Authorization: Token XPTO'
-H 'Cache-Control: no-cache'
-H 'Connection: keep-alive'
-H 'Content-Type: application/json'
-H 'Host: cmdbweb'
-H 'Postman-Token: e30af3a9-499c-422e-a69f-25c15edb59b3,cae622cf-2f8d-409d-8c0c-083eca0491e1'
-H 'User-Agent: PostmanRuntime/7.15.0'
-H 'accept-encoding: gzip, deflate'
-H 'cache-control: no-cache'
-H 'content-length: 114'
-H 'cookie: csrftoken=9cVlNttRCcRJ1SP7BM7EiYsC3sRISAxekLIp385OL9cf357es3c7LOEAIt1WT2Is'
-b csrftoken=9cVlNttRCcRJ1SP7BM7EiYsC3sRISAxekLIp385OL9cf357es3c7LOEAIt1WT2Is
-d '{
"name":"testService1",
"virtual_machine": 251,
"port":"9001",
"tag": "['''tagXPTOSample''']",
"protocol": 6
}'
Expected Behavior
Tag should be assigned to its service, but, no tag is assigned, only when adding manually through website. By api it's failing!
What happened instead?
API replied a 200 Status Code:
{"id":430,"device":null,"virtual_machine":{"id":251,"url":"http://cmdbweb/api/virtualization/virtual-machines/251/","name":"xptoservice.com.br"},"name":"testService1","port":9001,"protocol":{"value":"tcp","label":"TCP","id":6},"ipaddresses":[],"description":"","custom_fields":{},"created":"2020-01-29","last_updated":"2020-01-29T20:25:43.717031Z"}
The text was updated successfully, but these errors were encountered: