gi_cat_driver 0.2.5 → 0.2.6
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/version.rb +1 -1
- data/lib/gi_cat_driver.rb +23 -0
- 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.2.6
|
47
|
+
* Fix for creating accessors to enable the profile and save the configuration
|
46
48
|
* 0.2.5
|
47
49
|
* Added new methods to enable and disable published profilers (GI-Cat interfaces) for a profile
|
48
50
|
* 0.2.4
|
data/lib/gi_cat_driver.rb
CHANGED
@@ -163,6 +163,8 @@ module GiCatDriver
|
|
163
163
|
|
164
164
|
update_accessor_configuration( profile_id, accessor_id, accessor_configuration )
|
165
165
|
|
166
|
+
enable_profile profile_name
|
167
|
+
|
166
168
|
return accessor_id
|
167
169
|
end
|
168
170
|
|
@@ -251,6 +253,27 @@ module GiCatDriver
|
|
251
253
|
return harvester_id
|
252
254
|
end
|
253
255
|
|
256
|
+
# Retrieve the accessor id given a profile id and harvester id
|
257
|
+
def get_active_profile_accessor_id(profile_id, harvester_id)
|
258
|
+
accessor_request = "#{@base_url}/services/conf/brokerConfigurations/#{profile_id}/harvesters/#{harvester_id}"
|
259
|
+
response = Faraday.get do |req|
|
260
|
+
req.url accessor_request
|
261
|
+
req.headers = AUTHORIZATION_HEADERS
|
262
|
+
end
|
263
|
+
accessor_id = Nokogiri.XML(response.body).css("component id").text
|
264
|
+
return accessor_id
|
265
|
+
end
|
266
|
+
|
267
|
+
def get_active_profile_accessor_name(profile_id, accessor_id)
|
268
|
+
accessor_request = "#{@base_url}/services/conf/brokerConfigurations/#{profile_id}/accessors/#{accessor_id}"
|
269
|
+
response = Faraday.get do |req|
|
270
|
+
req.url accessor_request
|
271
|
+
req.headers = AUTHORIZATION_HEADERS
|
272
|
+
end
|
273
|
+
accessor = Nokogiri.XML(response.body).css("accessor name").text
|
274
|
+
return accessor
|
275
|
+
end
|
276
|
+
|
254
277
|
# Given a profile id, put all the associated resource id and title into harvest info array
|
255
278
|
def get_harvest_resources(profile_id)
|
256
279
|
id = get_active_profile_distributor_id(profile_id)
|