@@ -177,7 +177,7 @@ def upload_bundle(self, fp, project_key=None):
177177
178178class DSSProjectDeployerInfra (object ):
179179 """
180- A Deployment infrastructure on the Project Deployer
180+ An Automation infrastructure on the Project Deployer
181181
182182 Do not create this directly, use :meth:`~dataikuapi.dss.projectdeployer.DSSProjectDeployer.get_infra`
183183 """
@@ -188,6 +188,16 @@ def __init__(self, client, infra_id):
188188 def id (self ):
189189 return self .infra_id
190190
191+ def get_status (self ):
192+ """
193+ Returns status information about this infrastructure
194+
195+ :rtype: a :class:`dataikuapi.dss.projectdeployer.DSSProjectDeployerInfraStatus`
196+ """
197+ light = self .client ._perform_json ("GET" , "/project-deployer/infras/%s" % (self .infra_id ))
198+
199+ return DSSProjectDeployerInfraStatus (self .client , self .infra_id , light )
200+
191201 def get_settings (self ):
192202 """
193203 Gets the settings of this infra. If you want to modify the settings, you need to
@@ -211,7 +221,8 @@ def delete(self):
211221
212222
213223class DSSProjectDeployerInfraSettings (object ):
214- """The settings of a Project Deployer Infra.
224+ """
225+ The settings of an Automation infrastructure.
215226
216227 Do not create this directly, use :meth:`~dataikuapi.dss.projectdeployer.DSSProjectDeployerInfra.get_settings`
217228 """
@@ -236,6 +247,33 @@ def save(self):
236247 body = self .settings )
237248
238249
250+ class DSSProjectDeployerInfraStatus (object ):
251+ """
252+ The status of an Automation infrastructure.
253+
254+ Do not create this directly, use :meth:`~dataikuapi.dss.projectdeployer.DSSProjectDeployerInfra.get_status`
255+ """
256+ def __init__ (self , client , infra_id , light_status ):
257+ self .client = client
258+ self .infra_id = infra_id
259+ self .light_status = light_status
260+
261+ def list_deployments (self ):
262+ """
263+ Returns the deployments that are deployed on this infrastructure
264+
265+ :returns: a list of deployments
266+ :rtype: list of :class:`dataikuapi.dss.projectdeployer.DSSProjectDeployerDeployment`
267+ """
268+ return [DSSProjectDeployerDeployment (self .client , deployment .id ) for deployment in self .light_status ["deployments" ]]
269+
270+ def get_raw (self ):
271+ """
272+ Gets the raw status information. This returns a dictionary with various information about the infrastructure
273+ :rtype: dict
274+ """
275+ return self .light_status
276+
239277###############################################
240278# Deployments
241279###############################################
@@ -444,6 +482,7 @@ def delete(self):
444482 return self .client ._perform_empty (
445483 "DELETE" , "/project-deployer/projects/%s" % (self .project_key ))
446484
485+
447486class DSSProjectDeployerProjectSettings (object ):
448487 """The settings of a published project.
449488
@@ -511,4 +550,4 @@ def get_raw(self):
511550 Gets the raw status information. This returns a dictionary with various information about the project
512551 :rtype: dict
513552 """
514- return self .light_status
553+ return self .light_status
0 commit comments