sassoftware / pyviyatools

Python command-line tools that call the SAS Viya REST APIs - for SAS administrators.
Apache License 2.0
38 stars 31 forks source link

Fix validateviya.py columns #175

Closed henriquevaskys closed 1 year ago

henriquevaskys commented 1 year ago

Hi

I found out 2 strange outputs from validaiteviya.py

Test 0: Logged in User The columns 'name' and 'id' have their contents swapped. The only way I found to fix it was to change: {"id":"0", "name":"Logged in User", "active":"False", "req":['/identities/users/@currentUser'], "cols":['id','name'], 'type':'Data Collection'}, to: {"id":"0", "name":"Logged in User", "active":"False", "req":['/identities/users/@currentUser'], "cols":['name', 'id'], 'type':'Data Collection'},

I know it's not the most elegant way of fixing it.

Test 4: List CAS Server Metrics There I found the results for systemNodes and systemCores, and cpuSystemTime and memory are also swapped. I believe it's due the way python reads the data, it must be added and presented in order. Again, the only inelegant was to change the code reflecting the order where /casManagement/servers//metrics is presented.

Thanks, Henri

gerrynelson63 commented 1 year ago

Thanks Henri for making us aware of that. I think you are correct about the issue, we will do some investigation and fix the problem.

gerrynelson63 commented 1 year ago

@henriquevaskys , I believe I have fixed the problem. Would you mind testing it? The code is in the branch 175-fix-validateviyapy-columns.

If all goes well I will merge it in.

henriquevaskys commented 1 year ago

Hi Gerry, this one looks perfect! Thanks heaps! btw, I've just noticed "memory" on "Test 4: List CAS Server Metrics" isn't formatted in Mega/Tera notation. Do you think this is an easy fix? Cheers, Henri

gerrynelson63 commented 1 year ago

You are welcome I will merge the change in.

On the memory, we are just returning what the endpoint provides. It would not be easy in this context to format the value.