Sun Management Center 3.6.1 User's Guide

Import and Export CLI Interface

You can invoke the import and export utilities from CLI with the following commands:


# /opt/SUNWsymon/sbin/es-cli
> login
Host: servername
Login: username
Password: password
Login successful!
> export parameter
> import parameter

See Import Command Parameters and Export Command Parameters for information about appropriate command parameters.

Topology Import Utility

The import command retrieves previously exported topology data for the specified domain from a file.

Import Command Parameters

The import command takes the following parameters:

domain

The value of the domain parameter is the name of the domain whose topology is to be imported. If no domain is specified, all domains are imported.

domainmode

The value of the domainmode parameter determines whether new domains are created from the imported topology. If the value is follow, then group and domain topology are imported into the current topology, and new domains can be created. If the value is ignore, then only groups and entities are imported to the specified target domain.

filename

The value of the filename parameter is the name of the file from which the topology information should be retrieved.

nodemode

The value of the nodemode parameter determines whether the imported topology replaces the existing topology. If the value of the nodemode parameter is replace, then conflicting data is replaced with the imported values. If the value of the nodemode parameter is ignore, then conflicting data is not updated.

The explicit assignment in the command line overrides the same assignment in the parameter file. For example, if mode=ignore is assigned in the command line and mode=follow is assigned in the parameter file, then mode=ignore is used.


Example 19–1 Importing Topology Data from a File

In the following example, previously exported topology is imported from the file /home/examples/snapshot. New domains are created as necessary, and conflicting data is replaced by the imported topology.


> import filename=/home/examples/snapshot domainmode=follow \
nodemode=replace

Confirmation Messages

The import utility prompts you to answer the following items before the operation is done or when the data conflicts:

Output Messages for the Import Command

This section describes the messages that might appear as a result of the import command.


import: Results 1/1


State=Success


Message=The topology data is successfully imported.

Cause:

Success.

Description:

The operation completed successfully.


filename: No such file.

Cause:

File does not exist.

Description:

The specified file does not exist. The command line might use two files: a data file that provides the import data source, and a parameter file that provides a parameter list.


import: Cannot open filename.

Cause:

Permission denied.

Description:

The file cannot be opened for reading.


import: File format is not supported.

Cause:

Format wrong.

Description:

The source file is not a valid database file for exporting data.


import: File out-of-date (xx days).

Cause:

Data out-of-date.

Description:

You are using out-of-date data.


import: Authentication failed.

Cause:

Authentication failed.

Description:

The current user has no authority to create objects in the topology hierarchy.


import: Wrong parameter file.

Cause:

Parameter file error.

Description:

The parameter file should be a list of name = value pairs. If the format is not correct, the application generates an error message and stops.


import: illegal parameter - <para>.


Use -h option to get usage.

Cause:

Illegal parameter.

Description:

An illegal parameter has been passed to the import operation. Use import -h to view the available options and the available parameters.

Topology Export Utility

The export command saves the topology data for a domain, or for all domains, to a file.

Export Command Parameters

The export command takes the following parameters:

comment

The value of the comment parameter is an annotation to be included in the file.

domain

The value of the domain parameter is the name of the domain whose topology is to be exported. If no domain is specified, all domains are exported.

filename

The value of the filename parameter is the name of the file to which the topology information should be exported.

mode

The value of the mode parameter determines how the topology information is incorporated into the file. If the value is append, then the data is appended to the contents of the file. If the value is overwrite, then the previous contents of the file are replaced by the new data.

validity

The value of the validity parameter is the length of time in days for which the data is valid. The following values are legal values for the validity parameter:

  • Unlimited

  • 7

  • 15

  • 30

  • 90


Example 19–2 Exporting Default Domain Topology to a File

In the following example, the Default Domain is saved to a file that is named snapshot. The original contents of snapshot are overwritten by the new data. The new data is assumed to be valid for an unlimited period of time. The comment specifies that this data is for the system testing group.


> export filename=/home/examples/snapshot \
domain="Default Domain" mode=overwrite validity=Unlimited \
comment="System Test Group"

Output Messages for the Export Command

The following list shows the messages that might appear as a result of the export command.


Export: Results 1/1


State=Success


Message=The topology data is successfully exported.

Cause:

Success.

Description:

The operation completed successfully.


export: Cannot open file.

Cause:

File does not exist.

Description:

The parameter file does not exist.


filename: Permission denied.

Cause:

File error.

Description:

The file cannot be created or be opened for writing.


export: File format not supported.

Cause:

Format wrong.

Description:

The error occurs when appending the export data to a file that is not a valid export data file.


export: The domain <domainname> does not exist

Cause:

Object error.

Description:

The domain that you want to export does not exist.


export: Wrong parameter file.

Cause:

Parameter file error.

Description:

The parameter file contains a list of name = value pairs. If the file format is not correct, the application notifies you and stops.


export: The current user is different from the last one.

Cause:

User conflict.

Description:

The error occurs when you try overwrite or append the data to an existing data file created by others. You cannot modify or overwrite export data that another user created.


export: Data is out-of-date.

Cause:

Data is too old.

Description:

You are using an out-of-date export file. This message only occurs when you export data in append mode.


export: illegal parameter - <para>.


Please use -h option to get usage.

Cause:

Illegal parameter.

Description:

An illegal parameter was passed to the export operation.