Managing pods and containers from the BMC Network Automation CLI
The topics in this section describe the following Pod and Container Management (PCM) functions that you can perform from the BMC Network Automation command line interface that are related to BMC Cloud Lifecycle Management:
- Importing and exporting components using a script
- Using the container utilities script to provision, modify, and deprovision a container
- Using the API to facilitate customizations and automated testing
- Viewing the javadocs for the web services
To import and export PCM components
You can export the following components from one BMC Network Automation system into an XML file that you can then import into another BMC Network Automation system. You also can import components that you create manually.
- Container blueprints
- Containers
- Device security profiles
- Pod blueprints
- Pods
- Predefined jobs
- Rules
- Rule sets
- Remote file servers
- Templates
This topic describes how to export and import components using a script.
The scripts are available in the bcan-import-export- v.r.mm.zip file in the BCAN_HOME\public\bmc\bca-networks\extras directory. When the file is unzipped, the scripts are in the bin subdirectory. The lib subdirectory contains the libraries needed to run the scripts.
Both Linux and Microsoft Windows scripts are available. For usage information, invoke any of the scripts with a -? option. This option displays the list of input parameters.
To export components using a script
Invoke the export.bat or export.sh command with the following options:
Option | Description |
---|---|
-? | Displays help |
-component component_name | Specifies the component to export: Valid values:
|
-containerBlueprintName container_blueprint_name | (Optional) Specifies the full name of a container blueprint; do not use wildcards in the the container blueprint name. |
-file filename | Specifies the name of the export file |
-fileEncoding encoding | (Optional) Specifies the character encoding to be used to when creating the output file during export Valid values: UTF-16, UTF-8 (default) |
-name "filter" | (Optional) Specifies the name of the component to export |
-password password | Specifies the BMC Network Automation server password |
-url URL | Specifies the BMC Network Automation server URL in the following format: https://<server>:<port> |
-user username | Specifies the BMC Network Automation server user name |
-v | Prints detailed error stack trace |
To import components using a script
Invoke the import.bat or import.sh command with the following syntax and options:
import options filename [filename ...]
The following options are available for this command:
Option | Description |
---|---|
-? | Displays help |
-fileEncoding encoding | (Optional) Specifies the character encoding to be used to read the input files during import Valid values: UTF-16, UTF-8 (default) |
-password password | Specifies the BMC Network Automation server password |
-scope scope | (Optional) Specifies the import scope that designates the components to import Valid values:
|
-url URL | Specifies the BMC Network Automation server URL in the following format: https://<server>:<port> |
-user username | Specifies the BMC Network Automation server user name |
-v | Prints detailed error stack trace |
Replace filename with the names of one or more XML files that were exported from a BMC Network Automation server.
These file names can contain absolute or relative paths. If a file name contains a blank space, it must be enclosed in double quotation marks (").
You can also use wildcards (for example, *myfile.xml*).
Related topic
Exporting-and-importing-components-using-APIs
To manage containers using a script
You can use the container utilities script to provision, modify, and deprovision a container and add or remove a NIC, without involving BMC Cloud Lifecycle Management. This can be helpful when testing out a new container blueprint. For more information about this script, see Using-the-container-utilities-script.
Using the API
The BMC Network Automation Web Services API fully exposes the information in the underlying Pod and Container Management (PCM) engine model to facilitate customizations and automated testing. For more information about using API classes and methods to manage pods and containers, see Virtual-Data-Center-API-classes-and-methods.
Viewing the javadocs for the web services
Perform the following steps to view the javadocs for the BMC Network Automation web services:
- Unzip the most recent BCAN_INSTALL\BCA-Networks\public\bmc\bca-networks\extras\bcan-ws-clientapi-8.8.xx.zip file.
- Identify the destination directory for the .zip file.
- Navigate to the API_Destination_Directory \bcan-ws-clientapi\apidocs directory.
- Open the overview-frame.html file. A page displays that provides links to the various DTOs and web service APIs.
- Click the com.bmc.bcan.ws.shared link. A page displays that provides links to the javadocs for the various BMC Network Automation web services.