require 'conjur/command' class Conjur::Command::Deployments < Conjur::Command self.prefix = :deployment desc "Add a host to an deployment" arg_name "deployment host" command :"hosts:add" do |c| c.action do |global_options, options, args| id = require_arg(args, 'deployment') hostid = require_arg(args, 'host') api.deployment(id).add_host hostid end end desc "Remove a host from an deployment" arg_name "deployment host" command :"hosts:remove" do |c| c.action do |global_options, options, args| id = require_arg(args, 'deployment') hostid = require_arg(args, 'host') api.deployment(id).remove_host hostid end end desc "Add a child deployment to a deployment" arg_name "deployment child" command :"children:add" do |c| c.action do |global_options, options, args| id = require_arg(args, 'deployment') childid = require_arg(args, 'child') api.deployment(id).add_child childid end end desc "Remove a child deployment from a deployment" arg_name "deployment child" command :"children:remove" do |c| c.action do |global_options, options, args| id = require_arg(args, 'deployment') childid = require_arg(args, 'child') api.deployment(id).remove_child childid end end end