pub trait Agent:
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_instance<'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<AppInstance, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn terminate_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_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_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AppInstance, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_instances<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppInstance>, AutoscalerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_instance_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_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 an agent that manages app instance operations on nodes
Required Methods§
Sourcefn id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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 agent
Sourcefn 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_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 agent
Sourcefn 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 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
Sourcefn create_instance<'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<AppInstance, AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_instance<'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<AppInstance, AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new app instance on a specific node
Sourcefn terminate_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn terminate_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Terminate an app instance
Sourcefn get_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AppInstance, AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_instance<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AppInstance, AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get information about a specific app instance
Sourcefn get_instances<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppInstance>, AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_instances<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppInstance>, AutoscalerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all app instances managed by this agent
Sourcefn get_instance_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_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,
fn get_instance_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_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 app instance