pub struct UptrakitClient { /* private fields */ }Expand description
Typed HTTP client for the Uptrakit web API.
Provides compile-time type safety for all API endpoints by using shared
request/response types from uptrakit-web-api-types.
Implementations§
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn get_access_catalog(&self) -> Result<AccessCatalogResponse>
pub async fn get_access_catalog(&self) -> Result<AccessCatalogResponse>
Fetch the access catalog (actions, role bundles, scope presets).
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_access_grants(
&self,
query: &ListAccessGrantsQuery,
) -> Result<Vec<AccessGrantResponse>>
pub async fn list_access_grants( &self, query: &ListAccessGrantsQuery, ) -> Result<Vec<AccessGrantResponse>>
List grants (active tenant + global rows), optionally one subject’s.
Sourcepub async fn get_access_grant(&self, id: &Uuid) -> Result<AccessGrantResponse>
pub async fn get_access_grant(&self, id: &Uuid) -> Result<AccessGrantResponse>
Get a single grant.
Sourcepub async fn create_access_grant(
&self,
req: &CreateAccessGrantRequest,
) -> Result<AccessGrantResponse>
pub async fn create_access_grant( &self, req: &CreateAccessGrantRequest, ) -> Result<AccessGrantResponse>
Create a grant.
Sourcepub async fn update_access_grant(
&self,
id: &Uuid,
req: &UpdateAccessGrantRequest,
) -> Result<AccessGrantResponse>
pub async fn update_access_grant( &self, id: &Uuid, req: &UpdateAccessGrantRequest, ) -> Result<AccessGrantResponse>
Update a grant’s patterns/selector/description.
Sourcepub async fn delete_access_grant(&self, id: &Uuid) -> Result<()>
pub async fn delete_access_grant(&self, id: &Uuid) -> Result<()>
Delete a grant.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn create_api_token(
&self,
req: &CreateApiTokenRequest,
) -> Result<CreateApiTokenResponse>
pub async fn create_api_token( &self, req: &CreateApiTokenRequest, ) -> Result<CreateApiTokenResponse>
Create a new API token.
Sourcepub async fn list_api_tokens(&self) -> Result<ApiTokenListResponse>
pub async fn list_api_tokens(&self) -> Result<ApiTokenListResponse>
List all API tokens for the current user.
Sourcepub async fn revoke_api_token(&self, id: &Uuid) -> Result<()>
pub async fn revoke_api_token(&self, id: &Uuid) -> Result<()>
Revoke an API token by ID.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_audit_logs(
&self,
params: &AuditLogListParams,
) -> Result<PaginatedResponse<AuditLogResponse>>
pub async fn list_audit_logs( &self, params: &AuditLogListParams, ) -> Result<PaginatedResponse<AuditLogResponse>>
List tenant-scoped audit log entries with optional filters and pagination.
Sourcepub async fn list_system_audit_logs(
&self,
params: &AuditLogListParams,
) -> Result<PaginatedResponse<SystemAuditLogResponse>>
pub async fn list_system_audit_logs( &self, params: &AuditLogListParams, ) -> Result<PaginatedResponse<SystemAuditLogResponse>>
List system-level audit log entries with optional filters and pagination.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn register(&self, req: &RegisterRequest) -> Result<AuthResponse>
pub async fn register(&self, req: &RegisterRequest) -> Result<AuthResponse>
Register a new user account.
This endpoint does not require authentication.
Sourcepub async fn login(&self, req: &LoginRequest) -> Result<AuthResponse>
pub async fn login(&self, req: &LoginRequest) -> Result<AuthResponse>
Log in with email and password.
This endpoint does not require authentication.
Sourcepub async fn refresh(&self, req: &RefreshRequest) -> Result<RefreshResponse>
pub async fn refresh(&self, req: &RefreshRequest) -> Result<RefreshResponse>
Refresh an access token using a refresh token.
This endpoint does not require authentication.
Sourcepub async fn logout(&self, req: &LogoutRequest) -> Result<()>
pub async fn logout(&self, req: &LogoutRequest) -> Result<()>
Log out by revoking a refresh token.
Sourcepub async fn auth_methods(&self) -> Result<AuthMethodsResponse>
pub async fn auth_methods(&self) -> Result<AuthMethodsResponse>
List available authentication methods.
This endpoint does not require authentication.
Sourcepub async fn device_auth_approve(
&self,
req: &DeviceAuthApproveRequest,
) -> Result<DeviceAuthApproveResponse>
pub async fn device_auth_approve( &self, req: &DeviceAuthApproveRequest, ) -> Result<DeviceAuthApproveResponse>
Approve a pending device authorization request.
Sourcepub async fn me(&self) -> Result<UserResponse>
pub async fn me(&self) -> Result<UserResponse>
Retrieve the current authenticated user’s profile.
Start an RFC 8628 device authorization flow.
Per RFC 8628 §3.1. Returns the device_code, user_code, verification URIs, expiry, and recommended polling interval. This endpoint does not require authentication.
Sourcepub async fn oauth_token(
&self,
req: &OAuthTokenRequest,
) -> Result<OAuthTokenResponse>
pub async fn oauth_token( &self, req: &OAuthTokenRequest, ) -> Result<OAuthTokenResponse>
Exchange a device_code for an access token.
Per RFC 6749 §3.2 / RFC 8628 §3.4. Form-urlencoded body. On HTTP 400 the
caller receives Err(ClientError::OAuthError(OAuthErrorResponse)) with
the typed OAuthErrorCode. This endpoint does not require
authentication.
Fetch the RFC 8414 §3 authorization server metadata document.
Public; no authentication required.
Sourcepub async fn device_auth_deny(
&self,
req: &DeviceAuthDenyRequest,
) -> Result<DeviceAuthDenyResponse>
pub async fn device_auth_deny( &self, req: &DeviceAuthDenyRequest, ) -> Result<DeviceAuthDenyResponse>
Deny a pending device authorization request (UI-internal).
Sourcepub async fn device_auth_lookup(
&self,
query: &DeviceAuthLookupQuery,
) -> Result<DeviceAuthLookupResponse>
pub async fn device_auth_lookup( &self, query: &DeviceAuthLookupQuery, ) -> Result<DeviceAuthLookupResponse>
Look up the client_name + expires_at for a pending flow.
Authenticated; requires CanViewServices. Query parameters are
serialised by reqwest::RequestBuilder::query (which uses
serde_urlencoded internally) so no manual URL building is required.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn approve_software_item(
&self,
id: &Uuid,
) -> Result<SoftwareItemResponse>
pub async fn approve_software_item( &self, id: &Uuid, ) -> Result<SoftwareItemResponse>
Approve a pending discovered software item.
Sets discovery_state = approved and enabled = true.
Sourcepub async fn discover_host(
&self,
host_id: &Uuid,
) -> Result<TriggerDiscoveryResponse>
pub async fn discover_host( &self, host_id: &Uuid, ) -> Result<TriggerDiscoveryResponse>
Trigger autodiscovery on a specific host.
Sourcepub async fn discover_plugin_config(
&self,
id: &Uuid,
) -> Result<TriggerDiscoveryResponse>
pub async fn discover_plugin_config( &self, id: &Uuid, ) -> Result<TriggerDiscoveryResponse>
Trigger autodiscovery for a specific plugin config across all agents.
Sourcepub async fn list_software_ignores(
&self,
params: &ListIgnoresParams,
) -> Result<PaginatedResponse<SoftwareIgnoreResponse>>
pub async fn list_software_ignores( &self, params: &ListIgnoresParams, ) -> Result<PaginatedResponse<SoftwareIgnoreResponse>>
List software ignore rules for this tenant.
Sourcepub async fn create_software_ignore(
&self,
req: &CreateSoftwareIgnoreRequest,
) -> Result<SoftwareIgnoreResponse>
pub async fn create_software_ignore( &self, req: &CreateSoftwareIgnoreRequest, ) -> Result<SoftwareIgnoreResponse>
Create a software ignore rule (idempotent).
Sourcepub async fn delete_software_ignore(&self, id: &Uuid) -> Result<()>
pub async fn delete_software_ignore(&self, id: &Uuid) -> Result<()>
Delete a software ignore rule by ID.
Sourcepub async fn batch_software_ignores(
&self,
req: &BatchActionRequest,
) -> Result<BatchActionResponse>
pub async fn batch_software_ignores( &self, req: &BatchActionRequest, ) -> Result<BatchActionResponse>
Perform a batch action on multiple software ignore rules.
Supported actions: delete.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn stream_batch_progress(
&self,
id: &Uuid,
) -> Result<impl Stream<Item = Result<BatchProgressEvent, StreamError>>>
pub async fn stream_batch_progress( &self, id: &Uuid, ) -> Result<impl Stream<Item = Result<BatchProgressEvent, StreamError>>>
Connect to the batch progress SSE stream and return a stream of typed events.
The returned stream yields BatchProgressEvent values until the batch
completes (indicated by a BatchCompleted event) or the connection closes.
This method uses no request timeout since SSE connections are long-lived.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_discovery_allowlist(
&self,
) -> Result<Vec<TenantDiscoveryAllowlistEntry>>
pub async fn list_discovery_allowlist( &self, ) -> Result<Vec<TenantDiscoveryAllowlistEntry>>
List all tenant-wide discovery allowlist entries.
An empty list means no restrictions — all discovery plugin types will run.
Sourcepub async fn add_discovery_allowlist_entry(
&self,
req: &CreateDiscoveryAllowlistEntryRequest,
) -> Result<TenantDiscoveryAllowlistEntry>
pub async fn add_discovery_allowlist_entry( &self, req: &CreateDiscoveryAllowlistEntryRequest, ) -> Result<TenantDiscoveryAllowlistEntry>
Add a plugin type to the tenant-wide discovery allowlist.
Idempotent: returns the existing entry if it already exists (HTTP 201).
Sourcepub async fn remove_discovery_allowlist_entry(&self, id: &Uuid) -> Result<()>
pub async fn remove_discovery_allowlist_entry(&self, id: &Uuid) -> Result<()>
Remove a tenant-wide discovery allowlist entry.
Sourcepub async fn list_host_discovery_allowlist(
&self,
host_id: &Uuid,
) -> Result<Vec<HostDiscoveryAllowlistEntry>>
pub async fn list_host_discovery_allowlist( &self, host_id: &Uuid, ) -> Result<Vec<HostDiscoveryAllowlistEntry>>
List host-specific discovery allowlist entries.
An empty list means the host inherits the tenant-wide allowlist.
Sourcepub async fn add_host_discovery_allowlist_entry(
&self,
host_id: &Uuid,
req: &CreateDiscoveryAllowlistEntryRequest,
) -> Result<HostDiscoveryAllowlistEntry>
pub async fn add_host_discovery_allowlist_entry( &self, host_id: &Uuid, req: &CreateDiscoveryAllowlistEntryRequest, ) -> Result<HostDiscoveryAllowlistEntry>
Add a plugin type to a host’s discovery allowlist.
Idempotent: returns the existing entry if it already exists (HTTP 201).
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn create_enrollment_token(
&self,
req: &CreateEnrollmentTokenRequest,
) -> Result<EnrollmentTokenCreatedResponse>
pub async fn create_enrollment_token( &self, req: &CreateEnrollmentTokenRequest, ) -> Result<EnrollmentTokenCreatedResponse>
Create a new enrollment token.
Sourcepub async fn list_enrollment_tokens(
&self,
query: &ListEnrollmentTokensQuery,
) -> Result<PaginatedResponse<EnrollmentTokenResponse>>
pub async fn list_enrollment_tokens( &self, query: &ListEnrollmentTokensQuery, ) -> Result<PaginatedResponse<EnrollmentTokenResponse>>
List enrollment tokens with pagination.
Sourcepub async fn list_all_enrollment_tokens(
&self,
query: &ListEnrollmentTokensQuery,
) -> Result<Vec<EnrollmentTokenResponse>>
pub async fn list_all_enrollment_tokens( &self, query: &ListEnrollmentTokensQuery, ) -> Result<Vec<EnrollmentTokenResponse>>
Fetch all enrollment tokens across all pages.
Sourcepub async fn get_enrollment_token(
&self,
id: &Uuid,
) -> Result<EnrollmentTokenResponse>
pub async fn get_enrollment_token( &self, id: &Uuid, ) -> Result<EnrollmentTokenResponse>
Get a single enrollment token by ID.
Sourcepub async fn revoke_enrollment_token(&self, id: &Uuid) -> Result<()>
pub async fn revoke_enrollment_token(&self, id: &Uuid) -> Result<()>
Revoke an enrollment token (soft-delete).
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn stream_events(
&self,
) -> Result<impl Stream<Item = Result<AdminSseEvent, StreamError>>>
pub async fn stream_events( &self, ) -> Result<impl Stream<Item = Result<AdminSseEvent, StreamError>>>
Connect to the admin events SSE stream and return a stream of typed events.
The returned stream yields AdminSseEvent values for the authenticated
user’s tenant. The stream stays open indefinitely (server pushes events as
state changes occur) and should be cancelled by the caller when no longer
needed.
Uses an 86400s (24h) timeout, matching other long-lived SSE connections.
Source§impl UptrakitClient
impl UptrakitClient
List host tags with pagination and optional search.
Fetch all host tags across all pages.
Sourcepub async fn get_host_tag(&self, id: &Uuid) -> Result<HostTagResponse>
pub async fn get_host_tag(&self, id: &Uuid) -> Result<HostTagResponse>
Get a single host tag by ID.
Sourcepub async fn create_host_tag(
&self,
req: &CreateHostTagRequest,
) -> Result<HostTagResponse>
pub async fn create_host_tag( &self, req: &CreateHostTagRequest, ) -> Result<HostTagResponse>
Create a new host tag.
Sourcepub async fn update_host_tag(
&self,
id: &Uuid,
req: &UpdateHostTagRequest,
) -> Result<HostTagResponse>
pub async fn update_host_tag( &self, id: &Uuid, req: &UpdateHostTagRequest, ) -> Result<HostTagResponse>
Update an existing host tag.
Sourcepub async fn delete_host_tag(&self, id: &Uuid) -> Result<()>
pub async fn delete_host_tag(&self, id: &Uuid) -> Result<()>
Delete a host tag (soft-delete).
Perform a batch action on multiple host tags.
Supported actions: delete.
Set (replace-all) tags on a host.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_hosts(
&self,
params: &PaginationParams,
) -> Result<PaginatedResponse<HostResponse>>
pub async fn list_hosts( &self, params: &PaginationParams, ) -> Result<PaginatedResponse<HostResponse>>
List hosts with pagination.
Sourcepub async fn list_all_hosts(&self) -> Result<Vec<HostResponse>>
pub async fn list_all_hosts(&self) -> Result<Vec<HostResponse>>
Fetch all hosts across all pages.
Automatically iterates through every page at MAX_PER_PAGE items per
request and returns the concatenated list. Use list_hosts when
manual pagination control is needed.
Sourcepub async fn get_host(&self, id: &Uuid) -> Result<HostResponse>
pub async fn get_host(&self, id: &Uuid) -> Result<HostResponse>
Get a single host by ID.
Sourcepub async fn update_host(
&self,
id: &Uuid,
req: &UpdateHostRequest,
) -> Result<HostResponse>
pub async fn update_host( &self, id: &Uuid, req: &UpdateHostRequest, ) -> Result<HostResponse>
Update a host (e.g. change its friendly name).
Sourcepub async fn deactivate_host(&self, id: &Uuid) -> Result<()>
pub async fn deactivate_host(&self, id: &Uuid) -> Result<()>
Deactivate (remove) a host.
Sourcepub async fn batch_hosts(
&self,
req: &BatchActionRequest,
) -> Result<BatchActionResponse>
pub async fn batch_hosts( &self, req: &BatchActionRequest, ) -> Result<BatchActionResponse>
Perform a batch action on multiple hosts.
Supported actions: deactivate.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn create_notification_channel(
&self,
req: &CreateNotificationChannelRequest,
) -> Result<NotificationChannelResponse>
pub async fn create_notification_channel( &self, req: &CreateNotificationChannelRequest, ) -> Result<NotificationChannelResponse>
Create a new notification channel.
Sourcepub async fn list_notification_channels(
&self,
params: &PaginationParams,
) -> Result<PaginatedResponse<NotificationChannelResponse>>
pub async fn list_notification_channels( &self, params: &PaginationParams, ) -> Result<PaginatedResponse<NotificationChannelResponse>>
List notification channels with pagination.
Sourcepub async fn get_notification_channel(
&self,
id: &Uuid,
) -> Result<NotificationChannelResponse>
pub async fn get_notification_channel( &self, id: &Uuid, ) -> Result<NotificationChannelResponse>
Get a single notification channel by ID.
Sourcepub async fn update_notification_channel(
&self,
id: &Uuid,
req: &UpdateNotificationChannelRequest,
) -> Result<NotificationChannelResponse>
pub async fn update_notification_channel( &self, id: &Uuid, req: &UpdateNotificationChannelRequest, ) -> Result<NotificationChannelResponse>
Update an existing notification channel.
Sourcepub async fn delete_notification_channel(&self, id: &Uuid) -> Result<()>
pub async fn delete_notification_channel(&self, id: &Uuid) -> Result<()>
Delete a notification channel.
Sourcepub async fn test_notification_channel(
&self,
id: &Uuid,
) -> Result<TestNotificationResponse>
pub async fn test_notification_channel( &self, id: &Uuid, ) -> Result<TestNotificationResponse>
Send a test notification through a channel.
Sourcepub async fn create_notification_rule(
&self,
req: &CreateNotificationRuleRequest,
) -> Result<NotificationRuleResponse>
pub async fn create_notification_rule( &self, req: &CreateNotificationRuleRequest, ) -> Result<NotificationRuleResponse>
Create a new notification rule.
Sourcepub async fn list_notification_rules(
&self,
params: &PaginationParams,
) -> Result<PaginatedResponse<NotificationRuleResponse>>
pub async fn list_notification_rules( &self, params: &PaginationParams, ) -> Result<PaginatedResponse<NotificationRuleResponse>>
List notification rules with pagination.
Sourcepub async fn get_notification_rule(
&self,
id: &Uuid,
) -> Result<NotificationRuleResponse>
pub async fn get_notification_rule( &self, id: &Uuid, ) -> Result<NotificationRuleResponse>
Get a single notification rule by ID.
Sourcepub async fn update_notification_rule(
&self,
id: &Uuid,
req: &UpdateNotificationRuleRequest,
) -> Result<NotificationRuleResponse>
pub async fn update_notification_rule( &self, id: &Uuid, req: &UpdateNotificationRuleRequest, ) -> Result<NotificationRuleResponse>
Update an existing notification rule.
Sourcepub async fn delete_notification_rule(&self, id: &Uuid) -> Result<()>
pub async fn delete_notification_rule(&self, id: &Uuid) -> Result<()>
Delete a notification rule.
Sourcepub async fn list_notification_log(
&self,
params: &PaginationParams,
) -> Result<PaginatedResponse<NotificationLogResponse>>
pub async fn list_notification_log( &self, params: &PaginationParams, ) -> Result<PaginatedResponse<NotificationLogResponse>>
List the notification log with pagination.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_clients(
&self,
params: &PaginationParams,
) -> Result<PaginatedResponse<OAuthClientResponse>>
pub async fn list_clients( &self, params: &PaginationParams, ) -> Result<PaginatedResponse<OAuthClientResponse>>
List registered OAuth clients (paginated, newest first).
Sourcepub async fn manual_register_client(
&self,
req: &DcrRegistrationRequest,
) -> Result<DcrRegistrationResponse>
pub async fn manual_register_client( &self, req: &DcrRegistrationRequest, ) -> Result<DcrRegistrationResponse>
Manually register an OAuth client (operator, RFC 7591 shape).
The response carries a one-time registration_access_token — never
log or Debug-format it.
Sourcepub async fn revoke_client(&self, client_id: &str) -> Result<()>
pub async fn revoke_client(&self, client_id: &str) -> Result<()>
Revoke an OAuth client (cascades to its consents and refresh tokens).
Sourcepub async fn trust_client(&self, client_id: &str) -> Result<()>
pub async fn trust_client(&self, client_id: &str) -> Result<()>
Promote an OAuth client to trusted.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_consents(&self) -> Result<Vec<OAuthConsentResponse>>
pub async fn list_consents(&self) -> Result<Vec<OAuthConsentResponse>>
List the current user’s active OAuth consents (newest-granted first).
Sourcepub async fn revoke_consent(&self, id: &Uuid) -> Result<()>
pub async fn revoke_consent(&self, id: &Uuid) -> Result<()>
Revoke one of the current user’s OAuth consents.
Source§impl UptrakitClient
impl UptrakitClient
Get the OIDC authorization URL for a provider.
This endpoint does not require authentication.
Sourcepub async fn oidc_exchange(
&self,
req: &OidcExchangeRequest,
) -> Result<AuthResponse>
pub async fn oidc_exchange( &self, req: &OidcExchangeRequest, ) -> Result<AuthResponse>
Exchange an OIDC authorization code for tokens.
This endpoint does not require authentication.
Sourcepub async fn oidc_link(&self, req: &OidcLinkRequest) -> Result<AuthResponse>
pub async fn oidc_link(&self, req: &OidcLinkRequest) -> Result<AuthResponse>
Link an OIDC account to an existing user.
Sourcepub async fn oidc_complete_registration(
&self,
req: &OidcCompleteRegistrationRequest,
) -> Result<AuthResponse>
pub async fn oidc_complete_registration( &self, req: &OidcCompleteRegistrationRequest, ) -> Result<AuthResponse>
Complete OIDC registration with a registration code and token.
This endpoint does not require authentication.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn create_oidc_provider(
&self,
req: &CreateOidcProviderRequest,
) -> Result<OidcProviderResponse>
pub async fn create_oidc_provider( &self, req: &CreateOidcProviderRequest, ) -> Result<OidcProviderResponse>
Create a new OIDC provider.
Sourcepub async fn list_oidc_providers(&self) -> Result<Vec<OidcProviderResponse>>
pub async fn list_oidc_providers(&self) -> Result<Vec<OidcProviderResponse>>
List all OIDC providers.
Sourcepub async fn get_oidc_provider(&self, id: &Uuid) -> Result<OidcProviderResponse>
pub async fn get_oidc_provider(&self, id: &Uuid) -> Result<OidcProviderResponse>
Get a single OIDC provider by ID.
Sourcepub async fn update_oidc_provider(
&self,
id: &Uuid,
req: &UpdateOidcProviderRequest,
) -> Result<OidcProviderResponse>
pub async fn update_oidc_provider( &self, id: &Uuid, req: &UpdateOidcProviderRequest, ) -> Result<OidcProviderResponse>
Update an existing OIDC provider.
Sourcepub async fn delete_oidc_provider(&self, id: &Uuid) -> Result<()>
pub async fn delete_oidc_provider(&self, id: &Uuid) -> Result<()>
Delete an OIDC provider.
Sourcepub async fn activate_oidc_provider(
&self,
id: &Uuid,
) -> Result<OidcProviderResponse>
pub async fn activate_oidc_provider( &self, id: &Uuid, ) -> Result<OidcProviderResponse>
Activate an OIDC provider.
Sourcepub async fn deactivate_oidc_provider(
&self,
id: &Uuid,
) -> Result<OidcProviderResponse>
pub async fn deactivate_oidc_provider( &self, id: &Uuid, ) -> Result<OidcProviderResponse>
Deactivate an OIDC provider.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_plugin_types(&self) -> Result<Vec<PluginTypeInfo>>
pub async fn list_plugin_types(&self) -> Result<Vec<PluginTypeInfo>>
List all known plugin types with their display names and capabilities.
Returns static registry metadata. Use this to populate plugin-type selectors rather than hard-coding plugin type strings.
Sourcepub async fn create_plugin_config(
&self,
req: &CreatePluginConfigRequest,
) -> Result<PluginConfigResponse>
pub async fn create_plugin_config( &self, req: &CreatePluginConfigRequest, ) -> Result<PluginConfigResponse>
Create a new plugin configuration.
Sourcepub async fn list_plugin_configs(
&self,
params: &PaginationParams,
) -> Result<PaginatedResponse<PluginConfigResponse>>
pub async fn list_plugin_configs( &self, params: &PaginationParams, ) -> Result<PaginatedResponse<PluginConfigResponse>>
List plugin configurations with pagination.
Sourcepub async fn list_all_plugin_configs(&self) -> Result<Vec<PluginConfigResponse>>
pub async fn list_all_plugin_configs(&self) -> Result<Vec<PluginConfigResponse>>
Fetch all plugin configurations across all pages.
Automatically iterates through every page at MAX_PER_PAGE items per
request. Use list_plugin_configs for manual pagination control.
Sourcepub async fn get_plugin_config(
&self,
id: &Uuid,
) -> Result<(PluginConfigResponse, String)>
pub async fn get_plugin_config( &self, id: &Uuid, ) -> Result<(PluginConfigResponse, String)>
Get a single plugin configuration by ID.
Returns the response body and the raw ETag header value.
Sourcepub async fn update_plugin_config(
&self,
id: &Uuid,
req: &UpdatePluginConfigRequest,
etag: &str,
) -> Result<(PluginConfigResponse, String)>
pub async fn update_plugin_config( &self, id: &Uuid, req: &UpdatePluginConfigRequest, etag: &str, ) -> Result<(PluginConfigResponse, String)>
Update an existing plugin configuration. etag must be the value returned by a prior
get_plugin_config call — the server requires If-Match for optimistic locking.
Sourcepub async fn delete_plugin_config(&self, id: &Uuid) -> Result<()>
pub async fn delete_plugin_config(&self, id: &Uuid) -> Result<()>
Delete a plugin configuration.
Sourcepub async fn batch_plugin_configs(
&self,
req: &BatchActionRequest,
) -> Result<BatchActionResponse>
pub async fn batch_plugin_configs( &self, req: &BatchActionRequest, ) -> Result<BatchActionResponse>
Perform a batch action on multiple plugin configurations.
Supported actions: delete.
Sourcepub async fn test_plugin_config(
&self,
req: &TestPluginConfigRequest,
) -> Result<TestPluginConfigResponse>
pub async fn test_plugin_config( &self, req: &TestPluginConfigRequest, ) -> Result<TestPluginConfigResponse>
Test a plugin configuration without saving it.
Validates the configuration and, depending on the plugin type, either performs a controller-side connectivity check or routes the request to an agent for host-side validation.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_plugin_type_settings(
&self,
) -> Result<Vec<PluginTypeSettingsResponse>>
pub async fn list_plugin_type_settings( &self, ) -> Result<Vec<PluginTypeSettingsResponse>>
List all plugin-type-level settings.
Returns settings for every plugin type that has been configured.
Sourcepub async fn get_plugin_type_settings(
&self,
plugin_type: &str,
) -> Result<PluginTypeSettingsResponse>
pub async fn get_plugin_type_settings( &self, plugin_type: &str, ) -> Result<PluginTypeSettingsResponse>
Get plugin-type-level settings for a specific plugin type.
Sourcepub async fn upsert_plugin_type_settings(
&self,
plugin_type: &str,
req: &UpsertPluginTypeSettingsRequest,
) -> Result<PluginTypeSettingsResponse>
pub async fn upsert_plugin_type_settings( &self, plugin_type: &str, req: &UpsertPluginTypeSettingsRequest, ) -> Result<PluginTypeSettingsResponse>
Create or update plugin-type-level settings for a specific plugin type.
Sourcepub async fn delete_plugin_type_settings(&self, plugin_type: &str) -> Result<()>
pub async fn delete_plugin_type_settings(&self, plugin_type: &str) -> Result<()>
Delete plugin-type-level settings for a specific plugin type.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_roles(&self) -> Result<Vec<RoleResponse>>
pub async fn list_roles(&self) -> Result<Vec<RoleResponse>>
List roles for the active tenant plus the global built-ins.
Sourcepub async fn get_role(&self, id: &Uuid) -> Result<RoleResponse>
pub async fn get_role(&self, id: &Uuid) -> Result<RoleResponse>
Get a single role by ID.
Sourcepub async fn create_role(&self, req: &CreateRoleRequest) -> Result<RoleResponse>
pub async fn create_role(&self, req: &CreateRoleRequest) -> Result<RoleResponse>
Create a tenant-scoped custom role.
Sourcepub async fn update_role(
&self,
id: &Uuid,
req: &UpdateRoleRequest,
) -> Result<RoleResponse>
pub async fn update_role( &self, id: &Uuid, req: &UpdateRoleRequest, ) -> Result<RoleResponse>
Rename/re-describe an own-tenant custom role.
Sourcepub async fn delete_role(&self, id: &Uuid) -> Result<()>
pub async fn delete_role(&self, id: &Uuid) -> Result<()>
Delete an own-tenant custom role.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_scheduled_tasks(&self) -> Result<Vec<ScheduledTaskResponse>>
pub async fn list_scheduled_tasks(&self) -> Result<Vec<ScheduledTaskResponse>>
List all scheduled tasks.
Sourcepub async fn get_scheduled_task(
&self,
id: &Uuid,
) -> Result<ScheduledTaskResponse>
pub async fn get_scheduled_task( &self, id: &Uuid, ) -> Result<ScheduledTaskResponse>
Get a single scheduled task by ID.
Sourcepub async fn update_scheduled_task(
&self,
id: &Uuid,
req: &UpdateScheduledTaskRequest,
) -> Result<ScheduledTaskResponse>
pub async fn update_scheduled_task( &self, id: &Uuid, req: &UpdateScheduledTaskRequest, ) -> Result<ScheduledTaskResponse>
Update a scheduled task (interval, jitter, enabled state, or config).
Sourcepub async fn trigger_scheduled_task(
&self,
id: &Uuid,
) -> Result<TriggerScheduledTaskResponse>
pub async fn trigger_scheduled_task( &self, id: &Uuid, ) -> Result<TriggerScheduledTaskResponse>
Trigger immediate execution of a scheduled task.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_services(
&self,
query: &ListServicesQuery,
) -> Result<PaginatedResponse<ServiceResponse>>
pub async fn list_services( &self, query: &ListServicesQuery, ) -> Result<PaginatedResponse<ServiceResponse>>
List services with optional filters and pagination.
Sourcepub async fn list_all_services(
&self,
query: &ListServicesQuery,
) -> Result<Vec<ServiceResponse>>
pub async fn list_all_services( &self, query: &ListServicesQuery, ) -> Result<Vec<ServiceResponse>>
Fetch all services matching the given filters across all pages.
Automatically iterates through every page at MAX_PER_PAGE items per
request. The page and per_page fields of query are ignored; use
list_services for manual pagination control.
Sourcepub async fn get_service(&self, id: &Uuid) -> Result<ServiceResponse>
pub async fn get_service(&self, id: &Uuid) -> Result<ServiceResponse>
Get a single service by ID.
Sourcepub async fn approve_service(&self, id: &Uuid) -> Result<ServiceResponse>
pub async fn approve_service(&self, id: &Uuid) -> Result<ServiceResponse>
Approve a pending service.
Sourcepub async fn reject_service(&self, id: &Uuid) -> Result<ServiceResponse>
pub async fn reject_service(&self, id: &Uuid) -> Result<ServiceResponse>
Reject a pending service.
Sourcepub async fn update_service(
&self,
id: &Uuid,
req: &UpdateServiceRequest,
) -> Result<ServiceResponse>
pub async fn update_service( &self, id: &Uuid, req: &UpdateServiceRequest, ) -> Result<ServiceResponse>
Update a service’s configurable settings (e.g. ping interval).
Sourcepub async fn remove_service(&self, id: &Uuid) -> Result<()>
pub async fn remove_service(&self, id: &Uuid) -> Result<()>
Deactivate (remove) a service.
Sourcepub async fn set_update_freeze(
&self,
id: &Uuid,
req: &SetUpdateFreezeRequest,
) -> Result<MessageResponse>
pub async fn set_update_freeze( &self, id: &Uuid, req: &SetUpdateFreezeRequest, ) -> Result<MessageResponse>
Enable or disable the update freeze on a connected service.
Sourcepub async fn batch_services(
&self,
req: &BatchActionRequest,
) -> Result<BatchActionResponse>
pub async fn batch_services( &self, req: &BatchActionRequest, ) -> Result<BatchActionResponse>
Perform a batch action on multiple services.
Supported actions: approve, reject, deactivate.
Sourcepub async fn merge_service(
&self,
target_id: &Uuid,
req: &MergeAgentRequest,
) -> Result<ServiceResponse>
pub async fn merge_service( &self, target_id: &Uuid, req: &MergeAgentRequest, ) -> Result<ServiceResponse>
Merge a pending source service into an approved target service.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn get_global_combined_settings(
&self,
) -> Result<GlobalSettingsCombinedResponse>
pub async fn get_global_combined_settings( &self, ) -> Result<GlobalSettingsCombinedResponse>
Get combined global settings (network, system services, MQTT limit, optional NATS).
Sourcepub async fn get_combined_settings(&self) -> Result<CombinedSettingsResponse>
pub async fn get_combined_settings(&self) -> Result<CombinedSettingsResponse>
Get combined settings (access, certificates, enrollment tokens).
Sourcepub async fn get_access_settings(
&self,
) -> Result<(AccessSettingsResponse, String)>
pub async fn get_access_settings( &self, ) -> Result<(AccessSettingsResponse, String)>
Get access settings (registration + authentication combined).
Returns the response body and the raw ETag header value.
Sourcepub async fn update_access_settings(
&self,
req: &UpdateAccessSettingsRequest,
etag: &str,
) -> Result<(AccessSettingsResponse, String)>
pub async fn update_access_settings( &self, req: &UpdateAccessSettingsRequest, etag: &str, ) -> Result<(AccessSettingsResponse, String)>
Update access settings. etag must be the value returned by a prior
get_access_settings call — the server requires If-Match for optimistic locking.
Sourcepub async fn get_agent_certificate_settings(
&self,
) -> Result<AgentCertificateSettingsResponse>
pub async fn get_agent_certificate_settings( &self, ) -> Result<AgentCertificateSettingsResponse>
Get agent certificate settings.
Sourcepub async fn update_agent_certificate_settings(
&self,
req: &UpdateAgentCertificateSettingsRequest,
) -> Result<AgentCertificateSettingsResponse>
pub async fn update_agent_certificate_settings( &self, req: &UpdateAgentCertificateSettingsRequest, ) -> Result<AgentCertificateSettingsResponse>
Update agent certificate settings.
Sourcepub async fn get_network_settings(&self) -> Result<NetworkSettingsResponse>
pub async fn get_network_settings(&self) -> Result<NetworkSettingsResponse>
Get network settings.
Sourcepub async fn update_network_settings(
&self,
req: &UpdateNetworkSettingsRequest,
) -> Result<NetworkSettingsResponse>
pub async fn update_network_settings( &self, req: &UpdateNetworkSettingsRequest, ) -> Result<NetworkSettingsResponse>
Update network settings.
Sourcepub async fn rotate_ca(&self) -> Result<RotateCaResponse>
pub async fn rotate_ca(&self) -> Result<RotateCaResponse>
Rotate the CA certificate.
Sourcepub async fn renew_server_certificate(&self) -> Result<RenewServerCertResponse>
pub async fn renew_server_certificate(&self) -> Result<RenewServerCertResponse>
Renew the server TLS certificate.
Sourcepub async fn reset_data(
&self,
req: &ResetDataRequest,
) -> Result<ResetDataResponse>
pub async fn reset_data( &self, req: &ResetDataRequest, ) -> Result<ResetDataResponse>
Reset all tenant-scoped data.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn get_nats_settings(&self) -> Result<NatsSettingsResponse>
pub async fn get_nats_settings(&self) -> Result<NatsSettingsResponse>
Get the global NATS server URL settings.
Sourcepub async fn update_nats_settings(
&self,
req: &UpdateNatsSettingsRequest,
) -> Result<NatsSettingsResponse>
pub async fn update_nats_settings( &self, req: &UpdateNatsSettingsRequest, ) -> Result<NatsSettingsResponse>
Update the global NATS server URL settings.
Changes take effect after the controller is restarted.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn get_github_provider_settings(
&self,
) -> Result<GitHubProviderSettingsResponse>
pub async fn get_github_provider_settings( &self, ) -> Result<GitHubProviderSettingsResponse>
Get global GitHub provider settings.
Sourcepub async fn update_github_provider_settings(
&self,
req: &UpdateGitHubProviderSettingsRequest,
) -> Result<GitHubProviderSettingsResponse>
pub async fn update_github_provider_settings( &self, req: &UpdateGitHubProviderSettingsRequest, ) -> Result<GitHubProviderSettingsResponse>
Update global GitHub provider settings.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_software_items(
&self,
params: &ListSoftwareItemsParams,
) -> Result<PaginatedResponse<SoftwareItemResponse>>
pub async fn list_software_items( &self, params: &ListSoftwareItemsParams, ) -> Result<PaginatedResponse<SoftwareItemResponse>>
List software items with pagination and optional discovery state filter.
Sourcepub async fn preview_software_item_merge(
&self,
req: &MergeSoftwareItemsPreviewRequest,
) -> Result<MergeSoftwareItemsPreviewResponse>
pub async fn preview_software_item_merge( &self, req: &MergeSoftwareItemsPreviewRequest, ) -> Result<MergeSoftwareItemsPreviewResponse>
Preview a manual merge of software items.
Sourcepub async fn execute_software_item_merge(
&self,
req: &MergeSoftwareItemsExecuteRequest,
) -> Result<MergeSoftwareItemsExecuteResponse>
pub async fn execute_software_item_merge( &self, req: &MergeSoftwareItemsExecuteRequest, ) -> Result<MergeSoftwareItemsExecuteResponse>
Execute a manual merge of software items.
Sourcepub async fn list_all_software_items(&self) -> Result<Vec<SoftwareItemResponse>>
pub async fn list_all_software_items(&self) -> Result<Vec<SoftwareItemResponse>>
Fetch all software items across all pages.
Automatically iterates through every page at MAX_PER_PAGE items per
request. Use list_software_items for manual pagination control.
Sourcepub async fn get_software_item(
&self,
id: &Uuid,
) -> Result<SoftwareItemDetailResponse>
pub async fn get_software_item( &self, id: &Uuid, ) -> Result<SoftwareItemDetailResponse>
Get a single software item by ID (detailed view with host info).
Sourcepub async fn create_software_item(
&self,
req: &CreateSoftwareItemRequest,
) -> Result<SoftwareItemResponse>
pub async fn create_software_item( &self, req: &CreateSoftwareItemRequest, ) -> Result<SoftwareItemResponse>
Create a new software item (catalog entry — name and enabled flag only).
Sourcepub async fn update_software_item(
&self,
id: &Uuid,
req: &UpdateSoftwareItemRequest,
) -> Result<SoftwareItemResponse>
pub async fn update_software_item( &self, id: &Uuid, req: &UpdateSoftwareItemRequest, ) -> Result<SoftwareItemResponse>
Update an existing software item (name and/or enabled flag).
Sourcepub async fn delete_software_item(&self, id: &Uuid) -> Result<()>
pub async fn delete_software_item(&self, id: &Uuid) -> Result<()>
Delete a software item.
Sourcepub async fn assign_hosts(
&self,
id: &Uuid,
req: &AssignHostsRequest,
) -> Result<SoftwareItemDetailResponse>
pub async fn assign_hosts( &self, id: &Uuid, req: &AssignHostsRequest, ) -> Result<SoftwareItemDetailResponse>
Assign hosts to a software item.
Each host assignment carries its own plugin_config_id, package_identifier,
and optional config_override.
Sourcepub async fn unassign_host(&self, item_id: &Uuid, host_id: &Uuid) -> Result<()>
pub async fn unassign_host(&self, item_id: &Uuid, host_id: &Uuid) -> Result<()>
Unassign a host from a software item.
Sourcepub async fn unassign_host_with_ignore(
&self,
item_id: &Uuid,
host_id: &Uuid,
) -> Result<()>
pub async fn unassign_host_with_ignore( &self, item_id: &Uuid, host_id: &Uuid, ) -> Result<()>
Unassign a host from a software item and create an autodiscovery ignore rule.
Equivalent to DELETE .../hosts/{host_id}?ignore=true. The ignore rule is created for
the (plugin_config_id, package_identifier) pair stored on the host assignment,
preventing re-discovery of that package on any host in the future.
Sourcepub async fn update_host_assignment(
&self,
item_id: &Uuid,
host_id: &Uuid,
req: &UpdateHostAssignmentRequest,
) -> Result<SoftwareItemDetailResponse>
pub async fn update_host_assignment( &self, item_id: &Uuid, host_id: &Uuid, req: &UpdateHostAssignmentRequest, ) -> Result<SoftwareItemDetailResponse>
Update the plugin assignment for a specific host–software-item link.
Sourcepub async fn delete_plugin_assignment(
&self,
item_id: &Uuid,
host_id: &Uuid,
role: &str,
ordinal: i32,
) -> Result<SoftwareItemDetailResponse>
pub async fn delete_plugin_assignment( &self, item_id: &Uuid, host_id: &Uuid, role: &str, ordinal: i32, ) -> Result<SoftwareItemDetailResponse>
Remove a specific plugin assignment by role and ordinal.
Sourcepub async fn check_versions(
&self,
item_id: &Uuid,
) -> Result<TriggerVersionCheckResponse>
pub async fn check_versions( &self, item_id: &Uuid, ) -> Result<TriggerVersionCheckResponse>
Trigger a version check for a software item across all assigned hosts.
Sourcepub async fn check_versions_host(
&self,
item_id: &Uuid,
host_id: &Uuid,
) -> Result<TriggerVersionCheckResponse>
pub async fn check_versions_host( &self, item_id: &Uuid, host_id: &Uuid, ) -> Result<TriggerVersionCheckResponse>
Trigger a version check for a software item on a specific host.
Sourcepub async fn trigger_update(
&self,
item_id: &Uuid,
host_id: &Uuid,
req: &TriggerUpdateRequest,
) -> Result<TriggerUpdateResponse>
pub async fn trigger_update( &self, item_id: &Uuid, host_id: &Uuid, req: &TriggerUpdateRequest, ) -> Result<TriggerUpdateResponse>
Trigger an update for a software item on a specific host.
Sourcepub async fn batch_software_items(
&self,
req: &BatchActionRequest,
) -> Result<BatchActionResponse>
pub async fn batch_software_items( &self, req: &BatchActionRequest, ) -> Result<BatchActionResponse>
Perform a batch action on multiple software items.
Supported actions: approve, delete.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_surfaces(
&self,
slot: Option<&str>,
page: Option<&str>,
) -> Result<Vec<SurfaceResponse>>
pub async fn list_surfaces( &self, slot: Option<&str>, page: Option<&str>, ) -> Result<Vec<SurfaceResponse>>
List registered surfaces. Optional slot and page filters map to query params.
Sourcepub async fn list_surface_providers(
&self,
surface_id: &str,
) -> Result<Vec<SurfaceProviderInfo>>
pub async fn list_surface_providers( &self, surface_id: &str, ) -> Result<Vec<SurfaceProviderInfo>>
List targeted providers for a surface.
Sourcepub async fn read_surface(
&self,
surface_id: &str,
) -> Result<SurfaceReadResponse>
pub async fn read_surface( &self, surface_id: &str, ) -> Result<SurfaceReadResponse>
Read a single surface with its interactions and data sources.
Sourcepub async fn read_surface_interaction(
&self,
surface_id: &str,
interaction_id: &str,
query: &[(&str, String)],
) -> Result<Value>
pub async fn read_surface_interaction( &self, surface_id: &str, interaction_id: &str, query: &[(&str, String)], ) -> Result<Value>
Read a surface interaction via GET. query pairs are forwarded verbatim
as query-string parameters (reserved keys included).
Sourcepub async fn invoke_surface_interaction(
&self,
surface_id: &str,
interaction_id: &str,
request: &InvokeSurfaceInteractionRequest,
) -> Result<Value>
pub async fn invoke_surface_interaction( &self, surface_id: &str, interaction_id: &str, request: &InvokeSurfaceInteractionRequest, ) -> Result<Value>
Invoke a surface interaction.
Sourcepub async fn update_surface_interaction(
&self,
surface_id: &str,
interaction_id: &str,
request: &InvokeSurfaceInteractionRequest,
) -> Result<Value>
pub async fn update_surface_interaction( &self, surface_id: &str, interaction_id: &str, request: &InvokeSurfaceInteractionRequest, ) -> Result<Value>
Update a surface interaction via PUT.
Sourcepub async fn delete_surface_interaction(
&self,
surface_id: &str,
interaction_id: &str,
request: &InvokeSurfaceInteractionRequest,
) -> Result<Value>
pub async fn delete_surface_interaction( &self, surface_id: &str, interaction_id: &str, request: &InvokeSurfaceInteractionRequest, ) -> Result<Value>
Delete a surface interaction via DELETE.
Sourcepub async fn read_surface_interaction_item(
&self,
surface_id: &str,
interaction_id: &str,
item_id: &str,
query: &[(&str, String)],
) -> Result<Value>
pub async fn read_surface_interaction_item( &self, surface_id: &str, interaction_id: &str, item_id: &str, query: &[(&str, String)], ) -> Result<Value>
Read a surface interaction targeting a specific item via GET .../{item_id}.
Sourcepub async fn update_surface_interaction_item(
&self,
surface_id: &str,
interaction_id: &str,
item_id: &str,
request: &InvokeSurfaceInteractionRequest,
) -> Result<Value>
pub async fn update_surface_interaction_item( &self, surface_id: &str, interaction_id: &str, item_id: &str, request: &InvokeSurfaceInteractionRequest, ) -> Result<Value>
Update a surface interaction targeting a specific item via PUT .../{item_id}.
Sourcepub async fn delete_surface_interaction_item(
&self,
surface_id: &str,
interaction_id: &str,
item_id: &str,
request: &InvokeSurfaceInteractionRequest,
) -> Result<Value>
pub async fn delete_surface_interaction_item( &self, surface_id: &str, interaction_id: &str, item_id: &str, request: &InvokeSurfaceInteractionRequest, ) -> Result<Value>
Delete a surface interaction targeting a specific item via DELETE .../{item_id}.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn get_system_alerts(&self) -> Result<SystemAlertsResponse>
pub async fn get_system_alerts(&self) -> Result<SystemAlertsResponse>
Get active system alerts.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn create_system_enrollment_token(
&self,
req: &CreateSystemEnrollmentTokenRequest,
) -> Result<SystemEnrollmentTokenCreatedResponse>
pub async fn create_system_enrollment_token( &self, req: &CreateSystemEnrollmentTokenRequest, ) -> Result<SystemEnrollmentTokenCreatedResponse>
Create a new system enrollment token.
The plaintext token is only returned in this response — store it securely immediately after creation.
Sourcepub async fn list_system_enrollment_tokens(
&self,
query: &ListSystemEnrollmentTokensQuery,
) -> Result<PaginatedResponse<SystemEnrollmentTokenResponse>>
pub async fn list_system_enrollment_tokens( &self, query: &ListSystemEnrollmentTokensQuery, ) -> Result<PaginatedResponse<SystemEnrollmentTokenResponse>>
List system enrollment tokens with pagination.
Sourcepub async fn list_all_system_enrollment_tokens(
&self,
query: &ListSystemEnrollmentTokensQuery,
) -> Result<Vec<SystemEnrollmentTokenResponse>>
pub async fn list_all_system_enrollment_tokens( &self, query: &ListSystemEnrollmentTokensQuery, ) -> Result<Vec<SystemEnrollmentTokenResponse>>
Fetch all system enrollment tokens across all pages.
Sourcepub async fn get_system_enrollment_token(
&self,
id: &Uuid,
) -> Result<SystemEnrollmentTokenResponse>
pub async fn get_system_enrollment_token( &self, id: &Uuid, ) -> Result<SystemEnrollmentTokenResponse>
Get a single system enrollment token by ID.
Sourcepub async fn revoke_system_enrollment_token(&self, id: &Uuid) -> Result<()>
pub async fn revoke_system_enrollment_token(&self, id: &Uuid) -> Result<()>
Revoke a system enrollment token (soft-delete).
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_system_services(
&self,
query: &ListSystemServicesQuery,
) -> Result<PaginatedResponse<SystemServiceResponse>>
pub async fn list_system_services( &self, query: &ListSystemServicesQuery, ) -> Result<PaginatedResponse<SystemServiceResponse>>
List system services with optional filters and pagination.
Sourcepub async fn list_all_system_services(
&self,
query: &ListSystemServicesQuery,
) -> Result<Vec<SystemServiceResponse>>
pub async fn list_all_system_services( &self, query: &ListSystemServicesQuery, ) -> Result<Vec<SystemServiceResponse>>
Fetch all system services matching the given filters across all pages.
Automatically iterates through every page at MAX_PER_PAGE items per
request. The page and per_page fields of query are ignored; use
list_system_services for manual pagination control.
Sourcepub async fn get_system_service(
&self,
id: &Uuid,
) -> Result<SystemServiceResponse>
pub async fn get_system_service( &self, id: &Uuid, ) -> Result<SystemServiceResponse>
Get a single system service by ID.
Sourcepub async fn approve_system_service(
&self,
id: &Uuid,
) -> Result<SystemServiceResponse>
pub async fn approve_system_service( &self, id: &Uuid, ) -> Result<SystemServiceResponse>
Approve a pending system service.
Sourcepub async fn reject_system_service(
&self,
id: &Uuid,
) -> Result<SystemServiceResponse>
pub async fn reject_system_service( &self, id: &Uuid, ) -> Result<SystemServiceResponse>
Reject a pending system service.
Sourcepub async fn update_system_service(
&self,
id: &Uuid,
req: &UpdateSystemServiceRequest,
) -> Result<SystemServiceResponse>
pub async fn update_system_service( &self, id: &Uuid, req: &UpdateSystemServiceRequest, ) -> Result<SystemServiceResponse>
Update a system service’s configurable settings (e.g. ping interval).
Sourcepub async fn remove_system_service(&self, id: &Uuid) -> Result<()>
pub async fn remove_system_service(&self, id: &Uuid) -> Result<()>
Deactivate (remove) a system service.
Sourcepub async fn batch_system_services(
&self,
req: &BatchActionRequest,
) -> Result<BatchActionResponse>
pub async fn batch_system_services( &self, req: &BatchActionRequest, ) -> Result<BatchActionResponse>
Perform a batch action on multiple system services.
Supported actions: approve, reject, deactivate.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn trigger_host_batch_update(
&self,
host_id: &Uuid,
req: &HostBatchUpdateRequest,
) -> Result<BatchUpdateResponse>
pub async fn trigger_host_batch_update( &self, host_id: &Uuid, req: &HostBatchUpdateRequest, ) -> Result<BatchUpdateResponse>
Trigger a host-wide batch update for all outdated software items on a host.
Sourcepub async fn trigger_item_batch_update(
&self,
item_id: &Uuid,
req: &ItemBatchUpdateRequest,
) -> Result<BatchUpdateResponse>
pub async fn trigger_item_batch_update( &self, item_id: &Uuid, req: &ItemBatchUpdateRequest, ) -> Result<BatchUpdateResponse>
Trigger an item-wide batch update to roll out a software item to hosts.
Sourcepub async fn list_update_batches(
&self,
query: &UpdateBatchListQuery,
) -> Result<PaginatedResponse<UpdateBatchSummaryResponse>>
pub async fn list_update_batches( &self, query: &UpdateBatchListQuery, ) -> Result<PaginatedResponse<UpdateBatchSummaryResponse>>
List update batches with optional filters and pagination.
Sourcepub async fn list_all_update_batches(
&self,
query: &UpdateBatchListQuery,
) -> Result<Vec<UpdateBatchSummaryResponse>>
pub async fn list_all_update_batches( &self, query: &UpdateBatchListQuery, ) -> Result<Vec<UpdateBatchSummaryResponse>>
Fetch all update batches matching the given filters across all pages.
Sourcepub async fn get_update_batch(
&self,
id: &Uuid,
) -> Result<UpdateBatchDetailResponse>
pub async fn get_update_batch( &self, id: &Uuid, ) -> Result<UpdateBatchDetailResponse>
Get a single update batch with per-item update details.
Sourcepub fn batch_progress_stream_path(id: &Uuid) -> String
pub fn batch_progress_stream_path(id: &Uuid) -> String
Returns the relative path for the batch progress SSE stream.
The caller should combine this with the base URL and use an SSE/EventSource client to consume it.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_update_history(
&self,
query: &UpdateHistoryQuery,
) -> Result<PaginatedResponse<UpdateHistoryResponse>>
pub async fn list_update_history( &self, query: &UpdateHistoryQuery, ) -> Result<PaginatedResponse<UpdateHistoryResponse>>
List update history with optional filters and pagination.
Sourcepub async fn list_all_update_history(
&self,
query: &UpdateHistoryQuery,
) -> Result<Vec<UpdateHistoryResponse>>
pub async fn list_all_update_history( &self, query: &UpdateHistoryQuery, ) -> Result<Vec<UpdateHistoryResponse>>
Fetch all update history entries matching the given filters across all pages.
Automatically iterates through every page at MAX_PER_PAGE items per
request. The page and per_page fields of query are ignored; use
list_update_history for manual pagination control.
Sourcepub async fn get_update_history(
&self,
id: &Uuid,
) -> Result<UpdateHistoryResponse>
pub async fn get_update_history( &self, id: &Uuid, ) -> Result<UpdateHistoryResponse>
Get a single update history entry by ID.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn stream_update_output(
&self,
id: &Uuid,
) -> Result<impl Stream<Item = Result<UpdateOutputEvent, StreamError>>>
pub async fn stream_update_output( &self, id: &Uuid, ) -> Result<impl Stream<Item = Result<UpdateOutputEvent, StreamError>>>
Connect to the update output SSE stream and return a stream of typed events.
The returned stream yields UpdateOutputEvent values until the update
completes (indicated by a Completed event) or the connection closes.
This method uses no request timeout since SSE connections are long-lived.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub async fn list_users(&self) -> Result<Vec<UserWithRolesResponse>>
pub async fn list_users(&self) -> Result<Vec<UserWithRolesResponse>>
List all users with their roles.
Sourcepub async fn get_user(&self, id: &Uuid) -> Result<UserWithRolesResponse>
pub async fn get_user(&self, id: &Uuid) -> Result<UserWithRolesResponse>
Get a single user by ID with roles.
Sourcepub async fn update_user_roles(
&self,
id: &Uuid,
req: &UpdateUserRolesRequest,
) -> Result<UserWithRolesResponse>
pub async fn update_user_roles( &self, id: &Uuid, req: &UpdateUserRolesRequest, ) -> Result<UserWithRolesResponse>
Replace a user’s roles.
Sourcepub async fn update_user_active(
&self,
id: &Uuid,
req: &UpdateUserActiveRequest,
) -> Result<UserWithRolesResponse>
pub async fn update_user_active( &self, id: &Uuid, req: &UpdateUserActiveRequest, ) -> Result<UserWithRolesResponse>
Activate or deactivate a user.
Source§impl UptrakitClient
impl UptrakitClient
Sourcepub fn new(
base_url: &str,
token: Option<&str>,
insecure: bool,
ca_pem: Option<&str>,
request_timeout: Option<Duration>,
) -> Result<Self>
pub fn new( base_url: &str, token: Option<&str>, insecure: bool, ca_pem: Option<&str>, request_timeout: Option<Duration>, ) -> Result<Self>
Create a new client. Pass token: None for unauthenticated endpoints
(e.g. the device authorization flow).
When ca_pem is Some, the provided PEM replaces system root
certificates entirely (via tls_certs_only). This is the correct
approach for private CA trust — add_root_certificate is deprecated
because it appends to rather than replacing system roots.
insecure = true takes precedence over ca_pem and disables all TLS
verification. ca_pem is ignored when insecure is true.
request_timeout overrides DEFAULT_REQUEST_TIMEOUT when Some.
Sourcepub fn with_token(
base_url: &str,
token: &str,
insecure: bool,
ca_pem: Option<&str>,
) -> Result<Self>
pub fn with_token( base_url: &str, token: &str, insecure: bool, ca_pem: Option<&str>, ) -> Result<Self>
Create a client with a required bearer token.
When ca_pem is Some, the provided PEM replaces system root
certificates (see Self::new for details).
Sourcepub fn with_retry(self, config: RetryConfig) -> Self
pub fn with_retry(self, config: RetryConfig) -> Self
Enable automatic retry on transient failures (429 and 5xx).
Returns a new client with the given retry configuration. By default,
the client fails fast with no retries. Retries use exponential backoff
for 5xx errors and respect Retry-After headers for 429 errors.
Sourcepub async fn raw_request(
&self,
method: &str,
path: &str,
body: Option<Value>,
) -> Result<RawResponse>
pub async fn raw_request( &self, method: &str, path: &str, body: Option<Value>, ) -> Result<RawResponse>
Execute a raw (untyped) API request. Used by the CLI api escape-hatch command.
Auto Trait Implementations§
impl !RefUnwindSafe for UptrakitClient
impl !UnwindSafe for UptrakitClient
impl Freeze for UptrakitClient
impl Send for UptrakitClient
impl Sync for UptrakitClient
impl Unpin for UptrakitClient
impl UnsafeUnpin for UptrakitClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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