Changing snaplex of a task using api or any automated process

As we all know that when we migrate any project from one location to another the snaplex of the tasks remains the same. Now here is one problem let us say we are migrating project from one environment to another (eg development to Testing) we want to change the snaplex of all the task.
(Right now we have DEV snaplex and QCVMWARE snaplex).
so can anybody suggest any solution to change the snaplex of the tasks through any automated procedure or by rest api so that we don’t need to go in each task and manually change the snaplex.

You should be able to use the metadata snap to read tasks and then update the snaplex name/path.

hi @tlui,
thanks for your reply, here while reading task using snaplogic read snap we are not able to get snaplex parameter in the metadata, I have attached the sanp. you can see in parameters object there is no trace of snaplex. I even tried adding parameters.snaplex property explicitly which leads to an error saying 'additional parameters are not allowed in metadata while updating snap

The plex attribute is runtime_path_id.

thanks it worked