{"openapi":"3.1.1","info":{"title":"API | v1","version":"1.0.0"},"paths":{"/api/dbmachines":{"get":{"tags":["DbMachines"],"summary":"Retrieves a list of all database servers","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DbMachineResponse"}}}}}},"post":{"tags":["DbMachines"],"summary":"Adds a new database server"}},"/api/datasources":{"get":{"tags":["DataSources"],"summary":"Lists all saved data sources, excluding passwords"},"post":{"tags":["DataSources"],"summary":"Creates a new data source by saving credentials for a specific machine"}},"/api/datasources/{id}":{"get":{"tags":["DataSources"],"summary":"Returns information about a specific data source, excluding password"},"delete":{"tags":["DataSources"],"summary":"Removes the data source and all its related configuration"}},"/api/datasources/{id}/databases":{"get":{"tags":["Databases"],"summary":"Retrieves the list of specific databases that the user has already saved"},"post":{"tags":["Databases"],"summary":"Saves a specific database for a user"}},"/api/datasources/{id}/databases/{id}":{"delete":{"tags":["Databases"],"summary":"Removes a saved database for a user"}},"/api/datasources/{id}/test":{"post":{"tags":["External"],"summary":"Attempts to establish a connection to the database server"}},"/api/datasources/{id}/introspect":{"get":{"tags":["External"],"summary":"Queries database server to discover all databases on a machine"}},"/api/datasources/{id}/databases/{name}/introspect":{"get":{"tags":["External"],"summary":"Queries database server to discover all available schemas in a database"}},"/api/datasources/{id}/run":{"post":{"tags":["External"],"summary":"Executes an SQL command on the remote database and returns the result"}}},"components":{"schemas":{"DbType":{"type":"string","description":"Supported database engines for introspection and queries","enum":["PostgreSQL","Oracle","SQLServer","MariaDb","MySQL"]},"DbMachineRequest":{"type":"object","required":["host","port","dbType"],"properties":{"host":{"type":"string","example":"student-db.cvut.cz"},"port":{"type":"integer","example":5432},"dbType":{"$ref":"#/components/schemas/DbType"}}},"DbMachineResponse":{"type":"object","required":["id","host","port","dbType"],"properties":{"id":{"type":"integer","example":1},"host":{"type":"string"},"port":{"type":"integer"},"dbType":{"$ref":"#/components/schemas/DbType"}}}}}}