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