The sections in this topic describe the following Pod and Container Management (PCM) functions that you can perform from the TrueSight Network Automation command line interface that are related to BMC Cloud Lifecycle Management:
To import and export PCM components
You can export the following components from one TrueSight Network Automation system into an XML file that you can then import into another TrueSight Network Automation system. You also can import components that you create manually.
- Combo groups
- Conditions
- Container blueprints
- Containers
- Device security profiles
- Dynamic fields
- Global substitution parameters
- Keywords
- Pod blueprints
- Pods
- Policies
- Predefined jobs
- Roles
- Rules
- Rule sets
- Remote file servers
- Templates
This topic describes how to export and import components using a script.
Import and export scripts
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.
Note
The string v.r.mm is a substitute for the current version of the TrueSight Network Automation software.
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.
Note
- You can export and import components only between TrueSight Network Automation application servers of the same version. If you import a component exported from a different version, and then log on or log out of the TrueSight Network Automation GUI, you might get the following error message: Database password decryption failed. To import the component successfully, follow these steps:
- Restart the TrueSight Network Automation web service.
- Delete the imported component.
- Encrypt the sensitive phrases (including passwords) by using the BcanMaintenance Tool available with the latest version of the TrueSight Network Automation and update the XML file with the encrypted data.
- Import the component again.
- Dependent components that you are importing should already exist in the TrueSight Network Automation system. For more information, see Import dependencies.
Back to top
Invoke the export.bat or export.sh command with the following options:
| |
---|
| |
-component component_name | Specifies the component to export: Valid values: - ComboGroups
- Conditions
- Containers
- ContainerBlueprints
- DeviceSecurityProfiles
- DynamicTypes
- Keywords
- PodBlueprints
- Pods
- Policies
- PredefinedJobs
- RemoteFileServers
- Roles
- Rules
- RuleSets
- SubstitutionParameters
- TemplateGroups
|
-containerBlueprintName container_blueprint_name | (Optional) Specifies the full name of a container blueprint; do not use wildcards in the the container blueprint name.
This option is only applicable for template groups and can be optionally used to export template groups specified by the named container blueprint. |
| Specifies the name of the export file |
| (Optional) Specifies the character encoding to be used to when creating the output file during export Valid values: UTF-16, UTF-8 (default) Note: For UTF-8, the file should not contain Byte Order Mark (BOM) encoding because the Java APIs do not handle UTF-8 with BOM-encoded files. |
| (Optional) Specifies the name of the component to export
You can use wildcards; for example, Bronze container. The following option is only applicable to container blueprints: The number of the revision to be exported can be specified as per the following format: <ContainerBlueprintName>#<RevisionNumber> If no filter is specified when exporting container blueprints, all revisions of the container blueprints are exported. |
| Specifies the TrueSight Network Automation server password |
| Specifies the TrueSight Network Automation server URL in the following format: https://<server>:<port> |
| Specifies the TrueSight Network Automation server user name |
| Prints detailed error stack trace |
A component might use or have dependency on other underlying components. Before you import a component, ensure that you import its underlying components. For more information about considerations and conditions while importing components, see the following table.
| Dependency description and other conditions |
---|
| Components - Groups – The groups which comprise the combo group must be present in the destination system.
- Dynamic fields – The dynamic fields associated with the combo group must be present in the destination system.
|
| Components - Keywords – The keywords used by the condition must be present in the destination system.
- Devices – The devices for which the condition is applicable must be present in the destination system.
- Groups – The groups for which the condition is applicable must be present in the destination system.
- Realms – The realms for which the condition is applicable must be present in the destination system.
- Dynamic fields – The dynamic fields associated with the condition must be present in the destination system.
|
| Components - Container blueprint template – The container blueprint template must be present in the destination system.
- Custom actions – The custom actions (if used) in the container blueprint must be enabled in the destination system.
- External script actions – The external script actions (if used) in the container blueprint must be enabled in the destination system.
Condition - If you had exported the container blueprint before installing TrueSight Network Automation and the <poolMask> tag existed, ensure that you change its value from dotted decimal format to CIDR format, otherwise, the import will fail.
|
| Components - Container blueprint – The container blueprint must be present in the destination system.
- Pod – The pod which the container belongs to must be present in the destination system.
Conditions - If a container with the same name already exists in the destination system, it must be deleted before a new one is imported.
- If you had exported the container before installing TrueSight Network Automation and the <poolMask> tag existed, ensure that you change its value from dotted decimal format to CIDR format, otherwise, the import will fail.
|
| No dependencies Condition - If a device security profile with the same name already exists on the destination system, that device security profile is overwritten.
|
| These dependencies are applicable for only the configuration profiled (CAP) dynamic fields: - Devices – The devices with which the dynamic fields are associated must be present in the destination system.
- Groups – The groups with which the dynamic fields are associated must be present in the destination system.
- Realms – The realms with which the dynamic fields are associated must be present in the destination system
|
Global substitution parameters | Component - Dynamic fields – The dynamic fields associated with the global substitution parameter must be present in the destination system.
|
| Component - Dynamic fields – The dynamic fields associated with the keyword must be present in the destination system.
|
| Condition - If you had exported the pod blueprint before installing TrueSight Network Automation and the <poolMask> tag existed, ensure that you change its value from dotted decimal format to CIDR format, otherwise, the import will fail.
|
| Components - Pod blueprint – The pod blueprint must be present in the destination system.
- Devices – The devices assigned to the pod must be present in the destination system.
Conditions - If a pod with the same name already exists in the destination system, it must be deleted before a new one is imported.
- If you had exported the pod before installing TrueSight Network Automation and the <poolMask> tag existed, ensure that you change its value from dotted decimal format to CIDR format, otherwise, the import will fail.
|
| Components - Devices – The devices for which the policy is applicable must be present in the destination system.
- Groups – The groups for which the policy is applicable must be present in the destination system.
- Realms – The realms for which the policy is applicable must be present in the destination system.
- Keywords – The keywords being used by the policy must be present in the destination system.
- Conditions – The conditions being used by the policy must be present in the destination system.
- Users – If a notification is to be sent to a set of users, the same set of users must be present in the destination system.
|
| Components - Devices – The devices on which the predefined job needs to be run must be present in the destination system.
- Groups – The groups on which the predefined job needs to be run must be present in the destination system.
- Realms – The realms on which the predefined job needs to be run must be present in the destination system. If you are importing a predefined job containing a span action with group as the span and the system contains groups with the same name in multiple realms, you must specify the realm name under the spanParams tag in the XML file being imported. If you do not specify a realm, a random group (as a span) gets associated with the job.
- Rules – The rules being used in the predefined job actions must be present in the destination system.
- Templates – When importing a predefined job containing a template (for example, Deploy to Active), the destination system should already have a template by that name. Alternatively, you can import the template, but import it prior to importing the predefined job, or add the template to the XML file that is being imported and place it before the predefined job.
|
| Components - Dynamic fields – The dynamic fields associated with the role must be present in the destination system.
- Custom action adpaters – The custom action adapter (if used) in the role must be present in the destination system.
Conditions - No users are associated with roles while importing or exporting roles.
- You cannot add a new root role, or modify a role to be the root role while importing.
- You can modify only the dynamic fields of an Administrator role while importing.
- If a role with the same name already exists on the destination system, that role is overwritten.
The user who is importing a new role or the changes to an existing role must have rights to add or edit such a role. If you want to change the rights assigned to a role in the XML file, see the Javadoc documentation for the values that you can pass in the XML file. Note that you must log on to access the documentation. You must log in or register to view this page Click here to download it.
|
| Components - Rule sets – The rule set which the rule belongs to must be present and enabled in the destination system.
- Device types – The device types for which the rule is applicable must be enabled in the destination system.
- Devices – The devices for which the rule is applicable must be present in the destination system.
- Groups – The groups for which the rule is applicable must be present in the destination system.
- Relams – The realms for which the rule is applicable must be present in the destination system.
- Dynamic fields – The dynamic fields associated with the rule must be present in the destination system.
|
| Components - Devices – The devices for which the rule set is applicable must be present in the destination system.
- Groups – The groups for which the rule set is applicable must be present in the destination system.
- Realms – The realms for which the rule set is applicable must be present in the destination system.
|
| Component - Dynamic fields – The dynamic fields associated with the remote file server must be present in the destination system.
|
| Component - Dynamic fields – The dynamic fields associated with the template must be present in the destination system.
|
Invoke the import.bat or import.sh command with the following syntax and options:
import options filename [filename ...]
Note
- If you import components that already exist, TrueSight Network Automation deletes the existing component and adds the new one.
TrueSight Network Automation does not merge the data of the existing component and the new component. A container is tightly bound to a specific TrueSight Network Automation system. Rarely, when you export and import pods and containers from one system to another, imported job numbers will not map to the jobs in the system to which they are imported.
A container is imported successfully if the target system does not contain any job at all or if no existing jobs match the ones present in the imported file. If the job numbers map and you click the links of an imported container, you would be looking at incorrect information.
The following options are available for this command:
| |
---|
| |
| (Optional) Specifies the character encoding to be used to read the input files during import Valid values: UTF-16, UTF-8 (default) Note: For UTF-8, the file should not contain BOM encoding because the Java APIs do not handle UTF-8 with BOM-encoded files. |
| Specifies the TrueSight Network Automation server password |
| (Optional) Specifies the import scope that designates the components to import Valid values: - all – Default
- new – Only imports components that are not already in the database
- existing – Reimports components and overwrites those already in the database
|
| Specifies the TrueSight Network Automation server URL in the following format: https://<server>:<port> |
| Specifies the TrueSight Network Automation server user name |
| Prints detailed error stack trace |
Replace filename with the names of one or more XML files that were exported from a TrueSight 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*).
Back to top
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 TrueSight 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 TrueSight Network Automation Automation web services:
- Unzip the most recent BCAN_INSTALL\BCA-Networks\public\bmc\bca-networks\extras\bcan-ws-clientapi-8.9.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 TrueSight Network Automation web services.
Back to top