Forum Discussion
Julio_Navarro
Cirrostratus
Jul 18, 2019Using an asynchronous task | Creating UCS File
Hi, I am trying the following REST URL to create a task to generate a UCS File: Method: Post
URI: mgmt/tm/task/sys/ucs/
Body: { "command": "save", "name": "UCS01" }
So, I get back: {...
- Apr 24, 2020
; to close the loop on this one, it appears that you the part that was missing in your request is the -X PUT request, to set the state to 'VALIDATING'
# curl -k -u admin:admin -H 'Content-Type: application/json' -X PUT -d '{"_taskState":"VALIDATING"}' https://localhost/mgmt/tm/task/sys/ucs/1563478591515657?ver=12.1.3.4 { "code":202, "message":"Task will execute asynchronously.", "errorStack":[] }That is the request which is necessary to cause any task to begin processing. Until then, the task is waiting for any number of additional tasks to be added together.
cjunior
Nacreous
Jul 18, 2019Hi,
Tested on v15.0.0 looks OK for me.
What BIG-IP version are you trying to?
curl -k -u admin:admin -X POST -H 'Content-Type: application/json' -d '{ "command": "save", "name": "UCS01" }' https://localhost/mgmt/tm/task/sys/ucs
{
"_taskId": 1563470408202544,
"_taskState": "STARTED",
"_taskTimeInStateMs": 0,
"_taskResultLink": "https://localhost/mgmt/tm/task/sys/ucs/1563470408202544/result?ver=15.0.0",
"selfLink": "https://localhost/mgmt/tm/task/sys/ucs/1563470408202544?ver=15.0.0"
}curl -k -u admin:admin -H 'Content-Type: application/json' -X PUT -d '{"_taskState":"VALIDATING"}' https://localhost/mgmt/tm/task/sys/ucs/1563470408202544
{
"code": 202,
"message": "Task will execute asynchronously.",
"errorStack": []
}curl -k -u admin:admin https://localhost/mgmt/tm/task/sys/ucs/1563470408202544
{
"selfLink": "https://localhost/mgmt/tm/task/sys/ucs/1563470408202544?ver=15.0.0",
"_taskId": 1563470408202544,
"_taskState": "COMPLETED",
"_taskTimeInStateMs": 13000,
"_taskResultLink": "https://localhost/mgmt/tm/task/sys/ucs/1563470408202544/result?ver=15.0.0"
}# ls -la /var/local/ucs
total 484520
drwxr-xr-x. 3 root root 4096 Jul 18 14:29 .
drwxr-xr-x. 9 root root 4096 Jun 28 12:23 ..
-rw-r--r--. 1 root root 195341011 Jun 28 12:23 config.ucs
-r--r--r--. 1 root root 114 May 10 05:57 cs_backup_rotate.conf
drwxr-xr-x. 2 root root 4096 Jun 28 12:43 tmp
-rw-r--r--. 1 root root 300789664 Jul 18 14:15 UCS01.ucs
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
