Class: RightScaleCLI::Tags
- Inherits:
-
Thor
- Object
- Thor
- RightScaleCLI::Tags
- Defined in:
- lib/rightscale_cli/tags.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add(hrefs, tags) ⇒ Object
- #delete(hrefs, tags) ⇒ Object
-
#initialize(*args) ⇒ Tags
constructor
A new instance of Tags.
- #resource(resource_hrefs) ⇒ Object
- #search(resource_type, tag) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Tags
Returns a new instance of Tags.
27 28 29 30 31 |
# File 'lib/rightscale_cli/tags.rb', line 27 def initialize(*args) super @client = RightScaleCLI::Client.new() @logger = RightScaleCLI::Logger.new() end |
Class Method Details
.banner(task, namespace = true, subcommand = false) ⇒ Object
57 58 59 |
# File 'lib/rightscale_cli/tags.rb', line 57 def self.(task, namespace = true, subcommand = false) "#{basename} #{task.formatted_usage(self, true, subcommand)}" end |
Instance Method Details
#add(hrefs, tags) ⇒ Object
48 49 50 |
# File 'lib/rightscale_cli/tags.rb', line 48 def add(hrefs, ) @client.client..multi_add(:resource_hrefs => hrefs.split(','), :tags => .split(',')) end |
#delete(hrefs, tags) ⇒ Object
53 54 55 |
# File 'lib/rightscale_cli/tags.rb', line 53 def delete(hrefs, ) @client.client..multi_delete(:resource_hrefs => hrefs.split(','), :tags => .split(',')) end |
#resource(resource_hrefs) ⇒ Object
43 44 45 |
# File 'lib/rightscale_cli/tags.rb', line 43 def resource(resource_hrefs) @client.client..by_resource(:resource_hrefs => resource_hrefs.split(',')) end |
#search(resource_type, tag) ⇒ Object
37 38 39 40 |
# File 'lib/rightscale_cli/tags.rb', line 37 def search(resource_type, tag) #@client.render(@client.client.tags.by_tag({:resource_type => resource_type, :tags => [ tag ]}), 'servers') puts @client.client..by_tag({:resource_type => resource_type, :tags => [ tag ]}).count end |