Skip to content

Commit

Permalink
Added Test Connection functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Rasmussen committed May 23, 2017
1 parent 37f00f6 commit dd94e43
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ deploy:
provider: releases
api_key:
secure: HaLgQjTqegx0wexEexbBKB+D1DGwbiW7zQgLMpbA/d1PUQRLHMIZLNE8u1V5/4/qLSRqmp/VdLHwvSWbcc7dPrzNN09rwEb7HPLORkCvSHq6/pOgnJ1xIWU4CMjNewjxYS94AnQN+0+PFdFw7mqTuf6cz/IVCZxypCEzckziI220DLYBXBS9vNSko55979yhQv7U31vd/CJ63cp21qvemAcFncQr98FKq6JsbpMtOOjAqjvN/VPpnphhoV7DxbiKEMZ9ZePClg69HpZ+Q/o2qUm/BKd32ZmpZosTE27Gaj81TVnLeLfveeBRt0jTK4gisS5++t6AfK01DHGexT4hVgG34jkjQQX76imCMa+sd61Ixs2P4rVRl9zqJKFBlxoeOkdXhenLqDZL0c/jKYXXtIln6f24rnQ26t1L7zbdI2I0G+gS0aZfXAMSXoFioZCplydRkuuHrr/HOVmlBk7LF36cvXSbv2UVwATrNjOZs0Sd0fBxrOtnQ7l9g3vSufV59kHE/ic80Lrbn8Pphh3gRDsOrVGF/vHvz5Aho0kCxLwqoz6hajQ0kIVvfIz3kC2xITeFWYwYgUUupLUopj2GiIpOdcPhZJ/9Lr0+zr3cxW/l7orWwmuVT/Eo9JdyhX+GaYvRvNkU9x1A1VFF/R3AOc2eSDi+zmCASbqdA9vE/Zs=
file: build/libs/xlr-ucd-plugin-1.3.0.jar
file: build/libs/xlr-ucd-plugin-1.4.0.jar
skip_cleanup: true
on:
tags: true
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id "com.xebialabs.xl.docker" version "1.1.0"
}

version='1.3.0'
version='1.4.0'

apply plugin: 'java'
apply plugin: 'idea'
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/synthetic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<synthetic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.xebialabs.com/deployit/synthetic" xsi:schemaLocation="http://www.xebialabs.com/deployit/synthetic synthetic.xsd">

<type type="ucd.Server" extends="configuration.HttpConnection">
<property name="scriptLocation" default="ucd/TestConnection.py" hidden="true" />
<property name="disableSslVerification" required="true" kind="boolean" default="false" description="Disable SSL verification" />
</type>

Expand Down
21 changes: 21 additions & 0 deletions src/main/resources/ucd/TestConnection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright 2017 XEBIALABS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

from ucd.UCDClientUtil import UCD_Client_Util

server = {}
server['username'] = configuration.username
server['password'] = configuration.password
server['url'] = configuration.url
server['disableSslVerification'] = configuration.disableSslVerification
verifySsl = not server['disableSslVerification']
ucd_client = UCD_Client_Util.create_ucd_client(server, None, None, verifySsl)
ucd_client.list_system_configuration()

0 comments on commit dd94e43

Please sign in to comment.