Created
March 14, 2014 22:21
-
-
Save agrohe21/9558204 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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