github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/core/migration/minionreports.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package migration
     5  
     6  // MinionReports returns information about the migration minion
     7  // reports received so far for a given migration phase.
     8  type MinionReports struct {
     9  	// ModelUUID holds the unique identifier for the model migration.
    10  	MigrationId string
    11  
    12  	// Phases indicates the migration phase the reports relate to.
    13  	Phase Phase
    14  
    15  	// SuccesCount indicates how many agents have successfully
    16  	// completed the migration phase.
    17  	SuccessCount int
    18  
    19  	// UnknownCount indicates how many agents are yet to report
    20  	// regarding the migration phase.
    21  	UnknownCount int
    22  
    23  	// SomeUnknownMachines holds the ids of some of the machines which
    24  	// have not yet reported in.
    25  	SomeUnknownMachines []string
    26  
    27  	// SomeUnknownUnits holds the names of some of the units which
    28  	// have not yet reported in.
    29  	SomeUnknownUnits []string
    30  
    31  	// SomeUnknownApplications holds the names of some of the applications which
    32  	// have not yet reported in.
    33  	SomeUnknownApplications []string
    34  
    35  	// FailedMachines holds the ids of machines which have failed to
    36  	// complete the migration phase.
    37  	FailedMachines []string
    38  
    39  	// FailedUnits holds the names of units which have failed to
    40  	// complete the migration phase.
    41  	FailedUnits []string
    42  
    43  	// FailedApplications holds the names of applications which have failed to
    44  	// complete the migration phase.
    45  	FailedApplications []string
    46  }
    47  
    48  // IsZero returns true if the MinionReports instance hasn't been set.
    49  func (r *MinionReports) IsZero() bool {
    50  	return r.MigrationId == "" && r.Phase == UNKNOWN
    51  }