//! A command in a service's running container.
use super::*;
impl ApiClient {
pub async fn run_in_service(
&self,
service_environment_id: &str,
command: &str,
) -> Result<Answer<ConsolePage>> {
self.post_answer(
&format!("/api/infra/services/{service_environment_id}/console"),
&serde_json::json!({ "command": command }),
)
.await
}
/// Pulls the service's tag now and deploys a newer image if one is behind it.
pub async fn pull_image(&self, service_environment_id: &str) -> Result<Answer<ImageCheckPage>> {
self.post_answer(
&format!("/api/infra/services/{service_environment_id}/pull"),
&serde_json::json!({}),
)
.await
}
}