/// Wait for the given task to be provisioned and attributed a private IP
/// TODO better error management
/// TODO fargate container lifecycle
Wait for the given task to be provisioned and attributed a private IP
TODO better error management
TODO fargate container lifecycle
Wait for the given task to be provisioned and attributed a private IP TODO better error management TODO fargate container lifecycle
async fn wait_for_provisioning(
        &self,
        task_arn: String,
        hcomb_cluster_name: String,
    ) -> Result<String> {
        loop {
            let input = DescribeTasksRequest {
                cluster: Some(hcomb_cluster_name.clone()),
                include: None,
                tasks: vec![task_arn.clone()],
            };
            let description = self
                .client
                .describe_tasks(input)
                .await
                .map_err(|e| BuzzError::CloudClient(format!("{}", e)))?
                .tasks
                .unwrap();
            let attachment_props = description[0].attachments.as_ref().unwrap()[0]
                .details
                .as_ref()
                .unwrap();
            for prop in attachment_props {
                if let Some(ref key) = prop.name {
                    if key == "privateIPv4Address" && prop.value.as_ref().is_some() {
                        return Ok(prop.value.as_ref().unwrap().clone());
                    }
                }
            }
            tokio::time::sleep(Duration::from_millis(200)).await;
        }
    }
async fn wait_for_provisioning ( & self , task_arn : String , hcomb_cluster_name : String , ) -> Result < String > { loop { let input = DescribeTasksRequest { cluster : Some ( hcomb_cluster_name . clone ( ) ) , include : None , tasks : vec ! [ task_arn clone ( ) ] , } ; let description = self . client . describe_tasks ( input ) . await . map_err ( | e | BuzzError :: CloudClient ( format ! ( " " e ) ) ) ? . tasks . unwrap ( ) ; let attachment_props = description [ 0 ] . attachments . as_ref ( ) . unwrap ( ) [ 0 ] . details . as_ref ( ) . unwrap ( ) ; for prop in attachment_props { if let Some ( ref key ) = prop . name { if key == " " && prop . value . as_ref ( ) . is_some ( ) { return Ok ( prop . value . as_ref ( ) . unwrap ( ) . clone ( ) ) ; } } } tokio :: time :: sleep ( Duration :: from_millis ( 200 ) ) . await ; } }
Wait for the given task to be provisioned and attributed a private IP
TODO better error management
TODO fargate container lifecycle
Wait for the given task to be provisioned and attributed a private IP TODO better error management TODO fargate container lifecycle
&self
task_arn
String
hcomb_cluster_name
String