Ubuntu Pastebin

Paste from axw at Fri, 26 Feb 2016 01:50:35 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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,
Download as text