Class: Armrest::CLI::ResourceGroup

Inherits:
Armrest::Command show all
Defined in:
lib/armrest/cli/resource_group.rb

Instance Method Summary collapse

Methods inherited from Armrest::Command

alter_command_description, command_help, dispatch, exit_on_failure?, website

Instance Method Details

#check_existence(name) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/armrest/cli/resource_group.rb', line 5

def check_existence(name)
  exist = Armrest::Services::ResourceGroup.new(options).check_existence(name: name)
  if exist
    puts "Resource group exists: #{name}"
  else
    puts "Resource group does not exist: #{name}"
  end
end

#create_or_update(name) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/armrest/cli/resource_group.rb', line 18

def create_or_update(name)
  resp = Armrest::Services::ResourceGroup.new(options).create_or_update(options.merge(name: name))
  if resp.code == "201"
    puts "Resource group created: #{name}"
  else
    puts "Resource group unable to create: #{name}"
    puts "resp:"
    pp resp
  end
end