Class: ServerRegistryClient::CLI
- Inherits:
-
Thor
- Object
- Thor
- ServerRegistryClient::CLI
- Defined in:
- lib/server-registry-client/cli.rb
Instance Method Summary collapse
Instance Method Details
#add_server ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/server-registry-client/cli.rb', line 13 def add_server require_server_option require_server_hostname_or_ip_address server = categories = parse_csv([:categories]) client = construct_client client.add_server_to_categories(server, categories) end |
#remove_server ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/server-registry-client/cli.rb', line 48 def remove_server require_server_option require_server_hostname_or_ip_address server = client = construct_client client.remove_servers_like(server) end |
#remove_server_from_category ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/server-registry-client/cli.rb', line 30 def remove_server_from_category require_server_option require_server_hostname_or_ip_address server = categories = parse_csv([:categories]) client = construct_client categories.each do |category_name| client.remove_server_from_category(server, category_name) end end |