![]() ![]() The following example will build a package with 2 artifacts, a WAR artifact and a JBoss datasource. Optionally, this script can also deploy the package into an environment.īefore looking at the script execution, first lets take a look at the properties format. This script will create a package with an arbitrary number of artifacts and is useful in situations where a application build process does not feature a tool where there is an existing XL Deploy integration, such as with Jenkins. The script is stored as a Gist on GitHub, This article describes a script which builds a DAR package in XL Deploy from properties which can be specified in and combination of 3 different locations: The post XLD Scripting comparison : Jython vs REST API vs CLI appeared first on XebiaLabs. py while trying out writing XL-Rules or Rest Endpoints You may also try them out inside a script with extension.The simplest way to try them out is using Jytutor Extension for XLD.Then use the command line with the -f flag to execute the script You may also put the lines in a file with extension.You can simply login in the CLI tool and start typing the commands.Finally, you can make these connections through html/javascript, java or any other language to setup dashboards, perform tasks on both pc and mobile.Yet another way is to use python with Requests Library or any other http connection library to make connections.You can put the body content in a file and pass that file with a suitable flag You will have to set the user/password using respective flags and also set headers. Another way is to use them using curl/wget in linux.The simplest way is to use a firefox extension called REST Client , set authorization and content-type headers and try it out.Member2 = repository.read("Infrastructure/windows")Įnv = nfigurationItem("Environments/myEnv", "udm.Environment") Member1 = repository.read("Infrastructure/windows/server1") Print "Environment " + env.id + " Created" # Use this to add individual members to environment #(member1._delegate) NewMembers = HashSet()Įnv = ("Environments/myEnv") _delegate to get a ConfigurationItem object Member2 = repositoryService.read("Infrastructure/windows") Member1 = repositoryService.read("Infrastructure/windows/server1") For this, you require good knowledge of python, working knowledge of jython/java(depending on use cases).įrom .api.reflect import Type Because of its server side nature, it carries pre-authenticated objects which hold a users security and permissions information. Jython API – This is a server side scripting interface so this is definitely the fastest out of three in terms of execution, but it runs on the server itself so it can’t connect to different servers. ![]() ![]() You require knowledge about basic usage on how to call REST Services in general It however becomes very tedious since if you are trying to do complex work, you would also have to deal with conversion of xml request/response. REST API – This is the easiest interface to work with since its a standard and you can make direct calls through command line tools to connect to any target XLD Server. You can connect to any server as long you can access the server and you have login permissions(in security). Objects returned from the server are converted to convenient python objects to work with simple python constructs You require knowledge of python to work your way with CLI. You can connect to any server as long you can access the server and you have login permissions(in security). Infrastructure (Existing ) Name: Infrastructure/windowsĬLI Scripting – It uses a custom java library and jython to interact with a target XLDeploy server. Infrastructure (Existing ) Name: Infrastructure/windows/server1 Our use case is to create an environment and add the infrastructure to that environmentĮnvironment(to be created) Id : Environments/myEnv We can talk further about each one can be used USE CASE It would give you a fine comparison of how to do the same thing using different approaches. How about we do a comparison of Jython API vs REST API vs CLI tool. Now if you want to go further, it has the REST API and last but not least, the latest addition of the Jython APIs (Server side scripting) that can be used for XL-Rules and for creation of custom REST Endpoints. There is the GUI interface and then there’s CLI(Command Line Interface). I bet all those of you working on XL Deploy for a while might feel overwhelmed by all those different ways you can interact with the server. ![]()
0 Comments
Leave a Reply. |