Getting the output of uuid execution is empty


(Giorgos Karagkounis) #1

I run a uuid action . When I try to retrieve the output on the endpoint /api/v1/executions/{id}/output I don’t get any data on the response. How can I use the /output endpoint?

(L K) #2

Can you paste a curl example of the API call and the response? (Please remove any sensitive data such as API token). Also, do you see any output when you do st2 execution get ${id}?

(Giorgos Karagkounis) #3
curl -X POST \
  https://localhost/api/v1/executions/ \
  -H 'Content-Type: application/json' \
  -H 'X-Auth-Token: {token}' \
  -d '{
  "action": "core.uuid"

I get the execution id from the response.

Then :

curl -X GET \
  https://localhost/api/v1/executions/{execution_id}/output \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'X-Auth-Token: {token}'

The response is empty. Although I get a 200 ok status code.

(Lindsay Hill) #4

I think that /output is for streaming action output. That’s not going to be relevant for this, since it is not a long-running action.

If you just want the result, then get that instead - e.g. https://localhost/api/v1/executions/{execution_id}/attribute/result

I also recommend running st2 --debug run core.uuid to see some of the API calls being made there.

(Giorgos Karagkounis) #5

I cannot see the /result endpoint documented. Can you please link to it? I get a response “The resource could not be found.” when I try to access it.

I found that /attribute/result can do the job. Is that what you mean?

(Lindsay Hill) #6

Sorry, my mistake - I should have copied & pasted, rather than typed it out. Yes, attribute/result is probably what you want.

I’ll fix my original post