manageMappings command
Use the --action argument to control how entities are mapped. The following table lists the available actions.
gateway83
Purpose and Usage |
Use to manage conflicts when a bundle is imported (migrateIn) to a target Gateway with existing entities.
|
Always use the manageMappings command to change an entity names, GUIDs, or user logins. Note:
- Thetemplatecommand does not templatize these properties.
- TheNewOrUpdateorUpdatemapping actions do not change entity names, GUIDs, or user logins when updating existing entities. Changing these attributes can break existing policies and services that reference them. However, new entities that are created on the target use the attributes that are specified in the migration bundle.
Mapping Actions
Use the
--action
argument to control how entities are mapped. The following table lists the available actions. Notes | GMU Mapping Action | REST Management API Mappings | Description |
1 | New | NewOrExisting + FailOnExisting | Create new entity. Fail if entity exists. |
2 | Update | NewOrUpdate + FailOnNew | Update existing entity. Fail if entity does not exist. |
2 | Existing | NewOrExisting + FailOnNew | Use existing entity. Fail if entity does not exist. |
1 | ForceNew | AlwaysCreateNew | Create new entity, using a new ID if necessary. |
Delete | Delete + FailOnNew | Delete an entity. Fail if entity does not exist. | |
Ignore | Ignore | Ignore an entity regardless if entity exists or not. | |
1, 2 | NewOrUpdate | NewOrUpdate | Update an existing entity. Create one if entity does not exist. |
1, 2 | NewOrExisting | NewOrExisting | Use an existing entity. Create one if entity does not exist. |
DeleteOrIgnore | Delete | Delete an entity. Ignore if it does not exist. |
Note 1: The parent folder of these mapping must also be specified or the action does not know where to place the entity.
Note 2: If you want to map by name, use the
--targetname
argument. Unless specified, the default mapping is by ID.Use the
--type
argument to specify the type in the mapping element. Tip:
For a list of all the available types, use the list command.Example: Change mappings in the bundle for specific entities
$ ./GatewayMigrationUtility.sh manageMappings --bundle originalBundle.xml --type FOLDER --srcId 0000000000000000ffffffffffffec76 --targetId f4ce2cb557379c7bf7113246fe818387
Change all service mappings to update on the target. This change causes the mapping to fail if there is no such entity.
$ ./GatewayMigrationUtility.sh manageMappings --bundle bundle.xml --type SERVICE --action Update
Change mapping for a JDBC connection named "Test" to map to a JDBC connection named "Test2".
$ ./GatewayMigrationUtility.sh manageMappings --bundle bundle.xml --type JDBC_CONNECTION --srcName Test --targetName Test2
Change mapping for policy with id '4d269b3b4612fe54e09369023301ae2e' to map to a policy named "My Policy." Create if it does not exist, otherwise update.
$ ./GatewayMigrationUtility.sh manageMappings --bundle bundle.xml --type POLICY --srcId 4d269b3b4612fe54e09369023301ae2e --targetName 'My Policy' --action NewOrUpdate
Example: Create an override mapping file, preserve the bundle
$ ./GatewayMigrationUtility.sh manageMappings --bundle originalBundle.xml --outputFile overridemappings.xml --type FOLDER --srcId 0000000000000000ffffffffffffec76 --targetId f4ce2cb557379c7bf7113246fe818387 Creates mappings file overridemappings.xml containing a single mapping: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <l7:Mappings xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management"> <l7:Mapping action="NewOrExisting" targetId="f4ce2cb557379c7bf7113246fe818387" srcId="0000000000000000ffffffffffffec76 " srcUri="https://127.0.0.1:8443/restman/1.0/folders/0000000000000000ffffffffffffec76 " type="FOLDER"/> </l7:Mappings>