Skip to content

Commit

Permalink
Merge pull request #16 from Oreoxmt/fix/13
Browse files Browse the repository at this point in the history
Release 1.0.3
  • Loading branch information
Oreoxmt authored Dec 5, 2022
2 parents 201b382 + 6407627 commit c29d334
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ config\
cluster = project.create_cluster(config)
print(cluster)
cluster.wait_for_ready()
cluster.wait_for_available()
```
### Connect to TiDB
Expand Down Expand Up @@ -223,7 +223,7 @@ print("The original config is: {}".format(cluster.config.components.to_object())
new_config = UpdateClusterConfig()
new_config.update_component("tiflash", node_quantity=1, node_size="8C64G", storage_size_gib=500)
cluster.update(new_config)
cluster.wait_for_ready()
cluster.wait_for_available()
print("The new config is: {}".format(cluster.config.components.to_object()))
```
Expand Down
2 changes: 1 addition & 1 deletion examples/2_1_create_serverless_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
cluster = project.create_cluster(config)
print(cluster)

cluster.wait_for_ready()
cluster.wait_for_available()
2 changes: 1 addition & 1 deletion examples/2_2_create_dedicated_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
cluster = project.create_cluster(config)
print(cluster)

cluster.wait_for_ready()
cluster.wait_for_available()
2 changes: 1 addition & 1 deletion examples/4_scale_a_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
new_config = UpdateClusterConfig()
new_config.update_component("tiflash", node_quantity=1, node_size="8C64G", storage_size_gib=500)
cluster.update(new_config)
cluster.wait_for_ready()
cluster.wait_for_available()
print("The new config is: {}".format(cluster.config.components.to_object()))
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tidbcloudy"
version = "1.0.2"
version = "1.0.3"
description = "Python SDK for TiDB Cloud"
readme = "README.md"
authors = ["Aolin <[email protected]>"]
Expand Down
3 changes: 1 addition & 2 deletions tidbcloudy/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ def wait_for_available(self, *, timeout_sec: int = None, interval_sec: int = 10)
cluster_config = CreateClusterConfig()
cluster_config.set_name("your_cluster_name").set_cluster_type("your_cluster_type").set_cloud_provider("your_cloud_provider").set_region("your_region").set_port(4000).set_root_password("your_root_password")
cluster = project.create_cluster(cluster_config)
cluster.wait_for_ready()
cluster.wait_for_available()
"""
time_start = time.monotonic()
counter = 1
log("Cluster id={} is {}".format(self.id, self.status.cluster_status.value))
while True:
duration = time.monotonic() - time_start
minutes = duration - 60 * counter
Expand Down
2 changes: 1 addition & 1 deletion tidbcloudy/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def create_cluster(self, config: Union[CreateClusterConfig, dict]) -> Cluster:
.add_ip_access(cidr="your ip") \
.add_ip_access(cidr="your ip")
cluster = project.create_cluster(config)
cluster.wait_for_ready()
cluster.wait_for_available()
"""
if isinstance(config, CreateClusterConfig):
config = config.to_object()
Expand Down

0 comments on commit c29d334

Please sign in to comment.