Skip to main content

AdminApiService

Struct AdminApiService 

Source
pub struct AdminApiService { /* private fields */ }
Expand description

AdminApiService — canonical business-logic layer for node administration.

Both the REST/BFF (admin_api.rs) and the gRPC NodeAdminService trait call into the *_direct() methods defined here. REST handlers should be thin wrappers that parse the request and format the JSON response.

Implementations§

Source§

impl AdminApiService

Source

pub fn new( node_id: impl Into<String>, name: impl Into<String>, location_tag: impl Into<String>, version: impl Into<String>, service_collector: ServiceCollector, ) -> Result<AdminApiService, AdminError>

Create a new control gRPC service instance.

Source

pub fn with_metrics_provider<F, Fut>(self, provider: F) -> AdminApiService
where F: Fn() -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<SystemMetrics, AdminError>> + Send + 'static,

Override the metrics provider used by GetNodeInfo.

Source

pub fn with_shutdown_handler<F, Fut>(self, handler: F) -> AdminApiService
where F: Fn(bool, Option<i32>, Option<String>) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<(), AdminError>> + Send + 'static,

Attach a shutdown handler invoked when Shutdown is accepted.

Source

pub fn with_override_store( self, store: Arc<ConfigOverrideStore>, ) -> AdminApiService

Attach a SQLite-backed config override store for L2 dynamic overrides.

Source

pub fn with_reload_handler<F, Fut>(self, handler: F) -> AdminApiService
where F: Fn() -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<bool, AdminError>> + Send + 'static,

Attach a reload handler invoked when reload is requested.

Source

pub fn with_running_config(self, config: ActrixConfig) -> AdminApiService

Attach the runtime config snapshot (AdminUi head mode).

Source

pub fn with_toml_content(self, content: String) -> AdminApiService

Attach the raw TOML content for L1 detection.

Source

pub fn with_config_path(self, path: PathBuf) -> AdminApiService

Attach the config file path.

Source

pub fn override_store(&self) -> Option<&Arc<ConfigOverrideStore>>

Get the override store reference.

Source

pub async fn service_statuses(&self) -> Vec<ServiceStatus>

Collect current service statuses for this node.

Returns all service statuses from the service registry.

Source

pub async fn resolve_node_name(&self) -> String

Resolve the effective node name (L2 override → L1 config → running).

Source

pub async fn health_info(&self) -> HealthInfo

Health check info.

Source

pub async fn list_overrides_direct(&self) -> Result<Vec<ConfigOverride>, Status>

List L2 dynamic config overrides.

Source

pub async fn set_override_direct( &self, key: &str, value: &str, by: &str, ) -> Result<(), Status>

Set a dynamic config override.

Source

pub async fn delete_override_direct(&self, key: &str) -> Result<bool, Status>

Delete a dynamic config override.

Source

pub async fn get_platform_detail_direct(&self) -> Result<PlatformDetail, Status>

Get platform detail with resolved config fields.

Source

pub async fn get_service_detail_direct( &self, name: &str, ) -> Result<ServiceDetail, Status>

Get service detail with resolved config fields.

Source

pub fn get_registry_direct(&self) -> &'static [ConfigFieldDef]

Get config registry (all field definitions).

Source

pub async fn get_config_file_direct(&self) -> Result<ConfigFileContent, Status>

Read config file from disk.

Source

pub async fn save_config_file_direct(&self, content: &str) -> Result<(), Status>

Write config file to disk (with TOML validation).

Source

pub async fn reload_direct(&self) -> Result<bool, Status>

Trigger reload (SIGHUP).

Source

pub async fn get_signer_keys_direct(&self) -> Result<KsKeysResult, Status>

Query Signer keys from the SQLite database.

Source

pub async fn cleanup_signer_keys_direct( &self, ) -> Result<KsCleanupResult, Status>

Cleanup expired Signer keys.

Source

pub async fn get_ais_keys_direct(&self) -> Result<Vec<KeyInfo>, Status>

Query AIS keys from the SQLite database.

Source

pub async fn node_info_direct(&self) -> Result<GetNodeInfoResponse, Status>

Get node info including metrics and service statuses.

Source

pub async fn list_realms_direct(&self) -> Result<ListRealmsResponse, Status>

List all realms.

Source

pub async fn create_realm_with_secret_direct( &self, req: CreateRealmRequest, ) -> Result<(CreateRealmResponse, Option<String>), Status>

Create a realm and return the plaintext realm secret once.

Source

pub async fn create_realm_direct( &self, req: CreateRealmRequest, ) -> Result<CreateRealmResponse, Status>

Create a realm (gRPC path, does not expose plaintext secret in response).

Source

pub async fn get_realm_direct( &self, realm_id: u32, ) -> Result<GetRealmResponse, Status>

Get a single realm by ID.

Source

pub async fn update_realm_direct( &self, req: UpdateRealmRequest, ) -> Result<UpdateRealmResponse, Status>

Update an existing realm.

Source

pub async fn delete_realm_direct( &self, realm_id: u32, ) -> Result<DeleteRealmResponse, Status>

Delete a realm by ID.

Source

pub async fn delete_realm_hard_direct( &self, realm_id: u32, ) -> Result<DeleteRealmResponse, Status>

Hard-delete a realm for local Admin UI standalone mode.

Source

pub async fn rotate_realm_secret_direct( &self, realm_id: u32, ) -> Result<RealmSecretRotationResult, Status>

Rotate realm secret and return plaintext once.

Source

pub async fn get_config_direct( &self, config_type: ConfigType, config_key: String, ) -> Result<GetConfigResponse, Status>

Get a config value.

Source

pub async fn update_config_direct( &self, config_type: ConfigType, config_key: String, config_value: String, ) -> Result<UpdateConfigResponse, Status>

Update a config value.

Source

pub async fn shutdown_direct( &self, graceful: bool, timeout_secs: Option<i32>, reason: Option<String>, ) -> Result<ShutdownResponse, Status>

Request node shutdown.

Trait Implementations§

Source§

impl Clone for AdminApiService

Source§

fn clone(&self) -> AdminApiService

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl NodeAdminService for AdminApiService

Source§

fn update_config<'life0, 'async_trait>( &'life0 self, request: Request<UpdateConfigRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UpdateConfigResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

———— Configuration management ————
Source§

fn get_config<'life0, 'async_trait>( &'life0 self, request: Request<GetConfigRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetConfigResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Source§

fn create_realm<'life0, 'async_trait>( &'life0 self, request: Request<CreateRealmRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CreateRealmResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

———— Realm management ————
Source§

fn get_realm<'life0, 'async_trait>( &'life0 self, request: Request<GetRealmRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetRealmResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Source§

fn update_realm<'life0, 'async_trait>( &'life0 self, request: Request<UpdateRealmRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UpdateRealmResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Source§

fn delete_realm<'life0, 'async_trait>( &'life0 self, request: Request<DeleteRealmRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<DeleteRealmResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Source§

fn list_realms<'life0, 'async_trait>( &'life0 self, request: Request<ListRealmsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ListRealmsResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Source§

fn get_node_info<'life0, 'async_trait>( &'life0 self, request: Request<GetNodeInfoRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetNodeInfoResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

———— Node control ————
Source§

fn shutdown<'life0, 'async_trait>( &'life0 self, request: Request<ShutdownRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ShutdownResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Source§

fn list_config_overrides<'life0, 'async_trait>( &'life0 self, _request: Request<ListConfigOverridesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ListConfigOverridesResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

———— Config override management (remote admin) ————
Source§

fn set_config_override<'life0, 'async_trait>( &'life0 self, request: Request<SetConfigOverrideRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SetConfigOverrideResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Source§

fn delete_config_override<'life0, 'async_trait>( &'life0 self, request: Request<DeleteConfigOverrideRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<DeleteConfigOverrideResponse>, Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, AdminApiService: 'async_trait,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more