Objects available in the Deploy CLI

The Deploy command-line interface (CLI) provides objects that you can use to interact with the Deploy server.

The deployit object

The deployit object provides access to the main functions of Deploy itself. You can use this object to import a package, work with tasks, and discover middleware.

The deployment object

The deployment object provides access to the deployment engine of Deploy. Using this object, you can create a task for an initial deployment or upgrade. You execute the created tasks using the deployit object.

The factory object

You can use the factory object to create new configuration items (CIs) and artifacts (files and packages), to be saved in the Deploy repository.

The repository object

Use the repository object to access the Deploy repository. It provides Create, Read, Update, and Delete (CRUD) operations on CIs in the repository. You can also use this object to export task overviews to a local XML file, export CIs to a ZIP file, or import CIs from a ZIP file.

The security object

Use the security object to log into or out of Deploy or to create and delete local users in the repository.

Users with administrative permissions can also grant, deny, or revoke security permissions to other users, even users who are managed in a credentials store other than the Deploy repository. By default, users with administrative permissions have all permissions that are available in Deploy.

The task2 object

The task2 object provides access to the Deploy task block engine. You can use it to start, stop, abort, archive, or assign tasks.

Use help option with CLI objects

When you log in to the CLI, a welcome message with information about the objects appears. To see this message again, type help and press ENTER.

To use the help option with a specific object, invoke the help() function. This lists all the methods on the object that are available for scripting. For example, execute:

deployit> factory.help()

The output is:

factory: Helper that can construct Configuration Items (CI) and Artifacts

The methods available are:

* factory.artifactAsInputStream(String id, String ciType, Map values, InputStream data) : ArtifactAndData
* factory.configurationItem(String id, String ciType) : ConfigurationItem
* factory.configurationItem(String id, String ciType, Map values) : ConfigurationItem
* factory.types() : void

To retrieve help with a specific method, execute a command such as:

deployit> security.help('getPermissions')

Note: The name of the method must be enclosed in quotation marks and without parentheses.