gi_cat_driver 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gi_cat_driver (0.2.4)
4
+ gi_cat_driver (0.2.5)
5
5
  faraday (~> 0.8.7)
6
6
  nokogiri (~> 1.5.6)
7
7
 
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
@@ -1,3 +1,3 @@
1
1
  module GiCatDriver
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gi_cat_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: