github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/apiserver/params/migration.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package params
     5  
     6  // InitiateModelMigrationArgs holds the details required to start one
     7  // or more model migrations.
     8  type InitiateModelMigrationArgs struct {
     9  	Specs []ModelMigrationSpec `json:"specs"`
    10  }
    11  
    12  // ModelMigrationSpec holds the details required to start the
    13  // migration of a single model.
    14  type ModelMigrationSpec struct {
    15  	ModelTag   string                   `json:"model-tag"`
    16  	TargetInfo ModelMigrationTargetInfo `json:"target-info"`
    17  }
    18  
    19  // ModelMigrationTargetInfo holds the details required to connect to
    20  // and authenticate with a remote controller for model migration.
    21  type ModelMigrationTargetInfo struct {
    22  	ControllerTag string   `json:"controller-tag"`
    23  	Addrs         []string `json:"addrs"`
    24  	CACert        string   `json:"ca-cert"`
    25  	AuthTag       string   `json:"auth-tag"`
    26  	Password      string   `json:"password"`
    27  }
    28  
    29  // InitiateModelMigrationResults is used to return the result of one
    30  // or more attempts to start model migrations.
    31  type InitiateModelMigrationResults struct {
    32  	Results []InitiateModelMigrationResult `json:"results"`
    33  }
    34  
    35  // InitiateModelMigrationResult is used to return the result of one
    36  // model migration initiation attempt.
    37  type InitiateModelMigrationResult struct {
    38  	ModelTag string `json:"model-tag"`
    39  	Error    *Error `json:"error"`
    40  	Id       string `json:"id"` // the ID for the migration attempt
    41  }
    42  
    43  // SetMigrationPhaseArgs provides a migration phase to the
    44  // migrationmaster.SetPhase API method.
    45  type SetMigrationPhaseArgs struct {
    46  	Phase string `json:"phase"`
    47  }
    48  
    49  // SerializedModel wraps a buffer contain a serialised Juju model.
    50  type SerializedModel struct {
    51  	Bytes []byte `json:"bytes"`
    52  }
    53  
    54  // ModelArgs wraps a simple model tag.
    55  type ModelArgs struct {
    56  	ModelTag string `json:"model-tag"`
    57  }
    58  
    59  // MigrationStatus reports the current status of a model migration.
    60  type MigrationStatus struct {
    61  	Attempt int    `json:"attempt"`
    62  	Phase   string `json:"phase"`
    63  
    64  	// TODO(mjs): I'm not convinced these Source fields will get used.
    65  	SourceAPIAddrs []string `json:"source-api-addrs"`
    66  	SourceCACert   string   `json:"source-ca-cert"`
    67  
    68  	TargetAPIAddrs []string `json:"target-api-addrs"`
    69  	TargetCACert   string   `json:"target-ca-cert"`
    70  }
    71  
    72  // FullMigrationStatus reports the current status of a model
    73  // migration, including authentication details for the remote
    74  // controller.
    75  type FullMigrationStatus struct {
    76  	Spec    ModelMigrationSpec `json:"spec"`
    77  	Attempt int                `json:"attempt"`
    78  	Phase   string             `json:"phase"`
    79  }
    80  
    81  type PhaseResult struct {
    82  	Phase string `json:"phase"`
    83  	Error *Error
    84  }
    85  
    86  type PhaseResults struct {
    87  	Results []PhaseResult `json:"Results"`
    88  }