Deploy App to Edge Device
4 min
deploy application to edge device (lem async task) ui trigger lem > edge lifecycle management > applications > launch application lem long running operations (app launch, ml deploy, software update) are wrapped in an async task envelope the client posts a task description, gets a taskid , and polls subtask status until success the same pattern underlies several lem ops step table step name in collection method endpoint body / notes output 1 catalogs get {{lem url}}/mpcs/catalogs header authorization {{lem adminapitoken}} (not x authtoken ) catalogid 2 catalog applications get {{lem url}}/mpcs/catalogs/{catalogid}/applications same authorization header applicationid , applicationname , applicationversion 3 launch application to edge device post {{lem url}}/api/v1/async task/task with subtasks header x authtoken {{lem adminapitoken}} body see below { taskid } 4 verify if deploy task is complete (poll) get {{lem url}}/api/v1/async task/{{task id}}/subtasks poll until each subtask status == "success" other states pending , in progress , failed subtask list with status 5 apps list for device get {{lem url}}/api/v1/marketplace/app/plain? confirm app installed on device step 3 body { "name" "\<task name>", "companyname" " ", "projectid" " ", "type" "marketplace application launch", "subtasks" \[{ "deviceid" " ", "type" "marketplace application launch", "params" { "applicationid" " ", "applicationname" " ", "applicationversion" " ", "catalogid" " ", "catalogname" " ", "catalogurl" " ", "applicationparameters" { } } }] } same async task wrapper is used by ml model deploy ( type "analytics ml model upload" ) software updates ( type "firmware update" ) other long running fleet ops software update history endpoint at /api/v1/async task/subtasks reads recent runs across all task types auth nuance steps 1 and 2 hit /mpcs/ and require authorization {{lem adminapitoken}} (no bearer prefix) steps 3 5 hit /api/v1/ and require x authtoken {{lem adminapitoken}} sending the wrong header returns 401