# Preface

This document describes the functionality provided by the Generic Model plugin.

See the Deployit Reference Manual for background information on Deployit and deployment concepts.

# Overview

Deployit supports a number of middleware platforms. Sometimes, though, it is necessary to extend Deployit with new middleware support. The Generic Model plugin provides a way to do this, without having to write Java code. Instead, using Deployit's flexible type system and the base CIs from the Generic Model plugin, new CIs can be defined by writing XML and providing scripts for functionality.

Several of Deployit's standard plugins are also built on top of the Generic Model plugin.

## Features

- Define custom containers
  - Stop, start, restart capabilities
- Define and copy custom artifacts to a custom container
- Define, copy and execute custom scripts and folders on a custom container
- Define resources to be processed by a template and copied to a custom container
- Define and execute control tasks on containers and deployeds
- Flexible templating engine

# Requirements

The plugin requires:

- Deployit: version 3.5+

# Plugin Concepts

The Generic Model plugin provides several CIs that can be used as base classes for creating Deployit extensions. There are base CIs for each of Deployit's CI types (deployables, deployeds and containers). A typical usage scenario is to create custom, synthetic CIs (based on one of the provided CIs) and using it to invoke the required behavior (scripts) in a deployment plan.

Note: since Deployit version 3.6, the deployeds in the Generic Model Plugin can target containers that implement the HostContainer interface. In addition to the Container and derived CIs, this means they can also be targeted to CIs derived from Host.

## Container

A Container is a topology CI and models middleware in your infrastructure. This would typically be used to model middleware for Deployit does not have out of the box support or that is custom to your environment. The other CIs in the plugin can be deployed to (subclasses of) the container. The behavior of the container in a deployment is configured by specifying scripts to be executed when it is started, stopped or restarted. Deployit will invoke these scripts as needed.

## NestedContainer

A Nested Container is a topology CI and models middleware in your infrastructure. The nested container allows for the modelling of abstract middleware concepts as containers to which items can be deployed.

## Copied Artifact

A CopiedArtifact is an artifact as copied over to a Container. It manages the copying of any generic artifact (File, Folder, Archive, Resource) in the deployment package to the container. It is possible to indicate that this copied artifact requires a container restart.

## Executed Script

An ExecutedScript encapsulates a script that is executed on a Container. The script is processed by the templating engine (see below) before being copied to the target container. The behavior of the script is configured by specifying scripts to be executed when it is deployed, upgraded or undeployed.

## Manual Process

A ManualProcess entails a script containing manual inststructions for the operator to perform before the deployment can continue. The script is processed by the templating engine (see below) and is displayed to the operator in the step logs. Once the instructions have been carried out, the operator can continue the deployment. The instructions can also be automatically emailed.

## Executed Folder

An ExecutedFolder encapsulates a folder containing installation and rollback scripts that are executed on a Container. Installation scripts are executed when the folder is deployed or updated, rollback scripts are executed when it is undeployed. Execution of the scripts happens in order. Scripts are processed by the templating engine (see below) before being copied to the target container.

## Processed Template

A ProcessedTemplate is a Freemarker template that is processed by the templating engine (see below), then copied to a Container.

## Templating

When defining and using CIs with the Generic Model plugin, the need arises to use variables in certain CI properties and scripts. The most obvious use is to include properties from the deployment itself, such as the names or locations of files in the deployment package. Deployit uses the Freemarker templating engine for this.

When performing a deployment using the Generic Model plugin, all CIs and scripts are processed in Freemarker. This means that placeholders can be used in CI properties and scripts to make them more flexible. Freemarker resolves placeholders using a context, a set of objects defining the template's environment. This context depends on the type of CI being deployed.

For deployed CIs, the context deployed refers to the current CI instance. For example:

    <type type="tc.DeployedDataSource" extends="generic.ProcessedTemplate" deployable-type="tc.DataSource"
          container-type="tc.Server">
        ...
        <property name="targetFile" default="${deployed.name}-ds.xml" hidden="true"/>
        ...
    </type>

For container CIs, the context container refers to the current container instance. For example:

    <type type="tc.Server" extends="generic.Container">
        <property name="home" default="/tmp/tomcat"/>
        <property name="targetDirectory" default="${container.home}/webapps" hidden="true"/>
    </type>

A special case is when referring to an artifact in the placeholder. For example, when deploying a CI representing a WAR file, the following placeholder can be used to refer to that file (assuming there is a `file` property on the deployable):

    ${deployed.deployable.file}

In this case, Deployit will copy the referred artifact to the target container so that the file is available to the executing script. A script containing a command like the following would therefore copy the file represented by the deployable to it's installation path on the remote machine:

    cp ${deployed.deployable.file} /install/path

## Control Tasks

CIs based on the Container, CopiedArtifact, ExecutedScript or ProcessedTemplate can also define control tasks to manage them. Control tasks are implemented using scripts that will be loaded and executed on the target middleware when executed.

This is an example of defining a control task:

    <type type="tc.DeployedDataSource" extends="generic.ProcessedTemplate" deployable-type="tc.DataSource"
          container-type="tc.Server">
        <generate-deployable type="tc.DataSource" extends="generic.Resource"/>
        ...
        <property name="pingScript" default="tc/ping.sh" hidden="true"/>
        <method name="ping" description="Test whether the datasource is available"/>
    </type>

The method XML fragment defines that control task ping is available on the CI. The pingScript property indicates the script that must be executed when it is invoked. The script will be resolved from the classpath. The same mechanism applies to a container.

# Using the deployables and deployeds

## Deployable vs. Container Table

The following table describes which deployable / container combinations are possible.

Deployable | Containers | Generated deployed
--- | --- | ---
generic.File generic.Archive | overthere.HostContainer | generic.CopiedArtifact
any deployable | overthere.HostContainer | generic.ExecutedScript
any deployable | overthere.HostContainer | generic.ManualProcess
any folder deployable | overthere.HostContainer | generic.ExecutedFolder
any deployable | overthere.HostContainer | generic.ProcessedTemplate

## Deployed Actions Table

The following table describes the effect a deployed has on its container.

Deployed | Create | Destroy | Modify
--- | --- | --- | ---
generic.CopiedArtifact | Create target path on host, if needed Copy file to target path on host | Delete file from host (if the preserveExistingFiles property if set to false) | Delete old file from host (if the preserveExistingFiles property if set to false) Copy modified file to target path on host
generic.ExecutedScript | Run script through template engine Copy create script to container Execute script | Run script through template engine Copy destroy script to container Execute script | Run script through template engine Copy modify script to container Execute script
generic.ManualProcess | Run instructions script through template engine Mail instructions if mail properties set and target container has a mail.SMTPServer Display in step logs Pause step When operator retries step, step continues as successful | Same as Create | Same as Create
generic.ExecutedFolder | For each installation script in the folder (ordered alphabetically by name, ascending): Run script through template engine Copy create script to container Execute script | For each rollback script in the folder (ordered alphabetically by name, descending): Run script through template engine Copy destroy script to container Execute script | For each installation script in the folder that was not part of the deployment being upgraded (ordered alphabetically by name, ascending): Run script through template engine Copy modify script to container Execute script
generic.ProcessedTemplate | Run script through template engine Copy template to container | Run script through template engine Delete template from container | Run script through template engine Delete template from container Copy new template to container

# Sample Usage Scenario - Deploying a new middleware platform

This section describes an example of using the Generic Model plugin to implement support for a simple middleware platform. Deployment to this platform is done by simply copying a WAR archive to the right directory on the container. Resources are created by copying configuration files into the container's configuration directory. The Tomcat application server works in a very similar manner.

By defining a container and several other CIs based on CIs from the Generic Model plugin, it is possible to add support for deploying to this platform to Deployit.

## Defining the Container

To use any of the CIs in the Generic Model plugin, they need to be targeted to a Container. This snippet shows how to define a generic container as a synthetic type:

    <type type="tc.Server" extends="generic.Container">
        <property name="home" default="/tmp/tomcat"/>
    </type>

    <type type="tc.UnmanagedServer" extends="tc.Server">
        <property name="startScript" default="tc/start.sh" hidden="true"/>
        <property name="stopScript" default="tc/stop.sh" hidden="true"/>
        <property name="restartScript" default="tc/restart.sh" hidden="true"/>
    </type>

Note that the tc.UnmanagedServer CI defines a start, stop and restart script. Deployit Server reads these scripts from the classpath. When targetting a deployment to the tc.UnmanagedServer, Deployit will include steps executing the start, stop and restart scripts in appropriate places in the deployment plan.

## Defining a Configuration File

The following snippet defines a CI based on the CopiedArtifact. The tc.DeployedFile CI can be targeted to the tc.Server. The target directory is specified as a hidden property. Note the placeholder syntax used here.

    <type type="tc.DeployedFile" extends="generic.CopiedArtifact" deployable-type="tc.File"
          container-type="tc.Server">
        <generate-deployable type="tc.File" extends="generic.File"/>
        <property name="targetDirectory" default="${deployed.container.home}/conf" hidden="true"/>
    </type>

Using the above snippet, it is possible to create a package with a tc.File deployable and deploy it to an environment containing a tc.UnmanagedServer. This will result in a tc.DeployedFile deployed.

## Defining a WAR

To deploy a WAR file to the tc.Server, one possibility is to define a tc.DeployedWar CI that extends the ExecutedScript. The tc.DeployedWar CI is generated when deploying a jee.War to the tc.Server CI. This is what the XML looks like:

    <type type="tc.DeployedWar" extends="generic.ExecutedScript" deployable-type="jee.War"
          container-type="tc.Server">
        <generate-deployable type="tc.War" extends="jee.War"/>
        <property name="createScript" default="tc/install-war" hidden="true"/>
        <property name="modifyScript" default="tc/reinstall-war" hidden="true" required="false"/>
        <property name="destroyScript" default="tc/uninstall-war" hidden="true"/>
    </type>

When performing an initial deployment, the create script, `tc/install-war` is executed on the target container. Inside the script, a reference to the `file` property is replaced by the actual archive. Note that the script files do not have an extension. Depending on the target platform, the extension `sh` (Unix) or `bat` (Windows) is used.

The WAR file is referenced from the script as follows:

    echo Installing WAR ${deployed.deployable.file} in ${deployed.container.home}

## Defining a Datasource

Configuration files can be deployed by creating a CI based on the ProcessedTemplate. By including a Resource in the package that is a Freemarker template, a configuration file can be generated during the deployment and copied to the container. This snippet defines such a CI, tc.DeployedDataSource:

    <type type="tc.DeployedDataSource" extends="generic.ProcessedTemplate" deployable-type="tc.DataSource"
          container-type="tc.Server">
        <generate-deployable type="tc.DataSource" extends="generic.Resource"/>

        <property name="jdbcUrl"/>
        <property name="port" kind="integer"/>
        <property name="targetDirectory" default="${deployed.container.home}/webapps" hidden="true"/>
        <property name="targetFile" default="${deployed.name}-ds.xml" hidden="true"/>
        <property name="template" default="tc/datasource.ftl" hidden="true"/>
    </type>

The `template` property specifies the Freemarker template file that Deployit Server reads from the classpath. The `targetDirectory` controls where the template is copied to. Inside the template, properties like `jdbcUrl` on the datasource can be used to produce a proper configuration file.

# Discovery

The Generic Model plugin supports discovery in any subtype of Container, Nested Container and Deployed. Extenders of the plugin provide shell scripts that interact with the discovery mechanism, via the standard out, with specially formatted output representing the inspected property or discovered configuration item.

    <!-- Sample of extending Generic Mode plugin -->
    <type type="sample.TomcatServer" extends="generic.Container">
        ...
        <property name="inspectScript" default="inspect/inspect-server" hidden="true"/>
    </type>

    <type type="sample.VirtualHost" extends="sample.NestedContainer">
        <property name="server" kind="ci" as-containment="true" referenced-type="sample.TomcatServer"/>
        ...
        <property name="inspectScript" default="inspect/inspect-virtualhost" hidden="true"/>
    </type>

    <type type="sample.DataSource" extends="generic.ProcessedTemplate" deployable-type="sample.DataSourceSpec"
          container-type="sample.Server">
        <generate-deployable type="sample.DataSourceSpec" extends="generic.Resource"/>
        <property name="inspectScript" default="inspect/inspect-ds" hidden="true"/>
        ...
    </type>

## Encoding

The discovery mechanism uses URL encoding as described in RFC3986 to interpret the value of an inspected property. It is the responsibility of the plugin extender to perform said encoding in the inspect shell scripts.

Sample of encoding in a BASH shell script

    function encode()
    {
        local  myresult=$(printf "%b" "$1" | perl -pe's/([^-_.~A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg')
        echo "$myresult"
    }
    myString='This is a string spanning many lines and with funky characters like !@#$%^&*() and \|'"'"'";:<>,.[]{}'
    myEncodedString = $(encode "$myString")
    echo $myEncodedString

## Property Inspection

The discovery mechanism identifies an inspected property when output with the following format is sent to the standard out.

    INSPECTED:propertyName=value

The output must be prefixed with INSPECTED: followed by the name of the inspected property, an = sign and then the encoded value of the property.

Sample :

    echo INSPECTED:stringField=A,value,with,commas
    echo INSPECTED:intField=1999
    echo INSPECTED:boolField=true

### Inspecting Set properties

When an inspected property is a set of strings, the value must be comma separated

    INSPECTED:propertyName=value1,value2,value3

Sample :

    echo INSPECTED:stringSetField=$(encode 'Jac,q,ues'),de,Molay
    # will result in the following output
    # INSPECTED:stringSetField=Jac%2Cq%2Cues,de,Molay

### Inspecting Map properties

When an inspected property is a map of strings, entries must be comma separated and key values must be colon separated

    INSPECTED:propertyName=key1:value1,key2:value2,key3:value3

Sample :

    echo INSPECTED:mapField=first:$(encode 'Jac,q,ues:'),second:2
    # will result in the following output
    # INSPECTED:mapField=first:Jac%2Cq%2Cues,second:2

## Configuration Item Discovery

The discovery mechanism identifies a discovered configuration item when output with the following format is sent to the standard out.

    DISCOVERED:configurationItemId=type

The output must be prefixed with DISCOVERED:_ followed by the id of the configuration item as stored in the Deployit repository, an = sign and the type of the configuration item

Sample :

    echo DISCOVERED:Infrastructure/tomcat/defaultContext=sample.VirtualHost

# CI Reference

## Configuration Item Overview

### Deployables

### Deployeds

### Containers

### Other Configuration Items

## Configuration Item Details

### generic.AbstractDeployed

Virtual Type
Type Hierarchy | udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Deployed, udm.ConfigurationItem

Abstract deployed that can target any deployable to a generic container

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.

|  | Hidden Properties
--- | --- | ---
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.

### generic.AbstractDeployedArtifact

Virtual Type
Type Hierarchy | generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Deployed, udm.ConfigurationItem

Abstract deployed that can target any artifact to a generic container

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.
|  | targetFile : STRING
|  | Name of the artifact on the generic server.

|  | Hidden Properties
--- | --- | ---
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | targetDirectory : STRING
|  | Path to which artifact must be copied to on the generic server.
|  | createTargetDirectory : BOOLEAN = false
|  | Create the target directory on the generic server if it does not exist.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.
|  | targetDirectoryShared : BOOLEAN = true
|  | Is the target directory shared by others on the generic server. When true, the target directory is not deleted during a destroy operation; only the artifacts copied to it.

### generic.Archive

Virtual Type
Type Hierarchy | udm.BaseDeployableArchiveArtifact >> udm.BaseDeployableFileArtifact >> udm.BaseDeployableArtifact >> udm.BaseDeployable >> udm.BaseConfigurationItem
Interfaces | udm.Taggable, udm.Deployable, udm.SourceArtifact, udm.ArchiveArtifact, udm.Artifact, udm.DeployableArtifact, udm.ConfigurationItem, udm.FileArtifact

A generic, compressed binary artifact

|  | Public Properties
--- | --- | ---
|  | excludeFileNamesRegex : STRING
|  | Regular expression that matches file names that must be excluded from scanning
|  | placeholders : SET_OF_STRING
|  | Placeholders detected in this artifact
|  | scanPlaceholders : BOOLEAN = false
|  | Whether to scan this artifact for placeholders when it is imported
|  | tags : SET_OF_STRING
|  | If set, this deployable will only be mapped automatically to containers with the same tag.

|  | Hidden Properties
--- | --- | ---
|  | textFileNamesRegex : STRING = .+\.(cfg | conf | config | ini | properties | props | txt | asp | aspx | htm | html | jsf | jsp | xht | xhtml | sql | xml | xsd | xsl | xslt)
|  | Regular expression that matches file names of text files

### generic.Container

Virtual Type
Type Hierarchy | udm.BaseContainer >> udm.BaseConfigurationItem
Interfaces | udm.Taggable, udm.ConfigurationItem, udm.Container, generic.GenericContainer, overthere.HostContainer

A container to which generic CIs can be deployed. Start, stop and restart behavior of this container can be controlled using the corresponding script properties.

|  | Parent
--- | --- | ---
|  | host : CI<overthere.Host>
|  | Host upon which the container resides

|  | Public Properties
--- | --- | ---
|  | deploymentGroup : INTEGER
|  | If the group-orchestrator is enabled, all containers with the same deployment group number will be deployed to at the same time. The groups are ordered by this number.
|  | envVars : MAP_STRING_STRING
|  | Environment variables for container
|  | tags : SET_OF_STRING
|  | If set, only deployables with the same tag will be automatically mapped to this container.

|  | Hidden Properties
--- | --- | ---
|  | restartOrder : INTEGER = 90
|  | The order of the restart container step in the step list.
|  | startOrder : INTEGER = 90
|  | The order of the start container step in the step list.
|  | startWaitTime : INTEGER = 0
|  | The time to wait in seconds for a container start action.
|  | stopOrder : INTEGER = 10
|  | The order of the stop container step in the step list.
|  | stopWaitTime : INTEGER = 0
|  | The time to wait in seconds for a container stop action.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | restartScript : STRING
|  | Classpath to the script used to restart the generic container.
|  | restartWaitTime : INTEGER = 0
|  | The time to wait in seconds for a container restart action.
|  | startScript : STRING
|  | Classpath to the script used to start the generic container.
|  | stopScript : STRING
|  | Classpath to the script used to stop the generic container.

### generic.CopiedArtifact

Virtual Type
Type Hierarchy | generic.AbstractDeployedArtifact >> generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Artifact, udm.Deployed, udm.ConfigurationItem, udm.DerivedArtifact

An artifact deployed on a generic container

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.
|  | placeholders : MAP_STRING_STRING
|  | A Map containing all the placeholders mapped to their values. Special values are <ignore> or <empty>
|  | targetFile : STRING
|  | Name of the artifact on the generic server.

|  | Hidden Properties
--- | --- | ---
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | targetDirectory : STRING
|  | Path to which artifact must be copied to on the generic server.
|  | createTargetDirectory : BOOLEAN = false
|  | Create the target directory on the generic server if it does not exist.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | preserveExistingFiles : BOOLEAN = false
|  | if true, preserve the existing files on the remote host (do not delete the copied files during the destroy operation).
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.
|  | targetDirectoryShared : BOOLEAN = true
|  | Is the target directory shared by others on the generic server. When true, the target directory is not deleted during a destroy operation; only the artifacts copied to it.

### generic.ExecutedFolder

Virtual Type
Type Hierarchy | generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Artifact, udm.Deployed, udm.ConfigurationItem, udm.DerivedArtifact

Scripts in the folder are executed against a Container based on a naming convention

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | executorScript : STRING
|  | Name of the executor script that will be executed for each script found in the folder.
|  | rollbackScriptPostfix : STRING
|  | A script's associated rollback script is derived by using the 1st group identified by the scriptRecognitionRegex and then appending this postfix to it. e.g give name '01-myscript.sql', regex '([0-9]*-.*)\.sql' and rollback script postfix '-rollback.sql', we can derive the name of the associated rollback script to be '01-myscript-rollback.sql'
|  | rollbackScriptRecognitionRegex : STRING
|  | Regular expression used to identify a rollback script in the folder. A successful match should returns a single group, ie the logical script name. e.g. [0-9]*-.*-rollback\.sql
|  | scriptRecognitionRegex : STRING
|  | Regular expression used to identify a script in the folder. A successful match should returns a single group to which the rollbackScriptPostfix can be appended to inorder to find the associated rollback script or the script's dependent subfolder. e.g.([0-9]*-.*)\.sql
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.
|  | placeholders : MAP_STRING_STRING
|  | A key/value pair mapping of placeholders in the deployed artifact to their values. Special values are and

|  | Hidden Properties
--- | --- | ---
|  | commonScriptFolderName : STRING = common
|  | Common folder that should be uploaded to the working directory.
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | classpathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the script.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.
|  | templateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.

### generic.ExecutedScript

Virtual Type
Type Hierarchy | generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Deployed, udm.ConfigurationItem

A script executed on a generic container

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.

|  | Hidden Properties
--- | --- | ---
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | classpathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the script.
|  | destroyScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the destroy operation.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | modifyScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the modify operation.
|  | noopScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the noop operation.
|  | remoteWorkingDirectoryPath : STRING
|  | Name of working directory on target host. Default is to create a temporary directory which is deleted when connection is closed.
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.
|  | retainRemoteWorkingDirectory : BOOLEAN = false
|  | Retain the specified working directory on target host after completion.
|  | templateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.

### generic.ExecutedScriptWithDerivedArtifact

Virtual Type
Type Hierarchy | generic.ExecutedScript >> generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Artifact, udm.Deployed, udm.ConfigurationItem, udm.DerivedArtifact

A script executed on a generic container whose deployable artifact supports placeholder replacement

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.
|  | placeholders : MAP_STRING_STRING
|  | A key/value pair mapping of placeholders in the deployed artifact to their values. Special values are and

|  | Hidden Properties
--- | --- | ---
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | classpathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the script.
|  | destroyScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the destroy operation.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | modifyScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the modify operation.
|  | noopScript : STRING
|  | Classpath to the script that is uploaded and executed on the generic container for the noop operation.
|  | remoteWorkingDirectoryPath : STRING
|  | Name of working directory on target host. Default is to create a temporary directory which is deleted when connection is closed.
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.
|  | retainRemoteWorkingDirectory : BOOLEAN = false
|  | Retain the specified working directory on target host after completion.
|  | templateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.

### generic.File

Virtual Type
Type Hierarchy | udm.BaseDeployableFileArtifact >> udm.BaseDeployableArtifact >> udm.BaseDeployable >> udm.BaseConfigurationItem
Interfaces | udm.Taggable, udm.Deployable, udm.SourceArtifact, udm.Artifact, udm.DeployableArtifact, udm.ConfigurationItem, udm.FileArtifact

A generic binary artifact

|  | Public Properties
--- | --- | ---
|  | excludeFileNamesRegex : STRING
|  | Regular expression that matches file names that must be excluded from scanning
|  | placeholders : SET_OF_STRING
|  | Placeholders detected in this artifact
|  | scanPlaceholders : BOOLEAN = true
|  | Whether to scan this artifact for placeholders when it is imported
|  | tags : SET_OF_STRING
|  | If set, this deployable will only be mapped automatically to containers with the same tag.

|  | Hidden Properties
--- | --- | ---
|  | textFileNamesRegex : STRING = .+\.(cfg | conf | config | ini | properties | props | txt | asp | aspx | htm | html | jsf | jsp | xht | xhtml | sql | xml | xsd | xsl | xslt)
|  | Regular expression that matches file names of text files

### generic.Folder

Virtual Type
Type Hierarchy | udm.BaseDeployableFolderArtifact >> udm.BaseDeployableArtifact >> udm.BaseDeployable >> udm.BaseConfigurationItem
Interfaces | udm.Taggable, udm.Deployable, udm.SourceArtifact, udm.Artifact, udm.DeployableArtifact, udm.ConfigurationItem, udm.FolderArtifact

A generic folder artifact

|  | Public Properties
--- | --- | ---
|  | excludeFileNamesRegex : STRING
|  | Regular expression that matches file names that must be excluded from scanning
|  | placeholders : SET_OF_STRING
|  | Placeholders detected in this artifact
|  | scanPlaceholders : BOOLEAN = true
|  | Whether to scan this artifact for placeholders when it is imported
|  | tags : SET_OF_STRING
|  | If set, this deployable will only be mapped automatically to containers with the same tag.

|  | Hidden Properties
--- | --- | ---
|  | textFileNamesRegex : STRING = .+\.(cfg | conf | config | ini | properties | props | txt | asp | aspx | htm | html | jsf | jsp | xht | xhtml | sql | xml | xsd | xsl | xslt)
|  | Regular expression that matches file names of text files

### generic.ManualProcess

Virtual Type
Type Hierarchy | generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Deployed, udm.ConfigurationItem

A manual process that needs to be performed on a generic container

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.
|  | fromAddress : STRING
|  | From mail address. Defaults to SMTPServer fromAddress.
|  | subject : STRING
|  | Mail subject
|  | toAddresses : LIST_OF_STRING
|  | Mail addresses of recepients.

|  | Hidden Properties
--- | --- | ---
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createScript : STRING
|  | Classpath to the script that generates the instructions for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | destroyScript : STRING
|  | Classpath to the script that generates the instructions for the destroy operation.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | modifyScript : STRING
|  | Classpath to the script that generates the instructions for the modify operation.
|  | noopScript : STRING
|  | Classpath to the script that generates the instructions for the noop operation.
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.

### generic.NestedContainer

Virtual Type
Type Hierarchy | udm.BaseContainer >> udm.BaseConfigurationItem
Interfaces | udm.Taggable, udm.ConfigurationItem, udm.Container, generic.GenericContainer, overthere.HostContainer

A container that is nested with another container

|  | Public Properties
--- | --- | ---
|  | deploymentGroup : INTEGER
|  | If the group-orchestrator is enabled, all containers with the same deployment group number will be deployed to at the same time. The groups are ordered by this number.
|  | envVars : MAP_STRING_STRING
|  | Environment variables for container
|  | tags : SET_OF_STRING
|  | If set, only deployables with the same tag will be automatically mapped to this container.

|  | Hidden Properties
--- | --- | ---
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.

### generic.ProcessedTemplate

Virtual Type
Type Hierarchy | generic.AbstractDeployedArtifact >> generic.AbstractDeployed >> udm.BaseDeployed >> udm.BaseConfigurationItem
Interfaces | udm.Deployed, udm.ConfigurationItem

A template deployed to a generic container

|  | Parent
--- | --- | ---
|  | container : CI<udm.Container>
|  | The container on which this deployed runs.

|  | Public Properties
--- | --- | ---
|  | deployable : CI<udm.Deployable>
|  | The deployable that this deployed is derived from.
|  | targetFile : STRING
|  | Name of the artifact on the generic server.

|  | Hidden Properties
--- | --- | ---
|  | createOrder : INTEGER = 50
|  | The order of the step in the step list for the create operation.
|  | createVerb : STRING = Create
|  | Create Verb
|  | destroyOrder : INTEGER = 40
|  | The order of the step in the step list for the destroy operation.
|  | destroyVerb : STRING = Destroy
|  | Destroy Verb
|  | modifyOrder : INTEGER = 50
|  | The order of the step in the step list for the modify operation.
|  | modifyVerb : STRING = Modify
|  | Modify Verb
|  | noopOrder : INTEGER = 50
|  | The order of the step in the step list for the noop operation.
|  | noopVerb : STRING = Modify
|  | Noop Verb
|  | targetDirectory : STRING
|  | Path to which artifact must be copied to on the generic server.
|  | template : STRING
|  | Classpath to the freemarker template used to generate the content of the final text base artifact.
|  | createTargetDirectory : BOOLEAN = false
|  | Create the target directory on the generic server if it does not exist.
|  | inspectClasspathResources : SET_OF_STRING
|  | Additional classpath resources that should be uploaded to the working directory before executing the inspect script.
|  | inspectScript : STRING
|  | Classpath to the script used to inspect the generic container.
|  | inspectTemplateClasspathResources : SET_OF_STRING
|  | Additional template classpath resources that should be uploaded to the working directory before executing the inspect script.The template is first rendered and the rendered content copied to a file, with the same name as the template, in the working directory.
|  | restartRequired : BOOLEAN = false
|  | The generic container requires a restart for the action performed by this deployed.
|  | restartRequiredForNoop : BOOLEAN = false
|  | The generic container requires a restart for the NOOP action performed by this deployed.
|  | targetDirectoryShared : BOOLEAN = true
|  | Is the target directory shared by others on the generic server. When true, the target directory is not deleted during a destroy operation; only the artifacts copied to it.

### generic.Resource

Virtual Type
Type Hierarchy | udm.BaseDeployable >> udm.BaseConfigurationItem
Interfaces | udm.Taggable, udm.Deployable, udm.ConfigurationItem

A generic resource specification

|  | Public Properties
--- | --- | ---
|  | tags : SET_OF_STRING
|  | If set, this deployable will only be mapped automatically to containers with the same tag.

### mail.SmtpServer

Type Hierarchy | udm.BaseConfigurationItem
Interfaces | udm.ConfigurationItem

SMTP Mail Server Configuration

|  | Public Properties
--- | --- | ---
|  | fromAddress : STRING
|  | Default from address to use for messages sent with this server.
|  | host : STRING
|  | SMTP host
|  | port : INTEGER = 25
|  | SMTP port
|  | password : STRING
|  | Password to authenticate with host
|  | smtpProperties : MAP_STRING_STRING
|  | Refer to http://javamail.kenai.com/nonav/javadocs/com/sun/mail/smtp/package-summary.html for all properties that can be used.
|  | username : STRING
|  | Username to authenticate with host