File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 22
22
K8sClusterHostConfig ,
23
23
K8sClusterStatus ,
24
24
)
25
+ from hpecp .user import (
26
+ User
27
+ )
25
28
from hpecp import (
26
29
ContainerPlatformClient ,
27
30
ContainerPlatformClientException ,
@@ -821,6 +824,24 @@ def create(
821
824
print ("User already exists." )
822
825
sys .exit (1 )
823
826
827
+ def list (
828
+ self , output = "table" , columns = User .default_display_fields ,
829
+ ):
830
+ """Retrieve the list of Users
831
+ :param output: how to display the output [text|table|json]
832
+ """
833
+ if output == "table" :
834
+ print (get_client ().user .list ().tabulate (columns = columns ))
835
+ elif output == "text" :
836
+ print (
837
+ get_client ()
838
+ .user .list ()
839
+ .tabulate (
840
+ columns = columns , style = "plain" , display_headers = False ,
841
+ )
842
+ )
843
+ else :
844
+ print (get_client ().user .list ().json )
824
845
# raise NotImplementedError
825
846
826
847
You can’t perform that action at this time.
0 commit comments