File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,22 @@ def listMasInstances(dynClient: DynamicClient) -> list:
134134 return suites
135135
136136
137+ def listAiServiceInstances (dynClient : DynamicClient ) -> list :
138+ """
139+ Get a list of AI Service instances on the cluster
140+ """
141+ api = dynClient .resources .get (api_version = "aiservice.ibm.com/v1" , kind = "AIServiceApp" )
142+
143+ instances = api .get ().to_dict ()['items' ]
144+ if len (instances ) > 0 :
145+ logger .info (f"There are { len (instances )} AI Service instances installed on this cluster:" )
146+ for instance in instances :
147+ logger .info (f" * { instance ['metadata' ]['name' ]} v{ instance ['status' ]['versions' ]['reconciled' ]} " )
148+ else :
149+ logger .info ("There are no AI Service instances installed on this cluster" )
150+ return instances
151+
152+
137153def getWorkspaceId (dynClient : DynamicClient , instanceId : str ) -> str :
138154 """
139155 Get the MAS workspace ID for namespace "mas-{instanceId}-core"
You can’t perform that action at this time.
0 commit comments