Skip to content

Commit 7e3df33

Browse files
authored
chore: update enterprise edition license url (#17445)
* chore: update enterprise edition license url https://docs.databend.com/guides/products/dee/ * create global str
1 parent 3d03417 commit 7e3df33

File tree

2 files changed

+46
-16
lines changed

2 files changed

+46
-16
lines changed

src/query/ee/src/license/license_mgr.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGsKCbhXU7j56VKZ7piDlLXGhud0a
3535
pWjW3wxSdeARerxs/BeoWK7FspDtfLaAT8iJe4YEmR0JpkRQ8foWs0ve3w==
3636
-----END PUBLIC KEY-----"#;
3737

38+
pub const LICENSE_URL: &str = "https://docs.databend.com/guides/overview/editions/dee/";
39+
3840
pub struct RealLicenseManager {
3941
tenant: String,
4042
public_keys: Vec<String>,
@@ -76,8 +78,8 @@ impl LicenseManager for RealLicenseManager {
7678
fn check_enterprise_enabled(&self, license_key: String, feature: Feature) -> Result<()> {
7779
if license_key.is_empty() {
7880
return feature.verify_default(format!(
79-
"The use of this feature requires a Databend Enterprise Edition license. No license key found for tenant: {}. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/",
80-
self.tenant
81+
"The use of this feature requires a Databend Enterprise Edition license. No license key found for tenant: {}. To unlock enterprise features, please contact Databend to obtain a license. Learn more at {}",
82+
self.tenant, LICENSE_URL
8183
));
8284
}
8385

@@ -199,7 +201,7 @@ impl RealLicenseManager {
199201
fn verify_if_expired(&self, feature: Feature) -> Result<()> {
200202
feature.verify_default("").map_err(|_|
201203
ErrorCode::LicenseKeyExpired(format!(
202-
"The use of this feature requires a Databend Enterprise Edition license. License key has expired for tenant: {}. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/",
204+
"The use of this feature requires a Databend Enterprise Edition license. License key has expired for tenant: {}. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/products/dee/",
203205
self.tenant
204206
))
205207
)

src/query/ee_features/resources_management/src/resources_management.rs

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ use databend_common_management::WarehouseInfo;
2424
use databend_common_meta_types::NodeInfo;
2525
use databend_common_meta_types::NodeType;
2626

27+
const ENTERPRISE_FEATURE_UNAVAILABLE_ERROR: &str = "The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/";
28+
2729
#[async_trait::async_trait]
2830
pub trait ResourcesManagement: Sync + Send + 'static {
2931
fn support_forward_warehouse_request(&self) -> bool;
@@ -96,31 +98,45 @@ impl ResourcesManagement for DummyResourcesManagement {
9698
}
9799

98100
async fn create_warehouse(&self, _: String, _: Vec<SelectedNode>) -> Result<WarehouseInfo> {
99-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
101+
Err(ErrorCode::Unimplemented(
102+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
103+
))
100104
}
101105

102106
async fn drop_warehouse(&self, _: String) -> Result<WarehouseInfo> {
103-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
107+
Err(ErrorCode::Unimplemented(
108+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
109+
))
104110
}
105111

106112
async fn resume_warehouse(&self, _: String) -> Result<()> {
107-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
113+
Err(ErrorCode::Unimplemented(
114+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
115+
))
108116
}
109117

110118
async fn suspend_warehouse(&self, _: String) -> Result<()> {
111-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
119+
Err(ErrorCode::Unimplemented(
120+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
121+
))
112122
}
113123

114124
async fn rename_warehouse(&self, _: String, _: String) -> Result<()> {
115-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
125+
Err(ErrorCode::Unimplemented(
126+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
127+
))
116128
}
117129

118130
async fn inspect_warehouse(&self, _: String) -> Result<Vec<NodeInfo>> {
119-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
131+
Err(ErrorCode::Unimplemented(
132+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
133+
))
120134
}
121135

122136
async fn list_warehouses(&self) -> Result<Vec<WarehouseInfo>> {
123-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
137+
Err(ErrorCode::Unimplemented(
138+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
139+
))
124140
}
125141

126142
async fn add_warehouse_cluster(
@@ -129,35 +145,47 @@ impl ResourcesManagement for DummyResourcesManagement {
129145
_: String,
130146
_: Vec<SelectedNode>,
131147
) -> Result<()> {
132-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
148+
Err(ErrorCode::Unimplemented(
149+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
150+
))
133151
}
134152

135153
async fn rename_warehouse_cluster(&self, _: String, _: String, _: String) -> Result<()> {
136-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
154+
Err(ErrorCode::Unimplemented(
155+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
156+
))
137157
}
138158

139159
async fn drop_warehouse_cluster(&self, _: String, _: String) -> Result<()> {
140-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
160+
Err(ErrorCode::Unimplemented(
161+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
162+
))
141163
}
142164

143165
async fn assign_warehouse_nodes(
144166
&self,
145167
_: String,
146168
_: HashMap<String, Vec<SelectedNode>>,
147169
) -> Result<()> {
148-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
170+
Err(ErrorCode::Unimplemented(
171+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
172+
))
149173
}
150174

151175
async fn unassign_warehouse_nodes(
152176
&self,
153177
_: String,
154178
_: HashMap<String, Vec<SelectedNode>>,
155179
) -> Result<()> {
156-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
180+
Err(ErrorCode::Unimplemented(
181+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
182+
))
157183
}
158184

159185
async fn list_online_nodes(&self) -> Result<Vec<NodeInfo>> {
160-
Err(ErrorCode::Unimplemented("The use of this feature requires a Databend Enterprise Edition license. To unlock enterprise features, please contact Databend to obtain a license. Learn more at https://docs.databend.com/guides/overview/editions/dee/"))
186+
Err(ErrorCode::Unimplemented(
187+
ENTERPRISE_FEATURE_UNAVAILABLE_ERROR,
188+
))
161189
}
162190
}
163191

0 commit comments

Comments
 (0)