Skip to content

Commit 08c031a

Browse files
authored
Merge pull request #140 from dataiku/task/dss90-add-publish-version-method
Add publish version method
2 parents 0f578d0 + f1cdf14 commit 08c031a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

dataikuapi/dss/apiservice.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,16 @@ def download_package_to_file(self, package_id, path):
106106
f.write(chunk)
107107
f.flush()
108108

109+
def publish_package(self, package_id, published_service_id=None):
110+
"""
111+
Publish a package on the API Deployer.
112+
113+
:param string package_id: The identifier of the package
114+
:param string published_service_id: The identifier of the API service on the API Deployer where the package will be published.
115+
A new published API service will be created if none matches the identifier.
116+
If the parameter is not set, the identifier from the current :class:`DSSAPIService` is used.
117+
"""
118+
params = None
119+
if published_service_id is not None:
120+
params = {"publishedServiceId": published_service_id}
121+
self.client._perform_empty("POST", "/projects/%s/apiservices/%s/packages/%s/publish" % (self.project_key, self.service_id, package_id), params=params)

dataikuapi/dss/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ def publish_bundle(self, bundle_id, published_project_key=None):
10671067
params = None
10681068
if published_project_key is not None:
10691069
params = {"publishedProjectKey": published_project_key}
1070-
return self.client._perform_json("GET", "/projects/%s/bundles/%s/publish" % (self.project_key, bundle_id), params=params)
1070+
return self.client._perform_json("POST", "/projects/%s/bundles/%s/publish" % (self.project_key, bundle_id), params=params)
10711071

10721072
########################################################
10731073
# Bundles / Import (Automation node)

0 commit comments

Comments
 (0)