This reverts commit b741fe9005
.
This was backed out as problems started occuring shortly after
a large CLI pull request was merged. However, log analysis
shows that the CLI was unrelated to the problems.
19 lines
703 B
Ruby
19 lines
703 B
Ruby
# frozen_string_literal: true
|
|
|
|
UbiRodish.on("pg").run_is("add-metric-destination", args: 3, invalid_args_message: "username, password, and url are required") do |username, password, url|
|
|
params = {
|
|
"username" => username,
|
|
"password" => password,
|
|
"url" => url
|
|
}
|
|
post(project_path("location/#{@location}/postgres/#{@name}/metric-destination"), params) do |data|
|
|
body = []
|
|
body << "Metric destination added to PostgreSQL database.\n"
|
|
body << "Current metric destinations:\n"
|
|
data["metric_destinations"].each_with_index do |md, i|
|
|
body << " " << (i + 1).to_s << ": " << md["id"] << " " << md["username"].to_s << " " << md["url"] << "\n"
|
|
end
|
|
body
|
|
end
|
|
end
|