With the power of AI I have created a piece of software to copy the policy package from one CMA to another in the same MDS , I know there are a number of tools for that but I could not find one that had it all.
Required Options:
-s, --source-domain SOURCE Source CMA domain name (required)
-d, --dest-domain DEST Destination CMA domain name (required)
-p, --package PACKAGE Policy package name to copy (required)
Optional Options:
-n, --new-name NAME New package name in destination
Remote Access Options:
-m, --mds-server SERVER MDS server IP/hostname (default: 127.0.0.1)
-P, --port PORT MDS API port (default: 443)
-u, --username USER Username for API authentication
-w, --password PASS Password for API authentication
Local Access Options:
-l, --local Use local authentication (login as root on MDS)
Other Options:
-h, --help Show this help message
Authentication Modes:
1. Remote Access (default if -u/-w specified):
Connects to MDS remotely using username/password
2. Local Access (-l flag):
Must be run ON the MDS server
Uses 'login as root' (no credentials needed)
Examples:
# Remote access with credentials
./copyCMA_full.sh -m "10.1.1.1" -u "admin" -w "password" \
-s "CMA1" -d "CMA2" -p "Standard-Policy"
# Remote access, different package name
./copyCMA_full.sh -m "mds.company.com" -u "admin" -w "password" \
-s "CMA1" -d "CMA2" -p "Policy" -n "Policy-Backup"
# Local access (on MDS server)
./copyCMA_full.sh -l -s "CMA1" -d "CMA2" -p "Standard-Policy"
Notes:
- Remote access requires network connectivity to MDS API port
- User must have permissions to manage both source and dest domains
- For security, consider using environment variables for credentials:
export CP_USER="admin"
export CP_PASS="password"