2019-07-10 16:42:04 +00:00
|
|
|
package test
|
2019-07-01 21:24:48 +00:00
|
|
|
|
2019-07-10 16:42:04 +00:00
|
|
|
import (
|
|
|
|
"github.com/hashicorp/nomad/nomad/structs"
|
|
|
|
"github.com/hashicorp/nomad/plugins/device"
|
|
|
|
)
|
2019-07-01 21:24:48 +00:00
|
|
|
|
2019-07-10 16:42:04 +00:00
|
|
|
type Client interface {
|
|
|
|
AllocStateHandler
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllocStateHandler exposes a handler to be called when a allocation's state changes
|
|
|
|
type AllocStateHandler interface {
|
|
|
|
// AllocStateUpdated is used to emit an updated allocation. This allocation
|
|
|
|
// is stripped to only include client settable fields.
|
|
|
|
AllocStateUpdated(alloc *structs.Allocation)
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeviceStatsReporter gives access to the latest resource usage
|
|
|
|
// for devices
|
|
|
|
type DeviceStatsReporter interface {
|
|
|
|
LatestDeviceResourceStats([]*structs.AllocatedDeviceResource) []*device.DeviceGroupStats
|
2019-07-01 21:24:48 +00:00
|
|
|
}
|