1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// @generated — do not edit; run `cargo run -p nifi-openapi-gen`
use crate::NifiClient;
use crate::NifiError;
pub struct SiteToSiteApi<'a> {
pub(crate) client: &'a NifiClient,
}
#[allow(
private_interfaces,
clippy::too_many_arguments,
clippy::vec_init_then_push
)]
impl<'a> SiteToSiteApi<'a> {
/// Returns the details about this NiFi necessary to communicate via site to site
///
/// Calls `GET /nifi-api/site-to-site`.
///
/// # Errors
/// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
/// - `401`: Client could not be authenticated.
/// - `403`: Client is not authorized to make this request.
/// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
///
/// # Permissions
/// Requires `Read - /site-to-site`.
pub async fn get_site_to_site_details(
&self,
) -> Result<crate::v2_6_0::types::ControllerDto, NifiError> {
let e: crate::v2_6_0::types::ControllerEntity = self.client.get("/site-to-site").await?;
Ok(e.controller.unwrap_or_default())
}
/// Returns the available Peers and its status of this NiFi
///
/// Calls `GET /nifi-api/site-to-site/peers`.
///
/// # Errors
/// - `400`: NiFi was unable to complete the request because it was invalid. The request should not be retried without modification.
/// - `401`: Client could not be authenticated.
/// - `403`: Client is not authorized to make this request.
/// - `409`: The request was valid but NiFi was not in the appropriate state to process it.
///
/// # Permissions
/// Requires `Read - /site-to-site`.
pub async fn get_peers(&self) -> Result<crate::v2_6_0::types::PeersEntity, NifiError> {
self.client.get("/site-to-site/peers").await
}
}
#[allow(clippy::too_many_arguments)]
impl crate::v2_6_0::traits::SiteToSiteApi for SiteToSiteApi<'_> {
async fn get_site_to_site_details(
&self,
) -> Result<crate::v2_6_0::types::ControllerDto, NifiError> {
self.get_site_to_site_details().await
}
async fn get_peers(&self) -> Result<crate::v2_6_0::types::PeersEntity, NifiError> {
self.get_peers().await
}
}