Skip to content

Instantly share code, notes, and snippets.

@agrohe21
Created March 14, 2014 22:21
Show Gist options
  • Save agrohe21/9558204 to your computer and use it in GitHub Desktop.
Save agrohe21/9558204 to your computer and use it in GitHub Desktop.
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7')
import groovyx.net.http.RESTClient
import static groovyx.net.http.ContentType.*
import org.crsh.text.ui.UIBuilder
UIBuilder ui = new UIBuilder();
def http = new RESTClient( 'http://localhost:8080/pentaho/' )
def resp = http.get( path: 'content/ws-run/soapConnectionService/getConnections', query: [userid: 'admin', password: 'password'] )
def data = resp.getData()
ui.table(separator: dashed) {
header(decoration: bold, foreground: black, background: white) {
label("NAME"); label("DB NAME"); label("DB PORT"); label("HOST"); label("DB TYPE"); label("URL")
}
}
data.return.each {
def row = it
ui.row() {
label(row.name, foreground: red, minWidth: 30);
label(row.databaseName);
label(row.databasePort);
label(row.hostname);
label(row.databaseType.name);
label(row.databaseType.extraOptionsHelpUrl);
}
}
out << ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment