- ES_USER
- ES_PASSWORD
+]
+defaults = relevant_defaults(names) +KIBANA_HOST = defaults['KIBANA_HOST'] || '172.17.0.1' +KIBANA_PORT = defaults['KIBANA_PORT'] || '20017'
+service_authentication = relevant_service_authentication(names)
+dashboard_ids = [] +ARGV.each do |i|
- dashboard_ids << i
+end
both class of dashboard_ids and ARGV are Array, just use: dashboard_ids = ARGV
Thanks, Luan Shengde
+dashboard_ids = %w[data resource all] if dashboard_ids.empty?
+cmd = "curl -u #{service_authentication['ES_USER']}:#{service_authentication['ES_PASSWORD']}" +cmd += " http://#%7BKIBANA_HOST%7D:#%7BKIBANA_PORT%7D/api/kibana/dashboards/export?da..."
+dashboard_ids.each do |id|
- new_cmd = cmd
- new_cmd += "#{id} >> #{id}.json"
- puts new_cmd
- system new_cmd
+end
2.23.0