Skip to content

Commit 7ee5c19

Browse files
committed
Initial commit for [branch ch33162]
1 parent 40284d8 commit 7ee5c19

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

dataikuapi/dss/project.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,44 @@ def export_to_file(self, path, options={}):
7474
f.write(chunk)
7575
f.flush()
7676

77+
########################################################
78+
# Project duplicate
79+
########################################################
80+
81+
def duplicate(self, target_project_key, target_project_name
82+
, duplicationMode = "MINIMAL"
83+
, exportAnalysisModels = True
84+
, exportSavedModels = True, exportGitRepository = True
85+
, exportInsightsData = True
86+
, remapping = {}):
87+
"""
88+
Duplicate the project
89+
90+
:param string target_project_key: The key of the new project
91+
:param string target_project_name: The name of the new project
92+
:param string duplicationMode: can be one of the following values: MINIMAL, SHARING, FULL, NONE
93+
:param boolean duplicateAllAnalysisModelsData
94+
:param boolean duplicateAllSavedModelsData
95+
:param boolean exportGitRepository
96+
:param boolean exportInsightsData
97+
:param struct remapping: list of connections to be remapped for the new project
98+
:return:
99+
"""
100+
101+
obj = {
102+
"targetProjectName": target_project_name,
103+
"targetProjectKey": target_project_key,
104+
"duplicationMode": duplicationMode,
105+
"exportAnalysisModels":exportAnalysisModels,
106+
"exportSavedModels":exportSavedModels,
107+
"exportGitRepository":exportGitRepository,
108+
"exportInsightsData":exportInsightsData,
109+
"remapping": remapping
110+
}
111+
112+
ref = self.client._perform_json("POST", "/projects/%s/duplicate/" % self.project_key, body = obj)
113+
return ref
114+
77115
########################################################
78116
# Project infos
79117
########################################################

0 commit comments

Comments
 (0)