Created
May 18, 2013 20:53
-
-
Save imbriaco/5605757 to your computer and use it in GitHub Desktop.
Hacking on a Ruby client for the new Arista Networks Command API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] pry(main)> host, user, password = %w(EAPI_HOST EAPI_USER EAPI_PASSWORD).map { |n| ENV[n] }; nil | |
=> nil | |
[2] pry(main)> Arista::EAPI::Switch.new(host, user, password).version | |
=> {:model_name=>"DCS-7048T-A-R", | |
:internal_version=>"4.12.0-1244071.EOS4120", | |
:system_mac_address=>"00:1c:73:16:c2:c8", | |
:serial_number=>"*redacted*", | |
:mem_total=>4009152, | |
:bootup_timestamp=>1368735672.686644, | |
:mem_free=>1851640, | |
:version=>"4.12.0", | |
:architecture=>"i386", | |
:internal_build_id=>"c25ec8ea-cb8f-40a8-af0b-d11eaa94d57c", | |
:hardware_revision=>"01.04"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are you familiar with Hash#values_at?
It'll change your life