After reading the article "Promoting SAS Viya Job Flows", I realized that I am a lazy person. Creating a JSON file that defines what to export is very time-consuming and can keep me focused if I only have to do it once. But if I needed to export many jobs many times, I thought I would write a script. And I managed to create a working script.
The example screenshot shows the procedure of exporting a test flow "ant-flow". You can specify the name or ID of the flow as an argument to the script. Please install the sas-viya CLI before running this script, this will not work with Viya 3.x.
The following shows how the script retrieves the desired ID and URI. First, get the ID of the flow from its name.
The next step is to use the ID of the flow as the key to search and get the URI of the flow and the jobs contained in the flow.
Retrieve the jobRequestUri by searching for Actions with the job ID as the key. The ID of the job flow is recursively broken down into jobs.
The script I attached is short and simple, and I think it can be easily modified. If you could point out any errors, I would be very grateful.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.