If you are not familiar with how to use the Valohai APIs, take a look at the Introduction section first.
When running a large Task it might happen that some of the executions fail due to various reasons. Instead of having to run the whole Task again, you can restart only the failed executions by using an API call.
Below is an example Python script for the call but you can of course use e.g. Postman to run it.
import requests
import json
import os
# Authenticate yourself with the token
auth_token = os.environ['VH_API_TOKEN']
headers = {'Authorization': 'Token %s' % auth_token}
# Send a POST request to the endpoint
url = 'https://staging.valohai.com/api/v0/tasks/{task-id}/restart_failed_executions/'
resp = requests.post(url, headers=headers)
# Print the response you've received back
print('# API Response:\n')
print(json.dumps(resp.json(), indent=4))
Assuming there were two restarted executions, the response would look something like this:
# API Response:
{
"restarted": [
"exec-id-1",
"exec-id-2"
]
}
Comments
0 comments
Please sign in to leave a comment.