Using CLI

This section provides murano end users with information on how they can use the Application Catalog through the command-line interface (CLI).

Using python-muranoclient, the CLI client for murano, you can easily manage your environments, packages, categories, and deploy environments.

Install and use the murano client

The Application Catalog project provides a command-line client, python-muranoclient, which enables you to access the project API. For prerequisites, see Install the prerequisite software.

To install the latest murano CLI client, run the following command in your terminal:

$ pip install python-muranoclient

Discover the client version number

To discover the version number for the python-muranoclient, run the following command:

$ murano --version

To check the latest version, see Client library for Murano API.

Upgrade or remove the client

To upgrade or remove the python-muranoclient, use the corresponding commands.

To upgrade the client:

$ pip install --upgrade python-muranoclient

To remove the client:

$ pip uninstall python-muranoclient

Set environment variables

To use the murano client, you must set the environment variables. To do this, download and source the OpenStack RC file. For more information, see Download and source the OpenStack RC file.

Alternatively, create the PROJECT-openrc.sh file from scratch. For this, perform the following steps:

  1. In a text editor, create a file named PROJECT-openrc.sh containing the following authentication information:

    export OS_USERNAME=user
    export OS_PASSWORD=password
    export OS_TENANT_NAME=tenant
    export OS_AUTH_URL=http://auth.example.com:5000
    export MURANO_URL=http://murano.example.com:8082/
    
  2. In the terminal, source the PROJECT-openrc.sh file. For example:

    $ . admin-openrc.sh
    

Once you have configured your authentication parameters, run murano help to see a complete list of available commands and arguments. Use murano help <sub_command> to get help on a specific subcommand.

Bash completion

To get the latest bash completion script, download murano.bash_completion from the source repository and add it to your completion scripts.

If you are not aware of the completion scripts location, perform the following steps:

  1. Create a new directory:

    $ mkdir -p ~/.bash_completion/
    
  2. Create a file containing the bash completion script:

    $ curl https://git.openstack.org/cgit/openstack/python-muranoclient/plain/tools/murano.bash_completion > ~/.bash_completion/murano.sh
    
  3. Add the following code to the ~/.profile file:

    for file in $HOME/.bash_completion/*.sh; do
        if [ -f "$file" ]; then
            . "$file"
        fi
    done
    
  4. In the current terminal, run:

    $ source ~/.bash_completion/murano.sh
    

Manage environments

An environment is a set of logically connected applications that are grouped together for an easy management. By default, each environment has a single network for all its applications, and the deployment of the environment is defined in a single heat stack. Applications in different environments are always independent from one another.

An environment is a single unit of deployment. This means that you deploy not an application but an environment that contains one or multiple applications.

Using CLI, you can easily perform such actions with an environment as creating, renaming, viewing, and others.

Create an environment

To create an environment, use the following command specifying the environment name:

$ murano environment-create <NAME>

Rename an environment

To rename an environment, use the following command specifying the old name of the environment or its ID and the new name:

$ murano environment-rename <OLD_NAME_OR_ID> <NEW_NAME>

Delete an environment

To delete an environment, use the following command specifying the environment name or ID:

$ murano environment-delete <NAME_OR_ID>

List deployments for an environment

To get a list of deployments for a particular environment, use the following command specifying the environment name or ID:

$ murano deployment-list <NAME_OR_ID>

List the environments

To get a list of all existing environments, run:

$ murano environment-list

Manage packages

This section describes how to manage packages using the command line interface. You can easily:

Import a package

With the package-import command you can import packages into murano in several different ways:

From a local .zip file

To import a package from a local .zip file, run:

$ murano package-import /path/to/PACKAGE.zip

where PACKAGE is the name of the package stored on your computer.

For example:

$ murano package-import /home/downloads/mysql.zip
Importing package com.example.databases.MySql
+---------------------------------+------+----------------------------+--------------+---------+
| ID                              | Name | FQN                        | Author       |Is Public|
+---------------------------------+------+----------------------------+--------------+---------+
| 83e4038885c248e3a758f8217ff8241f| MySQL| com.example.databases.MySql| Mirantis, Inc|         |
+---------------------------------+------+----------------------------+--------------+---------+

To make the package available for users from other projects (tenants), use the --is-public parameter. For example:

$ murano package-import --is-public mysql.zip

Note

The package-import command supports multiple positional arguments. This means that you can import several packages at once.

From murano app repository

To import a package from murano applications repository, specify the URL of the repository with --murano-repo-url and a fully qualified package name. For package names, go to murano applications repository, and click on the desired package to see its full name.

Note

You can also specify the URL of the repository with the corresponding MURANO_REPO_URL environment variable.

The following example shows how to import the MySQL package from the murano applications repository:

$ murano --murano-repo-url=http://storage.apps.openstack.org \
package-import com.example.databases.MySql

This command supports an optional --package-version parameter that instructs murano client to download a specified package version.

The package-import command inspects package requirements specified in the package’s manifest under the Require section, and attempts to import them from murano repository. The package-import command also inspects any image prerequisites mentioned in the images.lst file in the package. If there are any image requirements, client would inspect images already present in the image database. Unless image with the specific name is present, client would attempt to download it.

If any of the packages being installed is already registered in murano, the client asks you what to do with it. You can specify the default action with --exists-action, passing s - for skip, u - for update, and a - for abort.

From an URL

To import an application package from an URL, use the following command:

$ murano package-import http://example.com/path/to/PACKAGE.zip

The example below shows how to import a MySQL package from the murano applications repository using the package URL:

$ murano package-import http://storage.apps.openstack.org/apps/com.example.databases.MySql.zip
Inspecting required images
Importing package com.example.databases.MySql
+----------------------------------+-------+----------------------------+--------------+--------+----------+------------+
| ID                               | Name  | FQN                        | Author       | Active | Is Public| Type       |
+----------------------------------+-------+----------------------------+--------------+--------+----------+------------+
| 1aa62196595f411399e4e48cc2f6a512 | MySQL | com.example.databases.MySql| Mirantis, Inc| True   |          | Application|
+----------------------------------+-------+----------------------------+--------------+--------+----------+------------+

Import bundles of packages

With the bundle-import command you can install packages in several different ways:

When importing bundles, you can set their publicity with --is-public.

From a local bundle

To import a bundle from the a local file system, use the following command:

$ murano bundle-import /path/to/bundle/BUNDLE_NAME

This command imports all the requirements of packages and images.

When importing a bundle from a file system, the murano client searches for packages in a directory relative to the bundle location before attempting to download a package from repository. This facilitates cases with no Internet access.

The following example shows the import of a monitoring bundle:

$ murano bundle-import /home/downloads/monitoring.bundle
Inspecting required images
Importing package com.example.ZabbixServer
Importing package com.example.ZabbixAgent
+----------------------------------+---------------+--------------------------+---------------+--------+----------+------------+
| ID                               | Name          | FQN                      | Author        | Active | Is Public| Type       |
+----------------------------------+---------------+--------------------------+---------------+--------+----------+------------+
| fb0b35359e384fe18158ff3ed8f969b5 | Zabbix Agent  | com.example.ZabbixAgent  | Mirantis, Inc | True   |          | Application|
| 00a77e302a65420c8080dc97cc0f2723 | Zabbix Server | com.example.ZabbixServer | Mirantis, Inc | True   |          | Application|
+----------------------------------+---------------+--------------------------+---------------+--------+----------+------------+

Note

The bundle-import command supports multiple positional arguments. This means that you can import several bundles at once.

From an URL

To import a bundle from an URL, use the following command:

$ murano bundle-import http://example.com/path/to/bundle/BUNDLE_NAME

Where http://example.com/path/to/bundle/BUNDLE_NAME is any external http/https URL to load the bundle from.

For example:

$ murano bundle-import http://storage.apps.openstack.org/bundles/monitoring.bundle

From murano applications repository

To import a bundle from murano applications repository, use the following command, where bundle_name stands for the bundle name:

$ murano bundle-import BUNDLE_NAME

For example:

$ murano bundle-import monitoring

Note

For bundle names, go to murano applications repository, click the Format tab to show bundles first, and then click on the desired bundle to see its name.

List packages

To list all the existing packages you have, use the package-list command. The result will show you the package ID, name, author and if it is public or not. For example:

$ murano package-list
+----------------------------------+--------------------+-------------------------------------+---------------+--------+----------+------------+
| ID                               | Name               | FQN                                 | Author        | Active | Is Public| Type       |
+----------------------------------+--------------------+-------------------------------------+---------------+--------+----------+------------+
| daa46cfd78c74c11bcbe66d3239e546e | Apache HTTP Server | com.example.apache.ApacheHttpServer | Mirantis, Inc | True   |          | Application|
| 5252c9897e864c9f940e08500056f155 | Cloud Foundry      | com.example.paas.CloudFoundry       | Mirantis, Inc | True   |          | Application|
| 1aa62196595f411399e4e48cc2f6a512 | MySQL              | com.example.databases.MySql         | Mirantis, Inc | True   |          | Application|
| 11d73cfdc6d7447a910984d95090463b | SQL Library        | com.example.databases               | Mirantis, Inc | True   |          | Application|
| fb0b35359e384fe18158ff3ed8f969b5 | Zabbix Agent       | com.example.ZabbixAgent             | Mirantis, Inc | True   |          | Application|
| 00a77e302a65420c8080dc97cc0f2723 | Zabbix Server      | com.example.ZabbixServer            | Mirantis, Inc | True   |          | Application|
+----------------------------------+--------------------+-------------------------------------+---------------+--------+----------+------------+

Show packages

To get full information about a package, use the package-show command. For example:

$ murano package-show 1aa62196595f411399e4e48cc2f6a512
+----------------------+-----------------------------------------------------+
| Property             | Value                                               |
+----------------------+-----------------------------------------------------+
| categories           |                                                     |
| class_definitions    | com.example.databases.MySql                         |
| description          | MySql is a relational database management system    |
|                      | (RDBMS), and ships with no GUI tools to administer  |
|                      | MySQL databases or manage data contained within the |
|                      | databases.                                          |
| enabled              | True                                                |
| fully_qualified_name | com.example.databases.MySql                         |
| id                   | 1aa62196595f411399e4e48cc2f6a512                    |
| is_public            | False                                               |
| name                 | MySQL                                               |
| owner_id             | 1ddb2c610d4e4c5dab5185e32554560a                    |
| tags                 | Database, MySql, SQL, RDBMS                         |
| type                 | Application                                         |
+----------------------+-----------------------------------------------------+

Delete a package

To delete a package, use the following command:

$ murano package-delete PACKAGE_ID

Download a package

With the following command you can download a .zip archive with a specified package:

$ murano package-download PACKAGE_ID > FILE.zip

You need to specify the package ID and enter the .zip file name under which to save the package.

For example:

$ murano package-download e44a3f526dfb4e08b3c1018c9968d911 > Wordpress.zip

Create a package

With the murano client you can create application packages from package source files or directories. The package-create command is useful when application package files are spread across several directories. This command has the following required parameters:

-r RESOURCES_DIRECTORY
-c CLASSES_DIRECTORY
--type TYPE
-o PACKAGE_NAME.zip
-f FULL_NAME
-n DISPLAY_NAME

Example:

$ murano package-create -c Downloads/Folder1/Classes -r Downloads/Folder2/Resources \
-n mysql -f com.example.MySQL -d Package -o MySQL.zip --type Library
Application package is available at /home/Downloads/MySQL.zip

After this, the package is ready to be imported to the application catalog.

The package-create command is also useful for autogenerating packages from heat templates. In this case you do not need to manually specify so many parameters. For more information on automatic package composition, please see Automatic package composing.

Manage categories

In murano, applications can belong to a category or multiple categories. Administrative users can create and delete a category as well as list available categories and view details for a particular category.

Create a category

To create a category, use the following command specifying the category name:

$ murano category-create <NAME>

List available categories

To get a list of all existing categories, run:

$ murano category-list

Show category details

To see packages that belong to a particular category, use the following command specifying the category ID:

$ murano category-show <ID>

Delete a category

To delete a category, use the following command specifying the ID of a category or multiple categories to delete:

$ murano category-delete <ID> [<ID> ...]

Note

Verify that no packages belong to the category to be deleted, otherwise an error appears. For this, use the murano category-show <ID> command.

Manage environment templates

To manage environment templates, use the following commands specifying appropriate values:

murano env-template-create <ENV_TEMPLATE_NAME>
Creates an environment template.
murano env-template-clone <ID> <NEW_ENV_TEMPLATE_NAME>
Creates a new template, cloned from an existing template.
murano env-template-create-env <ID> <ENV_TEMPLATE_NAME>
Creates a new environment from template.
murano env-template-add-app <ENV_TEMPLATE_ID> <FILE>
Adds an application or multiple applications to the environment template.
murano env-template-del-app <ENV_TEMPLATE_ID> <ENV_TEMPLATE_APP_ID>
Deletes an application from the enviroment template.
murano env-template-list
Lists the environments templates.
murano env-template-show <ID>
Displays environment template details.
murano env-template-update <ID> <ENV_TEMPLATE_NAME>
Updates an environment template.
murano env-template-delete <ID>
Deletes an environment template.