File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/codeflare_sdk/cli/commands Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import click
2
+ from kubernetes import client , config
3
+
4
+ from codeflare_sdk .cluster .cluster import (
5
+ list_clusters_all_namespaces ,
6
+ list_all_clusters ,
7
+ get_current_namespace ,
8
+ )
9
+ from codeflare_sdk .cli .cli_utils import load_auth
10
+
11
+
12
+ @click .group ()
13
+ def cli ():
14
+ """List a specified resource"""
15
+ pass
16
+
17
+
18
+ @cli .command ()
19
+ @click .option ("--namespace" )
20
+ @click .option ("--all" , is_flag = True )
21
+ @click .pass_context
22
+ def rayclusters (ctx , namespace , all ):
23
+ """List all rayclusters in a specified namespace"""
24
+ if all and namespace :
25
+ click .echo ("--all and --namespace are mutually exclusive" )
26
+ return
27
+ namespace = namespace or "default"
28
+ if not all :
29
+ list_all_clusters (namespace )
30
+ return
31
+ list_clusters_all_namespaces ()
You can’t perform that action at this time.
0 commit comments