# -*- coding: utf-8 -*- require "magellan/cli/resources" module Magellan module Cli module Resources class Cloudsql < Base self.resource_key = "cloudsql~database" self.resource_dependency = {"stage" => "stage"} self.hidden_fields = %w[cloudsql_instance_id].map(&:freeze).freeze desc "create NAME", "Create a new #{resource_name} database with NAME" def create(name) o = load_selection!("stage") params = { parameter_name => { "stage_title_id" => o["id"], "name" => name, } } post_json("/admin/#{resource_key}/new.json", params) select(name) end desc "delete ID", "Delete the #{resource_name} database specified by ID" def delete(id) super("/admin/#{resource_key}/#{id}/delete.js") end end end end end