[PDF]Description Prerequisites How to use this script? - Rackcdn.comhttps://448bb31d92917ba3390f-4a8f48d20b0d8c78b979208d38d37653.ssl.cf1.rack...
0 downloads
160 Views
90KB Size
Description Use this script to call the Dollar Universe API and trigger tasks.
Prerequisites • • •
Powershell version 3 or above is required to run this script. The two following Windows packages needs to be downloaded in order to use PowerShell 4 on Windows 7 o Windows Management Framework 4.0: http://www.microsoft...s.aspx?id=40855 o Microsoft .NET Framework 4.5: http://www.microsoft...s.aspx?id=30653 Make sure the execution policy allows you to launch scripts.
To check what policy is currently available, open a Powershell prompt and run
Get-ExecutionPolicy Typically, the RemoteSigned execution policy will be enough to run unsigned scripts on your machine. To do so, open a powershell prompt with Administrator rights and do:
Set-ExecutionPolicy RemoteSigned
For more information on Powershell rights, visit http://technet.micro...y/ee176949.aspx
How to use this script? • •
•
Configure Dollar Universe and create the required objects. Usually, this would require at least a uproc, a provoked task and a trigger. Set the variables in the script. o TARGETHOST: hostname (or IP address) of the targeted Dollar Universe node. o PORT : HTTP server port number of the Dollar Universe node The IO X server port can also be used. o PROTOCOL: http or https (untested; more work will likely be needed) o USERNAME and PASSWORD: The user and password of a valid UVMS user to authenticate to the Dollar Universe node. If the AUTHENTICATION_KEY is given, there is no need to provide these values. o AUTHENTICATION_KEY: Authentication key required to send an event. If the authentication key is not provided ($null), the login API is called to obtain one and it will automatically be destroyed. o BODY: A hashtable object with the event type and a list of properties to be sent in order to trigger jobs in Dollar Universe. The "type" parameter is mandatory and its value must match the Event Type used in the Trigger(s) object(s). The area parameter is optional and is also part of the body. Any other properties can be added to the list o LOGOUT: Set this variable to true if you wish to invalidate the given token. Launch the script.
The output will contain a message for each stage: log in, event submission, log out. In case of failure, the script will output an error message and exit with return code of 1. Example of output with user aaa and 3 triggers matching the event type:
User aaa logged in successfully Status: incomplete trigger launch_number error_code error ------- ------------- ---------- ----AAA 0016988 BBB 0016989 TRIGGER_111 300 Access denied. Cannot launch the task . Logged out successfully