Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Unreleased
- Displays Self-servce limits when listing quotas

# v0.38.14
- Fixes an issue where CM packages could not be uploaded due to batch count error

Expand Down
4 changes: 2 additions & 2 deletions api/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ pub enum Error {
#[error("Failed to initialise the HTTP client")]
BuildHttpClient(#[source] reqwest::Error),

#[error("HTTP request error: {}", message)]
#[error("HTTP request error: {} {}", message, source)]
ReqwestError {
message: String,
source: reqwest::Error,
},

#[error("An unknown error has occurred: {}", message)]
#[error("An unknown error has occurred: {} {}", message, source)]
Unknown {
message: String,
source: Box<dyn std::error::Error + Send + Sync + 'static>,
Expand Down
2 changes: 2 additions & 0 deletions api/src/resources/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ pub struct Quota {
pub hard_limit: u64,
pub quota_kind: TenantQuotaKind,
pub current_max_usage: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_increase_up_to: Option<u64>,
}

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
Expand Down
9 changes: 7 additions & 2 deletions cli/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,18 @@ impl DisplayTable for Bucket {

impl DisplayTable for Quota {
fn to_table_headers() -> Row {
row![bFg => "Kind", "Hard Limit", "Usage (Total)", "Usage %"]
row![bFg => "Kind", "Hard Limit", "Self-serve limit", "Usage (Total)", "Usage %", ]
}

fn to_table_row(&self) -> Row {
row![
self.quota_kind,
Thousands(self.hard_limit),
if let Some(auto_increase_up_to) = self.auto_increase_up_to {
Thousands(auto_increase_up_to).to_string()
} else {
"N/A".dimmed().to_string()
},
Thousands(self.current_max_usage),
if self.hard_limit > 0 {
format!(
Expand All @@ -113,7 +118,7 @@ impl DisplayTable for Quota {
)
} else {
"N/A".dimmed().to_string()
}
},
]
}
}
Expand Down
Loading