Struct GCHubRestClient
pub struct GCHubRestClient {Show 21 fields
client: Client,
post_clear_url: String,
get_health_url: String,
post_new_runtime_url: String,
get_datapoint_values_url: String,
get_datapoint_values_buffered_url: String,
get_plugins_instances_url: String,
get_assets_url: String,
get_logs_url: String,
get_dashboard_url: String,
post_dashboard_url: String,
put_add_user: String,
post_login: String,
patch_attach_roles: String,
patch_detach_roles: String,
get_me_url: String,
get_me_api_keys_url: String,
put_me_api_keys_new_url: String,
get_users_url: String,
get_roles_url: String,
get_policies_url: String,
}Expand description
TODO: Separate client into a runtime client and a management client, so it reduces dependencies on the runtime side.
Fields§
§client: Client§post_clear_url: String§get_health_url: String§post_new_runtime_url: String§get_datapoint_values_url: String§get_datapoint_values_buffered_url: String§get_plugins_instances_url: String§get_assets_url: String§get_logs_url: String§get_dashboard_url: String§post_dashboard_url: String§put_add_user: String§post_login: String§patch_attach_roles: String§patch_detach_roles: String§get_me_url: String§get_me_api_keys_url: String§put_me_api_keys_new_url: String§get_users_url: String§get_roles_url: String§get_policies_url: StringImplementations§
§impl GCHubRestClient
impl GCHubRestClient
pub fn new(base_url: &str) -> Self
async fn handle_response<T: DeserializeOwned>( response: Response, ) -> Result<T, GCServiceHubError>
pub async fn clear(&self) -> Result<(), GCServiceHubError>
pub async fn search_logs( &self, search: LogSearchRequest, ) -> Result<GCLogSearchResponse, GCServiceHubError>
pub async fn get_datapoint_values( &self, names: &[&str], ) -> Result<GCResponseDatapointValues, GCServiceHubError>
pub async fn get_all_datapoint_values( &self, ) -> Result<GCResponseDatapointValues, GCServiceHubError>
pub async fn get_datapoint_values_buffered( &self, names: &[&str], ) -> Result<GCResponseBufferedDatapointValues, GCServiceHubError>
pub async fn get_dashboard( &self, ) -> Result<DashboardResponse, GCServiceHubError>
pub async fn post_dashboard( &self, dashboard: &Dashboard, ) -> Result<DashboardResponse, GCServiceHubError>
pub async fn get_assets( &self, asset_id: Option<&str>, ) -> Result<AssetListResponse, GCServiceHubError>
pub async fn get_plugin_instances( &self, ) -> Result<ResponseRetrievePluginInstances, GCServiceHubError>
pub async fn health(&self) -> Result<(), GCServiceHubError>
pub async fn add_user( &self, username: impl Into<String>, password: impl Into<String>, ) -> Result<(), GCServiceHubError>
pub async fn login( &self, username: impl Into<String>, password: impl Into<String>, ) -> Result<(), GCServiceHubError>
pub async fn attach_roles( &self, username: impl Into<String>, roles: impl Into<Vec<String>>, ) -> Result<(), GCServiceHubError>
pub async fn detach_roles( &self, username: impl Into<String>, roles: impl Into<Vec<String>>, ) -> Result<(), GCServiceHubError>
pub async fn get_me(&self) -> Result<UserInfoResponse, GCServiceHubError>
pub async fn get_users(&self) -> Result<UsersListResponse, GCServiceHubError>
pub async fn get_roles(&self) -> Result<RolesListResponse, GCServiceHubError>
pub async fn get_policies( &self, ) -> Result<PoliciesListResponse, GCServiceHubError>
pub async fn get_my_api_keys( &self, ) -> Result<ApiKeysListResponse, GCServiceHubError>
pub async fn create_api_key( &self, ) -> Result<NewApiKeyResponse, GCServiceHubError>
pub async fn register_runtime( &self, rest_port: u16, runtime_id: String, tcp_port: u16, ) -> Result<(), GCServiceHubError>
Trait Implementations§
§impl Clone for GCHubRestClient
impl Clone for GCHubRestClient
§fn clone(&self) -> GCHubRestClient
fn clone(&self) -> GCHubRestClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GCHubRestClient
impl !RefUnwindSafe for GCHubRestClient
impl Send for GCHubRestClient
impl Sync for GCHubRestClient
impl Unpin for GCHubRestClient
impl !UnwindSafe for GCHubRestClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more