uptrakit_openapi_client/
discovery_allowlist.rs1use crate::Result;
4use crate::UptrakitClient;
5use crate::types_impl::discovery_allowlist::{
6 CreateDiscoveryAllowlistEntryRequest, HostDiscoveryAllowlistEntry,
7 TenantDiscoveryAllowlistEntry,
8};
9use uuid::Uuid;
10
11impl UptrakitClient {
12 pub async fn list_discovery_allowlist(&self) -> Result<Vec<TenantDiscoveryAllowlistEntry>> {
16 self.get(crate::paths::discovery_allowlist::BASE).await
17 }
18
19 pub async fn add_discovery_allowlist_entry(
23 &self,
24 req: &CreateDiscoveryAllowlistEntryRequest,
25 ) -> Result<TenantDiscoveryAllowlistEntry> {
26 self.post_json(crate::paths::discovery_allowlist::BASE, req)
27 .await
28 }
29
30 pub async fn remove_discovery_allowlist_entry(&self, id: &Uuid) -> Result<()> {
32 self.delete(&crate::paths::discovery_allowlist::by_id(id))
33 .await
34 }
35
36 pub async fn list_host_discovery_allowlist(
40 &self,
41 host_id: &Uuid,
42 ) -> Result<Vec<HostDiscoveryAllowlistEntry>> {
43 self.get(&crate::paths::discovery_allowlist::host_base(host_id))
44 .await
45 }
46
47 pub async fn add_host_discovery_allowlist_entry(
51 &self,
52 host_id: &Uuid,
53 req: &CreateDiscoveryAllowlistEntryRequest,
54 ) -> Result<HostDiscoveryAllowlistEntry> {
55 self.post_json(&crate::paths::discovery_allowlist::host_base(host_id), req)
56 .await
57 }
58
59 pub async fn remove_host_discovery_allowlist_entry(
61 &self,
62 host_id: &Uuid,
63 entry_id: &Uuid,
64 ) -> Result<()> {
65 self.delete(&crate::paths::discovery_allowlist::host_entry(
66 host_id, entry_id,
67 ))
68 .await
69 }
70}