@@ -74,6 +74,47 @@ 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 ,
82+ target_project_name ,
83+ duplication_mode = "MINIMAL" ,
84+ export_analysis_models = True ,
85+ export_saved_models = True ,
86+ export_git_repository = True ,
87+ export_insights_data = True ,
88+ remapping = {}):
89+ """
90+ Duplicate the project
91+
92+ :param string target_project_key: The key of the new project
93+ :param string target_project_name: The name of the new project
94+ :param string duplication_mode: can be one of the following values: MINIMAL, SHARING, FULL, NONE
95+ :param bool export_analysis_models:
96+ :param bool export_saved_models:
97+ :param bool export_git_repository:
98+ :param bool export_insights_data:
99+ :param dict remapping: dict of connections to be remapped for the new project
100+ :returns: A dict containing the original and duplicated project's keys
101+ :rtype: :class:`ProjectDuplicateResult`
102+ """
103+
104+ obj = {
105+ "targetProjectName" : target_project_name ,
106+ "targetProjectKey" : target_project_key ,
107+ "duplicationMode" : duplication_mode ,
108+ "exportAnalysisModels" : export_analysis_models ,
109+ "exportSavedModels" : export_saved_models ,
110+ "exportGitRepository" : export_git_repository ,
111+ "exportInsightsData" : export_insights_data ,
112+ "remapping" : remapping
113+ }
114+
115+ ref = self .client ._perform_json ("POST" , "/projects/%s/duplicate/" % self .project_key , body = obj )
116+ return ref
117+
77118 ########################################################
78119 # Project infos
79120 ########################################################
0 commit comments