Skip to content
Snippets Groups Projects
Commit 3e2f86e8 authored by Juan Fuentes's avatar Juan Fuentes
Browse files

SSDM-10471 : openBIS Monitor tool

parent 5538940a
No related branches found
No related tags found
No related merge requests found
# MICROSERVICE SERVER # # MONITOR TOOL #
## Introduction ## ## Introduction ##
This project is supposed to be used to monitor openBIS. This tool monitors openBIS is up making a series of API calls.
It logs in on the AS, fetches a Dataset definition from the AS and returns a file listings from the DSS.
## Build ## ## Build ##
...@@ -20,7 +22,8 @@ openbis-monitor-tool % ./bin/openbis-monitor-tool https://openbis-eln.ethz.ch/ 3 ...@@ -20,7 +22,8 @@ openbis-monitor-tool % ./bin/openbis-monitor-tool https://openbis-eln.ethz.ch/ 3
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
sessionToken: user_id-210115124729932xA447FC439B489276083A5B201F521A6D Login [AS]: true
isSessionActive: true Dataset Search [AS]: true
true File Search [DSS]: true
ALL OK: true
...@@ -47,19 +47,19 @@ public class Monitor ...@@ -47,19 +47,19 @@ public class Monitor
} }
boolean isSessionActive = v3.isSessionActive(sessionToken); boolean isSessionActive = v3.isSessionActive(sessionToken);
System.out.println("sessionToken: " + sessionToken); System.out.println("Login [AS]: " + isSessionActive);
System.out.println("isSessionActive: " + isSessionActive);
// Search for the dataset // Search for the dataset
Map<IDataSetId, DataSet> results = v3.getDataSets(sessionToken, Arrays.asList(new DataSetPermId(args[4])), new DataSetFetchOptions()); Map<IDataSetId, DataSet> asSearchResults = v3.getDataSets(sessionToken, Arrays.asList(new DataSetPermId(args[4])), new DataSetFetchOptions());
System.out.println("Dataset Search [AS]: " + (asSearchResults.size() == 1));
DataSetFileSearchCriteria criteria = new DataSetFileSearchCriteria(); DataSetFileSearchCriteria criteria = new DataSetFileSearchCriteria();
criteria.withDataSet().withCode().thatEquals(args[4]); criteria.withDataSet().withCode().thatEquals(args[4]);
SearchResult<DataSetFile> files = dssv3.searchFiles(sessionToken, criteria, new DataSetFileFetchOptions()); SearchResult<DataSetFile> dssFileListing = dssv3.searchFiles(sessionToken, criteria, new DataSetFileFetchOptions());
System.out.println(!results.isEmpty() && files.getTotalCount() > 0); System.out.println("File Search [DSS]: " + (dssFileListing.getTotalCount() > 0));
v3.logout(sessionToken); v3.logout(sessionToken);
System.out.println("ALL OK: " + (isSessionActive && (asSearchResults.size() == 1) && (dssFileListing.getTotalCount() > 0)));
} catch(Exception ex) { } catch(Exception ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment