BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JoKl
Calcite | Level 5

Hallo allerseits.

Wir setzen auf unserer Viya 3.5 Umgebung seit Neuestem auch das Model Studio ein. Leider legt das Model Studio seine Projekte ohne jede Möglichkeit einer Ordnerstruktur falch nebeneinander ab. Sie erscheinen auch nicht unter "SAS Inhalte". Als Export Möglichkeit habe ich nur gefunden, jedes Projekt einzeln und manuell zu exportieren. Auch unter den pyviyatools habe ich kein Programm dafür gefunden. Laut SAS Support gibt es diese Möglichkeiten erst mit Viya 4.

 

Als SAS Administrator suche ich nach einer Möglichkeit, alle Model Studio Projekte in Summe zu exportieren/sichern. So, wie wir es z.B. mit dem VA Report Ordner tun.

 

Hat Jemand einen Tipp für mich?

Grüße,

Johannes.

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
The way I do it in the program is to access the URL http(s)://webhost:port/analyticsGateway/projects, which returned in JSON format a list of them. Typically this would return the first 10 results as well as a "next" link that would be something like /analyticsGateway/projects?start=10 to pull the next 10. You could also adjust the url you access with a higher limit (/analyticsGateway/projects?limit=100) to get more at once.
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

5 REPLIES 5
ShelleySessoms
Community Manager

For those able to help @JoKl , here is the English version:

 

Hello everybody.

We have recently been using the Model Studio on our Viya 3.5 environment. Unfortunately, the Model Studio stores its projects side by side without any possibility of a folder structure. They also do not appear under "SAS Content". The only export option I found was to export each project individually and manually. Also under the pyviyatools I did not find a program for it. According to SAS Support, these options are only available with Viya 4.
As a SAS administrator, I'm looking for a way to export/backup all Model Studio projects in one go. Just like we do with the VA Report folder, for example. Does anyone have a tip for me? Regards, John.
gwootton
SAS Super FREQ
If you know the URIs of the objects you wish to export the transfer service will accept a list of URIs to build an export package using the sas-admin CLI transfer plugin's "request" option.

I wrote a script a while back that extends the functionality of the sas-admin CLI's transfer plugin, and among the options it has is an "--endpoint" option that, when given an endpoint like /reports/reports would build an export package for every n reports (10 by default, this can be adjusted using the --chunksize option). I think that models would be part of the /analyticsGateway/projects endpoint (though I'm not sure, I'm not too familiar with Model Studio).

If you'd like to give it a try you can find the script here. I would caution you to take a backup first in case anything goes wrong. I have not done extensive testing of it, especially not with models. The script needs to be run on a system that has the jq command installed as well as the sas-admin CLI with the transfer plugin and a profile set up to connect to the environment you are exporting from and importing to (if you wish to use the import functionality).

https://github.com/greg-wootton/sas-programs/blob/main/Shell%20Scripts/transfer.sh

The underlying functionality I'm using is described here:

Promotion: How To (CLI)
https://go.documentation.sas.com/doc/en/calcdc/3.5/calpromotion/n0u4qkc837891vn1w8pd2rbqaxzb.htm

The script essentially calls the endpoint provided (i.e. /reports/reports) and parses the results to get a list of URIs (/reports/reports/<report_id>), building a new json file compatible with the request option of the transfer plugin with those URIs, exports them and downloads the export package, then deletes the export package from the server, as well as optionally checking the export file for issues and importing it to the new environment.
--
Greg Wootton | Principal Systems Technical Support Engineer
JoKl
Calcite | Level 5
Thanks for this hints. My next question ist, how to get al list of the URIs of all Model Studio Projects?
gwootton
SAS Super FREQ
The way I do it in the program is to access the URL http(s)://webhost:port/analyticsGateway/projects, which returned in JSON format a list of them. Typically this would return the first 10 results as well as a "next" link that would be something like /analyticsGateway/projects?start=10 to pull the next 10. You could also adjust the url you access with a higher limit (/analyticsGateway/projects?limit=100) to get more at once.
--
Greg Wootton | Principal Systems Technical Support Engineer
JoKl
Calcite | Level 5
thanks a lot, that will help me.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1742 views
  • 2 likes
  • 3 in conversation