Trait DevicePlugin

Source
pub trait DevicePlugin:
    Send
    + Sync
    + 'static {
    type ListAndWatchStream: Stream<Item = Result<ListAndWatchResponse, Status>> + Send + 'static;

    // Required methods
    fn list_and_watch<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Empty>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAndWatchStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn allocate<'life0, 'async_trait>(
        &'life0 self,
        request: Request<AllocateRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<AllocateResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with DevicePluginServer.

Required Associated Types§

Source

type ListAndWatchStream: Stream<Item = Result<ListAndWatchResponse, Status>> + Send + 'static

Server streaming response type for the ListAndWatch method.

Required Methods§

Source

fn list_and_watch<'life0, 'async_trait>( &'life0 self, request: Request<Empty>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListAndWatchStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

ListAndWatch returns a stream of List of Devices Whenever a Device state changes or a Device disappears, ListAndWatch returns the new list

Source

fn allocate<'life0, 'async_trait>( &'life0 self, request: Request<AllocateRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AllocateResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Allocate is called during container creation so that the Device Plugin can run device specific operations and instruct Kubelet of the steps to make the Device available in the container

Implementors§