Trait Director

Source
pub trait Director:
    Send
    + Sync
    + Debug {
    // Required methods
    fn id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_nodes<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Node>, AutoscalerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_node<'life0, 'life1, 'async_trait>(
        &'life0 self,
        node_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Node, AutoscalerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_vm<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        node_id: &'life1 str,
        name: &'life2 str,
        cpu: u32,
        memory: u32,
        storage: u32,
    ) -> Pin<Box<dyn Future<Output = Result<VM, AutoscalerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn terminate_vm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vm_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), AutoscalerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_vm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vm_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<VM, AutoscalerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_vms<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<VM>, AutoscalerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_vm_metrics<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vm_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f32>, AutoscalerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Interface for a director that manages VM operations on nodes

Required Methods§

Source

fn id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the unique ID of this director

Source

fn get_nodes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Node>, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the nodes managed by this director

Source

fn get_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Node, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get information about a specific node

Source

fn create_vm<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, node_id: &'life1 str, name: &'life2 str, cpu: u32, memory: u32, storage: u32, ) -> Pin<Box<dyn Future<Output = Result<VM, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create a new VM on a specific node

Source

fn terminate_vm<'life0, 'life1, 'async_trait>( &'life0 self, vm_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Terminate a VM

Source

fn get_vm<'life0, 'life1, 'async_trait>( &'life0 self, vm_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<VM, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get information about a specific VM

Source

fn get_vms<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<VM>, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all VMs managed by this director

Source

fn get_vm_metrics<'life0, 'life1, 'async_trait>( &'life0 self, vm_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f32>, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get metrics for a specific VM

Implementors§