4 # arv tag add tag1 [tag2 ...] --objects obj_uuid1 [obj_uuid2 ...]
5 # arv tag remove tag1 [tag2 ...] --objects obj_uuid1 [obj_uuid2 ...]
6 # arv tag remove tag1 [tag2 ...] --all
8 if RUBY_VERSION < '1.9.3' then
10 #{$0.gsub(/^\.\//,'')} requires Ruby version 1.9.3 or higher.
14 $arvados_api_version = ENV['ARVADOS_API_VERSION'] || 'v1'
15 $arvados_api_host = ENV['ARVADOS_API_HOST'] or
16 abort "#{$0}: fatal: ARVADOS_API_HOST environment variable not set."
17 $arvados_api_token = ENV['ARVADOS_API_TOKEN'] or
18 abort "#{$0}: fatal: ARVADOS_API_TOKEN environment variable not set."
22 require 'google/api_client'
28 #{$0}: fatal: some runtime dependencies are missing.
29 Try: gem install pp google-api-client json trollop
33 def debuglog(message, verbosity=1)
34 $stderr.puts "#{File.split($0).last} #{$$}: #{message}" if $debuglevel >= verbosity
39 original_verbosity = $VERBOSE
42 $VERBOSE = original_verbosity
47 if $arvados_api_host.match /local/
48 # You probably don't care about SSL certificate checks if you're
49 # testing with a dev server.
50 suppress_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE }
53 class Google::APIClient
54 def discovery_document(api, version)
56 return @discovery_documents["#{api}:#{version}"] ||=
58 response = self.execute!(
60 :uri => self.discovery_uri(api, version),
61 :authenticated => false
63 response.body.class == String ? JSON.parse(response.body) : response.body