gi_cat_driver 0.2.12 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/gi_cat_driver.rb +14 -1
- data/lib/gi_cat_driver/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -43,6 +43,8 @@ Annotated source code documentation is available at http://nsidc.github.com/gi_c
|
|
43
43
|
Rubydoc API documentation is available at http://rubydoc.info/gems/gi_cat_driver/
|
44
44
|
|
45
45
|
## Version History
|
46
|
+
* 0.3.0
|
47
|
+
* When a profile is removed all of its child accessors are also removed
|
46
48
|
* 0.2.8
|
47
49
|
* Removed constant variables causing errors in the console output
|
48
50
|
* 0.2.6
|
data/lib/gi_cat_driver.rb
CHANGED
@@ -52,8 +52,11 @@ module GiCatDriver
|
|
52
52
|
return profile_id
|
53
53
|
end
|
54
54
|
|
55
|
-
# Remove a profile with the given name
|
55
|
+
# Remove a profile with the given name and
|
56
|
+
# delete each of the related accessors to clear the associated data
|
56
57
|
def delete_profile( profile_name )
|
58
|
+
delete_all_accessors(profile_name)
|
59
|
+
|
57
60
|
profile_id = find_profile_id( profile_name )
|
58
61
|
response = Faraday.get do |req|
|
59
62
|
req.url "#{@base_url}/services/conf/brokerConfigurations/#{profile_id}", { :opts => 'delete', :random => generate_random_number }
|
@@ -179,6 +182,16 @@ module GiCatDriver
|
|
179
182
|
end
|
180
183
|
end
|
181
184
|
|
185
|
+
# Remove all accessors (xml feed resources) from the given profile
|
186
|
+
def delete_all_accessors( profile_name )
|
187
|
+
profile_id = find_profile_id(profile_name)
|
188
|
+
harvesters = get_harvest_resources(profile_id)
|
189
|
+
harvesters.each do |harvester_id, harvester_title|
|
190
|
+
accessor_name = get_active_profile_accessor_name(profile_id, harvester_id)
|
191
|
+
delete_accessor(profile_name, accessor_name)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
182
195
|
# Publish an interface to access GI-Cat data for the given profile name
|
183
196
|
# The interface_configuration is a hash that defines a 'profiler' and 'path'
|
184
197
|
def publish_interface( profile_name, interface_configuration )
|