The tool will automatically use the default profile.
The tool will automatically use the default profile.
1. To create a profile as a SAS Administrator logon to the machine that contains the Viya CLI's
1. To create a profile as a SAS Administrator logon to the machine that contains the Viya CLI's
2. Run */opt/sas/viya/home/bin/sas-admin profile init* and when prompter enter the base endpoint of your Viya server for example: http://myviyaserver.blah.com. You may enter your personal preference at the other prompts.
2. Run `/opt/sas/viya/home/bin/sas-admin profile init` and when prompted enter the base endpoint of your Viya server for example: http://myviyaserver.blah.com. You may enter your personal preference at the other prompts.
3. After you create the profile there are two options to authenticate
3. After you create the profile there are two options to authenticate
* Run */opt/sas/viya/home/bin/sas-admin auth login* to authenticate to Viya enter the userid and password of the SAS Administrator when prompted.
* Run `/opt/sas/viya/home/bin/sas-admin auth login` to authenticate to Viya enter the userid and password of the SAS Administrator when prompted.
* Create an .authinfo file in your home directory with your userid and password and use **loginviauthinfo.py** to authenticate with the credentials in the file (you can use different authinfo files with the -f option)
* Create an .authinfo file in your home directory with your userid and password and use **loginviauthinfo.py** to authenticate with the credentials in the file (you can use different authinfo files with the -f option)
The CLI allows for multiple profiles. To use a profile other than the default profile, for example newprofile
The CLI allows for multiple profiles. To use a profile other than the default profile, for example newprofile
@ -130,17 +132,17 @@ The most common problem is an expired access token. You may see a message like:
{"errorCode":0,"message":"Cannot convert access token to JSON","details":["traceId: 6bca23b2b3a2cfda","path: /folders/folders"],"remediation":null,"links":[ ],"version":2,"httpStatusCode":401}
{"errorCode":0,"message":"Cannot convert access token to JSON","details":["traceId: 6bca23b2b3a2cfda","path: /folders/folders"],"remediation":null,"links":[ ],"version":2,"httpStatusCode":401}
To fix the problem generate a new access token /opt/sas/viya/home/bin/sas-admin auth login
To fix the problem generate a new access token: `/opt/sas/viya/home/bin/sas-admin auth login`
To see the current setup, including python and package versions, environment variable settings, profile information and current user. Run
To see the current setup, including python and package versions, environment variable settings, profile information and current user. Run
*python showsetup.py*
`python showsetup.py`
If you get this error : Login failed. Error with security certificate.
If you get this error : Login failed. Error with security certificate.
Set the environment variable for the SSL certificate file. For example:
Set the environment variable for the SSL certificate file. For example:
@ -165,7 +167,7 @@ The file sharedfunctions.py contains a set of generic functions that make it eas
* data: optionally a python dictionary created from the json for the rest request
* data: optionally a python dictionary created from the json for the rest request
* stoponerror: whether the function will stop all further processing if an error occurs (default 0 to not stop)
* stoponerror: whether the function will stop all further processing if an error occurs (default 0 to not stop)
We suggest you use listcaslibs_example.py as a simple example to copy from if you wish to develop your own python scripts, and are new to Python or some of the concepts we have used. If one of the other existing tools is similar to what you want, of course you could use that as the basis for a new tool too.
We suggest you use [listcaslibs_example.py](listcaslibs_example.py) as a simple example to copy from if you wish to develop your own python scripts, and are new to Python or some of the concepts we have used. If one of the other existing tools is similar to what you want, of course you could use that as the basis for a new tool too.