Apama 10.15.0 | Deploying and Managing Apama Applications | Correlator Utilities Reference | Creating and managing an Apama project from the command line
 
Creating and managing an Apama project from the command line
The apama_project tool can be used to create and manage an Apama project outside of Software AG Designer. It lets you perform the following actions:
*create an Apama project,
*list all supported bundles that can be added to a project,
*list all bundles/instances that have already been added to a project,
*add connectivity, adapter and EPL bundles and their instances to a project,
*remove bundles/instances from a project.
Each Apama project generated by this tool is compatible with Software AG Designer and can seamlessly be imported into Software AG Designer as an Apama project. For more information, see Working with Projects.
The executable for this tool is located in the bin directory of the Apama installation. It is recommended that you run this tool in the Apama Command Prompt or using the apama_env wrapper (see Setting up the environment using the Apama Command Prompt); otherwise you have to provide the full path the apama_project executable each time you run it.
Synopsis
To use this tool, run the following command:
apama_project command [options]
When you run this command with the help (or --help, -help or –h) option, the usage message for this command is shown. For example:
*To display help for all commands:
apama_project help
*To display help for a specific command:
apama_project command help
Description
You can only specify one command at a time.
Apart from the command for creating a project, all other commands require you to run the tool from the project directory.
The apama_project tool takes the following commands and options:
Command
Option
Description
create
projectname
Creates a new project directory with the specified name in the current directory. If the project name is to consist of more than one word, you have to enclose it in quotes.
The new project directory has the same structure and content as an Apama project that you create with Software AG Designer. If desired, you can import it into Software AG Designer.
Note:
We recommend committing your project into a version control system, so that changes are recorded and you can compare or revert changes across versions if needed.
list bundles
not applicable
Lists all connectivity, adapter and EPL bundles that are available for adding to the project. Also lists the bundles with instance information that are already present in the project.
Some bundles support adding several instances to the same project if desired. For example, you can add separate HTTP Client connectivity bundle instances to talk to different servers. Other bundles support adding only one instance. Such singleton bundles, once added to the project, will no longer show up in the list of bundles that can be added.
Index numbers are shown for the bundles which can still be added. They can be used as shortcuts instead of typing the full name. Note that the index numbers are subject to change; they differ each time a bundle has been added. So if you want to use the number shortcut, list the bundles once more in order to find the correct number.
add bundle
bundlename [--instance instancename]
Adds the specified bundle to the project (which was either created using the apama_project tool or Software AG Designer).
The bundlename can be a display name that was displayed by the list bundles command or the absolute path of a .bnd file. If the name consists of more than one word, you have to enclose it in quotes.
Instead of specifying a bundle name, you can also specify the corresponding index number that has been output with the list bundles command.
For bundles supporting multiple bundle instances, you can optionally specify a user-defined instance name using --instance instancename. This is useful for indicating the logical name or purpose of the service or server being connected to. For some bundles, the provided instance name may be used in EPL code. Once added, the instance cannot be renamed, though it is possible to delete and re-add it with a different name. If a user-defined instance is not specified, the default instance name is used.
Duplicate instance names are not allowed for the project, even if the instances are of different bundles.
You can only add bundles from the standard EPL and connectivity catalogs. Adding bundles from the Capital Markets Foundation, Capital Markets Adapters, or user-defined bundle catalogs is not supported.
bundlename bundlename ...
Adds multiple bundles to the project (which was either created using the apama_project tool or Software AG Designer).
The bundlename can be a display name that was displayed by the list bundles command or the absolute path of a .bnd file. If the name consists of more than one word, you have to enclose it in quotes.
Note: 
When adding multiple bundles, it is not permitted to specify index numbers or the --instance argument.
You can only add bundles from the standard EPL and connectivity catalogs. Adding bundles from the Capital Markets Foundation, Capital Markets Adapters, or user-defined bundle catalogs is not supported.
remove bundle
bundlename | instancename
Removes the specified bundle from the project. Either specify an instancename to remove a specific instance or specify a bundlename to remove all instances associated with the specified bundle display name.
CAUTION:
All associated files will be deleted from disk. So check carefully and take a backup of your project if you are in doubt whether you really want to delete it.
Examples
The following examples show the different ways in which the apama_project tool can be started.
Note:
Keep in mind that you have to change to the project directory if you want to run the commands for listing, adding or removing bundles.
*Create an Apama project that is named MyApamaProject in the current directory:
apama_project create MyApamaProject
*List all connectivity and EPL bundles in APAMA_HOME that can be added to the current Apama project:
apama_project list bundles
*Add a bundle to the current Apama project, with a user-defined instance name:
apama_project add bundle "HTTP Client" --instance "MyHTTP"
*Add a bundle to the current Apama project using the index number:
apama_project add bundle 34
*Remove a bundle from the current Apama project, including all of its instances:
apama_project remove bundle "HTTP Client"