/usr/lib/ruby/vendor_ruby/influxdb/query/database.rb is in ruby-influxdb 0.2.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | module InfluxDB
module Query
module Database # :nodoc:
def create_database(name)
execute("CREATE DATABASE #{name}")
end
def delete_database(name)
execute("DROP DATABASE #{name}")
end
def list_databases
resp = execute("SHOW DATABASES", parse: true)
fetch_series(resp).fetch(0, {})
.fetch('values', [])
.flatten
.map { |v| { 'name' => v } }
end
end
end
end
|