File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class Config(BaseSettings):
88 # It is possible to override the default values by setting the environment variables
99 model_config = SettingsConfigDict (env_file = Path (".env" ))
1010
11- CENTML_WEB_URL : str = os .getenv ("CENTML_WEB_URL" , default = "http://localhost:5173" )
11+ CENTML_WEB_URL : str = os .getenv ("CENTML_WEB_URL" , default = "http://localhost:5173/ " )
1212 CENTML_CONFIG_PATH : str = os .getenv ("CENTML_CONFIG_PATH" , default = os .path .expanduser ("~/.centml" ))
1313 CENTML_CRED_FILE : str = os .getenv ("CENTML_CRED_FILE" , default = "credentials.json" )
1414 CENTML_CRED_FILE_PATH : str = os .path .join (CENTML_CONFIG_PATH , CENTML_CRED_FILE )
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """
3+ Example: Get available clusters
4+
5+ This example demonstrates how to retrieve cluster information
6+ using the CentML SDK.
7+ """
8+
9+ from centml .sdk .ops import get_centml_ops_client
10+
11+
12+ def main ():
13+ """Get and display cluster information"""
14+ print ("Retrieving cluster information..." )
15+
16+ with get_centml_ops_client () as ops_client :
17+ # Get all clusters
18+ clusters = ops_client .get_clusters ()
19+
20+ if not clusters :
21+ print ("No clusters found." )
22+ return
23+
24+ print (f"\n Found { len (clusters )} cluster(s):\n " )
25+
26+ for cluster in clusters :
27+ print (f"Cluster ID: { cluster .id } " )
28+ print (f" Display Name: { cluster .display_name } " )
29+ print (f" Region: { cluster .region or 'N/A' } " )
30+ print ()
31+
32+
33+ if __name__ == "__main__" :
34+ main ()
You can’t perform that action at this time.
0 commit comments