Skip to content

Commit acff77d

Browse files
authored
CLI: use namespace instead of org name (#782)
1 parent 6b33be3 commit acff77d

File tree

6 files changed

+25
-28
lines changed

6 files changed

+25
-28
lines changed

tembo-cli/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tembo-cli/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
workspace = { members = ["temboclient", "tembodataclient"] }
22
[package]
33
name = "tembo-cli"
4-
version = "0.20.4"
4+
version = "0.20.5"
55
edition = "2021"
66
authors = ["Tembo.io"]
77
description = "The CLI for Tembo"
@@ -54,7 +54,7 @@ dateparser = "0.2.0"
5454
log = "0.4.20"
5555
tera = "1.18.1"
5656
curl = "0.4.44"
57-
temboclient = { version = "1.0.1", path = "temboclient" }
57+
temboclient = { version = "1.0.2", path = "temboclient" }
5858
tembodataclient = { version = "0.0.2", path = "tembodataclient" }
5959
tokio = { version = "1.26.0", features = [
6060
"rt",
@@ -76,7 +76,7 @@ tembo-stacks = "0.7.0"
7676
itertools = "0.12.1"
7777
random-string = "1.1.0"
7878
test-case = "=2.0.0-rc2"
79-
clap-markdown = { git = "https://github.com/tembo-io/clap-markdown.git", branch = "main" }
79+
clap-markdown = { git = "https://github.com/tembo-io/clap-markdown.git", branch = "main", version = "0.1.3" }
8080

8181
[target.aarch64-unknown-linux-musl.dependencies]
8282
openssl = { version = "0.10", features = ["vendored"] }

tembo-cli/src/cmd/top.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ async fn fetch_metrics_loop(
100100
}
101101

102102
for value in instance_settings.values() {
103-
let org_name = get_instance_org_name(config, &env, &value.instance_name).await?;
104-
let namespace = format!("org-{}-inst-{}", org_name, &value.instance_name);
103+
let namespace = get_instance_namespace(config, &env, &value.instance_name).await?;
105104
let namespace_encoded = urlencoding::encode(&namespace);
106105

107106
let mut cpu_value = String::new();
@@ -227,7 +226,7 @@ async fn fetch_metric(
227226
Ok(response)
228227
}
229228

230-
async fn get_instance_org_name(
229+
async fn get_instance_namespace(
231230
config: &Configuration,
232231
env: &Environment,
233232
instance_name: &String,
@@ -250,7 +249,7 @@ async fn get_instance_org_name(
250249

251250
let instance_result = get_instance(config, org_id, &instance_id).await;
252251
match instance_result {
253-
Ok(instance) => Ok(instance.organization_name),
252+
Ok(instance) => Ok(instance.namespace),
254253
Err(e) => Err(e.into()),
255254
}
256255
}

tembo-cli/temboclient/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "temboclient"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
authors = ["OpenAPI Generator team and contributors"]
55
description = "Platform API for Tembo Cloud </br> </br> To find a Tembo Data API, please find it here: </br> </br> [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) "
66
# Override this license by providing a License Object in the OpenAPI.

tembo-cli/temboclient/docs/Instance.md

+12-14
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,26 @@ Name | Type | Description | Notes
77
**app_services** | Option<[**Vec<crate::models::AppType>**](AppType.md)> | | [optional]
88
**connection_info** | Option<[**crate::models::ConnectionInfo**](ConnectionInfo.md)> | | [optional]
99
**connection_pooler** | Option<[**crate::models::ConnectionPooler**](ConnectionPooler.md)> | | [optional]
10-
**cpu** | [**crate::models::Cpu**](Cpu.md) | |
10+
**cpu** | [**crate::models::Cpu**](Cpu.md) | |
1111
**created_at** | Option<**String**> | | [optional]
12-
**environment** | [**crate::models::Environment**](Environment.md) | |
12+
**environment** | [**crate::models::Environment**](Environment.md) | |
1313
**extensions** | Option<[**Vec<crate::models::ExtensionStatus>**](ExtensionStatus.md)> | | [optional]
1414
**extra_domains_rw** | Option<**Vec<String>**> | | [optional]
1515
**first_recoverability_time** | Option<**String**> | | [optional]
16-
**instance_id** | **String** | |
17-
**instance_name** | **String** | |
16+
**instance_id** | **String** | |
17+
**instance_name** | **String** | |
1818
**ip_allow_list** | Option<**Vec<String>**> | | [optional]
1919
**last_updated_at** | Option<**String**> | | [optional]
20-
**memory** | [**crate::models::Memory**](Memory.md) | |
21-
**organization_id** | **String** | |
22-
**organization_name** | **String** | |
20+
**memory** | [**crate::models::Memory**](Memory.md) | |
21+
**organization_id** | **String** | |
22+
**namespace** | **String** | |
2323
**postgres_configs** | Option<[**Vec<crate::models::PgConfig>**](PgConfig.md)> | | [optional]
24-
**postgres_version** | **i32** | Major Postgres version this instance is using. Currently: 14, 15 or 16 |
25-
**replicas** | **i32** | |
24+
**postgres_version** | **i32** | Major Postgres version this instance is using. Currently: 14, 15 or 16 |
25+
**replicas** | **i32** | |
2626
**runtime_config** | Option<[**Vec<crate::models::PgConfig>**](PgConfig.md)> | | [optional]
27-
**stack_type** | [**crate::models::StackType**](StackType.md) | |
28-
**state** | [**crate::models::State**](State.md) | |
29-
**storage** | [**crate::models::Storage**](Storage.md) | |
27+
**stack_type** | [**crate::models::StackType**](StackType.md) | |
28+
**state** | [**crate::models::State**](State.md) | |
29+
**storage** | [**crate::models::Storage**](Storage.md) | |
3030
**trunk_installs** | Option<[**Vec<crate::models::TrunkInstallStatus>**](TrunkInstallStatus.md)> | | [optional]
3131

3232
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
33-
34-

tembo-cli/temboclient/src/models/instance.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ pub struct Instance {
7070
pub memory: crate::models::Memory,
7171
#[serde(rename = "organization_id")]
7272
pub organization_id: String,
73-
#[serde(rename = "organization_name")]
74-
pub organization_name: String,
73+
#[serde(rename = "namespace")]
74+
pub namespace: String,
7575
#[serde(
7676
rename = "postgres_configs",
7777
default,
@@ -114,7 +114,7 @@ impl Instance {
114114
instance_name: String,
115115
memory: crate::models::Memory,
116116
organization_id: String,
117-
organization_name: String,
117+
namespace: String,
118118
postgres_version: i32,
119119
replicas: i32,
120120
stack_type: crate::models::StackType,
@@ -137,7 +137,7 @@ impl Instance {
137137
last_updated_at: None,
138138
memory,
139139
organization_id,
140-
organization_name,
140+
namespace,
141141
postgres_configs: None,
142142
postgres_version,
143143
replicas,

0 commit comments

Comments
 (0)