625 lines
24 KiB
Go
625 lines
24 KiB
Go
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|||
|
// source: hashicorp/nomad/plugins/device/device.proto
|
|||
|
|
|||
|
package hashicorp_nomad_plugins_device
|
|||
|
|
|||
|
import proto "github.com/golang/protobuf/proto"
|
|||
|
import fmt "fmt"
|
|||
|
import math "math"
|
|||
|
import empty "github.com/golang/protobuf/ptypes/empty"
|
|||
|
|
|||
|
import (
|
|||
|
context "golang.org/x/net/context"
|
|||
|
grpc "google.golang.org/grpc"
|
|||
|
)
|
|||
|
|
|||
|
// Reference imports to suppress errors if they are not otherwise used.
|
|||
|
var _ = proto.Marshal
|
|||
|
var _ = fmt.Errorf
|
|||
|
var _ = math.Inf
|
|||
|
|
|||
|
// This is a compile-time assertion to ensure that this generated file
|
|||
|
// is compatible with the proto package it is being compiled against.
|
|||
|
// A compilation error at this line likely means your copy of the
|
|||
|
// proto package needs to be updated.
|
|||
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|||
|
|
|||
|
// DetectedDevices is the set of devices that the device plugin has
|
|||
|
// detected and is exposing
|
|||
|
type DetectedDevices struct {
|
|||
|
// device_name is the name of the device. It should be scoped by
|
|||
|
// vendor (“nvidia/gpu”, “intel/gpu”, “amd/gpu”, …)
|
|||
|
DeviceName string `protobuf:"bytes,1,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"`
|
|||
|
// devices is the set of devices detected by the plugin.
|
|||
|
Devices []*DetectedDevice `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"`
|
|||
|
// node_attributes allows adding node attributes to be used for
|
|||
|
// constraints or affinities.
|
|||
|
NodeAttributes map[string]string `protobuf:"bytes,3,rep,name=node_attributes,json=nodeAttributes,proto3" json:"node_attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|||
|
XXX_unrecognized []byte `json:"-"`
|
|||
|
XXX_sizecache int32 `json:"-"`
|
|||
|
}
|
|||
|
|
|||
|
func (m *DetectedDevices) Reset() { *m = DetectedDevices{} }
|
|||
|
func (m *DetectedDevices) String() string { return proto.CompactTextString(m) }
|
|||
|
func (*DetectedDevices) ProtoMessage() {}
|
|||
|
func (*DetectedDevices) Descriptor() ([]byte, []int) {
|
|||
|
return fileDescriptor_device_065b29983b00b222, []int{0}
|
|||
|
}
|
|||
|
func (m *DetectedDevices) XXX_Unmarshal(b []byte) error {
|
|||
|
return xxx_messageInfo_DetectedDevices.Unmarshal(m, b)
|
|||
|
}
|
|||
|
func (m *DetectedDevices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||
|
return xxx_messageInfo_DetectedDevices.Marshal(b, m, deterministic)
|
|||
|
}
|
|||
|
func (dst *DetectedDevices) XXX_Merge(src proto.Message) {
|
|||
|
xxx_messageInfo_DetectedDevices.Merge(dst, src)
|
|||
|
}
|
|||
|
func (m *DetectedDevices) XXX_Size() int {
|
|||
|
return xxx_messageInfo_DetectedDevices.Size(m)
|
|||
|
}
|
|||
|
func (m *DetectedDevices) XXX_DiscardUnknown() {
|
|||
|
xxx_messageInfo_DetectedDevices.DiscardUnknown(m)
|
|||
|
}
|
|||
|
|
|||
|
var xxx_messageInfo_DetectedDevices proto.InternalMessageInfo
|
|||
|
|
|||
|
func (m *DetectedDevices) GetDeviceName() string {
|
|||
|
if m != nil {
|
|||
|
return m.DeviceName
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func (m *DetectedDevices) GetDevices() []*DetectedDevice {
|
|||
|
if m != nil {
|
|||
|
return m.Devices
|
|||
|
}
|
|||
|
return nil
|
|||
|
}
|
|||
|
|
|||
|
func (m *DetectedDevices) GetNodeAttributes() map[string]string {
|
|||
|
if m != nil {
|
|||
|
return m.NodeAttributes
|
|||
|
}
|
|||
|
return nil
|
|||
|
}
|
|||
|
|
|||
|
// DetectedDevice is a single detected device.
|
|||
|
type DetectedDevice struct {
|
|||
|
// ID is the ID of the device. This ID is used during
|
|||
|
// allocation.
|
|||
|
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
|||
|
// Health of the device.
|
|||
|
Healthy bool `protobuf:"varint,2,opt,name=healthy,proto3" json:"healthy,omitempty"`
|
|||
|
// health_description allows the device plugin to optionally
|
|||
|
// annotate the health field with a human readable reason.
|
|||
|
HealthDescription string `protobuf:"bytes,3,opt,name=health_description,json=healthDescription,proto3" json:"health_description,omitempty"`
|
|||
|
// pci_bus_id is the PCI bus ID for the device. If reported, it
|
|||
|
// allows Nomad to make NUMA aware optimizations.
|
|||
|
PciBusId string `protobuf:"bytes,4,opt,name=pci_bus_id,json=pciBusId,proto3" json:"pci_bus_id,omitempty"`
|
|||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|||
|
XXX_unrecognized []byte `json:"-"`
|
|||
|
XXX_sizecache int32 `json:"-"`
|
|||
|
}
|
|||
|
|
|||
|
func (m *DetectedDevice) Reset() { *m = DetectedDevice{} }
|
|||
|
func (m *DetectedDevice) String() string { return proto.CompactTextString(m) }
|
|||
|
func (*DetectedDevice) ProtoMessage() {}
|
|||
|
func (*DetectedDevice) Descriptor() ([]byte, []int) {
|
|||
|
return fileDescriptor_device_065b29983b00b222, []int{1}
|
|||
|
}
|
|||
|
func (m *DetectedDevice) XXX_Unmarshal(b []byte) error {
|
|||
|
return xxx_messageInfo_DetectedDevice.Unmarshal(m, b)
|
|||
|
}
|
|||
|
func (m *DetectedDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||
|
return xxx_messageInfo_DetectedDevice.Marshal(b, m, deterministic)
|
|||
|
}
|
|||
|
func (dst *DetectedDevice) XXX_Merge(src proto.Message) {
|
|||
|
xxx_messageInfo_DetectedDevice.Merge(dst, src)
|
|||
|
}
|
|||
|
func (m *DetectedDevice) XXX_Size() int {
|
|||
|
return xxx_messageInfo_DetectedDevice.Size(m)
|
|||
|
}
|
|||
|
func (m *DetectedDevice) XXX_DiscardUnknown() {
|
|||
|
xxx_messageInfo_DetectedDevice.DiscardUnknown(m)
|
|||
|
}
|
|||
|
|
|||
|
var xxx_messageInfo_DetectedDevice proto.InternalMessageInfo
|
|||
|
|
|||
|
func (m *DetectedDevice) GetID() string {
|
|||
|
if m != nil {
|
|||
|
return m.ID
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func (m *DetectedDevice) GetHealthy() bool {
|
|||
|
if m != nil {
|
|||
|
return m.Healthy
|
|||
|
}
|
|||
|
return false
|
|||
|
}
|
|||
|
|
|||
|
func (m *DetectedDevice) GetHealthDescription() string {
|
|||
|
if m != nil {
|
|||
|
return m.HealthDescription
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func (m *DetectedDevice) GetPciBusId() string {
|
|||
|
if m != nil {
|
|||
|
return m.PciBusId
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
// AllocateRequest is used to ask the device driver for information on
|
|||
|
// how to allocate the requested devices.
|
|||
|
type AllocateRequest struct {
|
|||
|
// device_ids are the requested devices.
|
|||
|
DeviceIds []string `protobuf:"bytes,1,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"`
|
|||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|||
|
XXX_unrecognized []byte `json:"-"`
|
|||
|
XXX_sizecache int32 `json:"-"`
|
|||
|
}
|
|||
|
|
|||
|
func (m *AllocateRequest) Reset() { *m = AllocateRequest{} }
|
|||
|
func (m *AllocateRequest) String() string { return proto.CompactTextString(m) }
|
|||
|
func (*AllocateRequest) ProtoMessage() {}
|
|||
|
func (*AllocateRequest) Descriptor() ([]byte, []int) {
|
|||
|
return fileDescriptor_device_065b29983b00b222, []int{2}
|
|||
|
}
|
|||
|
func (m *AllocateRequest) XXX_Unmarshal(b []byte) error {
|
|||
|
return xxx_messageInfo_AllocateRequest.Unmarshal(m, b)
|
|||
|
}
|
|||
|
func (m *AllocateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||
|
return xxx_messageInfo_AllocateRequest.Marshal(b, m, deterministic)
|
|||
|
}
|
|||
|
func (dst *AllocateRequest) XXX_Merge(src proto.Message) {
|
|||
|
xxx_messageInfo_AllocateRequest.Merge(dst, src)
|
|||
|
}
|
|||
|
func (m *AllocateRequest) XXX_Size() int {
|
|||
|
return xxx_messageInfo_AllocateRequest.Size(m)
|
|||
|
}
|
|||
|
func (m *AllocateRequest) XXX_DiscardUnknown() {
|
|||
|
xxx_messageInfo_AllocateRequest.DiscardUnknown(m)
|
|||
|
}
|
|||
|
|
|||
|
var xxx_messageInfo_AllocateRequest proto.InternalMessageInfo
|
|||
|
|
|||
|
func (m *AllocateRequest) GetDeviceIds() []string {
|
|||
|
if m != nil {
|
|||
|
return m.DeviceIds
|
|||
|
}
|
|||
|
return nil
|
|||
|
}
|
|||
|
|
|||
|
// AllocateResponse informs Nomad how to expose the requested devices
|
|||
|
// to the the task.
|
|||
|
type AllocateResponse struct {
|
|||
|
// container_alloc contains information on how to mount the device
|
|||
|
// into a task isolated using container technologies (where the
|
|||
|
// host is shared)
|
|||
|
ContainerAlloc *ContainerAllocation `protobuf:"bytes,1,opt,name=container_alloc,json=containerAlloc,proto3" json:"container_alloc,omitempty"`
|
|||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|||
|
XXX_unrecognized []byte `json:"-"`
|
|||
|
XXX_sizecache int32 `json:"-"`
|
|||
|
}
|
|||
|
|
|||
|
func (m *AllocateResponse) Reset() { *m = AllocateResponse{} }
|
|||
|
func (m *AllocateResponse) String() string { return proto.CompactTextString(m) }
|
|||
|
func (*AllocateResponse) ProtoMessage() {}
|
|||
|
func (*AllocateResponse) Descriptor() ([]byte, []int) {
|
|||
|
return fileDescriptor_device_065b29983b00b222, []int{3}
|
|||
|
}
|
|||
|
func (m *AllocateResponse) XXX_Unmarshal(b []byte) error {
|
|||
|
return xxx_messageInfo_AllocateResponse.Unmarshal(m, b)
|
|||
|
}
|
|||
|
func (m *AllocateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||
|
return xxx_messageInfo_AllocateResponse.Marshal(b, m, deterministic)
|
|||
|
}
|
|||
|
func (dst *AllocateResponse) XXX_Merge(src proto.Message) {
|
|||
|
xxx_messageInfo_AllocateResponse.Merge(dst, src)
|
|||
|
}
|
|||
|
func (m *AllocateResponse) XXX_Size() int {
|
|||
|
return xxx_messageInfo_AllocateResponse.Size(m)
|
|||
|
}
|
|||
|
func (m *AllocateResponse) XXX_DiscardUnknown() {
|
|||
|
xxx_messageInfo_AllocateResponse.DiscardUnknown(m)
|
|||
|
}
|
|||
|
|
|||
|
var xxx_messageInfo_AllocateResponse proto.InternalMessageInfo
|
|||
|
|
|||
|
func (m *AllocateResponse) GetContainerAlloc() *ContainerAllocation {
|
|||
|
if m != nil {
|
|||
|
return m.ContainerAlloc
|
|||
|
}
|
|||
|
return nil
|
|||
|
}
|
|||
|
|
|||
|
// ContainerAllocation returns how to mount the device into a
|
|||
|
// container that shares the host OS.
|
|||
|
type ContainerAllocation struct {
|
|||
|
// List of environment variable to be set
|
|||
|
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"`
|
|||
|
// Mounts for the task.
|
|||
|
Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"`
|
|||
|
// Devices for the task.
|
|||
|
Devices []*DeviceSpec `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"`
|
|||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|||
|
XXX_unrecognized []byte `json:"-"`
|
|||
|
XXX_sizecache int32 `json:"-"`
|
|||
|
}
|
|||
|
|
|||
|
func (m *ContainerAllocation) Reset() { *m = ContainerAllocation{} }
|
|||
|
func (m *ContainerAllocation) String() string { return proto.CompactTextString(m) }
|
|||
|
func (*ContainerAllocation) ProtoMessage() {}
|
|||
|
func (*ContainerAllocation) Descriptor() ([]byte, []int) {
|
|||
|
return fileDescriptor_device_065b29983b00b222, []int{4}
|
|||
|
}
|
|||
|
func (m *ContainerAllocation) XXX_Unmarshal(b []byte) error {
|
|||
|
return xxx_messageInfo_ContainerAllocation.Unmarshal(m, b)
|
|||
|
}
|
|||
|
func (m *ContainerAllocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||
|
return xxx_messageInfo_ContainerAllocation.Marshal(b, m, deterministic)
|
|||
|
}
|
|||
|
func (dst *ContainerAllocation) XXX_Merge(src proto.Message) {
|
|||
|
xxx_messageInfo_ContainerAllocation.Merge(dst, src)
|
|||
|
}
|
|||
|
func (m *ContainerAllocation) XXX_Size() int {
|
|||
|
return xxx_messageInfo_ContainerAllocation.Size(m)
|
|||
|
}
|
|||
|
func (m *ContainerAllocation) XXX_DiscardUnknown() {
|
|||
|
xxx_messageInfo_ContainerAllocation.DiscardUnknown(m)
|
|||
|
}
|
|||
|
|
|||
|
var xxx_messageInfo_ContainerAllocation proto.InternalMessageInfo
|
|||
|
|
|||
|
func (m *ContainerAllocation) GetEnvs() map[string]string {
|
|||
|
if m != nil {
|
|||
|
return m.Envs
|
|||
|
}
|
|||
|
return nil
|
|||
|
}
|
|||
|
|
|||
|
func (m *ContainerAllocation) GetMounts() []*Mount {
|
|||
|
if m != nil {
|
|||
|
return m.Mounts
|
|||
|
}
|
|||
|
return nil
|
|||
|
}
|
|||
|
|
|||
|
func (m *ContainerAllocation) GetDevices() []*DeviceSpec {
|
|||
|
if m != nil {
|
|||
|
return m.Devices
|
|||
|
}
|
|||
|
return nil
|
|||
|
}
|
|||
|
|
|||
|
// Mount specifies a host volume to mount into a task.
|
|||
|
// where device library or tools are installed on host and task
|
|||
|
type Mount struct {
|
|||
|
// Path of the mount within the task.
|
|||
|
TaskPath string `protobuf:"bytes,1,opt,name=task_path,json=taskPath,proto3" json:"task_path,omitempty"`
|
|||
|
// Path of the mount on the host.
|
|||
|
HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
|
|||
|
// If set, the mount is read-only.
|
|||
|
ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
|
|||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|||
|
XXX_unrecognized []byte `json:"-"`
|
|||
|
XXX_sizecache int32 `json:"-"`
|
|||
|
}
|
|||
|
|
|||
|
func (m *Mount) Reset() { *m = Mount{} }
|
|||
|
func (m *Mount) String() string { return proto.CompactTextString(m) }
|
|||
|
func (*Mount) ProtoMessage() {}
|
|||
|
func (*Mount) Descriptor() ([]byte, []int) {
|
|||
|
return fileDescriptor_device_065b29983b00b222, []int{5}
|
|||
|
}
|
|||
|
func (m *Mount) XXX_Unmarshal(b []byte) error {
|
|||
|
return xxx_messageInfo_Mount.Unmarshal(m, b)
|
|||
|
}
|
|||
|
func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||
|
return xxx_messageInfo_Mount.Marshal(b, m, deterministic)
|
|||
|
}
|
|||
|
func (dst *Mount) XXX_Merge(src proto.Message) {
|
|||
|
xxx_messageInfo_Mount.Merge(dst, src)
|
|||
|
}
|
|||
|
func (m *Mount) XXX_Size() int {
|
|||
|
return xxx_messageInfo_Mount.Size(m)
|
|||
|
}
|
|||
|
func (m *Mount) XXX_DiscardUnknown() {
|
|||
|
xxx_messageInfo_Mount.DiscardUnknown(m)
|
|||
|
}
|
|||
|
|
|||
|
var xxx_messageInfo_Mount proto.InternalMessageInfo
|
|||
|
|
|||
|
func (m *Mount) GetTaskPath() string {
|
|||
|
if m != nil {
|
|||
|
return m.TaskPath
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func (m *Mount) GetHostPath() string {
|
|||
|
if m != nil {
|
|||
|
return m.HostPath
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func (m *Mount) GetReadOnly() bool {
|
|||
|
if m != nil {
|
|||
|
return m.ReadOnly
|
|||
|
}
|
|||
|
return false
|
|||
|
}
|
|||
|
|
|||
|
// DeviceSpec specifies a host device to mount into a task.
|
|||
|
type DeviceSpec struct {
|
|||
|
// Path of the device within the task.
|
|||
|
TaskPath string `protobuf:"bytes,1,opt,name=task_path,json=taskPath,proto3" json:"task_path,omitempty"`
|
|||
|
// Path of the device on the host.
|
|||
|
HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
|
|||
|
// Cgroups permissions of the device, candidates are one or more of
|
|||
|
// * r - allows task to read from the specified device.
|
|||
|
// * w - allows task to write to the specified device.
|
|||
|
// * m - allows task to create device files that do not yet exist
|
|||
|
Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"`
|
|||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|||
|
XXX_unrecognized []byte `json:"-"`
|
|||
|
XXX_sizecache int32 `json:"-"`
|
|||
|
}
|
|||
|
|
|||
|
func (m *DeviceSpec) Reset() { *m = DeviceSpec{} }
|
|||
|
func (m *DeviceSpec) String() string { return proto.CompactTextString(m) }
|
|||
|
func (*DeviceSpec) ProtoMessage() {}
|
|||
|
func (*DeviceSpec) Descriptor() ([]byte, []int) {
|
|||
|
return fileDescriptor_device_065b29983b00b222, []int{6}
|
|||
|
}
|
|||
|
func (m *DeviceSpec) XXX_Unmarshal(b []byte) error {
|
|||
|
return xxx_messageInfo_DeviceSpec.Unmarshal(m, b)
|
|||
|
}
|
|||
|
func (m *DeviceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|||
|
return xxx_messageInfo_DeviceSpec.Marshal(b, m, deterministic)
|
|||
|
}
|
|||
|
func (dst *DeviceSpec) XXX_Merge(src proto.Message) {
|
|||
|
xxx_messageInfo_DeviceSpec.Merge(dst, src)
|
|||
|
}
|
|||
|
func (m *DeviceSpec) XXX_Size() int {
|
|||
|
return xxx_messageInfo_DeviceSpec.Size(m)
|
|||
|
}
|
|||
|
func (m *DeviceSpec) XXX_DiscardUnknown() {
|
|||
|
xxx_messageInfo_DeviceSpec.DiscardUnknown(m)
|
|||
|
}
|
|||
|
|
|||
|
var xxx_messageInfo_DeviceSpec proto.InternalMessageInfo
|
|||
|
|
|||
|
func (m *DeviceSpec) GetTaskPath() string {
|
|||
|
if m != nil {
|
|||
|
return m.TaskPath
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func (m *DeviceSpec) GetHostPath() string {
|
|||
|
if m != nil {
|
|||
|
return m.HostPath
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func (m *DeviceSpec) GetPermissions() string {
|
|||
|
if m != nil {
|
|||
|
return m.Permissions
|
|||
|
}
|
|||
|
return ""
|
|||
|
}
|
|||
|
|
|||
|
func init() {
|
|||
|
proto.RegisterType((*DetectedDevices)(nil), "hashicorp.nomad.plugins.device.DetectedDevices")
|
|||
|
proto.RegisterMapType((map[string]string)(nil), "hashicorp.nomad.plugins.device.DetectedDevices.NodeAttributesEntry")
|
|||
|
proto.RegisterType((*DetectedDevice)(nil), "hashicorp.nomad.plugins.device.DetectedDevice")
|
|||
|
proto.RegisterType((*AllocateRequest)(nil), "hashicorp.nomad.plugins.device.AllocateRequest")
|
|||
|
proto.RegisterType((*AllocateResponse)(nil), "hashicorp.nomad.plugins.device.AllocateResponse")
|
|||
|
proto.RegisterType((*ContainerAllocation)(nil), "hashicorp.nomad.plugins.device.ContainerAllocation")
|
|||
|
proto.RegisterMapType((map[string]string)(nil), "hashicorp.nomad.plugins.device.ContainerAllocation.EnvsEntry")
|
|||
|
proto.RegisterType((*Mount)(nil), "hashicorp.nomad.plugins.device.Mount")
|
|||
|
proto.RegisterType((*DeviceSpec)(nil), "hashicorp.nomad.plugins.device.DeviceSpec")
|
|||
|
}
|
|||
|
|
|||
|
// Reference imports to suppress errors if they are not otherwise used.
|
|||
|
var _ context.Context
|
|||
|
var _ grpc.ClientConn
|
|||
|
|
|||
|
// This is a compile-time assertion to ensure that this generated file
|
|||
|
// is compatible with the grpc package it is being compiled against.
|
|||
|
const _ = grpc.SupportPackageIsVersion4
|
|||
|
|
|||
|
// DevicePluginClient is the client API for DevicePlugin service.
|
|||
|
//
|
|||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|||
|
type DevicePluginClient interface {
|
|||
|
// FingerprintDevices allows the device plugin to return a set of
|
|||
|
// detected devices and provide a mechanism to update the state of
|
|||
|
// the device.
|
|||
|
FingerprintDevices(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (DevicePlugin_FingerprintDevicesClient, error)
|
|||
|
// Allocate is called by the client before starting an allocation
|
|||
|
// that requires access to the plugin’s devices. The plugin can use
|
|||
|
// this to run any setup steps and provides the mounting details to
|
|||
|
// the Nomad client
|
|||
|
Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
|
|||
|
}
|
|||
|
|
|||
|
type devicePluginClient struct {
|
|||
|
cc *grpc.ClientConn
|
|||
|
}
|
|||
|
|
|||
|
func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient {
|
|||
|
return &devicePluginClient{cc}
|
|||
|
}
|
|||
|
|
|||
|
func (c *devicePluginClient) FingerprintDevices(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (DevicePlugin_FingerprintDevicesClient, error) {
|
|||
|
stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[0], "/hashicorp.nomad.plugins.device.DevicePlugin/FingerprintDevices", opts...)
|
|||
|
if err != nil {
|
|||
|
return nil, err
|
|||
|
}
|
|||
|
x := &devicePluginFingerprintDevicesClient{stream}
|
|||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|||
|
return nil, err
|
|||
|
}
|
|||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|||
|
return nil, err
|
|||
|
}
|
|||
|
return x, nil
|
|||
|
}
|
|||
|
|
|||
|
type DevicePlugin_FingerprintDevicesClient interface {
|
|||
|
Recv() (*DetectedDevices, error)
|
|||
|
grpc.ClientStream
|
|||
|
}
|
|||
|
|
|||
|
type devicePluginFingerprintDevicesClient struct {
|
|||
|
grpc.ClientStream
|
|||
|
}
|
|||
|
|
|||
|
func (x *devicePluginFingerprintDevicesClient) Recv() (*DetectedDevices, error) {
|
|||
|
m := new(DetectedDevices)
|
|||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|||
|
return nil, err
|
|||
|
}
|
|||
|
return m, nil
|
|||
|
}
|
|||
|
|
|||
|
func (c *devicePluginClient) Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error) {
|
|||
|
out := new(AllocateResponse)
|
|||
|
err := c.cc.Invoke(ctx, "/hashicorp.nomad.plugins.device.DevicePlugin/Allocate", in, out, opts...)
|
|||
|
if err != nil {
|
|||
|
return nil, err
|
|||
|
}
|
|||
|
return out, nil
|
|||
|
}
|
|||
|
|
|||
|
// DevicePluginServer is the server API for DevicePlugin service.
|
|||
|
type DevicePluginServer interface {
|
|||
|
// FingerprintDevices allows the device plugin to return a set of
|
|||
|
// detected devices and provide a mechanism to update the state of
|
|||
|
// the device.
|
|||
|
FingerprintDevices(*empty.Empty, DevicePlugin_FingerprintDevicesServer) error
|
|||
|
// Allocate is called by the client before starting an allocation
|
|||
|
// that requires access to the plugin’s devices. The plugin can use
|
|||
|
// this to run any setup steps and provides the mounting details to
|
|||
|
// the Nomad client
|
|||
|
Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
|
|||
|
}
|
|||
|
|
|||
|
func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer) {
|
|||
|
s.RegisterService(&_DevicePlugin_serviceDesc, srv)
|
|||
|
}
|
|||
|
|
|||
|
func _DevicePlugin_FingerprintDevices_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|||
|
m := new(empty.Empty)
|
|||
|
if err := stream.RecvMsg(m); err != nil {
|
|||
|
return err
|
|||
|
}
|
|||
|
return srv.(DevicePluginServer).FingerprintDevices(m, &devicePluginFingerprintDevicesServer{stream})
|
|||
|
}
|
|||
|
|
|||
|
type DevicePlugin_FingerprintDevicesServer interface {
|
|||
|
Send(*DetectedDevices) error
|
|||
|
grpc.ServerStream
|
|||
|
}
|
|||
|
|
|||
|
type devicePluginFingerprintDevicesServer struct {
|
|||
|
grpc.ServerStream
|
|||
|
}
|
|||
|
|
|||
|
func (x *devicePluginFingerprintDevicesServer) Send(m *DetectedDevices) error {
|
|||
|
return x.ServerStream.SendMsg(m)
|
|||
|
}
|
|||
|
|
|||
|
func _DevicePlugin_Allocate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|||
|
in := new(AllocateRequest)
|
|||
|
if err := dec(in); err != nil {
|
|||
|
return nil, err
|
|||
|
}
|
|||
|
if interceptor == nil {
|
|||
|
return srv.(DevicePluginServer).Allocate(ctx, in)
|
|||
|
}
|
|||
|
info := &grpc.UnaryServerInfo{
|
|||
|
Server: srv,
|
|||
|
FullMethod: "/hashicorp.nomad.plugins.device.DevicePlugin/Allocate",
|
|||
|
}
|
|||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|||
|
return srv.(DevicePluginServer).Allocate(ctx, req.(*AllocateRequest))
|
|||
|
}
|
|||
|
return interceptor(ctx, in, info, handler)
|
|||
|
}
|
|||
|
|
|||
|
var _DevicePlugin_serviceDesc = grpc.ServiceDesc{
|
|||
|
ServiceName: "hashicorp.nomad.plugins.device.DevicePlugin",
|
|||
|
HandlerType: (*DevicePluginServer)(nil),
|
|||
|
Methods: []grpc.MethodDesc{
|
|||
|
{
|
|||
|
MethodName: "Allocate",
|
|||
|
Handler: _DevicePlugin_Allocate_Handler,
|
|||
|
},
|
|||
|
},
|
|||
|
Streams: []grpc.StreamDesc{
|
|||
|
{
|
|||
|
StreamName: "FingerprintDevices",
|
|||
|
Handler: _DevicePlugin_FingerprintDevices_Handler,
|
|||
|
ServerStreams: true,
|
|||
|
},
|
|||
|
},
|
|||
|
Metadata: "hashicorp/nomad/plugins/device/device.proto",
|
|||
|
}
|
|||
|
|
|||
|
func init() {
|
|||
|
proto.RegisterFile("hashicorp/nomad/plugins/device/device.proto", fileDescriptor_device_065b29983b00b222)
|
|||
|
}
|
|||
|
|
|||
|
var fileDescriptor_device_065b29983b00b222 = []byte{
|
|||
|
// 608 bytes of a gzipped FileDescriptorProto
|
|||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x5f, 0x6f, 0xd3, 0x3e,
|
|||
|
0x14, 0x5d, 0xd3, 0xfd, 0x49, 0x6f, 0x7f, 0x6a, 0xf7, 0xf3, 0x10, 0x8a, 0x3a, 0xfe, 0x54, 0x91,
|
|||
|
0x90, 0x26, 0x10, 0xe9, 0xd4, 0x3d, 0x80, 0x90, 0xf6, 0x30, 0xd6, 0x21, 0xfa, 0xc0, 0x18, 0xe1,
|
|||
|
0x15, 0x11, 0xb9, 0xc9, 0xa5, 0xb1, 0x96, 0xda, 0x26, 0x76, 0x2a, 0xf5, 0x13, 0xf0, 0x4d, 0x78,
|
|||
|
0xe3, 0x4b, 0xf1, 0x49, 0x50, 0xec, 0xa4, 0xa5, 0x68, 0xa2, 0x0c, 0x9e, 0x12, 0x9f, 0x7b, 0xce,
|
|||
|
0xb9, 0x37, 0xf1, 0xb1, 0xe1, 0x49, 0x4a, 0x55, 0xca, 0x62, 0x91, 0xcb, 0x01, 0x17, 0x33, 0x9a,
|
|||
|
0x0c, 0x64, 0x56, 0x4c, 0x19, 0x57, 0x83, 0x04, 0xe7, 0x2c, 0xc6, 0xea, 0x11, 0xc8, 0x5c, 0x68,
|
|||
|
0x41, 0x1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