Skip to content

Commit 89f4e8d

Browse files
author
Agathe Guillemot
committed
Add a DSSProject#publish_bundle method
1 parent 336cc0c commit 89f4e8d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

dataikuapi/dss/project.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ def get_api_service(self, service_id):
936936
return DSSAPIService(self.client, self.project_key, service_id)
937937

938938
########################################################
939-
# Bundles / Export (Design node)
939+
# Bundles / Export and Publish (Design node)
940940
########################################################
941941

942942
def list_exported_bundles(self):
@@ -971,6 +971,18 @@ def download_exported_bundle_archive_to_file(self, bundle_id, path):
971971
f.flush()
972972
stream.close()
973973

974+
def publish_bundle(self, bundle_id, published_project_key=None):
975+
"""
976+
Publish a bundle on the Project Deployer.
977+
:param string bundle_id: The identifier of the bundle
978+
:param string published_project_key: The key of the project on the Project Deployer where the bundle will be published.
979+
A new published project will be created if none matches the key.
980+
If the parameter is not set, the key from the current :class:`DSSProject` is used.
981+
"""
982+
params = None
983+
if published_project_key is not None:
984+
params = {"publishedProjectKey": published_project_key}
985+
return self.client._perform_json("GET", "/projects/%s/bundles/%s/publish" % (self.project_key, bundle_id), params=params)
974986

975987
########################################################
976988
# Bundles / Import (Automation node)

0 commit comments

Comments
 (0)