(url: Option<String>)
| 41 | } |
| 42 | |
| 43 | pub fn load_or_default(url: Option<String>) -> Result<Self> { |
| 44 | let api = match url { |
| 45 | Some(url) => Self::new(Some(url), None), |
| 46 | None => { |
| 47 | let local_config: SysConfig = |
| 48 | deserialize_json_file(format!("{HOST_SHARED_DIR}/{SYS_CONFIG}"))?; |
| 49 | Self::new(local_config.host_api_url, local_config.pccs_url) |
| 50 | } |
| 51 | }; |
| 52 | Ok(api) |
| 53 | } |
| 54 | |
| 55 | pub async fn notify(&self, event: &str, payload: &str) -> Result<()> { |
| 56 | match Platform::detect_or_dstack() { |
nothing calls this directly
no test coverage detected