After making any changes to a stack, save the changes and then from the Actions list in the main stack page, select
Publish Changes. The specified engines are affected by the changes immediately.
Micro-scaling - Start and stop Adapter archives based on your defined rules when they are already in your component.
Continuous Deployment (deploy archives directly to endpoints) - publish (deploy), unpublish (undeploy), start, or stop archives without having to change any stacks, components, or engines. Deploying application archives through REST and cURL commands is described in the next section.
TIBCO Silver Fabric supports many HTTP REST commands to GET,
PUT,
POST, and
DELETE objects and managed resources for use with archive scaling, brokers, components, daemons, enablers, gridlibs, schedules, stacks, and Skyway.
Deploy Send an archive to a Silver Fabric Engine running a Generic Adapter component that meets the criteria specified. The Deploy REST method enables specification of a properties files with criteria dictating where and how the archive should be deployed.
Start Start an archive that was deployed to an engine.
Stop Stop an archive that is running on an engine.
Undeploy Remove an archive from an engine, stopping any running instances of that archive on that engine.
-v "http://YourSFBroker.com:<port>/livecluster/rest/v1/sf/engines/archives"
[-F "GV=globalVariableA=123,globalVarB=SomeString"]
[-F "VariableProvider=
Some_PROVIDER(S)_Name"]
curl -u admin:admin -X POST -H "Accept:application/json" -H "Content-Type: multipart/form-data" -v http://MySFBroker.com:8080/livecluster/rest/v1/sf/engines/archives -F "archiveFile=@MyProcessOrder.ear" -F "AppName=MyOrders/MyProcOrder" -F "deploymentFile=@MyDeployCriteria.properties"
Where the user specified by -u must have Silver Fabric administrator level permissions, and the form-data fields (
-F "property=value") may be specified in any order. The form-data fields (
-F) are described as follows:
archiveFile: specifies the archive file (.zip, .par, or .ear file) to upload to the Silver Fabric Broker, which then publishes the archive to the appropriate Silver Fabric engine. Multiple application archives may be deployed in a single archive .zip or .ear file. You can deploy and run them all (default behavior) or you can selectively run a list of archives by specifying that list with the
Archives form-data field. Archives may also be uploaded using the component wizard.
deploymentFile: specifies the properties file that defines the endpoint selection criteria described as follows in more detail.
LogicalAnd (optional)
: by default
all criteria specified in the deployment properties file must be satisfied for deployment to an application endpoint, but that can be toggled to mean
any (meaning logical OR) of the deployment properties criteria by setting:
-F "LogicalAnd=false"
-v: specifies the target of the cURL POST execution and asks for a verbose response. The cURL
-v expression should specify the appropriate Silver Fabric directory. For the default installation, that expression would look like the following:
-v "http://YourSilverFabricBrokerName.com:<port>/livecluster/rest/v1/sf/engines/archives"
AppName: specifies the directory location where the application archives are deployed and what the application is named.
Where your archive application deploys and what it is called depends on what you specify with AppName. For example, when you use TIBCO Designer to create an
.ear file with a name such as
MyAppArchive, varying the
AppName specification gives following behavior:
•
|
If the AppName form-data field is not specified, MyAppArchive is deployed at the top level of the directory.
|
•
|
If -F "AppName=A" is submitted in the curl request, MyAppArchive is renamed A and deployed at the top level.
|
•
|
If -F "AppName=A/" is sent, the directory folder A is used or it is created and MyAppArchive is deployed within that subdirectory.
|
•
|
If -F "AppName=A/B" is sent, the subdirectory A is used or created, and MyAppArchive is deployed there and renamed B.
|
•
|
If -F "AppName=A/B/" is sent, the folder A with a subfolder B is used or created and MyAppArchive is published within the subfolder B.
|
The full application name is derived from the AppName directory location and the application archive name as it is deployed.
AppSettings (optional): specifies settings that your application uses when deployed.
-F "AppSettings.element1.element2=SomeValue"
-F "AppSettings.localRepoInstance.encoding=UTF-8"
-F "AppSettings.description=This%20application%20deployment%20is%20for%20validation%20testing."
•
|
contact: a string to name the person responsible for the deployment.
|
•
|
maxDeploymentRevision: specifies the default number of application revisions to keep in the revision history for each deployed application. Leave the value at -1 to keep all revisions by default.
|
•
|
localRepoInstance: for Enabler installed components and application archives installed with continuous deployment, a local file (or directory of files) is used as the deployment repository instance.
|
a.
|
encoding: specifies encoding for the repository instance. If this element is not specified, the encoding for the admin server is used. If the admin server is not available, the default for this element is ISO8859-1.
|
Archives (optional): form-data parameter that specifies a comma delimited list of archives that are to be deployed within the .zip file that are to be deployed. If an
archives list is omitted, all archives in the application archive package are deployed. Example:
ArchiveSettings (optional): form-data parameter specifies settings for the archive. Types of
ArchiveSettings are as follows:
•
|
enabled: true or false. Only enabled services are deployed. Disabling a service effectively undeploys just that service while letting all other services in the application run as normal. This can be useful when you wish to deploy an application that includes a service, for which you do not have the required software. A deployment configuration cURL expressions takes the form:
|
•
|
av: specify values for archive runtime variables with a comma-separated string with each key value pair joined by an equal (=) sign. For example:
|
|
Refer to the appendix of the TIBCO Runtime Agent Scripting Deployment User’s Guide for a full list of Archive Settings properties, parameters, descriptions, and usage. Not all elements and properties are supported for use by the TIBCO Silver Fabric Enabler for Generic Adapter . The following is the first attempt at listing them all.
|
ruleBase.uri: location of the rulebase file. Example syntax:
restart:
true or
false. If
true, the service instance is restarted upon failure.
description: information that describes this operation.
alertAction.performPolicy: the policy to perform.
Once:generates an alert only for the first occurrence.
Always:generates an alert for each occurrence.
alertAction.enabled:
true or
false. If
true, the action occurs when conditions for the action are
true. If
false, the action is not called.
Once:generates an alert only for the first occurrence.
Always: generates an alert for each occurrence.
enabled:
true or
false. If
true, the action occurs when conditions for the action are
true. If
false, the action is not called.
to: a comma-separated list of email addresses to which the messages are sent
cc: a comma-separated list of email addresses to which copies of the messages are sent
subject: the subject of the email message
sMTPServer: The mail server (SMTP server) to use to send the message. Specify the host name or the host IP address
Once: generates an alert only for the first occurrence.
Always: generates an alert for each occurrence.
enabled:
true or
false. If
true, the action occurs when conditions for the action are
true. If
false, the action is not called.
command: specify the script to execute. A good practice is to use script files.
arguments: the list of arguments for the command
restart:
true or
false. If
true, the service instance is restarted upon failure.
description: information that describes this operation.
alertAction.performPolicy: the policy to perform.
Once: generates an alert only for the first occurrence.
Always: generates an alert for each occurrence.
alertAction.enabled:
true or
false. If
true, the action occurs when conditions for the action are
true. If
false, the action is not called.
emailAction.performPolicy: the policy to perform.
Once:generates an alert only for the first occurrence.
Always: generates an alert for each occurrence.
emailAction.enabled:
true or
false. If
true, the action occurs when conditions for the action are
true. If
false, the action is not called.
emailAction.to: a comma-separated list of email addresses, to which the messages are sent.
emailAction.cc: a comma-separated list of email addresses, to which copies of the messages are sent.
emailAction.sMTPServer: the mail server (SMTP server) to use to send the message. Specify the host name or the host IP address.
customAction.performPolicy: the policy to perform.
Once: generates an alert only for the first occurrence.
Always:generates an alert for each occurrence.
customAction.enabled:
true or
false. If
true, the action occurs when conditions for the action are true. If
false, the action is not called.
restart:
true or
false. If
true, the service instance is restarted upon failure.
match: the string in the log file to match
alertAction.performPolicy: the policy to perform.
Once:generates an alert only for the first occurrence.
Always:generates an alert for each occurrence.
alertAction.enabled:
true or
false. If
true, the action occurs when conditions for the action are true. If
false, the action is not called.
emailAction.performPolicy: the policy to perform.
Once: generates an alert only for the first occurrence.
Always:generates an alert for each occurrence.
emailAction.enabled:
true or
false. If
true, the action occurs when conditions for the action are
true. If
false, the action is not called.
emailAction.to: a comma-separated list of email addresses, to which the messages are sent.
emailAction.cc: a comma-separated list of email addresses, to which copies of the messages are sent.
emailAction.sMTPServer: The mail server (SMTP server) to use to send the message. Specify the host name or the host IP address.
customAction.performPolicy: the policy to perform.
Once: generates an alert only for the first occurrence.
Always: generates an alert for each occurrence.
customAction.enabled:
true or
false. If
true, the action occurs when conditions for the action are
true. If
false, the action is not called.
•
|
failureCount: the value in this field defines how many restarts should be attempted before resetting the error counter to 0.
|
•
|
failureInterval: the value in this field defines how much time should expire before resetting the error counter to 0.
|
InstanceSettings - (optional) Some syntax examples:
•
|
description: specify any pertinent information about the binding.
|
•
|
contact: contact responsible for this application instance.
|
•
|
startOnBoot: when true, the service instance starts when the computer is restarted. The default value is false.
|
•
|
prepandClassPath: the values supplied here are prepended to your CLASSPATH environment variable.
|
•
|
appendClassPath: the items you supply here are appended to your CLASSPATH environment variable.
|
•
|
initHeapSize: specifies the initial size (in MB) for the JVM used for the process engine. The default is 32 MB.
|
•
|
maxHeapSize: specifies the maximum size (in MB) for the JVM used for the process engine. The default is 256 MB.
|
•
|
threadStackSize: specifies the size of the thread stack. The default is 256 KB.
|
•
|
runAsNT: when set to true the service is run as a Microsoft Windows Service. You can then manage the engine as you would any other service, and you can specify that it starts automatically when the machine reboots.
|
•
|
startUpType: specifies the instance service startup type as either: Automatic, Manual, or Disabled.
|
•
|
login: specifies the login account for the service, if any. The domain name must be specified as well.
|
•
|
password: sets the password for that service, if any.
|
•
|
checkpoint: when set to true, the process engine waits for all jobs to finish (up to the maximum timeout) before shutting down the engine, rather than remove jobs at their next checkpoint.
|
•
|
iv : this element uses a comma-separated string with name-value pairs with each key value pair joined by an equal (=) sign. For example:
|
configurationFile (optional): form-data parameter used to include an XML configuration file created to modify archive properties if needed. Example syntax:
ForceDeploy (optional): redeploy, forces a stop and overwrite of a pre-existing archive or set of archives with the same name. By default
ForceDeploy is set to
false and so a second deployment does not overwrite a pre-existing deployment of the same name. If a change of the archive file,
ForceDeploy should be set to
true so that the new application archive is redeployed. If
ForceDeploy is used with
-F Archives specifying a comma delimited list, only those archives are stopped, undeployed, and redeployed.
VariableProvider (optional):
specifies a variable provider to set global variables for applications deployed with REST. The variable provider is a Java Class extension compiled into a JAR and loaded into a Silver Fabric directory with an appropriate XML so that it may be called by REST during application deployment. It supports multiple VariableProviders at the same time. You can add multiple variable provider names with a comma separated list. If you use the global variable name in both variable providers, the latest in the list is used.
1.
|
Create a class that extends com.datasynapse.fabric.broker.userartifact.variable.AbstractVariableProvider and override the methods as needed. For example:
|
public class My_Var_Provider extends AbstractVariableProvider
NoStart - (optional) default value is false, meaning that the archives are both deployed and started by default. If
NoStart is set to true, the application is deployed but not started.
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"
Comparator Valid comparators include
=,
!=,
>,
<,
<=,
>=,
matches,
contains,
!matches, and
!contains.
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.
If you are encountering timeout issues, you can set a higher socket timeout between the broker and engines. This can be set in the Silver Fabric Administration Tool at Config > Broker > Communications under the section
HTTP Connections > Engines. The Socket Timeout parameter configures the HTTP connections established from brokers to clients and engines. Set the timeout value to the longest of the following three:
-v "http://<YourSFBroker.com>:<port>/livecluster/rest/v1/sf/e
ngines/{engine-id}/{engine-instance}/archives/{appname}/start"
The value of {engine-instance} can be obtained from the response to the successful cURL deployment REST execution or the TIBCO Silver Fabric Administrator >
Engines page > expanding the row to see Engine details.
The value of {appname} is usually the application name or the full application archive name.
|
When the {appname} is used, it is URL-encoded in a cURL statement so that spaces are converted to " %20" and forward slashes ( /) are represented by " %2F". Likewise, other special characters must be encoded appropriately.
|
-v "http://<YourSFBroker.com>:<port>/livecluster/rest/v1/sf/e
ngines/{engine-id}/{engine-instance}/archives/{appname}/{archive-id}/stop"
Refer to the Start method for a description on how to obtain the values of
{engine-id},
{engine-instance}, and
{appname}.
-v "http://<YourSFBroker.com>:<port>/livecluster/rest/v1/sf/engines/{engine-id}/{engine-instance}/archives/{appname}/undeploy"
Refer to the Start method for a description on how to obtain the values of
{engine-id},
{engine-instance}, and
{appname}.
DeleteApp - (optional - use with undeploy only) The default value is false and it can be omitted. When the
DeleteApp parameter is false, an undeploy archive action leaves the application configurations of global variables and bindings so that they can be used again. The archive and the application are only undeployed and not deleted.
Setting DeleteApp to
true deletes the application and the associated variable settings from the runtime engine after the archive is undeployed.