|
1 | 1 | use async_trait::async_trait; |
2 | 2 | use env_defs::{ |
3 | 3 | CloudHandlerError, CloudProvider, Dependent, DeploymentResp, EventData, |
4 | | - GenericFunctionResponse, InfraChangeRecord, ModuleResp, PolicyResp, ProjectData, |
| 4 | + GenericFunctionResponse, InfraChangeRecord, JobStatus, ModuleResp, PolicyResp, ProjectData, |
5 | 5 | }; |
6 | 6 | use env_utils::{ |
7 | 7 | _get_change_records, _get_dependents, _get_deployment, _get_deployment_and_dependents, |
@@ -147,6 +147,22 @@ impl CloudProvider for AwsCloudProvider { |
147 | 147 | ) -> Result<Option<ModuleResp>, anyhow::Error> { |
148 | 148 | _get_module_optional(self, crate::get_latest_stack_version_query(stack, track)).await |
149 | 149 | } |
| 150 | + async fn get_job_status(&self, job_id: &str) -> Result<Option<JobStatus>, anyhow::Error> { |
| 151 | + match crate::run_function( |
| 152 | + &self.function_endpoint, |
| 153 | + &crate::get_job_status_query(job_id), |
| 154 | + &self.project_id, |
| 155 | + &self.region, |
| 156 | + ) |
| 157 | + .await |
| 158 | + { |
| 159 | + Ok(response) => { |
| 160 | + let job_status: JobStatus = serde_json::from_value(response.payload)?; |
| 161 | + Ok(Some(job_status)) |
| 162 | + } |
| 163 | + Err(e) => Err(e.into()), |
| 164 | + } |
| 165 | + } |
150 | 166 | async fn generate_presigned_url( |
151 | 167 | &self, |
152 | 168 | key: &str, |
|
0 commit comments