icontrol ruby library
18 Topicsf5-icontrol-10.2.0.2 gem causing various warnings with ruby 1.9.3
Hi, Installed the gem, and get had to do the following workarounds... ruby /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/f5-icontrol-10.2.0.2/examples/get-version.rb 192.168.1.1 admin admin /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- soap/wsdlDriver (LoadError) from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/f5-icontrol-10.2.0.2/lib/f5-icontrol.rb:2:in `' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require' from /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/f5-icontrol-10.2.0.2/examples/get-version.rb:4:in `' To get round this, I did the following:- gem install soap4r Try again:- ruby /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/f5-icontrol-10.2.0.2/examples/get-version.rb 192.168.1.1 admin admin /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/xsd/charset.rb:13: warning: variable $KCODE is no longer effective /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use Stringencode instead. /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/xsd/xmlparser.rb:74:in `': XML processor module not found. (RuntimeError) from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/wsdl/parser.rb:12:in `' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:9:in `' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require' from /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/f5-icontrol-10.2.0.2/lib/f5-icontrol.rb:2:in `' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require' from /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require' from /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/f5-icontrol-10.2.0.2/examples/get-version.rb:4:in `' To get round this error, I followed the code here:- http://railsforum.com/viewtopic.php?id=41231 Essentially, changed, line 66 in file /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/xsd/xmlparser.rb before: c.downcase == name After c.to_s.downcase == name This solves the above problem, but now I get all sorts of warnings..... ruby /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/f5-icontrol-10.2.0.2/examples/get-version.rb 192.168.1.1 admin admin /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/xsd/charset.rb:13: warning: variable $KCODE is no longer effective /home/elastic/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use Stringencode instead. /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/property.rb:68: warning: encoding option is ignored - u /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/property.rb:69: warning: encoding option is ignored - u /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/property.rb:70: warning: encoding option is ignored - u /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hashindex is deprecated; use Hashkey /home/elastic/.rvm/gems/ruby-1.9.3-p194/gems/soap4r-1.5.8/lib/soap/generator.rb:276: warning: encoding option is ignored - UTF8 BIG-IP_v11.1.0 Hei, it works, but would be nice id someone could update the gem to fix all of the above and release a new version? thanks Sc0tt....594Views0likes5CommentsF5 LTM SOAP API - Ruby f5-icontrol Gem - Could not find element by name: pool_names
Hi there, Very much hoping there is someone that can help me with this problem. I am trying to gather some information about pool members from the F5 API (still on SOAP for a little while more). I am using the f5-icontrol Gem described here: http://www.rubydoc.info/gems/f5-icontrol/0.1.5 Specifically, I am trying to call the LocalLB.Pool.get_all_member_statistics method passing in a string of the pool name and receive the following error: /full/path/ruby-2.1.6/gems/savon-2.11.1/lib/savon/response.rb:85:in `raise_soap_and_http_errors!': (SOAP-ENV:Server) **Could not find element by name: pool_names** (Savon::SOAPFault) I am able to run a number of other methods and get back data, for example I can run api.LocalLB.Pool.get_list & api.Management.UserManagement.get_my_permission() and data is returned immediately. Also, the string I am passing in to get_all_member_statistics is the exact string returned by api.LocalLB.Pool.get_list. Note that I tried running as a normal user as well as an F5 admin. Here is my exact code: require 'f5-icontrol' F5::Icontrol.configure do |f| f.host = "big-ip-url.domain.com" f.username = "user" f.password = "pass" end api = F5::Icontrol::API.new get_list runs perfectly and returns all of the pool names in the format of "/Common/full_pool_name" for example response = api.LocalLB.Pool.get_list This successfully returns the permissions for the current user response = api.Management.UserManagement.get_my_permission() This is NOT working and returns the error above response = api.LocalLB.Pool.get_all_member_statistics("Common/full_pool_name_exactly_as_it_appears_in_the_UI") puts response.inspect469Views0likes4CommentsAPI Convetion confusions
Consider the following. ltm = F5::IControl.new(ltm_name, username, password, ["LocalLB.VirtualServer"]).get_interfaces["LocalLB.VirtualServer"] ltm.add_rule(["temp_vserver"], [[{:rule_name => "new_rule, :priority => 3}]]) The irule object/hash is imbedded in two arrays. The API is shown here. in LocalLB__VirtualServer__VirtualServerRule [] [] rules In referncing the API documentation how am I to know that the irule object should be imbedded in two arrays? It makes sense to me that the irule object is in a hash corresponding with the struct defined in the API. {:rule_name => "new_rule", :priority => 3} It also makes sense to me that this object is inside of an array, since you may want to add multiple rules at the same time. [{:rule_name => "new_rule", :priority => 3}, {:rule_name => "other_new_rule", :priority => 4}] What I don't get is why all of this is embedded in yet another array and I also don't see how I am supposed to tell this from the API. I figured this out by reading others code on the devcentral codeshare.385Views0likes6CommentsiControl EM Proxy Issues
Hi All, Trying to use the ruby f5-icontrol library to interact with Enterprise Manager's iControl proxy capability. So far I have had little luck. I have the following script, and it is functional in returning info from EM, except for when I attempt to run the get_context_id method. require 'f5-icontrol' require 'pp' wsdls = ['Management.EM'] b = F5::IControl.new('myem', 'admin', 'thepassword', wsdls).get_interfaces l = {} l['devices'] = b['Management.EM'].get_devices() l['context'] = b['Management.EM'].get_context_id() pp l This results in the following error: /usr/share/ruby/rexml/parsers/baseparser.rb:411:in `block in pull_event': Undefined prefix E found (REXML::UndefinedNamespaceException) from /usr/share/ruby/set.rb:232:in `each_key' from /usr/share/ruby/set.rb:232:in `each' from /usr/share/ruby/rexml/parsers/baseparser.rb:409:in `pull_event' from /usr/share/ruby/rexml/parsers/baseparser.rb:183:in `pull' from /usr/share/ruby/rexml/parsers/streamparser.rb:16:in `parse' from /usr/share/ruby/rexml/document.rb:243:in `parse_stream' from /usr/local/share/gems/gems/soap2r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' from /usr/local/share/gems/gems/soap2r-1.5.8/lib/soap/parser.rb:102:in `parse' from /usr/local/share/gems/gems/soap2r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' from /usr/local/share/gems/gems/soap2r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' from /usr/local/share/gems/gems/soap2r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' from /usr/local/share/gems/gems/soap2r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' from /usr/local/share/gems/gems/soap2r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' from (eval):6:in `get_context_id' from em2.rb:11:in `' I'm running ruby 2.0.0p247, EM 3.1.1 (40.7), and have tried f5-icontrol gems for v11.3.0 and v11.4.1. Any ideas? Thanks.356Views0likes1CommentAdding a user with Ruby & iControl
Hello. I've been knocking my brains out trying to get the Ruby iControl gem to add a user to a device. The complex type on this one is throwing me for a loop. If I can get the simple code down, I can expand it, but I can't get my head around the structure of user_info_3. Here's my simple code: bigip = F5::IControl.new(bigip_address, bigip_user, bigip_pass, ["Management.UserManagement"]).get_interfaces bigip["Management.UserManagement"].create_user_3([[{'name' => 'Guest', 'full_name' => 'Guest User'}], [{'is_encrypted' => false, 'password' => 'abcd'}], [{'role' => 'USER_ROLE_GUEST', 'partition' => 'Common'}], ['/bin/false']]) Any ideas? Thanks. rjwiii285Views0likes3CommentsHow to get the applications Assigned to a Web Acceleration Profile? (Possible API Bug)
I am trying to work out the applications a specific web acceleration profile are connected to. I am using the soap interface (ruby gem) When I make a get_application request from Soap Documentation: interfaces['LocalLB.ProfileWebAcceleration'].get_application(["/MYPARTITION/my_app_cache_profile"]) I get an empty response object: [] I would expect this to contain "/MYPARTITION/my_app.app" Verification (Profile is connected) I can confirm that this profile is connected to an app (by looking for it from the app): system_session.get_active_folder "/MYPARTITION/my_app.app" interfaces['LocalLB.ProfileWebAcceleration'].get_list ["/MYPARTITION/my_app.app/my_app_cache_profile"] NB: This does not help me as if you apply a profile to an app after creation the path is "/MYPARTITION/my_app_cache_profile" so running get_list on the app path will return 0 results even though there is a caching profile assigned.275Views0likes1CommentPublishing f5-icontrol on RubyGems.org?
Is there any way the f5-icontrol gem could be posted to RubyGems.org? I'm starting to build a few tools on top of the library and it would be nice for my gem dependencies to be able to be resolved without users having to come here to download and manually install the f5-icontrol gem. Thanks, --Nathan275Views0likes2CommentsConfusion on changing a pool member state
I can display states, nodes, and virtual servers just fine. Attached screenshot is my lazy attempt at diving into only the surface of the iControl api. For the most part I found the API documentation pretty good and useful for finding which methods to call. The problem comes when trying to make changes to objects. For example I'd like to use the ltm["LocalLB.PoolMember"]. set_monitor_state() method to force nodes offline or online. However it is not obvious what arguments set_monitor_state expects. I have tried variations of the following. member_state = {"member" => {"address" => "172.16.20.65", "port" => 0}, "monitor_state" => "STATE_DISABLED"} member_state = {"member" => {"address" => "172.16.20.65", "port" => 0}, "monitor_state" => 0} member_state = {:member => {:address => "172.16.20.65", :port => 0}, :monitor_state => 0} Passing that into the set_monitor_state @ltm["LocalLB.PoolMember"].set_monitor_state("tmp_test_pool", member_state) I cannot figure out how it wants the data arranged. Can anyone give me any hints or pointers??261Views0likes8Comments