Skip to content

Commit

Permalink
Tanzu RabbitMQ support: SDS status
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jan 17, 2025
1 parent 99424a3 commit 054f5eb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
20 changes: 19 additions & 1 deletion src/blocking_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
self, BulkUserDelete, EnforcedLimitParams, ExchangeParams, Permissions, PolicyParams,
QueueParams, RuntimeParameterDefinition, UserParams, VirtualHostParams, XArguments,
},
responses::{self, BindingInfo, DefinitionSet},
responses::{self, BindingInfo, DefinitionSet, SchemaDefinitionSyncStatus},
};
use backtrace::Backtrace;
use reqwest::{
Expand Down Expand Up @@ -1238,6 +1238,24 @@ where
Ok(response)
}

//
// Schema Definition Sync (Tanzu RabbitMQ)
//

pub fn schema_definition_sync_status(&self, node: Option<&str>) -> Result<SchemaDefinitionSyncStatus> {
let response = match node {
Some(val) => {
self.http_get(path!("tanzu", "osr", "schema", "status", val), None, None)?
}
None => {
self.http_get("tanzu/osr/schema/status", None, None)?
}
};
let response = response.json()?;

Ok(response)
}

//
// Implementation
//
Expand Down
18 changes: 15 additions & 3 deletions src/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ impl From<FeatureFlagState> for String {
fn from(value: FeatureFlagState) -> Self {
match value {
FeatureFlagState::Enabled => "enabled".to_owned(),
FeatureFlagState::Disabled => "disbled".to_owned(),
FeatureFlagState::Disabled => "disabled".to_owned(),
FeatureFlagState::StateChanging => "state_changing".to_owned(),
FeatureFlagState::Unavailable => "unavailable".to_owned(),
}
Expand Down Expand Up @@ -1224,7 +1224,7 @@ impl From<&str> for DeprecationPhase {
fn from(value: &str) -> Self {
match value {
"permitted_by_default" => DeprecationPhase::PermittedByDefault,
"denited_by_default" => DeprecationPhase::DeniedByDefault,
"denied_by_default" => DeprecationPhase::DeniedByDefault,
"disconnected" => DeprecationPhase::Disconnected,
"removed" => DeprecationPhase::Removed,
_ => DeprecationPhase::Undefined,
Expand All @@ -1236,7 +1236,7 @@ impl From<String> for DeprecationPhase {
fn from(value: String) -> Self {
match value.as_str() {
"permitted_by_default" => DeprecationPhase::PermittedByDefault,
"denited_by_default" => DeprecationPhase::DeniedByDefault,
"denied_by_default" => DeprecationPhase::DeniedByDefault,
"disconnected" => DeprecationPhase::Disconnected,
"removed" => DeprecationPhase::Removed,
_ => DeprecationPhase::Undefined,
Expand Down Expand Up @@ -1286,6 +1286,18 @@ pub struct DeprecatedFeature {
#[serde(transparent)]
pub struct DeprecatedFeatureList(pub Vec<DeprecatedFeature>);

#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "tabled", derive(Tabled))]
#[allow(dead_code)]
pub struct SchemaDefinitionSyncStatus {
pub node: String,
pub upstream_username: String,
}

//
// Implementation
//

fn undefined() -> String {
"?".to_string()
}
Expand Down

0 comments on commit 054f5eb

Please sign in to comment.