Skip to content

Commit 7bb0584

Browse files
author
Agathe Guillemot
committed
Miinor python doc fixes/improvements
1 parent 067f3eb commit 7bb0584

File tree

3 files changed

+53
-20
lines changed

3 files changed

+53
-20
lines changed

dataikuapi/dss/apideployer.py

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def list_stages(self):
6060
"""
6161
Lists infrastructure stages of the API Deployer
6262
63-
:rtype: a list of dict. Each dict contains a field "id" for the stage identifier and "desc" for its description.
63+
:rtype: list of dict. Each dict contains a field "id" for the stage identifier and "desc" for its description.
6464
:rtype: list
6565
"""
6666
return self.client._perform_json("GET", "/api-deployer/stages")
@@ -167,7 +167,7 @@ def get_status(self):
167167
"""
168168
Returns status information about this infrastructure
169169
170-
:rtype: a :class:`dataikuapi.dss.apideployer.DSSAPIDeployerInfraStatus`
170+
:rtype: :class:`dataikuapi.dss.apideployer.DSSAPIDeployerInfraStatus`
171171
"""
172172
light = self.client._perform_json("GET", "/api-deployer/infras/%s" % (self.infra_id))
173173

@@ -272,6 +272,7 @@ def list_deployments(self):
272272
def get_raw(self):
273273
"""
274274
Gets the raw status information. This returns a dictionary with various information about the infrastructure
275+
275276
:rtype: dict
276277
"""
277278
return self.light_status
@@ -295,7 +296,8 @@ def id(self):
295296
return self.deployment_id
296297

297298
def get_status(self):
298-
"""Returns status information about this deployment
299+
"""
300+
Returns status information about this deployment
299301
300302
:rtype: dataikuapi.dss.apideployer.DSSAPIDeployerDeploymentStatus
301303
"""
@@ -341,7 +343,8 @@ def delete(self):
341343

342344

343345
class DSSAPIDeployerDeploymentSettings(object):
344-
"""The settings of an API Deployer deployment.
346+
"""
347+
The settings of an API Deployer deployment.
345348
346349
Do not create this directly, use :meth:`~dataikuapi.dss.apideployer.DSSAPIDeployerDeployment.get_settings`
347350
"""
@@ -360,7 +363,9 @@ def get_raw(self):
360363
return self.settings
361364

362365
def set_enabled(self, enabled):
363-
"""Enables or disables this deployment"""
366+
"""
367+
Enables or disables this deployment
368+
"""
364369
self.settings["enabled"] = enabled
365370

366371
def set_single_version(self, version):
@@ -375,14 +380,17 @@ def set_single_version(self, version):
375380
}
376381

377382
def save(self):
378-
"""Saves back these settings to the deployment"""
383+
"""
384+
Saves back these settings to the deployment
385+
"""
379386
self.client._perform_empty(
380387
"PUT", "/api-deployer/deployments/%s/settings" % (self.deployment_id),
381388
body = self.settings)
382389

383390

384391
class DSSAPIDeployerDeploymentStatus(object):
385-
"""The status of an API Deployer deployment.
392+
"""
393+
The status of an API Deployer deployment.
386394
387395
Do not create this directly, use :meth:`~dataikuapi.dss.apideployer.DSSAPIDeployerDeployment.get_status`
388396
"""
@@ -404,12 +412,15 @@ def get_light(self):
404412
def get_heavy(self):
405413
"""
406414
Gets the 'heavy' (full) status. This returns a dictionary with various information about the deployment
415+
407416
:rtype: dict
408417
"""
409418
return self.heavy_status
410419

411420
def get_service_urls(self):
412-
"""Returns service-level URLs for this deployment (ie without the enpdoint-specific suffix)"""
421+
"""
422+
Returns service-level URLs for this deployment (ie without the enpdoint-specific suffix)
423+
"""
413424

414425
if "deployedServiceId" in self.light_status["deploymentBasicInfo"]:
415426
service_id = self.light_status["deploymentBasicInfo"]["deployedServiceId"]
@@ -424,7 +435,8 @@ def get_service_urls(self):
424435
raise ValueError("PublicURL not available for this deployment. It might still be initializing")
425436

426437
def get_health(self):
427-
"""Returns the health of this deployment as a string
438+
"""
439+
Returns the health of this deployment as a string
428440
429441
:returns: HEALTHY if the deployment is working properly, various other status otherwise
430442
:rtype: string
@@ -491,6 +503,7 @@ def get_settings(self):
491503
def delete_version(self, version):
492504
"""
493505
Deletes a version from this service
506+
494507
:param string version: The version to delete
495508
"""
496509
self.client._perform_empty(
@@ -507,7 +520,8 @@ def delete(self):
507520

508521

509522
class DSSAPIDeployerServiceSettings(object):
510-
"""The settings of an API Deployer Service.
523+
"""
524+
The settings of an API Deployer Service.
511525
512526
Do not create this directly, use :meth:`~dataikuapi.dss.apideployer.DSSAPIDeployerService.get_settings`
513527
"""
@@ -526,14 +540,17 @@ def get_raw(self):
526540
return self.settings
527541

528542
def save(self):
529-
"""Saves back these settings to the API service"""
543+
"""
544+
Saves back these settings to the API service
545+
"""
530546
self.client._perform_empty(
531547
"PUT", "/api-deployer/services/%s/settings" % (self.service_id),
532548
body = self.settings)
533549

534550

535551
class DSSAPIDeployerServiceStatus(object):
536-
"""The status of an API Deployer Service.
552+
"""
553+
The status of an API Deployer Service.
537554
538555
Do not create this directly, use :meth:`~dataikuapi.dss.apideployer.DSSAPIDeployerService.get_status`
539556
"""
@@ -556,6 +573,7 @@ def get_versions(self):
556573
def get_raw(self):
557574
"""
558575
Gets the raw status information. This returns a dictionary with various information about the service,
576+
559577
:rtype: dict
560578
"""
561579
return self.light_status

dataikuapi/dss/project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,8 @@ def get_exported_bundle_archive_stream(self, bundle_id):
958958
def download_exported_bundle_archive_to_file(self, bundle_id, path):
959959
"""
960960
Download a bundle archive that can be deployed in a DSS automation Node into the given output file.
961-
@param path if "-", will write to /dev/stdout
961+
962+
:param path if "-", will write to /dev/stdout
962963
"""
963964
if path == "-":
964965
path= "/dev/stdout"
@@ -974,6 +975,7 @@ def download_exported_bundle_archive_to_file(self, bundle_id, path):
974975
def publish_bundle(self, bundle_id, published_project_key=None):
975976
"""
976977
Publish a bundle on the Project Deployer.
978+
977979
:param string bundle_id: The identifier of the bundle
978980
:param string published_project_key: The key of the project on the Project Deployer where the bundle will be published.
979981
A new published project will be created if none matches the key.

dataikuapi/dss/projectdeployer.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def list_stages(self):
6969
"""
7070
Lists infrastructure stages of the Project Deployer
7171
72-
:rtype: a list of dict. Each dict contains a field "id" for the stage identifier and "desc" for its description.
72+
:rtype: list of dict. Each dict contains a field "id" for the stage identifier and "desc" for its description.
7373
:rtype: list
7474
"""
7575
return self.client._perform_json("GET", "/project-deployer/stages")
@@ -156,6 +156,7 @@ def upload_bundle(self, fp, project_key=None):
156156
"""
157157
Uploads a new version for a project from a file-like object pointing
158158
to a bundle Zip file.
159+
159160
:param string fp: A file-like object pointing to a bundle Zip file
160161
:param string project_key: The key of the published project where the bundle will be uploaded. If the project does not exist, it is created.
161162
If not set, the key of the bundle's source project is used.
@@ -193,7 +194,7 @@ def get_status(self):
193194
"""
194195
Returns status information about this infrastructure
195196
196-
:rtype: a :class:`dataikuapi.dss.projectdeployer.DSSProjectDeployerInfraStatus`
197+
:rtype: :class:`dataikuapi.dss.projectdeployer.DSSProjectDeployerInfraStatus`
197198
"""
198199
light = self.client._perform_json("GET", "/project-deployer/infras/%s" % (self.infra_id))
199200

@@ -242,7 +243,9 @@ def get_raw(self):
242243
return self.settings
243244

244245
def save(self):
245-
"""Saves back these settings to the infra"""
246+
"""
247+
Saves back these settings to the infra
248+
"""
246249
self.client._perform_empty(
247250
"PUT", "/project-deployer/infras/%s/settings" % (self.infra_id),
248251
body = self.settings)
@@ -271,6 +274,7 @@ def list_deployments(self):
271274
def get_raw(self):
272275
"""
273276
Gets the raw status information. This returns a dictionary with various information about the infrastructure
277+
274278
:rtype: dict
275279
"""
276280
return self.light_status
@@ -295,7 +299,8 @@ def id(self):
295299
return self.deployment_id
296300

297301
def get_status(self):
298-
"""Returns status information about this deployment
302+
"""
303+
Returns status information about this deployment
299304
300305
:rtype: dataikuapi.dss.apideployer.DSSProjectDeployerDeploymentStatus
301306
"""
@@ -400,20 +405,24 @@ def get_light(self):
400405
def get_heavy(self):
401406
"""
402407
Gets the 'heavy' (full) status. This returns a dictionary with various information about the deployment
408+
403409
:rtype: dict
404410
"""
405411
return self.heavy_status
406412

407413
def get_health(self):
408-
"""Returns the health of this deployment as a string
414+
"""
415+
Returns the health of this deployment as a string
409416
410417
:returns: HEALTHY if the deployment is working properly, various other status otherwise
411418
:rtype: string
412419
"""
413420
return self.heavy_status["health"]
414421

415422
def get_health_messages(self):
416-
"""Returns messages about the health of this deployment"""
423+
"""
424+
Returns messages about the health of this deployment
425+
"""
417426
return self.heavy_status["healthMessages"]
418427

419428
###############################################
@@ -462,6 +471,7 @@ def get_settings(self):
462471
def delete_bundle(self, bundle_id):
463472
"""
464473
Deletes a bundle from this project
474+
465475
:param string bundle_id: The identifier of the bundle to delete
466476
"""
467477
self.client._perform_empty(
@@ -497,7 +507,9 @@ def get_raw(self):
497507
return self.settings
498508

499509
def save(self):
500-
"""Saves back these settings to the project"""
510+
"""
511+
Saves back these settings to the project
512+
"""
501513
self.client._perform_empty(
502514
"PUT", "/project-deployer/projects/%s/settings" % (self.project_key),
503515
body = self.settings)
@@ -542,6 +554,7 @@ def get_bundles(self):
542554
def get_raw(self):
543555
"""
544556
Gets the raw status information. This returns a dictionary with various information about the project
557+
545558
:rtype: dict
546559
"""
547560
return self.light_status

0 commit comments

Comments
 (0)