How to programmatically connect a search datasource to a Splunk visualization (without using the dashboard):