Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE

API :: /storage/task/

rpchris

Newbie
Joined
Nov 29, 2019
Messages
3
Hey Guys,

Trying to create a snapshot task, and using the default params getting the following:

Code:
send("storage/task/", 'post', [
    'task_filesystem' => $fs,
    'task_recursive'  => true,
    'task_ret_unit'   => 'week',
    'task_enabled'    => true,
    "task_byweekday"  => "1,2,3,4,5",
    'task_interval'   => 60,


Result:

Code:
Server error: `POST http://10.10.0.2/api/v1.0/storage/task/` resulted in a `500 Internal Server Error` response:
{"error_message": "invalid literal for int() with base 10: '1,2,3,4,5'", "traceback": "Traceback (most recent call last)


Looks like this is where its failing perhaps?
data['dow'] = [int(day) for day in data.pop('byweekday')]

line: 2045, of forms.py.. Not a python guy so not sure what is causing it.. I tried without sending task_byweekday originally and it gave the same error. Tried sending as an array.. no dice.

FN Version: FreeNAS-11.2-U7

Any advise on where to go from here? I tried searching but came up empty. Thanks!
 

rpchris

Newbie
Joined
Nov 29, 2019
Messages
3
Quick Update: If I pass task_byweekday => (int) 1 -- it will accept a single day.. just not a CSV string.
 

rpchris

Newbie
Joined
Nov 29, 2019
Messages
3
..... if anyone sees this.. you have to pass an array of numbers wrapped as a string :) I ... yeah..
 
Top