github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/state/unit_assignment.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package state 5 6 // assignUnitDoc is a document that temporarily stores unit assignment 7 // information created during srevice creation until the unitassigner worker can 8 // come along and use it. 9 type assignUnitDoc struct { 10 // DocId is the unique id of the document, which is also the unit id of the 11 // unit to be assigned. 12 DocId string `bson:"_id"` 13 14 // Scope is the placement scope to apply to the unit. 15 Scope string `bson:"scope"` 16 17 // Directive is the placement directive to apply to the unit. 18 Directive string `bson:"directive"` 19 } 20 21 // UnitAssignment represents a staged unit assignment. 22 type UnitAssignment struct { 23 // Unit is the ID of the unit to be assigned. 24 Unit string 25 26 // Scope is the placement scope to apply to the unit. 27 Scope string 28 29 // Directive is the placement directive to apply to the unit. 30 Directive string 31 } 32 33 // UnitAssignmentResult is the result of running a staged unit assignment. 34 type UnitAssignmentResult struct { 35 Unit string 36 Error error 37 }