@@ -103,19 +103,28 @@ async def delete_cluster(self, name: str) -> Cluster:
103103
104104 @overload
105105 async def list_cluster_users (
106- self , cluster_name : str , with_user_info : Literal [True ]
106+ self ,
107+ cluster_name : str ,
108+ with_user_info : Literal [True ],
109+ org_name : Optional [str ] = None ,
107110 ) -> List [ClusterUserWithInfo ]:
108111 ...
109112
110113 @overload
111114 async def list_cluster_users (
112- self , cluster_name : str , with_user_info : Literal [False ] = ...
115+ self ,
116+ cluster_name : str ,
117+ with_user_info : Literal [False ] = ...,
118+ org_name : Optional [str ] = None ,
113119 ) -> List [ClusterUser ]:
114120 ...
115121
116122 @abstractmethod
117123 async def list_cluster_users (
118- self , cluster_name : str , with_user_info : bool = False
124+ self ,
125+ cluster_name : str ,
126+ with_user_info : bool = False ,
127+ org_name : Optional [str ] = None ,
119128 ) -> Union [List [ClusterUser ], List [ClusterUserWithInfo ]]:
120129 ...
121130
@@ -776,22 +785,35 @@ def _parse_cluster_user(
776785
777786 @overload
778787 async def list_cluster_users (
779- self , cluster_name : str , with_user_info : Literal [True ]
788+ self ,
789+ cluster_name : str ,
790+ with_user_info : Literal [True ],
791+ org_name : Optional [str ] = None ,
780792 ) -> List [ClusterUserWithInfo ]:
781793 ...
782794
783795 @overload
784796 async def list_cluster_users (
785- self , cluster_name : str , with_user_info : Literal [False ] = ...
797+ self ,
798+ cluster_name : str ,
799+ with_user_info : Literal [False ] = ...,
800+ org_name : Optional [str ] = None ,
786801 ) -> List [ClusterUser ]:
787802 ...
788803
789804 async def list_cluster_users (
790- self , cluster_name : str , with_user_info : bool = False
805+ self ,
806+ cluster_name : str ,
807+ with_user_info : bool = False ,
808+ org_name : Optional [str ] = None ,
791809 ) -> Union [List [ClusterUser ], List [ClusterUserWithInfo ]]:
810+ if org_name :
811+ url = f"clusters/{ cluster_name } /orgs/{ org_name } /users"
812+ else :
813+ url = f"clusters/{ cluster_name } /users"
792814 async with self ._request (
793815 "GET" ,
794- f"clusters/ { cluster_name } /users" ,
816+ url ,
795817 params = {"with_user_info" : _to_query_bool (with_user_info )},
796818 ) as resp :
797819 resp .raise_for_status ()
@@ -1804,18 +1826,27 @@ async def delete_cluster(self, name: str) -> Cluster:
18041826
18051827 @overload
18061828 async def list_cluster_users (
1807- self , cluster_name : str , with_user_info : Literal [True ]
1829+ self ,
1830+ cluster_name : str ,
1831+ with_user_info : Literal [True ],
1832+ org_name : Optional [str ] = None ,
18081833 ) -> List [ClusterUserWithInfo ]:
18091834 ...
18101835
18111836 @overload
18121837 async def list_cluster_users (
1813- self , cluster_name : str , with_user_info : Literal [False ] = ...
1838+ self ,
1839+ cluster_name : str ,
1840+ with_user_info : Literal [False ] = ...,
1841+ org_name : Optional [str ] = None ,
18141842 ) -> List [ClusterUser ]:
18151843 ...
18161844
18171845 async def list_cluster_users (
1818- self , cluster_name : str , with_user_info : bool = False
1846+ self ,
1847+ cluster_name : str ,
1848+ with_user_info : bool = False ,
1849+ org_name : Optional [str ] = None ,
18191850 ) -> Union [List [ClusterUser ], List [ClusterUserWithInfo ]]:
18201851 return [self .DUMMY_CLUSTER_USER ]
18211852
0 commit comments