# -*- coding: utf-8 -*- require "magellan/cli/resources" module Magellan module Cli module Resources class Cloudsql < Base include Deletable self.resource_key = "cloudsql~database" self.resource_dependency = {"stage" => Stage.parameter_name} 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 end end end end