Vegini Posted December 11, 2020 Share Posted December 11, 2020 Hello everyone, I was wondering whether there was a way for me to export or download a list of all the indexed data that is connected to the workbench. I don't need to values in these files, rather just a list of the names of all the indexed files in there. Thank you, Vegini Link to comment Share on other sites More sharing options...
Thorsten Vogt Posted December 11, 2020 Share Posted December 11, 2020 Hi Vegini, I guess there are two ways to accomplish this. First one is using Seeq CLI using the command seeq datasource items on the Seeq server. As you can see below you are able to filter for specific datasources you are interested in and also export the results to a .csv file. To get the name, class or id of a datasource you can execute seeq datasource list first to get the desired information to be used for filtering: More information on the CLI can be found here: https://support.seeq.com/space/KB/215384254/Seeq%20Server%20Command%20Line%20Interface%20(CLI) The second way would be utilizing the API, for example in a python script. As you see you have to specify the ID of the datasource to get the associated items. The ID of a datasource can be determined by calling the datasources endpoint: Hope this helps. Regards, Thorsten 3 Link to comment Share on other sites More sharing options...
Vegini Posted December 14, 2020 Author Share Posted December 14, 2020 Thank you very much Thorsten! This has helped a lot. I just wanted to check whether the API method allows us to export into a csv/some other file, or is the text from the response body the only output. Thanks again! Vegini Link to comment Share on other sites More sharing options...
Thorsten Vogt Posted December 14, 2020 Share Posted December 14, 2020 (edited) The API shown above returns the data in JSON format. To create a CSV file you - can write some custom code making use of the Seeq SDKs (here Python) import seeq_sdk as sdk import csv # login prompt definition def get_authenticated_client(api_url): api_client = sdk.ApiClient(api_url) auth_api = sdk.AuthApi(api_client) auth_input = sdk.AuthInputV1() auth_input.username = <username> auth_input.password = <password> auth_input.auth_provider_class = "Auth" auth_input.auth_provider_id = "Seeq" auth_api.login(body=auth_input) return api_client seeq_api_url = 'http://seeqserver:34216/api' seeq_api_client = get_authenticated_client(seeq_api_url) datasourcesApi = sdk.DatasourcesApi(seeq_api_client) output = datasourcesApi.get_items_hosted_by_datasource(id=<id of datasource>, limit=300) with open("C:\\temp\\items.csv", "w", newline='') as csvFile: writer = csv.writer(csvFile) writer.writerow(["Name", "Type"]) for item in output.items: writer.writerow([item.name, item.type]) - take the output from the response body and use 3rd-party tools to convert to csv - use Seeq Data Lab (requires Seeq Data Lab license) data = spy.search({"Datasource Name": "Example Data"}) data.to_csv('items.csv') Regards, Thorsten Edited December 14, 2020 by Thorsten Vogt 1 Link to comment Share on other sites More sharing options...
Vegini Posted December 15, 2020 Author Share Posted December 15, 2020 Thank you Thorsten! I shall try that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now