Skip to content

Commit

Permalink
Fix a bug in dash client
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Sep 20, 2023
1 parent e5be876 commit 7284db8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions dash/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ vine-api = { path = "../../vine/api" }

anyhow = { workspace = true }
reqwest = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true, features = [] }
serde_json = { workspace = true }
16 changes: 13 additions & 3 deletions dash/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use ark_core::result::Result as SessionResult;
use dash_api::{function::FunctionCrd, job::DashJobCrd, model::ModelCrd};
use dash_provider_api::job::Payload;
use reqwest::{Client, Method, Url};
use serde::{de::DeserializeOwned, Serialize};
use schemars::JsonSchema;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_json::Value;
use vine_api::user_session::{UserSessionCommandBatch, UserSessionRef};

Expand Down Expand Up @@ -50,7 +51,7 @@ impl DashClient {
self.get(format!("/function/{name}/")).await
}

pub async fn get_function_list(&self) -> Result<Vec<String>> {
pub async fn get_function_list(&self) -> Result<ObjectRef> {
self.get("/function/").await
}
}
Expand Down Expand Up @@ -104,7 +105,7 @@ impl DashClient {
self.get(format!("/model/{name}/function/")).await
}

pub async fn get_model_list(&self) -> Result<Vec<String>> {
pub async fn get_model_list(&self) -> Result<ObjectRef> {
self.get("/model/").await
}

Expand Down Expand Up @@ -205,3 +206,12 @@ impl DashClient {
url
}
}

#[derive(
Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema,
)]
#[serde(rename_all = "camelCase")]
pub struct ObjectRef {
pub name: String,
pub namespace: String,
}

0 comments on commit 7284db8

Please sign in to comment.