CiscoDevNet/sastre

run API call against "device", if it is all devices or devices deffined in txt/csv

Opened this issue · 3 comments

This would be absolutely great feature. I have it in my scripts it is called like this

python3 viptela_api.py --customer az get-api-devices-all-csv --api "dataservice/device/cellular/modem?deviceId=" --device_type vedge --csv_filename cellular_info_az2.csv

here i run API "dataservice/device/cellular/modem?deviceId=" against all rechable devices, which are vedge type (type is deffined by --device_type vedge

I have other function which is running the same not against all reachable devices but against devices deffined in other file so 2 type of script, run api against all or all API against devices I define for the script.

Such enhancement would be absolutely wonderful.

Potentially ...list of "aviable" APIs can be also shown via some --help. Sure some can be vedge type, other cedge type, some can work well for both vedge and cedge.
It can be some simple csv printed by the script, including what codes are supported by that API (I know API list can be more work to collect/maintain) :)

Thanks a lot, great job with sastre i use it several years and i use it a lot!

This would be a great enhancement for sastre

This is a very good idea Peter.

Instead of a csv file, I'm thinking about a yaml file as input. That would provide more flexibility into the api call parameters, making it suitable for more than just get requests. Thoughts?

This is a very good idea Peter.

Instead of a csv file, I'm thinking about a yaml file as input. That would provide more flexibility into the api call parameters, making it suitable for more than just get requests. Thoughts?

YAML is good idea, yes