store := c.ClientStore()
// Get current model details.
modelDetails, err := store.ModelByName(c.ControllerName(), c.AccountName(), c.ModelName())
...
// Get target controller details, and details of the current account for the
// target controller.
targetControllerName, err := modelcmd.ResolveController(c.targetController)
...
targetControllerDetails, err := store.ControllerByName(targetControllerName)
...
targetAccountName, err := store.CurrentAccount(targetControllerName)
...
targetAccountDetails, err := store.AccountByName(targetControllerName, targetAccountName)
...
modelUUID := modelInfo.APIEndpoint().ModelUUID
targetEndpoint := targetInfo.APIEndpoint()
targetCreds := targetInfo.APICredentials()
api, err := c.getAPI()
if err != nil {
return err
}
args := controller.ModelMigrationSpec{
ModelUUID: modelDetails.ModelUUID`,
TargetControllerUUID: targetControllerDetails.ControllerUUID,
TargetAddrs: targetControllerDetails.APIEndpoints,
TargetCACert: targetControllerDetails.CACert,
TargetUser: targetAccountNdetails.User,
TargetPassword: targetAccountDetails.Password,