Difference between revisions of "Package Creator"

From Hornbill
Jump to navigation Jump to search
 
(368 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
{{IntroAndLinks
 
{{IntroAndLinks
 
|
 
|
The Package Creator allows you, with the necessary programming background and ability, to create your own Operations within Packages.
+
The Package Creator allows for the creation of user-defined Packages for use on an instance. A Package consists of a single Package Info file and with additional resource files where required. The info file contains all the details regarding operations and all parameters that may be necessary.  Although it is possible to create a Package manually, a form-based editor is provided to simplify uploading and organising resources.  These files are used to provide or support a package's operations a can be a combination of one or more scripts, executables and other supported filetypes.  In addition to uploading files, an interface is also provided to create and edit various file types via a browser-based editor that supports syntax highlighting.
The ''Package Creator'' provides the tools to create a package that can be made up of various scripts or an executable.  These include:
 
:* Command Line
 
:* Batch Script
 
:* Powershell
 
:* Windows Installer / Executable
 
Each package can be configured to have one or more operations, of which can execute any any one of the above items.
 
 
|
 
|
 +
* [[ITOM Package Creator Quick Guide]]
 
* [[ITOM Package Library]]
 
* [[ITOM Package Library]]
 
}}
 
}}
== Listing ==
+
===Toolbar===
[[File:PackageCreatorListFade.png|800px|ITOM Package Creator List]]
+
[[File:PackageCreatorListFade.png|right|350px|link=https://wiki.hornbill.com/images/6/6e/PackageCreatorList.png]]
 +
<!--[[File:ITOMPackageCreatorToolbar.png]]-->
 +
:{|
 +
|- valign="top"
 +
|style="width:500px"|
 +
{{Bullet1|Refresh|}}
 +
{{Bullet1|Target OS|Operating System that the package was designed for execution}}
 +
{{Bullet2|Windows 32/64-bit|}}
 +
{{Bullet2|Apple macOS|}}
 +
{{Bullet2|Generic Linux|}}
 +
|style="width:500px|
 +
{{Bullet1|Purpose|Dynamic list populated from the Purpose field of entriies in the list}}
 +
{{Bullet1|Filter by package|Free text filter on Package}}
 +
{{Bullet1|[[#Create a New Package|Create a Package]]|Create an IT Automation Package}}
 +
|style="width:500px|
 +
{{Bullet1|[[#Delete a Package|Delete]]|Delete selected Package(s)}}
 +
|}
  
Within this view a list of created shows with the following ways to manage the list:
+
===Package List===
 +
:{|
 +
|- valign="top"
 +
|style="width:500px"|
 +
{{Bullet1|Package|Unique name given to the Package}}
 +
{{Bullet1|Purpose|Summary of the intended use of the package}}
 +
{{Bullet1|Target OS|Operating System that the package was designed for execution}}
 +
|style="width:500px"|
 +
{{Bullet1|Published|Late Published version of the packacge}}
 +
{{Bullet1|Created On|Date that the package was created}}
 +
{{Bullet1|Created By|The account used to create the package}}
 +
|style="width:500px"|
 +
{{Bullet1|Last Updated On|Date the package was last updated}}
 +
{{Bullet1|Last Updated By|The account last used to update the package}}
 +
|}
 +
<br/>
  
* Refresh
+
===Create a New Package===
* Target OS  [All / Unknown / Windows 32-bit / Windows 64-bit / Windows Universal / Linux / Mac OS]
+
# From the '''Package Creator''' list, click the [[File:NewPackageButton.png|23x22px]] button
* Purpose [All / ...supplied by the created packages... ]  
+
# Enter a new '''Package Name'''
* Filter by package...
+
# Click '''Create'''
* Create Site Integration Package
 
* Delete Selected
 
  
When creating custom packages, the following should be kept in mind:
+
===Open an Existing Package===
 +
# Locate the Package in the '''Package Creator''' list
 +
# Click on the Package name
  
* Packages are versioned/baselined.
+
===Delete a Package===
* Each Package '''must''' define at least one Operation.
+
# From the '''Package Creator''' list
* Each Package '''can''' define more than one Operations.
+
# Click the tick box next to each package to delete
* All necesary collateral (in the form of files) '''can''' be included and structured within folders within the Package.
+
# Click the [[File:jobInfoDeleteButton.png|23x22px]] button
  
It would be ill-advised to include (extremely) large files - instead, consider hosting those files on a network share and program the script to use that file/executable.
+
=Package Editor=
 +
The package editor displays a list of resources used, one of which is the Package Info file created by the system.  This file contains the configuration details that define the packages operations and how any additional resources are used.  Selecting the file displays a form used to edit the details; it is also possible to edit the file in its raw XML format via the built-in editor.  Additional resources such as scripts, data files can be created directly from within the interface via an editor, administrators can upload binary files such as executables and windows installer files.
  
Within the Package Creator interface there is the ablity to:
+
==Package Content Toolbar==
* Upload a file (Hornbill platform might block certain filetypes - this can be set in system settings - ultimately any file(type) can be uploaded (*))
+
[[File:PackageContentEmptyFrame.png|right|350px]]
* Add new folder
+
:{|
* Add new file (currently .bat, .sh, .js, .txt, .json and .csv file can be added (*))
+
|- valign="top"
* Modify certain text files (currently only certain file types are recognised as editable)
+
|style="width:500px"|
 +
{{Bullet1|Upload|Uploads files to the current folder}}
 +
{{Bullet1|New Folder|Creates a new Folder}}
 +
{{Bullet1|New File|Creates a new file in the current folder}}
 +
|style="width:500px"|
 +
{{Bullet1|[[#Baseline|Baseline]]|Creates a new baseline of the current package}}
 +
{{Bullet1|Save|Saves amended package details}}
 +
|}
  
{{infobox|
 
(*) you will either needs to disable '''security.fileUploadRestriction.entity.fileAttachments.enable''' or change the extensions in '''security.fileUploadRestriction.entity.fileAttachments.types'''
 
}}
 
  
==Package Info==
+
==Package Information==
 +
The '''Package Info''' file is viewed and modified via a form, displayed by default when entering the editor or whenever the file is selected.  The following details can be edited via the form excluding the Package ID and Name:
 +
<br>
 +
<div class="mw-collapsible mw-collapsed" data-collapsetext="Close View" data-expandtext="XML View" style=".right {position: absolute; right: 0px; width: 300px; border: 3px solid #73AD21; padding: 10px;}">
 +
[[File:PackagePropertiesFormFade.png|350px|right|link=https://wiki.hornbill.com/images/5/5d/PackagePropertiesForm.png]]
 +
<div class="mw-collapsible-content">
 +
[[File:PackagePropertiesXml.png|350px|right|link=https://wiki.hornbill.com/images/9/93/PackagePropertiesXml.png]]
 +
</div>
 +
</div>
 +
{{Bullet1|Package ID|A GUID which uniquely identifies the package) will be generated on creation}}
 +
{{Bullet1|Package|The name of the package entered during creation}}
 +
{{Bullet1|Description|Description of the packages content}}
 +
{{Bullet1|Purpose|Summary of the intended use of the package}}
 +
{{Bullet1|Vendor ID|Defined by the creator of the package (Hornbill packages will set to "Hornbill")}}
 +
<div class="mw-collapsible mw-collapsed" data-collapsetext="Show Less" data-expandtext="Read More" style="width:500px">
 +
{{Bullet1|Target OS|Specifies the target operating system that the package is designed to run on}}
 +
<div class="mw-collapsible-content">
 +
{{Bullet2|Windows 32-bit|}}
 +
{{Bullet2|Windows 64-bit|}}
 +
{{Bullet2|Windows Universal|Package can be invoked on either Windows 32 or 64-bit}}
 +
{{Bullet2|Apple macOS|}}
 +
{{Bullet2|Generic Linux|}}
 +
</div>
 +
</div>
 +
Selecting the XML View button on the toolbar switches the form editor to a text editor where an administrator can edit the file in its native XML format.  This can be useful when making changes that can be quite tedious using the form view, such as generic modifications to packaging operations.
 +
 
 +
==Package Operations==
 +
A package must contain one or more operations; each will perform an action that can be defined using one of a number of the command types.  The Comand Type selected will depend on the Operating System to target the package and the functionality required.  Some operations will require files to be created or uploaded before they can be configured, executing a script.  Other operations such as those that execute as a single command can be configured via the interface provided.
 +
===Creating an Operation===
 +
[[File:PackageOperationsFormFade.png|right|350px|link=https://wiki.hornbill.com/images/b/ba/PackageOperationsForm.png]]
 +
# Click the '''Add Operation''' button, located on the '''Package Operations''' section
 +
# Enter a unique '''Operation''' name
 +
# Enter a '''Description''' of the operation
 +
# Select the '''Command Type'''
 +
# Click '''Add'''
 +
 
 +
{{infobox|The selected Type determines whether a command is entered or a file is selected, where a file is required, it must already have been created or uploaded to the package.}}
 +
 
 +
===Operation Properties===
 +
{{Bullet1|Operation|Mandatory Name used to select the package when creating a Job}}
 +
{{Bullet1|Description|Describes the functionality provided by the operation}}
 +
<div class="mw-collapsible mw-collapsed" data-collapsetext="Show Less" data-expandtext="Read More" style="width:800px">
 +
{{Bullet1|Command Type|Provides a list of supported command types}}
 +
<div class="mw-collapsible-content">
 +
{{Bullet2|Run Command|Used to run an executable program on the target device}}
 +
{{Bullet3|Windows|Execute a program that is localy installed on the target device.  If the program name is entered with no extension then .exe is assumed, for .com programs the extension must be included.  If it is required to execute a cmd command then the command should be entered as follows: cmd.exe /c <command>}}
 +
{{Bullet3|Linux\Unix|Commands are executed using Secure Shell (ssh)}}
 +
<div class="mw-collapsible mw-collapsed" data-collapsetext="Show Less" data-expandtext="Read More" style="width:800px">
 +
{{Bullet2|Windows Installer|Executes an Installer(.msi) package, with one of four actions detailed below.  In order to use this operation the installer package will need to be uploaded to the package}}
 +
<div class="mw-collapsible-content">
 +
{{Bullet3|Install Software|Installs the .msi package}}
 +
{{Bullet3|Run Program|Executes the .msi package}}
 +
{{Bullet3|Uninstall Software|Uninstall an .msi package }}
 +
{{Bullet3|Update Software|Reinstalls the entire .msi package }}
 +
</div>
 +
</div>
 +
{{Bullet2|Windows Executable|Executes an uploaded windows executable, selected from the Run File list}}
 +
{{Bullet2|Batch Script|Excutes an uploaded Windows batch script (.cmd or .bat), selected from the Run File list}}
 +
{{Bullet2|Windows PowerShell|Executes an uploaded Windows PowerShell script, selected from the Script list}}
 +
{{Bullet2|PowerShell Core|Execute an uploaded PowerShell Core script, selected from the Script list}}
 +
{{Bullet2|Linux Shell Script|Executes an uploaded Linux / Unix shell script via SSH}}
 +
</div>
 +
</div>
 +
{{Bullet1|Timeout|Number of seconds before the operation times out, and setting the status of the Job to '''Timed Out'''}}
 +
{{Bullet1|Options / Args|Specifies arguments that are passed to the specified command at runtime.  The format required is dependant on the Command Type being used, below are some typical examples:}}
 +
{{Bullet2|Powershell|''parameter1 ... parameterx -Arg1 <value> -Arg2''}}
 +
{{Bullet2|Windows batch file|''/O /A <value> parameter1 ... parameterx''}}
 +
{{Bullet2|Linux Script|''-arg1 <value> -arg2 --long-arg parameter1 ... parameterx''}}
 +
 
 +
===Input Parameters===
 +
Input parameters are only required if the operation requires data to be passed to it. They allow for values to be dynamically applied at execution for use by the operation. Each parameter can be identified as required (mandatory) and given a specific data type used for basic validation.  Parameters can be manually assigned or populated via variables generated within a Runbook, BPM or Autotask process.
 +
 
 +
To create a new parameter,  from the '''Add Operation''' form:
 +
 
 +
# Click the '''Add Parameter''' button
 +
# Select '''Optional''' or '''Required''' from the drop-down
 +
# Set the '''Data type''' from the drop-down
 +
# Enter the parameter Name
 +
# If required, enter a '''Default value'''
 +
# Enter the '''Hint''' text
 +
# Specify if the parameter is sensitive
 +
 
 +
[[File:PackageOperationsFormInputParams.png]]
 +
 
 +
{{Bullet1|Requirement|Each parameter can be specified as Required or Optional}}
 +
{{Bullet1|Type|Specifys one of the following data types that can be entered: String, Number or Boolean.  This will be used for basic validation when parameter values are entered}}
 +
{{Bullet1|Parameter name|Used to identify the parameter when adding it to the arguments/options list}}
 +
{{Bullet1|Default value|Each parameter can be provided with  default value}}
 +
{{Bullet1|Hint|Describes the parameter and is visible during data entry}}
 +
{{Bullet1|Actions|Action buttons}}
 +
{{Bullet2|Sensitivety|A Toggle that marks a parameter as sensitive (struck out eye) and thus will not show its value during data entry}}
 +
{{Bullet2|Delete|Removes the parameter}}
 +
 
 +
===Adding Parameters to Options / Arguments===
 +
For values to be passed to an operation command, a parameter will be required to pass them via the Options / Args field.  The ordering and format will depend on what is required by the target of the specified Command Type.
 +
Input Parameters have the syntax of {param.<parameter name>} and is placed where the value is expected when the command is executed. 
 +
<br/>
 +
[[File:PackageOperationParamSelector.png|350px|link=https://wiki.hornbill.com/images/9/9b/PackageOperationParamSelector.png]]
 +
<br/>
 +
Parameters are entered manually; however, if the letters ''pa'' are entered, a list of all of the operation's input parameters are provided, and one can be selected from the list.  Entering any further characters will filter the list based on whether any entries contain the entered character.
 +
 
 +
During the execution of the operation, if the parameter value is blank, nothing is output and may not be the desired effect, as detailed in the following scenarios:
 +
 
 +
# The parameter is passed as a positional parameter and requires an empty string to be passed if blank.
 +
#: To ensure an empty string is passed when the value is blank, the parameter should be encapsulated within quotes.  '''"{param.ParamA}"'''
 +
# The parameter value is paired with an option such as '''-option {param.ParamA}''', if the value of '''{param.ParamA}''' is blank; then the '''-option''' is not removed.
 +
#: This can be remedied by encapsulating the option within the parameter definition such as: '''{-option param.ParamA}'''
 +
 
 +
 
 +
::{| class="wikitable"
 +
|+ Possible supported combinations
 +
|-
 +
! Format !! Parameter Value !! Output
 +
|-
 +
| <option> {param.name} || abcd || -option abcd
 +
|-
 +
| <option> {param.name} || <empty string> || -option
 +
|-
 +
| {<option> param.name} || abcd || -option abcd
 +
|-
 +
| {<option> param.name} || <empty string> || <blank>
 +
|}
 +
 
 +
{{infobox|'''<option>''' can be any text and thus allow for all formats of options and arguments that may be required i.e. '''/O''', '''-Output''', '''--Out-file''' or even '''start'''.  In order to specify this format just edit the parameter once it has been added or type itin manually.}}
 +
 
 +
===Output Parameters===
 +
Output parameters allow output from the package operation to be accessed after an IT Automation has been executed.  When executed within a BPM process or Runbook, the process can access the output parameters via self-named variables enabling the values to be used as inputs to other nodes within the process.  Similar to input parameters, each can be specified as required and are provided with a data type.
 +
 
 +
[[File:PackageOperationsFormOutputParams.png]]
 +
 
 +
To create a new parameter, click the Add Parameter button on the Add Package Operation form.
 +
 
 +
{{Bullet1|Requirement|Each parameter can be specified as Required or Optional.  If a required parameter is not returned in the operation's output, the IT Automation will return a failure after the package has been executed.}}
 +
{{Bullet1|Type|Specifys one of the following data types that parameter must be: String, Number or Boolean.  This will be used for basic validation when parameter values are entered}}
 +
{{Bullet1|Parameter name|Used to identify output parameters returned by the operation}}
 +
{{Bullet1|Default value|Each parameter can be provided with  default value}}
 +
 
 +
===Output Parameters Syntax===
 +
Output parameters are processed after the execution of an IT Automation and are identified by the output using the following syntax:
  
A Package ID (a GUID which uniquely identifies the package) will be generated on creation.
+
::{{SISJobOutputParameterStart:'''<param-name>'''}}'''<value>'''<nowiki>{{SISJobOutputParameterEnd}}</nowiki>
  
Description and Purpose allow for searching and categorisation.
+
::* '''<param-name>''' being the name of the configured output parameter
 +
::* '''<value>''' the actual value to store, and one entry will be required for each required parameter.
  
Vendor ID is currently not used - the Hornbill instance name is used behind-the-scenes though.
+
Providing the formatted output is relatively straightforward when the script or program is designed in-house; however, attempting to use a third-party script or program that is not modifiable can prove difficult. In these circumstances, there are still options available:
  
Target OS defines the intended platform [Windows 32-bit / Windows 64-bit / Windows Universal]
+
* Create a wrapper script and reformat the output to match the required syntax
MacOS and Linux will be added in future.
+
* Use the scripts/programs return code to provide feedback
  
The configured Operations can be of various Command Types:
+
Utilising the return codes can be a quick, simple way to capture output parameter values that can be used logically within a process. The Options / Args field can specify input parameters for the command and contain the logic to deal with any return code. The following examples show what can be achieved for different command types:
  
* Run Command
+
=====Windows Commands=====
* Windows Installer - an (uploaded) .msi package can be selected with the further action of:
+
::{| class="wikitable"
** Install Software
+
|-
** Run Program
+
|-
** Uninstall Software
+
| style="white-space: nowrap;" | Command Type || '''Run Command'''
** Update Software
+
|-
* Windows Executable
+
| Command ||  '''cmd /c find '''
* Batch Script
+
|-
* Windows PowerShell
+
| Options / Args || "'''{param.searchstring}'''" "C:\ProgramData\Hornbill\Site Integration Server\log\EspSisService.log" && echo <nowiki>{{</nowiki>SISJobOutputParameterStart:'''outcome'''<nowiki>}}</nowiki>OK<nowiki>{{</nowiki>SISJobOutputParameterEnd<nowiki>}} || </nowiki> echo <nowiki>{{</nowiki>SISJobOutputParameterStart:'''outcome'''<nowiki>}}</nowiki>FAIL<nowiki>{{</nowiki>SISJobOutputParameterEnd<nowiki>}}</nowiki>
* PowerShell Core
+
|}
* ...more to be added (SSH/shell etc)
 
  
[[File:ITOMPackageOperation.png|800px|ITOM Package Operation]]
+
=====Linux Commands=====
 +
::{| class="wikitable"
 +
|-
 +
|-
 +
| style="white-space: nowrap;" | Command Type || '''Run Command'''
 +
|-
 +
| Command ||  '''grep'''
 +
|-
 +
| Options / Args ||   /var/log/syslog -e "'''{param.searchstring}'''"; error=$?;  if [ $error == 0 ]; then echo "<nowiki>{{</nowiki>SISJobOutputParameterStart:'''outcome'''<nowiki>}}</nowiki>OK<nowiki>{{</nowiki>SISJobOutputParameterEnd<nowiki>}}</nowiki>"; else echo "<nowiki>{{</nowiki>SISJobOutputParameterStart:'''outcome'''<nowiki>}}</nowiki>FAIL<nowiki>{{</nowiki>SISJobOutputParameterEnd<nowiki>}}</nowiki>"; echo "<nowiki>{{</nowiki>SISJobOutputParameterStart:'''errors'''<nowiki>}}</nowiki>$error<nowiki>{{</nowiki>SISJobOutputParameterEnd<nowiki>}}</nowiki>"; fi
 +
|}
  
Depending on the selection you will, invariably, be able to select or type the name of the file to run and give the command line Options/Arguments. Input Parameters (similar to BP) can be set for a particular Operation (given a default value as well) which can be passed to the command line arguments in the following format:
+
=====Powershell Commands=====
<pre>
+
::{| class="wikitable"
{param.input_parameter_name}
+
|-
</pre>
+
|-
 +
| style="white-space: nowrap;" | Command Type || '''Run Command'''
 +
|-
 +
| Command ||  '''powershell -Command'''
 +
|-
 +
| Options / Args ||  "& { if(Select-String -Path 'C:\ProgramData\Hornbill\Site Integration Server\log\EspSisService.log' -Pattern ''''{param.searchstring}'''' -Quiet) {Write-Host '<nowiki>{{</nowiki>SISJobOutputParameterStart:'''outcome'''<nowiki>}}</nowiki>OK<nowiki>{{</nowiki>SISJobOutputParameterEnd<nowiki>}}</nowiki>'} else {Write-Host '<nowiki>{{</nowiki>SISJobOutputParameterStart:'''outcome'''<nowiki>}}</nowiki>FAIL<nowiki>{{</nowiki>SISJobOutputParameterEnd<nowiki>}}</nowiki>' }" }
 +
|}
  
For <strong>ping</strong> someone might use:<pre>
+
===Managing Files===
-n 2 "{param.host}"
+
[[File:PackageFileEditor.png|right|350px|link=https://wiki.hornbill.com/images/a/a8/PackageFileEditor.png]]
</pre>
+
As well as being able to upload files for use by operations, it is also possible to create files directly via the interface.  The editor supports the following file types and also provides enhanced usability with the use of syntax highlighting.  
  
A default value and a hint can be set for the Input Parameter.
+
:{|
If the Input Parameter is set as sensitive (struck out eye), then the parameters will be encrypted in transmission as the Credentials are.
+
|- valign="top"
 +
|style="width:500px"|
 +
{{Bullet1|.bat|Command Prompt Batch process files}}
 +
{{Bullet1|.ps1|Powershell and Powershell Core scripts}}
 +
{{Bullet1|.js|Javascript}}
 +
|style="width:500px"|
 +
{{bullet1|.sh|Unix/Linux and macOS Shell script}}
 +
{{Bullet1|.txt|Text format file}}
 +
{{Bullet1|.json|JavaScript Object Notation file}}
 +
|style="width:500px"|
 +
{{Bullet1|.csv|Comma Seperated Value file}}
 +
|}
  
 
{{infobox|
 
{{infobox|
* the parameters are ''substituted'', the character escaping needs to be handled by the developer.
+
'''The following will affect the entire instance!'''<br>
* It might be that n/m-dash are substituted with hyphens.
+
<br>
* Fancy quotes might also get added to the substitution list
+
Some of the above files are restricted by default; and can be allowed by disabling the System Setting: '''security.fileUploadRestriction.entity.fileAttachments.enable''' or alternatevly remove the relevant extensions from the System Setting: '''security.fileUploadRestriction.entity.fileAttachments.types'''.
 
}}
 
}}
  
It is also possible to pass user credentials to the command line. The credentials should be added to the "Extra Credentials" section of the Job definition. To use the credentials use: <pre>
+
====Upload a File====
{creds:credential_name.credential_property_name}</pre> eg:<pre>
+
[[File:PackageContentEmptyFrame.png|right|350px]]
{creds:credential1.apikey}</pre>
+
# Click the Upload [[File:FileUploadButton.png|35px]] button
 +
# Select the File to Upload
 +
#:The file appears in the file list
 +
# Select the File to View in the Editor pane
 +
 
 +
====Create a New Folder====
 +
# Click the Add New Folder [[file:CreateNewFolder.png|35px]] button
 +
# Enter the Folder Name
 +
 
 +
====Add New File====
 +
# Click the Add New File [[File:NewFile.png|25px]] button
 +
# Enter the file name
 +
 
 +
[[File:PackageFileEditorToolbar.png|350px|right]]
 +
The following actions are executed on individual files and folders; ensure that the correct file or folder is selected first from the file list.  The menu options are context-sensitive and will only display the options relevant to the selected item.
 +
 
 +
====Delete a File or Folder====
 +
# Select the File or Folder to Delete
 +
# Click the Delete button
 +
 
 +
====Download a File====
 +
# Select the File to Download
 +
# Click the Upload button
 +
#:The file will appear in the browsers download folder
 +
 
 +
====Save a File====
 +
The Save button is enabled when a file is loaded into the editor and its contents have changed.  Clicking on the Save will save the changes and reset the buttons state.  Exiting from the editor also prompts to save the file, with the option to Save, Cancel or Ignore the changes.
  
It would be well advised to ensure there is clear user documentation as to what Extra Credentials need setting (their exact names as well as their types) when creating these Packages.
+
==Baselining and Publishing==
 +
[[File:PackageContentBaselineVersions.png|350px|right|link=https://wiki.hornbill.com/images/f/fa/PackageContentBaselineVersions.png]]
 +
A Baseline is a snapshot of a package's current state, only available once the package is in a state where it is ready to be published (at least one Package Operation exist).  
  
Output Parameters can also be configured, the resulting Console Output is then expected to contain text in the following format:
+
The draft version of a package is the only version that can be updated. Once the Package is ready for release, the draft copy can be Baselined, creating a new version.  This latest version is then available for packaging and installation on the Installed Packages list.
<pre>
 
{{SISJobOutputParameterStart:output_variable_name}}output_data{{SISJobOutputParameterEnd}}
 
</pre>
 
The output data can then be used as input for a subsequent Automation call within the Runbook or Business Process (if passed on via the Runbook's Output Parameters).
 
  
==Baselining==
+
To enable the Baseline once the initial package has been created, the user must highlight the '''Package Info''' file in the file list. Once clicked, a confirmation pop appears, and the dropdown next to the Baseline Button will display a list of Baselined versions.  
In order to keep track of your package developments, you will invariably be working on a Draft. Once you are happy with your draft, '''baseline''' the draft. A new version will become the new published version of the package and ALL existing scheduled jobs using operations from the package will be using this new package.
 
  
{{infobox|when the Baseline action is clicked, the resulting context will be left in Draft mode. Select a specific version before releasing a home-baked creation to the world (by packaging it).
+
To publish and install or download a baselined version, select the relevant version from the list. The '''Baseline''' button will change to the '''Package and Install'''when clicked, two options are provided:
To recognise in what developing context is, look for '''View Draft''' button and the sub-header on the page which states the version number before '''(Readonly Baseline)'''
+
[[File:PackageContentDraftInstall.png|350px|right]]
}}
+
{{Bullet1|Package and Install|Build the package and add to the Install Packages list, Overwriting any existing version}}
 +
{{Bullet1|Package and Download|Build the package and Download to the local computer}}
  
[[File:ITOMPackageBaseline.png|ITOM Package Baseline]]
+
The package details will be read-only to change any details; The user must select the draft version by clicking the '''View Draft''' button.
  
Use the down-arrow next to the Baseline button to select the between the different versions of your package - this can be used to compare those versions.
 
  
[[File:ITOMPackageBaselineVersionSelection.png|ITOM Package Baseline Version Selection]]
+
===Baseline and Publish a new version of a package===
  
There are various actions you can select from on a particular baseline:
+
# Select the ITOM <strong>Package Creator</strong>
 +
# From the list select a package
 +
# Click the ''Baseline'' button
 +
# Select the ''Baseline'' button drop-down
 +
# Select the last version
 +
# Click ''Package and Install'', and select ''Package and Install''
 +
# Use the Breadcrumbs to go back to the ''Package Creator'' list
  
{{Bullet1|Package and Install|this will set the current baseline up as the active baseline for existing items on the '''Job Scheduling'''}}
+
The Package should now appear in the list with the latest version shown; all subsequent Jobs, including previously scheduled jobs, will now use the newly published version.
{{Bullet1|Package and Download|this will result in a .pkg being downloaded which can be shared and uploaded in the '''Installed Packages''' section}}
 
  
[[File:ITOMPackageBaselineOptions.png|ITOM Package Baseline Options]]
 
  
 
[[Category:ITOM]]
 
[[Category:ITOM]]
 +
 +
<!--
 +
 +
 +
After the creation of the input parameters, the following format enables them to be accessed:
 +
<pre>
 +
{param.<parameter_name>}
 +
</pre>
 +
<parameter_name> should substituted for the relevant parameter name such as {param.host}
 +
[[File:PackageOperationsFormOptions.png|350px|right|link=https://wiki.hornbill.com/images/3/3c/PackageOperationsFormOptions.png]]
 +
The use of a parameter can supply the value for an argument used by the selected Command Type. The example in the diagram shows how a parameter provides the value to the -n argument and hostname used by the '''ping''' command.  Intellisense is used to aid with the entry of parameters, start entering the prefix of the parameter. IntelliSense will display a list of params, and the user can select the relevant parameter.
 +
 +
{{infobox|
 +
:* the parameters are ''substituted'', the character escaping needs to be handled by the developer.
 +
:* It might be the substitution of n/m-dash with hyphens.
 +
:* Fancy quotes might also get added to the substitution list}}
 +
 +
It is also possible to pass user credentials to the command line. The credentials should be added to the "Extra Credentials" section of the Job definition. To use the credentials use: <pre>
 +
{creds:credential_name.credential_property_name}</pre> eg:<pre>
 +
{creds:credential1.apikey}</pre>
 +
 +
It would be well advised to ensure clear user documentation of what Extra Credentials need setting (their exact names and their types) when creating these Packages.
 +
->

Latest revision as of 17:51, 29 February 2024

Home > Administration > ITOM > Package Creator Index

Introduction

The Package Creator allows for the creation of user-defined Packages for use on an instance. A Package consists of a single Package Info file and with additional resource files where required. The info file contains all the details regarding operations and all parameters that may be necessary. Although it is possible to create a Package manually, a form-based editor is provided to simplify uploading and organising resources. These files are used to provide or support a package's operations a can be a combination of one or more scripts, executables and other supported filetypes. In addition to uploading files, an interface is also provided to create and edit various file types via a browser-based editor that supports syntax highlighting.

Related Articles

Toolbar

PackageCreatorListFade.png
  • Refresh
  • Target OS
Operating System that the package was designed for execution
  • Windows 32/64-bit
  • Apple macOS
  • Generic Linux
  • Purpose
Dynamic list populated from the Purpose field of entriies in the list
  • Filter by package
Free text filter on Package
Create an IT Automation Package
Delete selected Package(s)

Package List

  • Package
Unique name given to the Package
  • Purpose
Summary of the intended use of the package
  • Target OS
Operating System that the package was designed for execution
  • Published
Late Published version of the packacge
  • Created On
Date that the package was created
  • Created By
The account used to create the package
  • Last Updated On
Date the package was last updated
  • Last Updated By
The account last used to update the package


Create a New Package

  1. From the Package Creator list, click the NewPackageButton.png button
  2. Enter a new Package Name
  3. Click Create

Open an Existing Package

  1. Locate the Package in the Package Creator list
  2. Click on the Package name

Delete a Package

  1. From the Package Creator list
  2. Click the tick box next to each package to delete
  3. Click the JobInfoDeleteButton.png button

Package Editor

The package editor displays a list of resources used, one of which is the Package Info file created by the system. This file contains the configuration details that define the packages operations and how any additional resources are used. Selecting the file displays a form used to edit the details; it is also possible to edit the file in its raw XML format via the built-in editor. Additional resources such as scripts, data files can be created directly from within the interface via an editor, administrators can upload binary files such as executables and windows installer files.

Package Content Toolbar

PackageContentEmptyFrame.png
  • Upload
Uploads files to the current folder
  • New Folder
Creates a new Folder
  • New File
Creates a new file in the current folder
Creates a new baseline of the current package
  • Save
Saves amended package details


Package Information

The Package Info file is viewed and modified via a form, displayed by default when entering the editor or whenever the file is selected. The following details can be edited via the form excluding the Package ID and Name:

PackagePropertiesFormFade.png
PackagePropertiesXml.png
  • Package ID
A GUID which uniquely identifies the package) will be generated on creation
  • Package
The name of the package entered during creation
  • Description
Description of the packages content
  • Purpose
Summary of the intended use of the package
  • Vendor ID
Defined by the creator of the package (Hornbill packages will set to "Hornbill")
  • Target OS
Specifies the target operating system that the package is designed to run on
  • Windows 32-bit
  • Windows 64-bit
  • Windows Universal
Package can be invoked on either Windows 32 or 64-bit
  • Apple macOS
  • Generic Linux

Selecting the XML View button on the toolbar switches the form editor to a text editor where an administrator can edit the file in its native XML format. This can be useful when making changes that can be quite tedious using the form view, such as generic modifications to packaging operations.

Package Operations

A package must contain one or more operations; each will perform an action that can be defined using one of a number of the command types. The Comand Type selected will depend on the Operating System to target the package and the functionality required. Some operations will require files to be created or uploaded before they can be configured, executing a script. Other operations such as those that execute as a single command can be configured via the interface provided.

Creating an Operation

PackageOperationsFormFade.png
  1. Click the Add Operation button, located on the Package Operations section
  2. Enter a unique Operation name
  3. Enter a Description of the operation
  4. Select the Command Type
  5. Click Add
Information
The selected Type determines whether a command is entered or a file is selected, where a file is required, it must already have been created or uploaded to the package.

Operation Properties

  • Operation
Mandatory Name used to select the package when creating a Job
  • Description
Describes the functionality provided by the operation
  • Command Type
Provides a list of supported command types
  • Run Command
Used to run an executable program on the target device
  • Windows
Execute a program that is localy installed on the target device. If the program name is entered with no extension then .exe is assumed, for .com programs the extension must be included. If it is required to execute a cmd command then the command should be entered as follows: cmd.exe /c <command>
  • Linux\Unix
Commands are executed using Secure Shell (ssh)
  • Windows Installer
Executes an Installer(.msi) package, with one of four actions detailed below. In order to use this operation the installer package will need to be uploaded to the package
  • Install Software
Installs the .msi package
  • Run Program
Executes the .msi package
  • Uninstall Software
Uninstall an .msi package
  • Update Software
Reinstalls the entire .msi package
  • Windows Executable
Executes an uploaded windows executable, selected from the Run File list
  • Batch Script
Excutes an uploaded Windows batch script (.cmd or .bat), selected from the Run File list
  • Windows PowerShell
Executes an uploaded Windows PowerShell script, selected from the Script list
  • PowerShell Core
Execute an uploaded PowerShell Core script, selected from the Script list
  • Linux Shell Script
Executes an uploaded Linux / Unix shell script via SSH
  • Timeout
Number of seconds before the operation times out, and setting the status of the Job to Timed Out
  • Options / Args
Specifies arguments that are passed to the specified command at runtime. The format required is dependant on the Command Type being used, below are some typical examples:
  • Powershell
parameter1 ... parameterx -Arg1 <value> -Arg2
  • Windows batch file
/O /A <value> parameter1 ... parameterx
  • Linux Script
-arg1 <value> -arg2 --long-arg parameter1 ... parameterx

Input Parameters

Input parameters are only required if the operation requires data to be passed to it. They allow for values to be dynamically applied at execution for use by the operation. Each parameter can be identified as required (mandatory) and given a specific data type used for basic validation. Parameters can be manually assigned or populated via variables generated within a Runbook, BPM or Autotask process.

To create a new parameter, from the Add Operation form:

  1. Click the Add Parameter button
  2. Select Optional or Required from the drop-down
  3. Set the Data type from the drop-down
  4. Enter the parameter Name
  5. If required, enter a Default value
  6. Enter the Hint text
  7. Specify if the parameter is sensitive

PackageOperationsFormInputParams.png

  • Requirement
Each parameter can be specified as Required or Optional
  • Type
Specifys one of the following data types that can be entered: String, Number or Boolean. This will be used for basic validation when parameter values are entered
  • Parameter name
Used to identify the parameter when adding it to the arguments/options list
  • Default value
Each parameter can be provided with default value
  • Hint
Describes the parameter and is visible during data entry
  • Actions
Action buttons
  • Sensitivety
A Toggle that marks a parameter as sensitive (struck out eye) and thus will not show its value during data entry
  • Delete
Removes the parameter

Adding Parameters to Options / Arguments

For values to be passed to an operation command, a parameter will be required to pass them via the Options / Args field. The ordering and format will depend on what is required by the target of the specified Command Type. Input Parameters have the syntax of {param.<parameter name>} and is placed where the value is expected when the command is executed.
PackageOperationParamSelector.png
Parameters are entered manually; however, if the letters pa are entered, a list of all of the operation's input parameters are provided, and one can be selected from the list. Entering any further characters will filter the list based on whether any entries contain the entered character.

During the execution of the operation, if the parameter value is blank, nothing is output and may not be the desired effect, as detailed in the following scenarios:

  1. The parameter is passed as a positional parameter and requires an empty string to be passed if blank.
    To ensure an empty string is passed when the value is blank, the parameter should be encapsulated within quotes. "{param.ParamA}"
  2. The parameter value is paired with an option such as -option {param.ParamA}, if the value of {param.ParamA} is blank; then the -option is not removed.
    This can be remedied by encapsulating the option within the parameter definition such as: {-option param.ParamA}


Possible supported combinations
Format Parameter Value Output
<option> {param.name} abcd -option abcd
<option> {param.name} <empty string> -option
{<option> param.name} abcd -option abcd
{<option> param.name} <empty string> <blank>
Information
<option> can be any text and thus allow for all formats of options and arguments that may be required i.e. /O, -Output, --Out-file or even start. In order to specify this format just edit the parameter once it has been added or type itin manually.

Output Parameters

Output parameters allow output from the package operation to be accessed after an IT Automation has been executed. When executed within a BPM process or Runbook, the process can access the output parameters via self-named variables enabling the values to be used as inputs to other nodes within the process. Similar to input parameters, each can be specified as required and are provided with a data type.

PackageOperationsFormOutputParams.png

To create a new parameter, click the Add Parameter button on the Add Package Operation form.

  • Requirement
Each parameter can be specified as Required or Optional. If a required parameter is not returned in the operation's output, the IT Automation will return a failure after the package has been executed.
  • Type
Specifys one of the following data types that parameter must be: String, Number or Boolean. This will be used for basic validation when parameter values are entered
  • Parameter name
Used to identify output parameters returned by the operation
  • Default value
Each parameter can be provided with default value

Output Parameters Syntax

Output parameters are processed after the execution of an IT Automation and are identified by the output using the following syntax:

{{SISJobOutputParameterStart:<param-name>}}<value>{{SISJobOutputParameterEnd}}
  • <param-name> being the name of the configured output parameter
  • <value> the actual value to store, and one entry will be required for each required parameter.

Providing the formatted output is relatively straightforward when the script or program is designed in-house; however, attempting to use a third-party script or program that is not modifiable can prove difficult. In these circumstances, there are still options available:

  • Create a wrapper script and reformat the output to match the required syntax
  • Use the scripts/programs return code to provide feedback

Utilising the return codes can be a quick, simple way to capture output parameter values that can be used logically within a process. The Options / Args field can specify input parameters for the command and contain the logic to deal with any return code. The following examples show what can be achieved for different command types:

Windows Commands
Command Type Run Command
Command cmd /c find
Options / Args "{param.searchstring}" "C:\ProgramData\Hornbill\Site Integration Server\log\EspSisService.log" && echo {{SISJobOutputParameterStart:outcome}}OK{{SISJobOutputParameterEnd}} || echo {{SISJobOutputParameterStart:outcome}}FAIL{{SISJobOutputParameterEnd}}
Linux Commands
Command Type Run Command
Command grep
Options / Args /var/log/syslog -e "{param.searchstring}"; error=$?; if [ $error == 0 ]; then echo "{{SISJobOutputParameterStart:outcome}}OK{{SISJobOutputParameterEnd}}"; else echo "{{SISJobOutputParameterStart:outcome}}FAIL{{SISJobOutputParameterEnd}}"; echo "{{SISJobOutputParameterStart:errors}}$error{{SISJobOutputParameterEnd}}"; fi
Powershell Commands
Command Type Run Command
Command powershell -Command
Options / Args "& { if(Select-String -Path 'C:\ProgramData\Hornbill\Site Integration Server\log\EspSisService.log' -Pattern '{param.searchstring}' -Quiet) {Write-Host '{{SISJobOutputParameterStart:outcome}}OK{{SISJobOutputParameterEnd}}'} else {Write-Host '{{SISJobOutputParameterStart:outcome}}FAIL{{SISJobOutputParameterEnd}}' }" }

Managing Files

PackageFileEditor.png

As well as being able to upload files for use by operations, it is also possible to create files directly via the interface. The editor supports the following file types and also provides enhanced usability with the use of syntax highlighting.

  • .bat
Command Prompt Batch process files
  • .ps1
Powershell and Powershell Core scripts
  • .js
Javascript
  • .sh
Unix/Linux and macOS Shell script
  • .txt
Text format file
  • .json
JavaScript Object Notation file
  • .csv
Comma Seperated Value file
Information

The following will affect the entire instance!

Some of the above files are restricted by default; and can be allowed by disabling the System Setting: security.fileUploadRestriction.entity.fileAttachments.enable or alternatevly remove the relevant extensions from the System Setting: security.fileUploadRestriction.entity.fileAttachments.types.

Upload a File

PackageContentEmptyFrame.png
  1. Click the Upload FileUploadButton.png button
  2. Select the File to Upload
    The file appears in the file list
  3. Select the File to View in the Editor pane

Create a New Folder

  1. Click the Add New Folder CreateNewFolder.png button
  2. Enter the Folder Name

Add New File

  1. Click the Add New File NewFile.png button
  2. Enter the file name
PackageFileEditorToolbar.png

The following actions are executed on individual files and folders; ensure that the correct file or folder is selected first from the file list. The menu options are context-sensitive and will only display the options relevant to the selected item.

Delete a File or Folder

  1. Select the File or Folder to Delete
  2. Click the Delete button

Download a File

  1. Select the File to Download
  2. Click the Upload button
    The file will appear in the browsers download folder

Save a File

The Save button is enabled when a file is loaded into the editor and its contents have changed. Clicking on the Save will save the changes and reset the buttons state. Exiting from the editor also prompts to save the file, with the option to Save, Cancel or Ignore the changes.

Baselining and Publishing

PackageContentBaselineVersions.png

A Baseline is a snapshot of a package's current state, only available once the package is in a state where it is ready to be published (at least one Package Operation exist).

The draft version of a package is the only version that can be updated. Once the Package is ready for release, the draft copy can be Baselined, creating a new version. This latest version is then available for packaging and installation on the Installed Packages list.

To enable the Baseline once the initial package has been created, the user must highlight the Package Info file in the file list. Once clicked, a confirmation pop appears, and the dropdown next to the Baseline Button will display a list of Baselined versions.

To publish and install or download a baselined version, select the relevant version from the list. The Baseline button will change to the Package and Installwhen clicked, two options are provided:

PackageContentDraftInstall.png
  • Package and Install
Build the package and add to the Install Packages list, Overwriting any existing version
  • Package and Download
Build the package and Download to the local computer

The package details will be read-only to change any details; The user must select the draft version by clicking the View Draft button.


Baseline and Publish a new version of a package

  1. Select the ITOM Package Creator
  2. From the list select a package
  3. Click the Baseline button
  4. Select the Baseline button drop-down
  5. Select the last version
  6. Click Package and Install, and select Package and Install
  7. Use the Breadcrumbs to go back to the Package Creator list

The Package should now appear in the list with the latest version shown; all subsequent Jobs, including previously scheduled jobs, will now use the newly published version.