Command Line tool

Application Deployment provides a command line tool to help you import and export application deployment data. It has the following syntax:

/opt/opsware/da/bin/admtool.sh -opType [--appListTypeappList|appListFile] --fileTypefilePath [--importConflict overwrite|skip]

You can use this tool to import or export all the applications or a subset thereof.

Options for admtool.sh

Option

Description

opType

Specifies the operation: import, export, or preview.

You can abbreviate this option by specifying -i, -e, or -p.

appListType

Optional: Indicates that specific applications will be imported or exported and how the application names will be specified:

importAppList – application names specified on the command line

exportAppList – application names specified on the command line

importAppListFile - application names specified in a CSV file

exportAppListFile - applications names specified in a CSV file

If you do not specify this option, all applications are imported or exported.

appList

List of applications that will be imported or exported. Application names must be separated with semicolons:

app1;app2;app3;...appN

Used only with the importAppList and exportAppList options.

appListFile

CSV file containing the list of applications that will be imported or exported. Application names must be separated with semicolons:

app1;app2;app3;...appN

Used only with the importAppListFile and exportAppListFile options.

fileType

Specify importFile for import or preview operations.

Specify exportFile for export operations.

filePath

Full path and name of the XML file to import to, export from, or preview.

If you do not specify a file name for an export operation, a default export file is used. You can specify the default export file in the /etc/opt/opsware/da/da.conf file as follows:

exportFile=/var/tmp/my_export_default_file

If exportFile is not specified in the da.conf file, and no export file is specified on the command line, the exported data is written to the following file: /opt/opsware/da/bin/ADMExport.xml

importConflict

Optional: Indicates what happens if a conflict occurs during an import operation: skip or overwrite. A conflict occurs if any item in the import XML file already exists in the Application Deployment database.

skip leaves any item with a conflict unchanged in the database. This is the default behavior.

overwrite updates any item with a conflict based on the contents of the import file (see Overwrite conflict resolution).

You can abbreviate this option by specifying -c overwrite or -c skip.

Syntax examples

The following tables show the correct syntax for each type of import and export scenario that the Application Deployment Manager supports.

Preview syntax examples

Preview scenario

Example

Full Import Preview (all applications in the specified XML file)

/opt/opsware/da/bin/admtool.sh -p --importFile myImportData.xml

Full Import Preview with Overwrite on Conflict

/opt/opsware/da/bin/admtool.sh -p --importFile myImportData.xml --importConflict overwrite

Partial Import Preview of Specific Applications (listed on the command line)

/opt/opsware/da/bin/admtool.sh -p --importAppList "app1;app2;app3" --importFile myImportData.xml

Partial Import Preview of Specific Applications (listed on the command line) with Overwrite on Conflict

/opt/opsware/da/bin/admtool.sh -p --importAppList "app1;app2;app3" --importFile myImportData.xml --importConflict overwrite

Partial Import Preview of Specific Applications (listed in a CSV file)

/opt/opsware/da/bin/admtool.sh -p --importAppListFile app_list.csv --importFile myImportData.xml

Partial Import Preview of Specific Applications (listed in a CSV file) with Overwrite on Conflict

/opt/opsware/da/bin/admtool.sh -p --importAppListFile app_list.csv --importFile myImportData.xml --importConflict overwrite

See Preview examples for additional information.

Import syntax examples

Import scenario

Example

Full Import (all applications in the specified XML file)

/opt/opsware/da/bin/admtool.sh -i --importFile myImportData.xml

Full Import with Overwrite on Conflict

/opt/opsware/da/bin/admtool.sh -i --importFile myImportData.xml --importConflict overwrite

Partial Import of Specific Applications (listed on the command line)

/opt/opsware/da/bin/admtool.sh -i --importAppList "app1;app2;app3" --importFile myImportData.xml

Partial Import of Specific Applications (listed on the command line) with Overwrite on Conflict

/opt/opsware/da/bin/admtool.sh -i --importAppList "app1;app2;app3" --importFile myImportData.xml --importConflict overwrite

Partial Import of Specific Applications (listed in a CSV file)

/opt/opsware/da/bin/admtool.sh -i --importAppListFile app_list.csv --importFile myImportData.xml

Partial Import of Specific Applications (listed in a CSV file) with Overwrite on Conflict

/opt/opsware/da/bin/admtool.sh -i --importAppListFile app_list.csv --importFile myImportData.xml --importConflict overwrite

See Import examples for additional information.

Export syntax examples

Export scenario

Example

Full Export of All Application Deployment Data

/opt/opsware/da/bin/admtool.sh -e --exportFile myExportData.xml

Partial Export of Specific Applications (listed on the command line)

/opt/opsware/da/bin/admtool.sh -e --exportAppList "app1;app2;app3" --exportFile myExportData.xml

Partial Export of Specific Applications (listed in a CSV file)s

/opt/opsware/da/bin/admtool.sh -e --exportAppListFile app_list.csv --exportFile myExportData.xml

See Export examples for additional information.

In these examples, the app_list.csv file contains a list of application names separated by semicolons (;). For example: app1;app2;app3;app4

Overwrite conflict resolution

A conflict occurs when an item in the import XML file already exists in the Application Deployment database on this SA core. By default, the conflicted item is skipped during the import.

If you specify the --importConflict overwrite option, however, the conflicted item is modified instead. Certain items associated with a specific release can also be deleted.

The following table summarizes the results of an import operation when --importConflict overwrite is specified.

Conflict resolution scenarios

Type of item

In import file
not in database

In import file
in database

Not in import file
in database

Application

Application group

Release associated with a specific application

Environment

Lifecycle

Tier

Tier group

Script

Source type

Item is created

Item is updated based on the content of the import file

Item remains in the database and is not modified

Tier associated with a specific release

Component associated with a tier that is associated with a specific release

Item is created

Item is updated based on the content of the import file

Item is deleted

See Messages regarding data conflicts under Important messages for examples of messages that pertain to import conflicts.

Log files

The admtool.sh tool produces a detailed log file. The file name depends on the operation performed:

/var/log/opsware/da/importData.log

/var/log/opsware/da/exportData.log

/var/log/opsware/da/previewData.log

Important messages

For a preview operation, the following type of message (on stdout) indicates that something new will be created if this import is performed:

Import: 'CodeComponentSourceType' 'QA' will be created.

The following type of message indicates that an application will be skipped because it was not included in the list of applications to be imported or exported:

Skip: Application 'AppD' due to Application Filter.

For an import operation, the following type of message (on stdout) indicates that a library item—such as a Software Policy, Package, or Application Configuration—does not exist on the destination SA core:

Not Found:Package'OPSWpytwist2-40.0.0.7.325.zip(SunOS 5.8)'does not exist

The following types of messages indicate whether a conflict exists between the existing Application Deployment data on the destination SA core and the data in the import XML file:

Messages regarding data conflicts

Mode

Conflict Resolution

Conflict Detected?

Sample Message

Preview

Overwrite

Yes

Conflict: Release 'App1:Release1' will be updated.

Preview

Skip

Yes

Conflict: Release 'App1:Release1' already exists. will skip.

Preview

Overwrite or Skip

No

Import: Release 'App1:Release1' will be created.

Import

Overwrite

Yes

Updated Script 'Windows Code Rollback' based on importConflict 'overwrite' option.

Import

Overwrite

Yes

Deleted Component 'Script 1 (Sample Application:Q3 Release:Tomcat 6.0.20)' based on importConflict 'overwrite' option.

Import

Skip

Yes

Lifecycle 'Standard' already exists. Will not import based on importConflict 'skip' option.

Import

Overwrite or Skip

No

Created Lifecycle 'Complete'.