Deployment File

When deploying an archive by REST you must include a deployment file, which will specify at least one selection criteria for determining which Engine and Component will receive the deployed archive.

The deployment file is a simple properties text file specified by a form-data field like the following for REST upload with the archive:

     -F "deploymentFile=@YourDeploymentFileName.properties"

The deployment file contains one or more logical statements with a criteria, a comparator, and a value, delimited by spaces:

criteria comparator value

Some criteria require an argument to be specified in parentheses:

criteria(argument) comparator value

For example, the following is a simple statement to deploy an archive to an Engine running a Component with a Component Type that contains Adapter as part of the name and which has a Domain name of YourDomain:

ComponentType contains Adapter
ImportedVariable(TIBCO_DOMAIN_NAME) = YourDomain

By default all deployment file criteria statements must be satisfied for the deployment to occur, but you can change how the properties file criteria are evaluated to make them logical OR statements by using the optional cURL form-data switch:   -F "LogicalAnd=false"

Criteria - The following criteria are supported:

Name Definition
ComponentName The name of the Component.
ComponentType The type of the Component.
EnablerName The name of the Enabler running the Component.
EnablerVersion The version of the Enabler running the Component.
Account The name of the account running the Component.
EngineProperty(name) A named Engine property. The following engine properties may be used:
  • id: The numeric ID unique to each Engine, generated upon installation.
  • guid: The globally unique identifier for the Engine (network card address).
  • instance: The instance of the Engine, starting with zero. Multi-CPU hosts may have multiple instances of Engines running concurrently.
  • IP: The IP address of the Engine.
  • username: The username of the Engine, which will be the hostname of the Engine unless installed with tracking properties.
  • hostname: The hostname of the Engine.
  • cpuNo: The number of CPUs on the Engine's host computer.
  • cpuCoreCount: The total number of CPU cores on the Engine's host computer, if available. A value of -1 indicates that a value could not be determined.
  • cpuSocketCount: The total number of physical CPUs on the Engine's host computer, if available. A value of -1 indicates that a value could not be determined.
  • cpuThreadCount: The total number of hardware threads on the Engine's host computer, if available. A value of -1 indicates that a value could not be determined.
  • cpuIdString: The CPUID string of the first physical CPU on the Engine's host computer, if available.
  • cpuTotal: The amount of processing power on the Engine's host computer, measured in millions of floating-point arithmetic operations per second.
  • Calculated on the Engine Daemon using a Linpack performance calculation and reported when the Engine Daemon logs into the Manager and updated on a frequency that is set in the Engine Configuration.
  • totalMemInKB: The amount of total physical memory on the Engine's host computer, in kilobytes.
  • freeMemInKB: The amount of free physical memory on the Engine's host computer, in kilobytes, updated when any Engine instance is launched.
  • freeDiskInMB: The amount of available disk space on the Engine's host computer, in megabytes, updated when any Engine instance is launched.
  • os: The operating system platform. This corresponds with the Engine installation. Available platforms can be viewed on the Engine Install page.
  • osVersion: The version of the operating system.
  • homeDir: Home directory, the installation directory on the Engine's host computer.
  • dataDir: Data directory, the directory which is home to the DDT (direct data transfer) data.
  • dataUrl: Data URL, the URL corresponding to the DDT directory.
  • workUrl: Work URL, the URL of work directory on the Engine's fileserver that stores log and temporary files.
  • sharedDirID: A number which identifies a group of Engines running from the same home directory.
  • osUsername: The owner of the process running the Engine.
  • configurationName: The current Engine Configuration name. The value is [os]:[name] like on the Engine Configuration page.
  • pid: The process ID of the Engine process.
ActivationInfoProperty(name) A named property, such as ClusterName, or HTTP_STATIC_ROUTE_PREFIX within the Component’s ActivationInfo object. Archives that can be scaled elastically keep a list of ActivationInfo properties and their respective values for failover Broker.
ImportedVariable(name) A variable imported into a Component.
ExportedVariable(name) A variable exported from a Component.
Statistic(name) A named Enabler for Adapter for Files (Unix/Win) statistic like: Total Memory, Free Memory, Free Disk, CPU Utilization, DS CPU Utilization, Expected Engine Count, Actual Engine Count, or Allocating Engine Count
ArchiveStatistic(statName, archiveName) A named statistic for a specified archive.
DependencyComponent A named dependency on a Component.
DependencyEngine(componentName) A named dependency on an Engine running the named Component.
Comparator
Valid comparators include =, !=, >, <, <=, >=, matches, contains, !matches, and !contains.

Example Deployment File

# Sample deployment file
ComponentType = "TIBCO ActiveMatrix Adapter for Files:2.5.0"
Statistic(CPU Utilization) < 80
ActivationInfoProperty(ClusterName) matches dev_cluster.*

Successful Deployment

REST will return a Status of 200 (OK) when the archive is successfully deployed. A successful REST execution returns the Engine-Instance and Engine-Id where the archive deployed. Example response (application/JSON):

{
    "result": {
        "name": "Archive Deployment",
        "value": {
            "message": "ENGINE '[1885509966828815621-5 : my_archive.ear]' DEPLOYED",
            "Engine-Instance": "5",
            "Engine-Id": "1885509966828815621"
        }
    },
    "status": 200
}

Knowing the Engine-Id, Engine-Instance, and the full ArchiveName allows for invocation of START, STOP, and UNDEPLOY methods to enable full control of the Archive life cycle.

An unsuccessful deployment will return an error of Status 500 or some other appropriate error status depending on the cause.

1. Create a class that extends com.datasynapse.fabric.broker.userartifact.variable.AbstractVariableProvider and override the methods as needed. For example

package com.tibco.sf.providers;
import java.util.Properties;
import com.datasynapse.fabric.broker.userartifact.variable.AbstractVariableProvider;
public class My_Var_Provider extends AbstractVariableProvider
{
  private static final long serialVersionUID = 1L;
  @Override
  public Properties getVariables()
  {
    Properties p = new Properties();
    p.setProperty("MyApp/vars/name", "SomeString");
    p.setProperty("MyApp/vars/episodic", "true");
    p.setProperty("MyApp/vars/Xduration", "60");
    return p;
  }
  @Override
  public void destroy()
  {}
  @Override
  public void init() throws Exception
  {}
}

2. Export a JAR from it and save it to the TIBCO Silver Fabric Broker directory:

SILVERFABRIC_HOME/webapps/livecluster/deploy/config/variableProviders

3. Create an XML file with the properties shown below to associate the new class for TIBCO Silver Fabric.

<variableProvider class="com.tibco.sf.providers.My_Var_Provider">
   <property name="name" value="Some_PROVIDER_Name"/>
   <property name="description" value="GV values are in the JAR"/>
   <property name="enabled" value="true"/>
</variableProvider>

The variable provider name used by the REST statement is specified as "name" in the XML file.

4. Save the XML file in the same directory as the JAR: 

SILVERFABRIC_HOME/webapps/livecluster/deploy/config/variableProviders

You can verify what variable providers are ready for use by REST invocation on the TIBCO Silver Fabric Administrator > Admin > Variables page.