Skip to content

Commit

Permalink
admin_ws: add list_apps method
Browse files Browse the repository at this point in the history
  • Loading branch information
peeech committed May 24, 2024
1 parent b318467 commit 938a7db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 246 deletions.
15 changes: 13 additions & 2 deletions crates/hpos_connect_hc/src/admin_ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use super::hpos_agent::Agent;
use super::hpos_membrane_proof::MembraneProofs;
use anyhow::{anyhow, Context, Result};
use holochain_conductor_api::{
AdminRequest, AdminResponse, AppAuthenticationToken, AppAuthenticationTokenIssued,
AppStatusFilter, IssueAppAuthenticationTokenPayload,
AdminRequest, AdminResponse, AppAuthenticationToken, AppAuthenticationTokenIssued, AppInfo, AppStatusFilter, IssueAppAuthenticationTokenPayload
};
use holochain_types::{
app::{AppBundleSource, InstallAppPayload, InstalledAppId},
Expand Down Expand Up @@ -199,6 +198,18 @@ impl AdminWebsocket {
self.send(msg).await
}

#[instrument(skip(self), err)]
pub async fn list_apps(
&mut self,
status_filter: Option<AppStatusFilter>,
) -> Result<Vec<AppInfo>> {
let response = self.send(AdminRequest::ListApps { status_filter }).await?;
match response {
AdminResponse::AppsListed(apps_infos) => Ok(apps_infos),
_ => unreachable!("Unexpected response {:?}", response),
}
}

#[instrument(skip(self))]
pub async fn send(&mut self, msg: AdminRequest) -> Result<AdminResponse> {
let response = self
Expand Down
112 changes: 0 additions & 112 deletions crates/hpos_connect_hc/src/app_ws.rs

This file was deleted.

132 changes: 0 additions & 132 deletions crates/hpos_connect_hc/src/core_app_agent.rs

This file was deleted.

0 comments on commit 938a7db

Please sign in to comment.