The CLI import command imports a package that includes applications and their associated blueprints and deployment profiles, external services, policies, services, logical templates, and available custom tasks between different vCloud Application Director instances.

Before you import a deployment profile, save the custom task you added to the execution deployment plan. See Review the Execution Plan and Add Custom Tasks.

The export package includes the applications, services, external services, script task, or policies you selected to import. When you run the import command, the entire package is imported to the designated server. You cannot selectively import elements from the export package.

When you import packages between different vCloud Application Director instances, group permissions are not transferred and groups are not created. During the import process, the current group of the logged in user is used to add group permissions to applications, services, or logical templates created. Importing external services is supported, provided that the external service you are importing from the package is owned by the current group of the logged in user. You cannot import an external service on its own or as a dependency if it is owned by another group.

You cannot import external services with the same name into different groups. If you attempt to perform this import process, the operation fails with an error.

For the import process to finish successfully, the elements in the package cannot include non-ASCII characters.

CLI Import Commands

CLI Command

Description

import-package --importFilePath 
ImportFilePath
--conflictResolutionAction CHECK

Compares the package and publicly available repository elements that are in the group you are logged in to, lists the package elements that match and do not match the repository. Elements are not imported to the repository when you run this command.

The match is based on the name and version qualifiers such as major, minor, micro, and optional.

You must set one of the following settings for the conflictResolutionAction command option.

CHECK

SKIP

OVERWRITE

IMPORTASNEW

For example, you can specify the importFilePath as, /Users/UserName/tmp/test.xml.

If the specified directory in the ImportFilePath is not available when you run the import command, the operation fails.

You can import multiple application versions at the same time. For example,

import-package --importFilePath 
/Users/test_user/tmp/test.xml --applicationVersion 
"Clustered DotShoppingCart App:1.1.0,
Apache Hadoop App:2.0" --conflictResolutionAction CHECK

If the application version contains spaces, you must put the application version in double quotation marks.

import-package --importFilePath 
ImportFilePath
--conflictResolutionAction SKIP

Compares the package and publicly available repository elements that are in the group you are logged in to, reuses the elements that match from the repository elements, and imports the package.

The import process adds versions to elements that the logged in user's current group owns. If the current group does not own the element, the import process is cancelled. The process also matches the group membership information from the package. If such a match is not found, then the import process matches elements from the current group of logged in user.

The SKIP option compares only the application, service, external service, policy, and task name and version. This option does not compare properties or action scripts in an application. For example, if you change a property in an existing application and use this option to import the package, the revised property is not imported. In this case, you must use the OVERWRITE or IMPORTASNEW option.

If a package element does not match the repository element, then the SKIP option creates them in the repository.

The SKIP option does not work if an application, service, external service, policy, or task name in the repository differs only by an upper or lower case letter.

For example, if the repository already contains an Apache 2.0.0 service, you cannot import a package called APACHE 2.0.0, apache 2.0.0, or ApAche 2.0.0. In this case, change the name of the import package or use the IMPORTASNEW option.

You can add the --shared option to make the new elements in the package publicly available. If the --shared option is not added, by default the new elements in the package are available to only the logged in user's current group.

Custom sharing is not available for the import command.

import-package --importFilePath 
ImportFilePath
--conflictResolutionAction OVERWRITE

Compares the package and repository elements, overwrites the repository elements that match with the package elements, and imports the package. The process does not overwrite the group information. For example, you cannot change publicly available repository items to private and the reverse.

The import process adds versions to elements that the logged in user's current group owns. If the current group does not own the element, the import process is cancelled. The process also matches the group membership information from the package. If such a match is not found, then the import process matches elements from the current group of logged in user.

If a package element does not match the repository element, then the OVERWRITE option creates an element.

When the OVERWRITE option overwrites an existing logical template in the repository, all of the cloud templates that were assigned to the logical template are removed. After the OVERWRITE operation successfully finishes, you must remap cloud templates to this logical template.

The OVERWRITE option does not work if an application, service, external service, policy, or task name in the repository differs only by an upper or lower case letter.

For example, if the repository contains an Apache 2.0.0 service, you cannot import a package called APACHE 2.0.0, apache 2.0.0, or ApAche 2.0.0. In this case, change the name of the import package or use the IMPORTASNEW option.

You can add the --shared option to make the new elements in the package publicly available. If you do not add the --shared option, by default the new elements in the package are available to only the logged in user's current group.

Custom sharing is not available for the import command.

import-package --importFilePath 
ImportFilePath
--conflictResolutionAction IMPORTASNEW --suffix
NewSuffix

Imports the package and repository elements as new elements. The --suffix option renames the element with the specified suffix. It must be used with the IMPORTASNEW option.

If the NewSuffix contains spaces, you must enclose the suffix in double quotation marks.

When you import an application version using the IMPORTASNEW option, an application and associated application version is created based on the specified suffix. This option does not create an application version in an existing application. As part of the import process, it also creates a logical template version that you must map to a cloud provider to deploy the newly imported application.

For example, to import the Clustered DotShoppingCart application as a new application called test Windows app, use the command

import-package --importFilePath ./ClusteredDotShoppingCart1.0.0.xml
 --conflictResolutionAction IMPORTASNEW --suffix "test Windows app".

If you attempt to import a package element twice with the same suffix, the operation fails.

You can add the --shared option to make the new elements in the package publicly available. If you do not add the --shared option, by default the new elements in the package are available to only the logged in user's current group.

Custom sharing is not available for the import command.

Complete the tasks provided in the description section, before using this command.

import-package --importFilePath 
ImportFilePath
--withDeploymentProfilesUsingDeploymentEnvironment
DeploymentEnvironmentSpecification
Important

Before you use this command, use the import with CHECK option to review the existing logical templates in the repository. Then use the import with SKIP option to import the package. From the vCloud Application Director user interface, map the logical template to a cloud template.

The SKIP option is valid only with this command. When the import command is set to SKIP, all the deployment profiles associated with the exported application versions are imported to the repository.

Imports a deployment profile.

The DeploymentEnvironmentSpecification includes CloudProviderName: DeploymentEnvironmentName For example, you can use the --withDeploymentProfilesUsingDeploymentEnvironment myCloudProvider:myDeploymentEnv command to import a deployment profile.

When a deployment profile is imported, existing cloud network mappings are removed. In the Deployment Profile wizard, click Map Details to map to a cloud network and verify cloud template mapping before you can use the imported deployment profile to deploy an application blueprint.