github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/plugins/device/proto/device.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // source: github.com/hashicorp/nomad/plugins/device/proto/device.proto
     3  
     4  package proto
     5  
     6  import proto "github.com/golang/protobuf/proto"
     7  import fmt "fmt"
     8  import math "math"
     9  import timestamp "github.com/golang/protobuf/ptypes/timestamp"
    10  
    11  import (
    12  	context "golang.org/x/net/context"
    13  	grpc "google.golang.org/grpc"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    26  
    27  // FingerprintRequest is used to request for devices to be fingerprinted.
    28  type FingerprintRequest struct {
    29  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    30  	XXX_unrecognized     []byte   `json:"-"`
    31  	XXX_sizecache        int32    `json:"-"`
    32  }
    33  
    34  func (m *FingerprintRequest) Reset()         { *m = FingerprintRequest{} }
    35  func (m *FingerprintRequest) String() string { return proto.CompactTextString(m) }
    36  func (*FingerprintRequest) ProtoMessage()    {}
    37  func (*FingerprintRequest) Descriptor() ([]byte, []int) {
    38  	return fileDescriptor_device_ebefe60214c28313, []int{0}
    39  }
    40  func (m *FingerprintRequest) XXX_Unmarshal(b []byte) error {
    41  	return xxx_messageInfo_FingerprintRequest.Unmarshal(m, b)
    42  }
    43  func (m *FingerprintRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    44  	return xxx_messageInfo_FingerprintRequest.Marshal(b, m, deterministic)
    45  }
    46  func (dst *FingerprintRequest) XXX_Merge(src proto.Message) {
    47  	xxx_messageInfo_FingerprintRequest.Merge(dst, src)
    48  }
    49  func (m *FingerprintRequest) XXX_Size() int {
    50  	return xxx_messageInfo_FingerprintRequest.Size(m)
    51  }
    52  func (m *FingerprintRequest) XXX_DiscardUnknown() {
    53  	xxx_messageInfo_FingerprintRequest.DiscardUnknown(m)
    54  }
    55  
    56  var xxx_messageInfo_FingerprintRequest proto.InternalMessageInfo
    57  
    58  // FingerprintResponse returns a set of detected devices.
    59  type FingerprintResponse struct {
    60  	// device_group is a group of devices that share a vendor, device_type, and
    61  	// device_name. This is returned as a set so that a single plugin could
    62  	// potentially detect several device types and models.
    63  	DeviceGroup          []*DeviceGroup `protobuf:"bytes,1,rep,name=device_group,json=deviceGroup,proto3" json:"device_group,omitempty"`
    64  	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
    65  	XXX_unrecognized     []byte         `json:"-"`
    66  	XXX_sizecache        int32          `json:"-"`
    67  }
    68  
    69  func (m *FingerprintResponse) Reset()         { *m = FingerprintResponse{} }
    70  func (m *FingerprintResponse) String() string { return proto.CompactTextString(m) }
    71  func (*FingerprintResponse) ProtoMessage()    {}
    72  func (*FingerprintResponse) Descriptor() ([]byte, []int) {
    73  	return fileDescriptor_device_ebefe60214c28313, []int{1}
    74  }
    75  func (m *FingerprintResponse) XXX_Unmarshal(b []byte) error {
    76  	return xxx_messageInfo_FingerprintResponse.Unmarshal(m, b)
    77  }
    78  func (m *FingerprintResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    79  	return xxx_messageInfo_FingerprintResponse.Marshal(b, m, deterministic)
    80  }
    81  func (dst *FingerprintResponse) XXX_Merge(src proto.Message) {
    82  	xxx_messageInfo_FingerprintResponse.Merge(dst, src)
    83  }
    84  func (m *FingerprintResponse) XXX_Size() int {
    85  	return xxx_messageInfo_FingerprintResponse.Size(m)
    86  }
    87  func (m *FingerprintResponse) XXX_DiscardUnknown() {
    88  	xxx_messageInfo_FingerprintResponse.DiscardUnknown(m)
    89  }
    90  
    91  var xxx_messageInfo_FingerprintResponse proto.InternalMessageInfo
    92  
    93  func (m *FingerprintResponse) GetDeviceGroup() []*DeviceGroup {
    94  	if m != nil {
    95  		return m.DeviceGroup
    96  	}
    97  	return nil
    98  }
    99  
   100  // DeviceGroup is a group of devices that share a vendor, device type and name.
   101  type DeviceGroup struct {
   102  	// vendor is the name of the vendor of the device
   103  	Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"`
   104  	// device_type is the type of the device (gpu, fpga, etc).
   105  	DeviceType string `protobuf:"bytes,2,opt,name=device_type,json=deviceType,proto3" json:"device_type,omitempty"`
   106  	// device_name is the name of the device.
   107  	DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"`
   108  	// devices is the set of devices detected by the plugin.
   109  	Devices []*DetectedDevice `protobuf:"bytes,4,rep,name=devices,proto3" json:"devices,omitempty"`
   110  	// attributes allows adding attributes to be used for constraints or
   111  	// affinities.
   112  	Attributes           map[string]string `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
   113  	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
   114  	XXX_unrecognized     []byte            `json:"-"`
   115  	XXX_sizecache        int32             `json:"-"`
   116  }
   117  
   118  func (m *DeviceGroup) Reset()         { *m = DeviceGroup{} }
   119  func (m *DeviceGroup) String() string { return proto.CompactTextString(m) }
   120  func (*DeviceGroup) ProtoMessage()    {}
   121  func (*DeviceGroup) Descriptor() ([]byte, []int) {
   122  	return fileDescriptor_device_ebefe60214c28313, []int{2}
   123  }
   124  func (m *DeviceGroup) XXX_Unmarshal(b []byte) error {
   125  	return xxx_messageInfo_DeviceGroup.Unmarshal(m, b)
   126  }
   127  func (m *DeviceGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   128  	return xxx_messageInfo_DeviceGroup.Marshal(b, m, deterministic)
   129  }
   130  func (dst *DeviceGroup) XXX_Merge(src proto.Message) {
   131  	xxx_messageInfo_DeviceGroup.Merge(dst, src)
   132  }
   133  func (m *DeviceGroup) XXX_Size() int {
   134  	return xxx_messageInfo_DeviceGroup.Size(m)
   135  }
   136  func (m *DeviceGroup) XXX_DiscardUnknown() {
   137  	xxx_messageInfo_DeviceGroup.DiscardUnknown(m)
   138  }
   139  
   140  var xxx_messageInfo_DeviceGroup proto.InternalMessageInfo
   141  
   142  func (m *DeviceGroup) GetVendor() string {
   143  	if m != nil {
   144  		return m.Vendor
   145  	}
   146  	return ""
   147  }
   148  
   149  func (m *DeviceGroup) GetDeviceType() string {
   150  	if m != nil {
   151  		return m.DeviceType
   152  	}
   153  	return ""
   154  }
   155  
   156  func (m *DeviceGroup) GetDeviceName() string {
   157  	if m != nil {
   158  		return m.DeviceName
   159  	}
   160  	return ""
   161  }
   162  
   163  func (m *DeviceGroup) GetDevices() []*DetectedDevice {
   164  	if m != nil {
   165  		return m.Devices
   166  	}
   167  	return nil
   168  }
   169  
   170  func (m *DeviceGroup) GetAttributes() map[string]string {
   171  	if m != nil {
   172  		return m.Attributes
   173  	}
   174  	return nil
   175  }
   176  
   177  // DetectedDevice is a single detected device.
   178  type DetectedDevice struct {
   179  	// ID is the ID of the device. This ID is used during allocation and must be
   180  	// stable across restarts of the device driver.
   181  	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
   182  	// Health of the device.
   183  	Healthy bool `protobuf:"varint,2,opt,name=healthy,proto3" json:"healthy,omitempty"`
   184  	// health_description allows the device plugin to optionally
   185  	// annotate the health field with a human readable reason.
   186  	HealthDescription string `protobuf:"bytes,3,opt,name=health_description,json=healthDescription,proto3" json:"health_description,omitempty"`
   187  	// hw_locality is optionally set to expose hardware locality information for
   188  	// more optimal placement decisions.
   189  	HwLocality           *DeviceLocality `protobuf:"bytes,4,opt,name=hw_locality,json=hwLocality,proto3" json:"hw_locality,omitempty"`
   190  	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
   191  	XXX_unrecognized     []byte          `json:"-"`
   192  	XXX_sizecache        int32           `json:"-"`
   193  }
   194  
   195  func (m *DetectedDevice) Reset()         { *m = DetectedDevice{} }
   196  func (m *DetectedDevice) String() string { return proto.CompactTextString(m) }
   197  func (*DetectedDevice) ProtoMessage()    {}
   198  func (*DetectedDevice) Descriptor() ([]byte, []int) {
   199  	return fileDescriptor_device_ebefe60214c28313, []int{3}
   200  }
   201  func (m *DetectedDevice) XXX_Unmarshal(b []byte) error {
   202  	return xxx_messageInfo_DetectedDevice.Unmarshal(m, b)
   203  }
   204  func (m *DetectedDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   205  	return xxx_messageInfo_DetectedDevice.Marshal(b, m, deterministic)
   206  }
   207  func (dst *DetectedDevice) XXX_Merge(src proto.Message) {
   208  	xxx_messageInfo_DetectedDevice.Merge(dst, src)
   209  }
   210  func (m *DetectedDevice) XXX_Size() int {
   211  	return xxx_messageInfo_DetectedDevice.Size(m)
   212  }
   213  func (m *DetectedDevice) XXX_DiscardUnknown() {
   214  	xxx_messageInfo_DetectedDevice.DiscardUnknown(m)
   215  }
   216  
   217  var xxx_messageInfo_DetectedDevice proto.InternalMessageInfo
   218  
   219  func (m *DetectedDevice) GetID() string {
   220  	if m != nil {
   221  		return m.ID
   222  	}
   223  	return ""
   224  }
   225  
   226  func (m *DetectedDevice) GetHealthy() bool {
   227  	if m != nil {
   228  		return m.Healthy
   229  	}
   230  	return false
   231  }
   232  
   233  func (m *DetectedDevice) GetHealthDescription() string {
   234  	if m != nil {
   235  		return m.HealthDescription
   236  	}
   237  	return ""
   238  }
   239  
   240  func (m *DetectedDevice) GetHwLocality() *DeviceLocality {
   241  	if m != nil {
   242  		return m.HwLocality
   243  	}
   244  	return nil
   245  }
   246  
   247  // DeviceLocality is used to expose HW locality information about a device.
   248  type DeviceLocality struct {
   249  	// pci_bus_id is the PCI bus ID for the device. If reported, it
   250  	// allows Nomad to make NUMA aware optimizations.
   251  	PciBusId             string   `protobuf:"bytes,1,opt,name=pci_bus_id,json=pciBusId,proto3" json:"pci_bus_id,omitempty"`
   252  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   253  	XXX_unrecognized     []byte   `json:"-"`
   254  	XXX_sizecache        int32    `json:"-"`
   255  }
   256  
   257  func (m *DeviceLocality) Reset()         { *m = DeviceLocality{} }
   258  func (m *DeviceLocality) String() string { return proto.CompactTextString(m) }
   259  func (*DeviceLocality) ProtoMessage()    {}
   260  func (*DeviceLocality) Descriptor() ([]byte, []int) {
   261  	return fileDescriptor_device_ebefe60214c28313, []int{4}
   262  }
   263  func (m *DeviceLocality) XXX_Unmarshal(b []byte) error {
   264  	return xxx_messageInfo_DeviceLocality.Unmarshal(m, b)
   265  }
   266  func (m *DeviceLocality) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   267  	return xxx_messageInfo_DeviceLocality.Marshal(b, m, deterministic)
   268  }
   269  func (dst *DeviceLocality) XXX_Merge(src proto.Message) {
   270  	xxx_messageInfo_DeviceLocality.Merge(dst, src)
   271  }
   272  func (m *DeviceLocality) XXX_Size() int {
   273  	return xxx_messageInfo_DeviceLocality.Size(m)
   274  }
   275  func (m *DeviceLocality) XXX_DiscardUnknown() {
   276  	xxx_messageInfo_DeviceLocality.DiscardUnknown(m)
   277  }
   278  
   279  var xxx_messageInfo_DeviceLocality proto.InternalMessageInfo
   280  
   281  func (m *DeviceLocality) GetPciBusId() string {
   282  	if m != nil {
   283  		return m.PciBusId
   284  	}
   285  	return ""
   286  }
   287  
   288  // ReserveRequest is used to ask the device driver for information on
   289  // how to allocate the requested devices.
   290  type ReserveRequest struct {
   291  	// device_ids are the requested devices.
   292  	DeviceIds            []string `protobuf:"bytes,1,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"`
   293  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   294  	XXX_unrecognized     []byte   `json:"-"`
   295  	XXX_sizecache        int32    `json:"-"`
   296  }
   297  
   298  func (m *ReserveRequest) Reset()         { *m = ReserveRequest{} }
   299  func (m *ReserveRequest) String() string { return proto.CompactTextString(m) }
   300  func (*ReserveRequest) ProtoMessage()    {}
   301  func (*ReserveRequest) Descriptor() ([]byte, []int) {
   302  	return fileDescriptor_device_ebefe60214c28313, []int{5}
   303  }
   304  func (m *ReserveRequest) XXX_Unmarshal(b []byte) error {
   305  	return xxx_messageInfo_ReserveRequest.Unmarshal(m, b)
   306  }
   307  func (m *ReserveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   308  	return xxx_messageInfo_ReserveRequest.Marshal(b, m, deterministic)
   309  }
   310  func (dst *ReserveRequest) XXX_Merge(src proto.Message) {
   311  	xxx_messageInfo_ReserveRequest.Merge(dst, src)
   312  }
   313  func (m *ReserveRequest) XXX_Size() int {
   314  	return xxx_messageInfo_ReserveRequest.Size(m)
   315  }
   316  func (m *ReserveRequest) XXX_DiscardUnknown() {
   317  	xxx_messageInfo_ReserveRequest.DiscardUnknown(m)
   318  }
   319  
   320  var xxx_messageInfo_ReserveRequest proto.InternalMessageInfo
   321  
   322  func (m *ReserveRequest) GetDeviceIds() []string {
   323  	if m != nil {
   324  		return m.DeviceIds
   325  	}
   326  	return nil
   327  }
   328  
   329  // ReserveResponse informs Nomad how to expose the requested devices
   330  // to the the task.
   331  type ReserveResponse struct {
   332  	// container_res contains information on how to mount the device
   333  	// into a task isolated using container technologies (where the
   334  	// host is shared)
   335  	ContainerRes         *ContainerReservation `protobuf:"bytes,1,opt,name=container_res,json=containerRes,proto3" json:"container_res,omitempty"`
   336  	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
   337  	XXX_unrecognized     []byte                `json:"-"`
   338  	XXX_sizecache        int32                 `json:"-"`
   339  }
   340  
   341  func (m *ReserveResponse) Reset()         { *m = ReserveResponse{} }
   342  func (m *ReserveResponse) String() string { return proto.CompactTextString(m) }
   343  func (*ReserveResponse) ProtoMessage()    {}
   344  func (*ReserveResponse) Descriptor() ([]byte, []int) {
   345  	return fileDescriptor_device_ebefe60214c28313, []int{6}
   346  }
   347  func (m *ReserveResponse) XXX_Unmarshal(b []byte) error {
   348  	return xxx_messageInfo_ReserveResponse.Unmarshal(m, b)
   349  }
   350  func (m *ReserveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   351  	return xxx_messageInfo_ReserveResponse.Marshal(b, m, deterministic)
   352  }
   353  func (dst *ReserveResponse) XXX_Merge(src proto.Message) {
   354  	xxx_messageInfo_ReserveResponse.Merge(dst, src)
   355  }
   356  func (m *ReserveResponse) XXX_Size() int {
   357  	return xxx_messageInfo_ReserveResponse.Size(m)
   358  }
   359  func (m *ReserveResponse) XXX_DiscardUnknown() {
   360  	xxx_messageInfo_ReserveResponse.DiscardUnknown(m)
   361  }
   362  
   363  var xxx_messageInfo_ReserveResponse proto.InternalMessageInfo
   364  
   365  func (m *ReserveResponse) GetContainerRes() *ContainerReservation {
   366  	if m != nil {
   367  		return m.ContainerRes
   368  	}
   369  	return nil
   370  }
   371  
   372  // ContainerReservation returns how to mount the device into a
   373  // container that shares the host OS.
   374  type ContainerReservation struct {
   375  	// List of environment variable to be set
   376  	Envs map[string]string `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
   377  	// Mounts for the task.
   378  	Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"`
   379  	// Devices for the task.
   380  	Devices              []*DeviceSpec `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"`
   381  	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
   382  	XXX_unrecognized     []byte        `json:"-"`
   383  	XXX_sizecache        int32         `json:"-"`
   384  }
   385  
   386  func (m *ContainerReservation) Reset()         { *m = ContainerReservation{} }
   387  func (m *ContainerReservation) String() string { return proto.CompactTextString(m) }
   388  func (*ContainerReservation) ProtoMessage()    {}
   389  func (*ContainerReservation) Descriptor() ([]byte, []int) {
   390  	return fileDescriptor_device_ebefe60214c28313, []int{7}
   391  }
   392  func (m *ContainerReservation) XXX_Unmarshal(b []byte) error {
   393  	return xxx_messageInfo_ContainerReservation.Unmarshal(m, b)
   394  }
   395  func (m *ContainerReservation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   396  	return xxx_messageInfo_ContainerReservation.Marshal(b, m, deterministic)
   397  }
   398  func (dst *ContainerReservation) XXX_Merge(src proto.Message) {
   399  	xxx_messageInfo_ContainerReservation.Merge(dst, src)
   400  }
   401  func (m *ContainerReservation) XXX_Size() int {
   402  	return xxx_messageInfo_ContainerReservation.Size(m)
   403  }
   404  func (m *ContainerReservation) XXX_DiscardUnknown() {
   405  	xxx_messageInfo_ContainerReservation.DiscardUnknown(m)
   406  }
   407  
   408  var xxx_messageInfo_ContainerReservation proto.InternalMessageInfo
   409  
   410  func (m *ContainerReservation) GetEnvs() map[string]string {
   411  	if m != nil {
   412  		return m.Envs
   413  	}
   414  	return nil
   415  }
   416  
   417  func (m *ContainerReservation) GetMounts() []*Mount {
   418  	if m != nil {
   419  		return m.Mounts
   420  	}
   421  	return nil
   422  }
   423  
   424  func (m *ContainerReservation) GetDevices() []*DeviceSpec {
   425  	if m != nil {
   426  		return m.Devices
   427  	}
   428  	return nil
   429  }
   430  
   431  // Mount specifies a host volume to mount into a task.
   432  // where device library or tools are installed on host and task
   433  type Mount struct {
   434  	// Path of the mount within the task.
   435  	TaskPath string `protobuf:"bytes,1,opt,name=task_path,json=taskPath,proto3" json:"task_path,omitempty"`
   436  	// Path of the mount on the host.
   437  	HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
   438  	// If set, the mount is read-only.
   439  	ReadOnly             bool     `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
   440  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   441  	XXX_unrecognized     []byte   `json:"-"`
   442  	XXX_sizecache        int32    `json:"-"`
   443  }
   444  
   445  func (m *Mount) Reset()         { *m = Mount{} }
   446  func (m *Mount) String() string { return proto.CompactTextString(m) }
   447  func (*Mount) ProtoMessage()    {}
   448  func (*Mount) Descriptor() ([]byte, []int) {
   449  	return fileDescriptor_device_ebefe60214c28313, []int{8}
   450  }
   451  func (m *Mount) XXX_Unmarshal(b []byte) error {
   452  	return xxx_messageInfo_Mount.Unmarshal(m, b)
   453  }
   454  func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   455  	return xxx_messageInfo_Mount.Marshal(b, m, deterministic)
   456  }
   457  func (dst *Mount) XXX_Merge(src proto.Message) {
   458  	xxx_messageInfo_Mount.Merge(dst, src)
   459  }
   460  func (m *Mount) XXX_Size() int {
   461  	return xxx_messageInfo_Mount.Size(m)
   462  }
   463  func (m *Mount) XXX_DiscardUnknown() {
   464  	xxx_messageInfo_Mount.DiscardUnknown(m)
   465  }
   466  
   467  var xxx_messageInfo_Mount proto.InternalMessageInfo
   468  
   469  func (m *Mount) GetTaskPath() string {
   470  	if m != nil {
   471  		return m.TaskPath
   472  	}
   473  	return ""
   474  }
   475  
   476  func (m *Mount) GetHostPath() string {
   477  	if m != nil {
   478  		return m.HostPath
   479  	}
   480  	return ""
   481  }
   482  
   483  func (m *Mount) GetReadOnly() bool {
   484  	if m != nil {
   485  		return m.ReadOnly
   486  	}
   487  	return false
   488  }
   489  
   490  // DeviceSpec specifies a host device to mount into a task.
   491  type DeviceSpec struct {
   492  	// Path of the device within the task.
   493  	TaskPath string `protobuf:"bytes,1,opt,name=task_path,json=taskPath,proto3" json:"task_path,omitempty"`
   494  	// Path of the device on the host.
   495  	HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
   496  	// Cgroups permissions of the device, candidates are one or more of
   497  	// * r - allows task to read from the specified device.
   498  	// * w - allows task to write to the specified device.
   499  	// * m - allows task to create device files that do not yet exist
   500  	Permissions          string   `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"`
   501  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   502  	XXX_unrecognized     []byte   `json:"-"`
   503  	XXX_sizecache        int32    `json:"-"`
   504  }
   505  
   506  func (m *DeviceSpec) Reset()         { *m = DeviceSpec{} }
   507  func (m *DeviceSpec) String() string { return proto.CompactTextString(m) }
   508  func (*DeviceSpec) ProtoMessage()    {}
   509  func (*DeviceSpec) Descriptor() ([]byte, []int) {
   510  	return fileDescriptor_device_ebefe60214c28313, []int{9}
   511  }
   512  func (m *DeviceSpec) XXX_Unmarshal(b []byte) error {
   513  	return xxx_messageInfo_DeviceSpec.Unmarshal(m, b)
   514  }
   515  func (m *DeviceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   516  	return xxx_messageInfo_DeviceSpec.Marshal(b, m, deterministic)
   517  }
   518  func (dst *DeviceSpec) XXX_Merge(src proto.Message) {
   519  	xxx_messageInfo_DeviceSpec.Merge(dst, src)
   520  }
   521  func (m *DeviceSpec) XXX_Size() int {
   522  	return xxx_messageInfo_DeviceSpec.Size(m)
   523  }
   524  func (m *DeviceSpec) XXX_DiscardUnknown() {
   525  	xxx_messageInfo_DeviceSpec.DiscardUnknown(m)
   526  }
   527  
   528  var xxx_messageInfo_DeviceSpec proto.InternalMessageInfo
   529  
   530  func (m *DeviceSpec) GetTaskPath() string {
   531  	if m != nil {
   532  		return m.TaskPath
   533  	}
   534  	return ""
   535  }
   536  
   537  func (m *DeviceSpec) GetHostPath() string {
   538  	if m != nil {
   539  		return m.HostPath
   540  	}
   541  	return ""
   542  }
   543  
   544  func (m *DeviceSpec) GetPermissions() string {
   545  	if m != nil {
   546  		return m.Permissions
   547  	}
   548  	return ""
   549  }
   550  
   551  // StatsRequest is used to parameterize the retrieval of statistics.
   552  type StatsRequest struct {
   553  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   554  	XXX_unrecognized     []byte   `json:"-"`
   555  	XXX_sizecache        int32    `json:"-"`
   556  }
   557  
   558  func (m *StatsRequest) Reset()         { *m = StatsRequest{} }
   559  func (m *StatsRequest) String() string { return proto.CompactTextString(m) }
   560  func (*StatsRequest) ProtoMessage()    {}
   561  func (*StatsRequest) Descriptor() ([]byte, []int) {
   562  	return fileDescriptor_device_ebefe60214c28313, []int{10}
   563  }
   564  func (m *StatsRequest) XXX_Unmarshal(b []byte) error {
   565  	return xxx_messageInfo_StatsRequest.Unmarshal(m, b)
   566  }
   567  func (m *StatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   568  	return xxx_messageInfo_StatsRequest.Marshal(b, m, deterministic)
   569  }
   570  func (dst *StatsRequest) XXX_Merge(src proto.Message) {
   571  	xxx_messageInfo_StatsRequest.Merge(dst, src)
   572  }
   573  func (m *StatsRequest) XXX_Size() int {
   574  	return xxx_messageInfo_StatsRequest.Size(m)
   575  }
   576  func (m *StatsRequest) XXX_DiscardUnknown() {
   577  	xxx_messageInfo_StatsRequest.DiscardUnknown(m)
   578  }
   579  
   580  var xxx_messageInfo_StatsRequest proto.InternalMessageInfo
   581  
   582  // StatsResponse returns the statistics for each device group.
   583  type StatsResponse struct {
   584  	// groups contains statistics for each device group.
   585  	Groups               []*DeviceGroupStats `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
   586  	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
   587  	XXX_unrecognized     []byte              `json:"-"`
   588  	XXX_sizecache        int32               `json:"-"`
   589  }
   590  
   591  func (m *StatsResponse) Reset()         { *m = StatsResponse{} }
   592  func (m *StatsResponse) String() string { return proto.CompactTextString(m) }
   593  func (*StatsResponse) ProtoMessage()    {}
   594  func (*StatsResponse) Descriptor() ([]byte, []int) {
   595  	return fileDescriptor_device_ebefe60214c28313, []int{11}
   596  }
   597  func (m *StatsResponse) XXX_Unmarshal(b []byte) error {
   598  	return xxx_messageInfo_StatsResponse.Unmarshal(m, b)
   599  }
   600  func (m *StatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   601  	return xxx_messageInfo_StatsResponse.Marshal(b, m, deterministic)
   602  }
   603  func (dst *StatsResponse) XXX_Merge(src proto.Message) {
   604  	xxx_messageInfo_StatsResponse.Merge(dst, src)
   605  }
   606  func (m *StatsResponse) XXX_Size() int {
   607  	return xxx_messageInfo_StatsResponse.Size(m)
   608  }
   609  func (m *StatsResponse) XXX_DiscardUnknown() {
   610  	xxx_messageInfo_StatsResponse.DiscardUnknown(m)
   611  }
   612  
   613  var xxx_messageInfo_StatsResponse proto.InternalMessageInfo
   614  
   615  func (m *StatsResponse) GetGroups() []*DeviceGroupStats {
   616  	if m != nil {
   617  		return m.Groups
   618  	}
   619  	return nil
   620  }
   621  
   622  // DeviceGroupStats contains statistics for each device of a particular
   623  // device group, identified by the vendor, type and name of the device.
   624  type DeviceGroupStats struct {
   625  	Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"`
   626  	Type   string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
   627  	Name   string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
   628  	// instance_stats is a mapping of each device ID to its statistics.
   629  	InstanceStats        map[string]*DeviceStats `protobuf:"bytes,4,rep,name=instance_stats,json=instanceStats,proto3" json:"instance_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
   630  	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
   631  	XXX_unrecognized     []byte                  `json:"-"`
   632  	XXX_sizecache        int32                   `json:"-"`
   633  }
   634  
   635  func (m *DeviceGroupStats) Reset()         { *m = DeviceGroupStats{} }
   636  func (m *DeviceGroupStats) String() string { return proto.CompactTextString(m) }
   637  func (*DeviceGroupStats) ProtoMessage()    {}
   638  func (*DeviceGroupStats) Descriptor() ([]byte, []int) {
   639  	return fileDescriptor_device_ebefe60214c28313, []int{12}
   640  }
   641  func (m *DeviceGroupStats) XXX_Unmarshal(b []byte) error {
   642  	return xxx_messageInfo_DeviceGroupStats.Unmarshal(m, b)
   643  }
   644  func (m *DeviceGroupStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   645  	return xxx_messageInfo_DeviceGroupStats.Marshal(b, m, deterministic)
   646  }
   647  func (dst *DeviceGroupStats) XXX_Merge(src proto.Message) {
   648  	xxx_messageInfo_DeviceGroupStats.Merge(dst, src)
   649  }
   650  func (m *DeviceGroupStats) XXX_Size() int {
   651  	return xxx_messageInfo_DeviceGroupStats.Size(m)
   652  }
   653  func (m *DeviceGroupStats) XXX_DiscardUnknown() {
   654  	xxx_messageInfo_DeviceGroupStats.DiscardUnknown(m)
   655  }
   656  
   657  var xxx_messageInfo_DeviceGroupStats proto.InternalMessageInfo
   658  
   659  func (m *DeviceGroupStats) GetVendor() string {
   660  	if m != nil {
   661  		return m.Vendor
   662  	}
   663  	return ""
   664  }
   665  
   666  func (m *DeviceGroupStats) GetType() string {
   667  	if m != nil {
   668  		return m.Type
   669  	}
   670  	return ""
   671  }
   672  
   673  func (m *DeviceGroupStats) GetName() string {
   674  	if m != nil {
   675  		return m.Name
   676  	}
   677  	return ""
   678  }
   679  
   680  func (m *DeviceGroupStats) GetInstanceStats() map[string]*DeviceStats {
   681  	if m != nil {
   682  		return m.InstanceStats
   683  	}
   684  	return nil
   685  }
   686  
   687  // DeviceStats is the statistics for an individual device
   688  type DeviceStats struct {
   689  	// summary exposes a single summary metric that should be the most
   690  	// informative to users.
   691  	Summary *StatValue `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"`
   692  	// stats contains the verbose statistics for the device.
   693  	Stats *StatObject `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"`
   694  	// timestamp is the time the statistics were collected.
   695  	Timestamp            *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
   696  	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
   697  	XXX_unrecognized     []byte               `json:"-"`
   698  	XXX_sizecache        int32                `json:"-"`
   699  }
   700  
   701  func (m *DeviceStats) Reset()         { *m = DeviceStats{} }
   702  func (m *DeviceStats) String() string { return proto.CompactTextString(m) }
   703  func (*DeviceStats) ProtoMessage()    {}
   704  func (*DeviceStats) Descriptor() ([]byte, []int) {
   705  	return fileDescriptor_device_ebefe60214c28313, []int{13}
   706  }
   707  func (m *DeviceStats) XXX_Unmarshal(b []byte) error {
   708  	return xxx_messageInfo_DeviceStats.Unmarshal(m, b)
   709  }
   710  func (m *DeviceStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   711  	return xxx_messageInfo_DeviceStats.Marshal(b, m, deterministic)
   712  }
   713  func (dst *DeviceStats) XXX_Merge(src proto.Message) {
   714  	xxx_messageInfo_DeviceStats.Merge(dst, src)
   715  }
   716  func (m *DeviceStats) XXX_Size() int {
   717  	return xxx_messageInfo_DeviceStats.Size(m)
   718  }
   719  func (m *DeviceStats) XXX_DiscardUnknown() {
   720  	xxx_messageInfo_DeviceStats.DiscardUnknown(m)
   721  }
   722  
   723  var xxx_messageInfo_DeviceStats proto.InternalMessageInfo
   724  
   725  func (m *DeviceStats) GetSummary() *StatValue {
   726  	if m != nil {
   727  		return m.Summary
   728  	}
   729  	return nil
   730  }
   731  
   732  func (m *DeviceStats) GetStats() *StatObject {
   733  	if m != nil {
   734  		return m.Stats
   735  	}
   736  	return nil
   737  }
   738  
   739  func (m *DeviceStats) GetTimestamp() *timestamp.Timestamp {
   740  	if m != nil {
   741  		return m.Timestamp
   742  	}
   743  	return nil
   744  }
   745  
   746  // StatObject is a collection of statistics either exposed at the top
   747  // level or via nested StatObjects.
   748  type StatObject struct {
   749  	// nested is a mapping of object name to a nested stats object.
   750  	Nested map[string]*StatObject `protobuf:"bytes,1,rep,name=nested,proto3" json:"nested,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
   751  	// attributes is a mapping of statistic name to its value.
   752  	Attributes           map[string]*StatValue `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
   753  	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
   754  	XXX_unrecognized     []byte                `json:"-"`
   755  	XXX_sizecache        int32                 `json:"-"`
   756  }
   757  
   758  func (m *StatObject) Reset()         { *m = StatObject{} }
   759  func (m *StatObject) String() string { return proto.CompactTextString(m) }
   760  func (*StatObject) ProtoMessage()    {}
   761  func (*StatObject) Descriptor() ([]byte, []int) {
   762  	return fileDescriptor_device_ebefe60214c28313, []int{14}
   763  }
   764  func (m *StatObject) XXX_Unmarshal(b []byte) error {
   765  	return xxx_messageInfo_StatObject.Unmarshal(m, b)
   766  }
   767  func (m *StatObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   768  	return xxx_messageInfo_StatObject.Marshal(b, m, deterministic)
   769  }
   770  func (dst *StatObject) XXX_Merge(src proto.Message) {
   771  	xxx_messageInfo_StatObject.Merge(dst, src)
   772  }
   773  func (m *StatObject) XXX_Size() int {
   774  	return xxx_messageInfo_StatObject.Size(m)
   775  }
   776  func (m *StatObject) XXX_DiscardUnknown() {
   777  	xxx_messageInfo_StatObject.DiscardUnknown(m)
   778  }
   779  
   780  var xxx_messageInfo_StatObject proto.InternalMessageInfo
   781  
   782  func (m *StatObject) GetNested() map[string]*StatObject {
   783  	if m != nil {
   784  		return m.Nested
   785  	}
   786  	return nil
   787  }
   788  
   789  func (m *StatObject) GetAttributes() map[string]*StatValue {
   790  	if m != nil {
   791  		return m.Attributes
   792  	}
   793  	return nil
   794  }
   795  
   796  // StatValue exposes the values of a particular statistic. The value may
   797  // be of type double, integer, string or boolean. Numeric types can be
   798  // exposed as a single value or as a fraction.
   799  type StatValue struct {
   800  	// float_numerator_val exposes a floating point value. If denominator
   801  	// is set it is assumed to be a fractional value, otherwise it is a
   802  	// scalar.
   803  	FloatNumeratorVal   float64 `protobuf:"fixed64,1,opt,name=float_numerator_val,json=floatNumeratorVal,proto3" json:"float_numerator_val,omitempty"`
   804  	FloatDenominatorVal float64 `protobuf:"fixed64,2,opt,name=float_denominator_val,json=floatDenominatorVal,proto3" json:"float_denominator_val,omitempty"`
   805  	// int_numerator_val exposes a int value. If denominator
   806  	// is set it is assumed to be a fractional value, otherwise it is a
   807  	// scalar.
   808  	IntNumeratorVal   int64 `protobuf:"varint,3,opt,name=int_numerator_val,json=intNumeratorVal,proto3" json:"int_numerator_val,omitempty"`
   809  	IntDenominatorVal int64 `protobuf:"varint,4,opt,name=int_denominator_val,json=intDenominatorVal,proto3" json:"int_denominator_val,omitempty"`
   810  	// string_val exposes a string value. These are likely annotations.
   811  	StringVal string `protobuf:"bytes,5,opt,name=string_val,json=stringVal,proto3" json:"string_val,omitempty"`
   812  	// bool_val exposes a boolean statistic.
   813  	BoolVal bool `protobuf:"varint,6,opt,name=bool_val,json=boolVal,proto3" json:"bool_val,omitempty"`
   814  	// unit gives the unit type: °F, %, MHz, MB, etc.
   815  	Unit string `protobuf:"bytes,7,opt,name=unit,proto3" json:"unit,omitempty"`
   816  	// desc provides a human readable description of the statistic.
   817  	Desc                 string   `protobuf:"bytes,8,opt,name=desc,proto3" json:"desc,omitempty"`
   818  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
   819  	XXX_unrecognized     []byte   `json:"-"`
   820  	XXX_sizecache        int32    `json:"-"`
   821  }
   822  
   823  func (m *StatValue) Reset()         { *m = StatValue{} }
   824  func (m *StatValue) String() string { return proto.CompactTextString(m) }
   825  func (*StatValue) ProtoMessage()    {}
   826  func (*StatValue) Descriptor() ([]byte, []int) {
   827  	return fileDescriptor_device_ebefe60214c28313, []int{15}
   828  }
   829  func (m *StatValue) XXX_Unmarshal(b []byte) error {
   830  	return xxx_messageInfo_StatValue.Unmarshal(m, b)
   831  }
   832  func (m *StatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   833  	return xxx_messageInfo_StatValue.Marshal(b, m, deterministic)
   834  }
   835  func (dst *StatValue) XXX_Merge(src proto.Message) {
   836  	xxx_messageInfo_StatValue.Merge(dst, src)
   837  }
   838  func (m *StatValue) XXX_Size() int {
   839  	return xxx_messageInfo_StatValue.Size(m)
   840  }
   841  func (m *StatValue) XXX_DiscardUnknown() {
   842  	xxx_messageInfo_StatValue.DiscardUnknown(m)
   843  }
   844  
   845  var xxx_messageInfo_StatValue proto.InternalMessageInfo
   846  
   847  func (m *StatValue) GetFloatNumeratorVal() float64 {
   848  	if m != nil {
   849  		return m.FloatNumeratorVal
   850  	}
   851  	return 0
   852  }
   853  
   854  func (m *StatValue) GetFloatDenominatorVal() float64 {
   855  	if m != nil {
   856  		return m.FloatDenominatorVal
   857  	}
   858  	return 0
   859  }
   860  
   861  func (m *StatValue) GetIntNumeratorVal() int64 {
   862  	if m != nil {
   863  		return m.IntNumeratorVal
   864  	}
   865  	return 0
   866  }
   867  
   868  func (m *StatValue) GetIntDenominatorVal() int64 {
   869  	if m != nil {
   870  		return m.IntDenominatorVal
   871  	}
   872  	return 0
   873  }
   874  
   875  func (m *StatValue) GetStringVal() string {
   876  	if m != nil {
   877  		return m.StringVal
   878  	}
   879  	return ""
   880  }
   881  
   882  func (m *StatValue) GetBoolVal() bool {
   883  	if m != nil {
   884  		return m.BoolVal
   885  	}
   886  	return false
   887  }
   888  
   889  func (m *StatValue) GetUnit() string {
   890  	if m != nil {
   891  		return m.Unit
   892  	}
   893  	return ""
   894  }
   895  
   896  func (m *StatValue) GetDesc() string {
   897  	if m != nil {
   898  		return m.Desc
   899  	}
   900  	return ""
   901  }
   902  
   903  func init() {
   904  	proto.RegisterType((*FingerprintRequest)(nil), "hashicorp.nomad.plugins.device.FingerprintRequest")
   905  	proto.RegisterType((*FingerprintResponse)(nil), "hashicorp.nomad.plugins.device.FingerprintResponse")
   906  	proto.RegisterType((*DeviceGroup)(nil), "hashicorp.nomad.plugins.device.DeviceGroup")
   907  	proto.RegisterMapType((map[string]string)(nil), "hashicorp.nomad.plugins.device.DeviceGroup.AttributesEntry")
   908  	proto.RegisterType((*DetectedDevice)(nil), "hashicorp.nomad.plugins.device.DetectedDevice")
   909  	proto.RegisterType((*DeviceLocality)(nil), "hashicorp.nomad.plugins.device.DeviceLocality")
   910  	proto.RegisterType((*ReserveRequest)(nil), "hashicorp.nomad.plugins.device.ReserveRequest")
   911  	proto.RegisterType((*ReserveResponse)(nil), "hashicorp.nomad.plugins.device.ReserveResponse")
   912  	proto.RegisterType((*ContainerReservation)(nil), "hashicorp.nomad.plugins.device.ContainerReservation")
   913  	proto.RegisterMapType((map[string]string)(nil), "hashicorp.nomad.plugins.device.ContainerReservation.EnvsEntry")
   914  	proto.RegisterType((*Mount)(nil), "hashicorp.nomad.plugins.device.Mount")
   915  	proto.RegisterType((*DeviceSpec)(nil), "hashicorp.nomad.plugins.device.DeviceSpec")
   916  	proto.RegisterType((*StatsRequest)(nil), "hashicorp.nomad.plugins.device.StatsRequest")
   917  	proto.RegisterType((*StatsResponse)(nil), "hashicorp.nomad.plugins.device.StatsResponse")
   918  	proto.RegisterType((*DeviceGroupStats)(nil), "hashicorp.nomad.plugins.device.DeviceGroupStats")
   919  	proto.RegisterMapType((map[string]*DeviceStats)(nil), "hashicorp.nomad.plugins.device.DeviceGroupStats.InstanceStatsEntry")
   920  	proto.RegisterType((*DeviceStats)(nil), "hashicorp.nomad.plugins.device.DeviceStats")
   921  	proto.RegisterType((*StatObject)(nil), "hashicorp.nomad.plugins.device.StatObject")
   922  	proto.RegisterMapType((map[string]*StatValue)(nil), "hashicorp.nomad.plugins.device.StatObject.AttributesEntry")
   923  	proto.RegisterMapType((map[string]*StatObject)(nil), "hashicorp.nomad.plugins.device.StatObject.NestedEntry")
   924  	proto.RegisterType((*StatValue)(nil), "hashicorp.nomad.plugins.device.StatValue")
   925  }
   926  
   927  // Reference imports to suppress errors if they are not otherwise used.
   928  var _ context.Context
   929  var _ grpc.ClientConn
   930  
   931  // This is a compile-time assertion to ensure that this generated file
   932  // is compatible with the grpc package it is being compiled against.
   933  const _ = grpc.SupportPackageIsVersion4
   934  
   935  // DevicePluginClient is the client API for DevicePlugin service.
   936  //
   937  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   938  type DevicePluginClient interface {
   939  	// Fingerprint allows the device plugin to return a set of
   940  	// detected devices and provide a mechanism to update the state of
   941  	// the device.
   942  	Fingerprint(ctx context.Context, in *FingerprintRequest, opts ...grpc.CallOption) (DevicePlugin_FingerprintClient, error)
   943  	// Reserve is called by the client before starting an allocation
   944  	// that requires access to the plugin’s devices. The plugin can use
   945  	// this to run any setup steps and provides the mounting details to
   946  	// the Nomad client
   947  	Reserve(ctx context.Context, in *ReserveRequest, opts ...grpc.CallOption) (*ReserveResponse, error)
   948  	// Stats returns a stream of device statistics.
   949  	Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (DevicePlugin_StatsClient, error)
   950  }
   951  
   952  type devicePluginClient struct {
   953  	cc *grpc.ClientConn
   954  }
   955  
   956  func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient {
   957  	return &devicePluginClient{cc}
   958  }
   959  
   960  func (c *devicePluginClient) Fingerprint(ctx context.Context, in *FingerprintRequest, opts ...grpc.CallOption) (DevicePlugin_FingerprintClient, error) {
   961  	stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[0], "/hashicorp.nomad.plugins.device.DevicePlugin/Fingerprint", opts...)
   962  	if err != nil {
   963  		return nil, err
   964  	}
   965  	x := &devicePluginFingerprintClient{stream}
   966  	if err := x.ClientStream.SendMsg(in); err != nil {
   967  		return nil, err
   968  	}
   969  	if err := x.ClientStream.CloseSend(); err != nil {
   970  		return nil, err
   971  	}
   972  	return x, nil
   973  }
   974  
   975  type DevicePlugin_FingerprintClient interface {
   976  	Recv() (*FingerprintResponse, error)
   977  	grpc.ClientStream
   978  }
   979  
   980  type devicePluginFingerprintClient struct {
   981  	grpc.ClientStream
   982  }
   983  
   984  func (x *devicePluginFingerprintClient) Recv() (*FingerprintResponse, error) {
   985  	m := new(FingerprintResponse)
   986  	if err := x.ClientStream.RecvMsg(m); err != nil {
   987  		return nil, err
   988  	}
   989  	return m, nil
   990  }
   991  
   992  func (c *devicePluginClient) Reserve(ctx context.Context, in *ReserveRequest, opts ...grpc.CallOption) (*ReserveResponse, error) {
   993  	out := new(ReserveResponse)
   994  	err := c.cc.Invoke(ctx, "/hashicorp.nomad.plugins.device.DevicePlugin/Reserve", in, out, opts...)
   995  	if err != nil {
   996  		return nil, err
   997  	}
   998  	return out, nil
   999  }
  1000  
  1001  func (c *devicePluginClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (DevicePlugin_StatsClient, error) {
  1002  	stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[1], "/hashicorp.nomad.plugins.device.DevicePlugin/Stats", opts...)
  1003  	if err != nil {
  1004  		return nil, err
  1005  	}
  1006  	x := &devicePluginStatsClient{stream}
  1007  	if err := x.ClientStream.SendMsg(in); err != nil {
  1008  		return nil, err
  1009  	}
  1010  	if err := x.ClientStream.CloseSend(); err != nil {
  1011  		return nil, err
  1012  	}
  1013  	return x, nil
  1014  }
  1015  
  1016  type DevicePlugin_StatsClient interface {
  1017  	Recv() (*StatsResponse, error)
  1018  	grpc.ClientStream
  1019  }
  1020  
  1021  type devicePluginStatsClient struct {
  1022  	grpc.ClientStream
  1023  }
  1024  
  1025  func (x *devicePluginStatsClient) Recv() (*StatsResponse, error) {
  1026  	m := new(StatsResponse)
  1027  	if err := x.ClientStream.RecvMsg(m); err != nil {
  1028  		return nil, err
  1029  	}
  1030  	return m, nil
  1031  }
  1032  
  1033  // DevicePluginServer is the server API for DevicePlugin service.
  1034  type DevicePluginServer interface {
  1035  	// Fingerprint allows the device plugin to return a set of
  1036  	// detected devices and provide a mechanism to update the state of
  1037  	// the device.
  1038  	Fingerprint(*FingerprintRequest, DevicePlugin_FingerprintServer) error
  1039  	// Reserve is called by the client before starting an allocation
  1040  	// that requires access to the plugin’s devices. The plugin can use
  1041  	// this to run any setup steps and provides the mounting details to
  1042  	// the Nomad client
  1043  	Reserve(context.Context, *ReserveRequest) (*ReserveResponse, error)
  1044  	// Stats returns a stream of device statistics.
  1045  	Stats(*StatsRequest, DevicePlugin_StatsServer) error
  1046  }
  1047  
  1048  func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer) {
  1049  	s.RegisterService(&_DevicePlugin_serviceDesc, srv)
  1050  }
  1051  
  1052  func _DevicePlugin_Fingerprint_Handler(srv interface{}, stream grpc.ServerStream) error {
  1053  	m := new(FingerprintRequest)
  1054  	if err := stream.RecvMsg(m); err != nil {
  1055  		return err
  1056  	}
  1057  	return srv.(DevicePluginServer).Fingerprint(m, &devicePluginFingerprintServer{stream})
  1058  }
  1059  
  1060  type DevicePlugin_FingerprintServer interface {
  1061  	Send(*FingerprintResponse) error
  1062  	grpc.ServerStream
  1063  }
  1064  
  1065  type devicePluginFingerprintServer struct {
  1066  	grpc.ServerStream
  1067  }
  1068  
  1069  func (x *devicePluginFingerprintServer) Send(m *FingerprintResponse) error {
  1070  	return x.ServerStream.SendMsg(m)
  1071  }
  1072  
  1073  func _DevicePlugin_Reserve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  1074  	in := new(ReserveRequest)
  1075  	if err := dec(in); err != nil {
  1076  		return nil, err
  1077  	}
  1078  	if interceptor == nil {
  1079  		return srv.(DevicePluginServer).Reserve(ctx, in)
  1080  	}
  1081  	info := &grpc.UnaryServerInfo{
  1082  		Server:     srv,
  1083  		FullMethod: "/hashicorp.nomad.plugins.device.DevicePlugin/Reserve",
  1084  	}
  1085  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  1086  		return srv.(DevicePluginServer).Reserve(ctx, req.(*ReserveRequest))
  1087  	}
  1088  	return interceptor(ctx, in, info, handler)
  1089  }
  1090  
  1091  func _DevicePlugin_Stats_Handler(srv interface{}, stream grpc.ServerStream) error {
  1092  	m := new(StatsRequest)
  1093  	if err := stream.RecvMsg(m); err != nil {
  1094  		return err
  1095  	}
  1096  	return srv.(DevicePluginServer).Stats(m, &devicePluginStatsServer{stream})
  1097  }
  1098  
  1099  type DevicePlugin_StatsServer interface {
  1100  	Send(*StatsResponse) error
  1101  	grpc.ServerStream
  1102  }
  1103  
  1104  type devicePluginStatsServer struct {
  1105  	grpc.ServerStream
  1106  }
  1107  
  1108  func (x *devicePluginStatsServer) Send(m *StatsResponse) error {
  1109  	return x.ServerStream.SendMsg(m)
  1110  }
  1111  
  1112  var _DevicePlugin_serviceDesc = grpc.ServiceDesc{
  1113  	ServiceName: "hashicorp.nomad.plugins.device.DevicePlugin",
  1114  	HandlerType: (*DevicePluginServer)(nil),
  1115  	Methods: []grpc.MethodDesc{
  1116  		{
  1117  			MethodName: "Reserve",
  1118  			Handler:    _DevicePlugin_Reserve_Handler,
  1119  		},
  1120  	},
  1121  	Streams: []grpc.StreamDesc{
  1122  		{
  1123  			StreamName:    "Fingerprint",
  1124  			Handler:       _DevicePlugin_Fingerprint_Handler,
  1125  			ServerStreams: true,
  1126  		},
  1127  		{
  1128  			StreamName:    "Stats",
  1129  			Handler:       _DevicePlugin_Stats_Handler,
  1130  			ServerStreams: true,
  1131  		},
  1132  	},
  1133  	Metadata: "github.com/hashicorp/nomad/plugins/device/proto/device.proto",
  1134  }
  1135  
  1136  func init() {
  1137  	proto.RegisterFile("github.com/hashicorp/nomad/plugins/device/proto/device.proto", fileDescriptor_device_ebefe60214c28313)
  1138  }
  1139  
  1140  var fileDescriptor_device_ebefe60214c28313 = []byte{
  1141  	// 1086 bytes of a gzipped FileDescriptorProto
  1142  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xeb, 0x8e, 0xdb, 0x44,
  1143  	0x14, 0x26, 0xf7, 0xe4, 0x64, 0x2f, 0xdd, 0xd9, 0x05, 0x85, 0x40, 0xe9, 0xca, 0x12, 0x52, 0x59,
  1144  	0xa8, 0x53, 0xa5, 0x08, 0xaa, 0x42, 0xa1, 0xed, 0xa6, 0xd0, 0x95, 0x60, 0xb7, 0x72, 0xab, 0x4a,
  1145  	0x2d, 0x12, 0xd6, 0xc4, 0x9e, 0xc6, 0xd3, 0xda, 0x33, 0xc6, 0x33, 0x4e, 0x15, 0xde, 0x80, 0x37,
  1146  	0xe1, 0x4f, 0x5f, 0x80, 0x77, 0x80, 0x87, 0xe0, 0x49, 0xd0, 0x5c, 0x9c, 0x38, 0xdb, 0xa5, 0x49,
  1147  	0xe0, 0x97, 0xe7, 0x5c, 0xbe, 0x6f, 0x8e, 0xcf, 0x39, 0x73, 0x66, 0xe0, 0xeb, 0x09, 0x95, 0x51,
  1148  	0x3e, 0x76, 0x03, 0x9e, 0x0c, 0x22, 0x2c, 0x22, 0x1a, 0xf0, 0x2c, 0x1d, 0x30, 0x9e, 0xe0, 0x70,
  1149  	0x90, 0xc6, 0xf9, 0x84, 0x32, 0x31, 0x08, 0xc9, 0x94, 0x06, 0x64, 0x90, 0x66, 0x5c, 0x72, 0x2b,
  1150  	0xb8, 0x5a, 0x40, 0x1f, 0xcd, 0x21, 0xae, 0x86, 0xb8, 0x16, 0xe2, 0x1a, 0xaf, 0xfe, 0x95, 0x09,
  1151  	0xe7, 0x93, 0xd8, 0x42, 0xc7, 0xf9, 0xf3, 0x81, 0xa4, 0x09, 0x11, 0x12, 0x27, 0xa9, 0x21, 0x70,
  1152  	0x0e, 0x00, 0x7d, 0x47, 0xd9, 0x84, 0x64, 0x69, 0x46, 0x99, 0xf4, 0xc8, 0x2f, 0x39, 0x11, 0xd2,
  1153  	0x21, 0xb0, 0xbf, 0xa4, 0x15, 0x29, 0x67, 0x82, 0xa0, 0x53, 0xd8, 0x32, 0xbc, 0xfe, 0x24, 0xe3,
  1154  	0x79, 0xda, 0xab, 0x1c, 0xd6, 0xae, 0x76, 0x87, 0x9f, 0xba, 0x6f, 0x0f, 0xc2, 0x1d, 0xe9, 0xcf,
  1155  	0xf7, 0x0a, 0xe2, 0x75, 0xc3, 0x85, 0xe0, 0xfc, 0x59, 0x85, 0x6e, 0xc9, 0x88, 0xde, 0x83, 0xe6,
  1156  	0x94, 0xb0, 0x90, 0x67, 0xbd, 0xca, 0x61, 0xe5, 0x6a, 0xc7, 0xb3, 0x12, 0xba, 0x02, 0x16, 0xe6,
  1157  	0xcb, 0x59, 0x4a, 0x7a, 0x55, 0x6d, 0x04, 0xa3, 0x7a, 0x3c, 0x4b, 0x49, 0xc9, 0x81, 0xe1, 0x84,
  1158  	0xf4, 0x6a, 0x65, 0x87, 0x53, 0x9c, 0x10, 0xf4, 0x00, 0x5a, 0x46, 0x12, 0xbd, 0xba, 0x0e, 0xda,
  1159  	0x5d, 0x1d, 0xb4, 0x24, 0x81, 0x24, 0xa1, 0x89, 0xcf, 0x2b, 0xe0, 0xe8, 0x27, 0x00, 0x2c, 0x65,
  1160  	0x46, 0xc7, 0xb9, 0x24, 0xa2, 0xd7, 0xd0, 0x64, 0x5f, 0x6d, 0x90, 0x01, 0xf7, 0xee, 0x1c, 0x7d,
  1161  	0x9f, 0xc9, 0x6c, 0xe6, 0x95, 0xe8, 0xfa, 0xb7, 0x61, 0xf7, 0x9c, 0x19, 0x5d, 0x82, 0xda, 0x4b,
  1162  	0x32, 0xb3, 0x09, 0x51, 0x4b, 0x74, 0x00, 0x8d, 0x29, 0x8e, 0xf3, 0x22, 0x0f, 0x46, 0xb8, 0x55,
  1163  	0xbd, 0x59, 0x71, 0xfe, 0xa8, 0xc0, 0xce, 0x72, 0xdc, 0x68, 0x07, 0xaa, 0x27, 0x23, 0x8b, 0xae,
  1164  	0x9e, 0x8c, 0x50, 0x0f, 0x5a, 0x11, 0xc1, 0xb1, 0x8c, 0x66, 0x1a, 0xde, 0xf6, 0x0a, 0x11, 0x5d,
  1165  	0x03, 0x64, 0x96, 0x7e, 0x48, 0x44, 0x90, 0xd1, 0x54, 0x52, 0xce, 0x6c, 0x2a, 0xf7, 0x8c, 0x65,
  1166  	0xb4, 0x30, 0xa0, 0x33, 0xe8, 0x46, 0xaf, 0xfc, 0x98, 0x07, 0x38, 0xa6, 0x72, 0xd6, 0xab, 0x1f,
  1167  	0x56, 0xd6, 0xcb, 0xaa, 0xfa, 0xfc, 0x60, 0x51, 0x1e, 0x44, 0xaf, 0x8a, 0xb5, 0xe3, 0xaa, 0xd8,
  1168  	0xcb, 0x56, 0xf4, 0x21, 0x40, 0x1a, 0x50, 0x7f, 0x9c, 0x0b, 0x9f, 0x86, 0xf6, 0x1f, 0xda, 0x69,
  1169  	0x40, 0xef, 0xe5, 0xe2, 0x24, 0x74, 0x06, 0xb0, 0xe3, 0x11, 0x41, 0xb2, 0x29, 0xb1, 0x5d, 0x8b,
  1170  	0x2e, 0x83, 0x2d, 0xb9, 0x4f, 0x43, 0xa1, 0x9b, 0xb3, 0xe3, 0x75, 0x8c, 0xe6, 0x24, 0x14, 0x4e,
  1171  	0x0c, 0xbb, 0x73, 0x80, 0x6d, 0xe8, 0xa7, 0xb0, 0x1d, 0x70, 0x26, 0x31, 0x65, 0x24, 0xf3, 0x33,
  1172  	0x22, 0xf4, 0x26, 0xdd, 0xe1, 0xe7, 0xab, 0x7e, 0xe3, 0xb8, 0x00, 0x19, 0x42, 0xac, 0x32, 0xe2,
  1173  	0x6d, 0x05, 0x25, 0xad, 0xf3, 0x7b, 0x15, 0x0e, 0x2e, 0x72, 0x43, 0x1e, 0xd4, 0x09, 0x9b, 0x0a,
  1174  	0x7b, 0x78, 0xbe, 0xf9, 0x2f, 0x5b, 0xb9, 0xf7, 0xd9, 0xd4, 0x76, 0x8f, 0xe6, 0x42, 0xb7, 0xa1,
  1175  	0x99, 0xf0, 0x9c, 0x49, 0xd1, 0xab, 0x6a, 0xd6, 0x8f, 0x57, 0xb1, 0xfe, 0xa8, 0xbc, 0x3d, 0x0b,
  1176  	0x42, 0xa3, 0xc5, 0xe9, 0xa8, 0x69, 0xfc, 0xd1, 0x7a, 0x75, 0x7c, 0x94, 0x92, 0x60, 0x7e, 0x32,
  1177  	0xfa, 0x5f, 0x42, 0x67, 0x1e, 0xd7, 0x46, 0x6d, 0xfb, 0x33, 0x34, 0x74, 0x3c, 0xe8, 0x03, 0xe8,
  1178  	0x48, 0x2c, 0x5e, 0xfa, 0x29, 0x96, 0x51, 0x51, 0x6f, 0xa5, 0x78, 0x88, 0x65, 0xa4, 0x8c, 0x11,
  1179  	0x17, 0xd2, 0x18, 0x0d, 0x47, 0x5b, 0x29, 0x0a, 0x63, 0x46, 0x70, 0xe8, 0x73, 0x16, 0xcf, 0x74,
  1180  	0xcf, 0xb6, 0xbd, 0xb6, 0x52, 0x9c, 0xb1, 0x78, 0xe6, 0x44, 0x00, 0x8b, 0x78, 0xff, 0xc7, 0x26,
  1181  	0x87, 0xd0, 0x4d, 0x49, 0x96, 0x50, 0x21, 0x28, 0x67, 0xc2, 0x1e, 0x8d, 0xb2, 0xca, 0xd9, 0x81,
  1182  	0xad, 0x47, 0x12, 0x4b, 0x51, 0xcc, 0xd1, 0xa7, 0xb0, 0x6d, 0x65, 0xdb, 0x70, 0x0f, 0xa0, 0xa9,
  1183  	0x47, 0x67, 0x51, 0xfe, 0xeb, 0x1b, 0x4c, 0x0e, 0xc3, 0x64, 0xf1, 0xce, 0xeb, 0x2a, 0x5c, 0x3a,
  1184  	0x6f, 0xfc, 0xd7, 0x01, 0x8a, 0xa0, 0x5e, 0x9a, 0x9c, 0x7a, 0xad, 0x74, 0xa5, 0x61, 0xa9, 0xd7,
  1185  	0xe8, 0x05, 0xec, 0x50, 0x26, 0x24, 0x66, 0x01, 0xf1, 0x85, 0x62, 0xb4, 0xd3, 0xf2, 0x78, 0xd3,
  1186  	0x30, 0xdd, 0x13, 0x4b, 0xa3, 0x25, 0xd3, 0xaa, 0xdb, 0xb4, 0xac, 0xeb, 0x27, 0x80, 0xde, 0x74,
  1187  	0xba, 0xa0, 0x6f, 0xee, 0x96, 0xfb, 0x66, 0xed, 0xdb, 0xc6, 0x24, 0xab, 0xd4, 0x64, 0x7f, 0x55,
  1188  	0x8a, 0xbb, 0xc6, 0xa4, 0xea, 0x18, 0x5a, 0x22, 0x4f, 0x12, 0x9c, 0xcd, 0xec, 0xa1, 0xff, 0x64,
  1189  	0x15, 0xb1, 0xc2, 0x3d, 0x51, 0x7c, 0x5e, 0x81, 0x44, 0x77, 0xa0, 0x61, 0xd2, 0x64, 0x62, 0x3b,
  1190  	0x5a, 0x87, 0xe2, 0x6c, 0xfc, 0x82, 0x04, 0xd2, 0x33, 0x40, 0x74, 0x13, 0x3a, 0xf3, 0x2b, 0x59,
  1191  	0x97, 0xa2, 0x3b, 0xec, 0xbb, 0xe6, 0xd2, 0x76, 0x8b, 0x4b, 0xdb, 0x7d, 0x5c, 0x78, 0x78, 0x0b,
  1192  	0x67, 0xe7, 0xb7, 0x1a, 0xc0, 0x82, 0x0f, 0x9d, 0x42, 0x93, 0x11, 0x21, 0x49, 0x68, 0x3b, 0xeb,
  1193  	0x8b, 0xf5, 0x63, 0x71, 0x4f, 0x35, 0xd0, 0x54, 0xc9, 0xb2, 0xa0, 0x67, 0x4b, 0xf7, 0x9c, 0x19,
  1194  	0x2b, 0xb7, 0x36, 0xe0, 0x7c, 0xdb, 0x35, 0x47, 0xa0, 0x5b, 0xda, 0xf2, 0x82, 0x9a, 0xdf, 0x59,
  1195  	0xae, 0xf9, 0x46, 0x79, 0x9d, 0x97, 0xbc, 0x1f, 0xad, 0x73, 0x9b, 0x7e, 0xbb, 0xbc, 0xd5, 0x06,
  1196  	0x5d, 0x50, 0x6a, 0xae, 0xd7, 0x55, 0xe8, 0xcc, 0x0d, 0xc8, 0x85, 0xfd, 0xe7, 0x31, 0xc7, 0xd2,
  1197  	0x67, 0x79, 0x42, 0x32, 0x2c, 0x79, 0xe6, 0x4f, 0x71, 0xac, 0x37, 0xad, 0x78, 0x7b, 0xda, 0x74,
  1198  	0x5a, 0x58, 0x9e, 0xe0, 0x18, 0x0d, 0xe1, 0x5d, 0xe3, 0x1f, 0x12, 0xc6, 0x13, 0xca, 0xe6, 0x88,
  1199  	0xaa, 0x46, 0x18, 0xb2, 0xd1, 0xc2, 0xa6, 0x30, 0x47, 0xb0, 0x47, 0xd9, 0xf9, 0x1d, 0x54, 0xff,
  1200  	0xd4, 0xbc, 0x5d, 0xca, 0x96, 0xf9, 0x5d, 0xd8, 0x57, 0xbe, 0xe7, 0xd9, 0xeb, 0xda, 0x5b, 0xd1,
  1201  	0x9c, 0xe3, 0xbe, 0x0c, 0x20, 0x64, 0x46, 0xd9, 0x44, 0xbb, 0x35, 0x74, 0xae, 0x3a, 0x46, 0xa3,
  1202  	0xcc, 0xef, 0x43, 0x7b, 0xcc, 0x79, 0xac, 0x8d, 0x4d, 0xf3, 0x86, 0x50, 0xb2, 0x32, 0x21, 0xa8,
  1203  	0xe7, 0x8c, 0xca, 0x5e, 0xcb, 0xcc, 0x14, 0xb5, 0x56, 0x3a, 0xf5, 0xa0, 0xe8, 0xb5, 0x8d, 0x4e,
  1204  	0xad, 0x87, 0x7f, 0x57, 0x61, 0xcb, 0x1c, 0xc6, 0x87, 0x3a, 0xbb, 0xe8, 0x57, 0xe8, 0x96, 0x1e,
  1205  	0x9c, 0x68, 0xb8, 0xaa, 0x0a, 0x6f, 0xbe, 0x59, 0xfb, 0x37, 0x36, 0xc2, 0x98, 0x79, 0xec, 0xbc,
  1206  	0x73, 0xbd, 0x82, 0x62, 0x68, 0xd9, 0x77, 0x01, 0x5a, 0xf9, 0x7e, 0x59, 0x7e, 0x71, 0xf4, 0x07,
  1207  	0x6b, 0xfb, 0x17, 0xfb, 0xa1, 0x08, 0x1a, 0x66, 0x00, 0x7d, 0xb6, 0x4e, 0xa7, 0x15, 0x37, 0x49,
  1208  	0xff, 0xda, 0x9a, 0xde, 0x8b, 0xff, 0xba, 0xd7, 0x7a, 0xd6, 0x30, 0x13, 0xa4, 0xa9, 0x3f, 0x37,
  1209  	0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x5c, 0x8f, 0xd7, 0x6b, 0x0c, 0x00, 0x00,
  1210  }