Method: GoodData::Project#export_clone
- Defined in:
- lib/gooddata/models/project.rb
#export_clone(options = {}) ⇒ String
Export a clone from a project to be later imported. If you do not want to do anything special and you do not need fine grained controle use clone method which does all the heavy lifting for you.
919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 |
# File 'lib/gooddata/models/project.rb', line 919 def export_clone( = {}) with_data = [:data].nil? ? true : [:data] with_users = [:users].nil? ? false : [:users] export = { :exportProject => { :exportUsers => with_users ? 1 : 0, :exportData => with_data ? 1 : 0 } } export[:exportProject][:authorizedUsers] = [:authorized_users] if [:authorized_users] if [:exclude_schedules] exclude_notifications = [:exclude_schedules] ? 1 : 0 export[:exportProject][:excludeSchedules] = exclude_notifications end if [:cross_data_center_export] cross_data_center = [:cross_data_center_export] ? 1 : 0 export[:exportProject][:crossDataCenterExport] = cross_data_center end result = client.post("/gdc/md/#{obj_id}/maintenance/export", export) status_url = result['exportArtifact']['status']['uri'] polling_result = client.poll_on_response(status_url) do |body| body['taskState']['status'] == 'RUNNING' end ensure_clone_task_ok(polling_result, GoodData::ExportCloneError) result['exportArtifact']['token'] end |