stingray-exec 0.1.0

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.
Files changed (40) hide show
  1. data/.gitignore +19 -0
  2. data/.rspec +2 -0
  3. data/.simplecov +7 -0
  4. data/AUTHORS.md +2 -0
  5. data/CONTRIBUTING.md +8 -0
  6. data/Gemfile +12 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +66 -0
  9. data/Rakefile +22 -0
  10. data/bin/stingray-exec +3 -0
  11. data/examples/add-pool +10 -0
  12. data/examples/bork +6 -0
  13. data/examples/credentials.conf +4 -0
  14. data/examples/delete-pool +10 -0
  15. data/examples/list-pools +8 -0
  16. data/examples/list-virtual-servers +8 -0
  17. data/generate-actions.rb +119 -0
  18. data/lib/stingray-exec.rb +5 -0
  19. data/lib/stingray/control_api.rb +112 -0
  20. data/lib/stingray/control_api/actions.rb +49 -0
  21. data/lib/stingray/control_api/catalog_rule_methods.rb +31 -0
  22. data/lib/stingray/control_api/endpoint.rb +23 -0
  23. data/lib/stingray/control_api/generated-actions-9.0.yml +9036 -0
  24. data/lib/stingray/control_api/generated-actions-9.1.yml +9172 -0
  25. data/lib/stingray/control_api/pool_methods.rb +156 -0
  26. data/lib/stingray/control_api/soap_helper_methods.rb +69 -0
  27. data/lib/stingray/exec.rb +16 -0
  28. data/lib/stingray/exec/cli.rb +134 -0
  29. data/lib/stingray/exec/dsl.rb +48 -0
  30. data/lib/stingray/exec/version.rb +5 -0
  31. data/lib/stingray/junk.rb +16 -0
  32. data/spec/integration/catalog_rule_spec.rb +116 -0
  33. data/spec/integration/pool_spec.rb +61 -0
  34. data/spec/integration/users_spec.rb +21 -0
  35. data/spec/lib/stingray/control_api_spec.rb +51 -0
  36. data/spec/lib/stingray/exec/cli_spec.rb +7 -0
  37. data/spec/lib/stingray/exec/version_spec.rb +5 -0
  38. data/spec/spec_helper.rb +26 -0
  39. data/stingray-exec.gemspec +29 -0
  40. metadata +131 -0
@@ -0,0 +1,116 @@
1
+ require 'stingray/exec/dsl'
2
+
3
+ describe 'Catalog.Rule', :integration => true do
4
+ include Stingray::Exec::DSL
5
+
6
+ def test_rule_name
7
+ @test_rule_name ||= "test-rule-#{rand(999)}-#{Time.now.to_i}"
8
+ end
9
+
10
+ after :all do
11
+ stingray_exec do
12
+ begin
13
+ catalog_rule.delete_rule(test_rule_name)
14
+ rescue
15
+ # derp.
16
+ end
17
+ end
18
+ end
19
+
20
+ it 'should be able to get all rule names' do
21
+ stingray_exec do
22
+ catalog_rule.get_rule_names.should_not be_nil
23
+ end
24
+ end
25
+
26
+ it 'should be able to check the syntax of rule text' do
27
+ stingray_exec do
28
+ response = catalog_rule.check_syntax('if ("foo" == "bar") { 1; }')
29
+ response[:results][:item][:valid].should be_true
30
+ end
31
+ end
32
+
33
+ it 'should not be able to add new rules for reasons unknown' do
34
+ expect do
35
+ stingray_exec do
36
+ catalog_rule.add_rule(test_rule_name => [
37
+ %Q@if (http.getheader("Host") == "dev.null") {\n pool.use("discard");\n}@
38
+ ])
39
+ end
40
+ end.to raise_error
41
+
42
+ # XXX some debug output from failure in action:
43
+ # [1] stingray-exec(main)> catalog_rule.get_rule_names
44
+ # D, [2013-02-13T22:49:26.088638 #79858] DEBUG -- : SOAP request: https://admin:admin@192.168.1.8:9090/soap
45
+ # D, [2013-02-13T22:49:26.089951 #79858] DEBUG -- : SOAPAction: "getRuleNames", Content-Type: text/xml;charset=UTF-8, Content-Length: 337
46
+ # D, [2013-02-13T22:49:26.089995 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><wsdl:getRuleNames></wsdl:getRuleNames></env:Body></env:Envelope>
47
+ # W, [2013-02-13T22:49:26.109771 #79858] WARN -- : HTTPI executes HTTP POST using the net_http adapter
48
+ # D, [2013-02-13T22:49:26.218769 #79858] DEBUG -- : SOAP response (status 200):
49
+ # D, [2013-02-13T22:49:26.218871 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:zeusns_1_1="http://soap.zeus.com/zxtm/1.1/" xmlns:zeusns_1_2="http://soap.zeus.com/zxtm/1.2/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:zeusns="http://soap.zeus.com/zxtm/1.0/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><namesp1:getRuleNamesResponse><names soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array"><Item xsi:type="xsd:string">foo_host</Item><Item xsi:type="xsd:string">foo_host2</Item></names></namesp1:getRuleNamesResponse></soap:Body></soap:Envelope>
50
+ # => {:names=>
51
+ # {:item=>["foo_host", "foo_host2"],
52
+ # :"@soapenc:array_type"=>"xsd:string[2]",
53
+ # :"@xsi:type"=>"soapenc:Array"}}
54
+ # [2] stingray-exec(main)> catalog_rule.get_rule_details('foo_host')
55
+ # D, [2013-02-13T22:49:56.329022 #79858] DEBUG -- : SOAP request: https://admin:admin@192.168.1.8:9090/soap
56
+ # D, [2013-02-13T22:49:56.329106 #79858] DEBUG -- : SOAPAction: "getRuleDetails", Content-Type: text/xml;charset=UTF-8, Content-Length: 489
57
+ # D, [2013-02-13T22:49:56.329143 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Catalog.Rule="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><Catalog.Rule:getRuleDetails><names soapenc:arrayType="xsd:string[1]"><s0>foo_host</s0></names></Catalog.Rule:getRuleDetails></env:Body></env:Envelope>
58
+ # W, [2013-02-13T22:49:56.329191 #79858] WARN -- : HTTPI executes HTTP POST using the net_http adapter
59
+ # D, [2013-02-13T22:49:56.389574 #79858] DEBUG -- : SOAP response (status 200):
60
+ # D, [2013-02-13T22:49:56.389672 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:zeusns_1_1="http://soap.zeus.com/zxtm/1.1/" xmlns:zeusns_1_2="http://soap.zeus.com/zxtm/1.2/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:zeusns="http://soap.zeus.com/zxtm/1.0/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><namesp1:getRuleDetailsResponse><info soapenc:arrayType="zeusns:Catalog.Rule.RuleInfo[1]" xsi:type="soapenc:Array"><Item xsi:type="zeusns:Catalog.Rule.RuleInfo"><rule_text xsi:type="xsd:string">
61
+ # if( http.getheader( "Host" ) == "foo.local" ){
62
+ #
63
+ # pool.use( "foo" );
64
+ #
65
+ # }
66
+ # </rule_text><rule_notes xsi:type="xsd:string" /></Item></info></namesp1:getRuleDetailsResponse></soap:Body></soap:Envelope>
67
+ # => {:info=>
68
+ # {:item=>
69
+ # {:rule_text=>
70
+ # "\nif( http.getheader( \"Host\" ) == \"foo.local\" ){\n\n\tpool.use( \"foo\" );\n\n}\n",
71
+ # :rule_notes=>{:"@xsi:type"=>"xsd:string"},
72
+ # :"@xsi:type"=>"zeusns:Catalog.Rule.RuleInfo"},
73
+ # :"@soapenc:array_type"=>"zeusns:Catalog.Rule.RuleInfo[1]",
74
+ # :"@xsi:type"=>"soapenc:Array"}}
75
+ # [3] stingray-exec(main)> foo_host_rule = _[:info][:item][:rule_text]
76
+ # => "\nif( http.getheader( \"Host\" ) == \"foo.local\" ){\n\n\tpool.use( \"foo\" );\n\n}\n"
77
+ # [4] stingray-exec(main)> catalog_rule.add_rule('foo_host3' => [foo_host_rule])
78
+ # D, [2013-02-13T22:50:48.306876 #79858] DEBUG -- : SOAP request: https://admin:admin@192.168.1.8:9090/soap
79
+ # D, [2013-02-13T22:50:48.306988 #79858] DEBUG -- : SOAPAction: "addRule", Content-Type: text/xml;charset=UTF-8, Content-Length: 683
80
+ # D, [2013-02-13T22:50:48.307050 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Catalog.Rule="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><Catalog.Rule:addRule><names soapenc:arrayType="xsd:string[1]"><k0>foo_host3</k0></names><texts soapenc:arrayType="xsd:list[1]"><k0 soapenc:arrayType="xsd:string[1]"><node0>
81
+ # if( http.getheader( &quot;Host&quot; ) == &quot;foo.local&quot; ){
82
+ #
83
+ # pool.use( &quot;foo&quot; );
84
+ #
85
+ # }
86
+ # </node0></k0></texts></Catalog.Rule:addRule></env:Body></env:Envelope>
87
+ # W, [2013-02-13T22:50:48.307128 #79858] WARN -- : HTTPI executes HTTP POST using the net_http adapter
88
+ # D, [2013-02-13T22:50:48.488328 #79858] DEBUG -- : SOAP response (status 500):
89
+ # D, [2013-02-13T22:50:48.488425 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:zeusns_1_1="http://soap.zeus.com/zxtm/1.1/" xmlns:zeusns_1_2="http://soap.zeus.com/zxtm/1.2/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:zeusns="http://soap.zeus.com/zxtm/1.0/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Error: line 1: syntax error, unexpected '=', expecting '('
90
+ # Compilation of rule 'foo_host3' failed, with 1 error</faultstring></soap:Fault></soap:Body></soap:Envelope>
91
+ # Savon::SOAP::Fault: (soap:Client) Error: line 1: syntax error, unexpected '=', expecting '('
92
+ # Compilation of rule 'foo_host3' failed, with 1 error
93
+ # from /Users/d.buch/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/savon-1.2.0/lib/savon/soap/response.rb:107:in `raise_errors'
94
+ # [5] stingray-exec(main)> catalog_rule.check_syntax(foo_host_rule)
95
+ # D, [2013-02-13T22:51:13.719464 #79858] DEBUG -- : SOAP request: https://admin:admin@192.168.1.8:9090/soap
96
+ # D, [2013-02-13T22:51:13.719546 #79858] DEBUG -- : SOAPAction: "checkSyntax", Content-Type: text/xml;charset=UTF-8, Content-Length: 583
97
+ # D, [2013-02-13T22:51:13.719582 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Catalog.Rule="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><Catalog.Rule:checkSyntax><ruleText soapenc:arrayType="xsd:string[1]"><s0>
98
+ # if( http.getheader( &quot;Host&quot; ) == &quot;foo.local&quot; ){
99
+ #
100
+ # pool.use( &quot;foo&quot; );
101
+ #
102
+ # }
103
+ # </s0></ruleText></Catalog.Rule:checkSyntax></env:Body></env:Envelope>
104
+ # W, [2013-02-13T22:51:13.719629 #79858] WARN -- : HTTPI executes HTTP POST using the net_http adapter
105
+ # D, [2013-02-13T22:51:13.836153 #79858] DEBUG -- : SOAP response (status 200):
106
+ # D, [2013-02-13T22:51:13.836242 #79858] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="http://soap.zeus.com/zxtm/1.0/Catalog/Rule/" xmlns:zeusns_1_1="http://soap.zeus.com/zxtm/1.1/" xmlns:zeusns_1_2="http://soap.zeus.com/zxtm/1.2/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:zeusns="http://soap.zeus.com/zxtm/1.0/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><namesp1:checkSyntaxResponse><results soapenc:arrayType="zeusns:Catalog.Rule.SyntaxCheck[1]" xsi:type="soapenc:Array"><Item xsi:type="zeusns:Catalog.Rule.SyntaxCheck"><valid xsi:type="xsd:boolean">true</valid><warnings xsi:type="xsd:string" /><errors xsi:type="xsd:string" /></Item></results></namesp1:checkSyntaxResponse></soap:Body></soap:Envelope>
107
+ # => {:results=>
108
+ # {:item=>
109
+ # {:valid=>true,
110
+ # :warnings=>{:"@xsi:type"=>"xsd:string"},
111
+ # :errors=>{:"@xsi:type"=>"xsd:string"},
112
+ # :"@xsi:type"=>"zeusns:Catalog.Rule.SyntaxCheck"},
113
+ # :"@soapenc:array_type"=>"zeusns:Catalog.Rule.SyntaxCheck[1]",
114
+ # :"@xsi:type"=>"soapenc:Array"}}
115
+ end
116
+ end
@@ -0,0 +1,61 @@
1
+ require 'stingray/exec/dsl'
2
+
3
+ describe 'Pool', :integration => true do
4
+ include Stingray::Exec::DSL
5
+
6
+ def test_pool_name
7
+ @test_pool_name ||= "test_pool_#{rand(9999)}_#{Time.now.to_i}"
8
+ end
9
+
10
+ it 'should be able to add and delete pools' do
11
+ stingray_exec do
12
+ pool.add_pool(test_pool_name => ['localhost:9999'])
13
+ pool.delete_pool(test_pool_name)
14
+ end
15
+ end
16
+
17
+ it 'should be able to get the current nodes for pools' do
18
+ stingray_exec do
19
+ pool.add_pool(test_pool_name => ['localhost:9999'])
20
+ pool.get_nodes(test_pool_name)[:nodes][:item][:item].should == 'localhost:9999'
21
+ pool.delete_pool(test_pool_name)
22
+ end
23
+ end
24
+
25
+ it 'should be able to add and remove nodes from pools' do
26
+ stingray_exec do
27
+ pool.add_pool(test_pool_name => ['localhost:9999'])
28
+ pool.add_nodes(test_pool_name => ['localhost:8888', 'localhost:7777'])
29
+ pool.remove_nodes(test_pool_name => ['localhost:8888'])
30
+ pool.remove_nodes(test_pool_name => ['localhost:7777'])
31
+ pool.delete_pool(test_pool_name)
32
+ end
33
+ end
34
+
35
+ it 'should be able to add and remove draining nodes from pools' do
36
+ stingray_exec do
37
+ pool.add_pool(test_pool_name => ['localhost:9999'])
38
+ pool.add_nodes(test_pool_name => ['localhost:8888', 'localhost:7777'])
39
+ pool.add_draining_nodes(test_pool_name => ['localhost:8888'])
40
+ pool.remove_draining_nodes(test_pool_name => ['localhost:8888'])
41
+ pool.delete_pool(test_pool_name)
42
+ end
43
+ end
44
+
45
+ it 'should be able to add and remove monitors from pools' do
46
+ stingray_exec do
47
+ pool.add_pool(test_pool_name => ['localhost:9999'])
48
+ pool.add_monitors(test_pool_name => ['Simple HTTP', 'Ping'])
49
+ pool.remove_monitors(test_pool_name => ['Ping'])
50
+ pool.delete_pool(test_pool_name)
51
+ end
52
+ end
53
+
54
+ it 'should be able to set monitors for pools' do
55
+ stingray_exec do
56
+ pool.add_pool(test_pool_name => ['localhost:9999'])
57
+ pool.set_monitors(test_pool_name => ['Ping', 'Simple HTTP'])
58
+ pool.delete_pool(test_pool_name)
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,21 @@
1
+ require 'stingray/exec/dsl'
2
+
3
+ describe 'Users', :integration => true do
4
+ include Stingray::Exec::DSL
5
+
6
+ it 'should be able to list users' do
7
+ stingray_exec do
8
+ foreach(users.list_users[:values][:item]) do |item|
9
+ item.should_not be_nil
10
+ end
11
+ end
12
+ end
13
+
14
+ it 'should be able to list groups' do
15
+ stingray_exec do
16
+ foreach(users.list_groups[:values][:item]) do |item|
17
+ item.should_not be_nil
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,51 @@
1
+ describe Stingray::ControlApi do
2
+ it 'should generate classes on the fly for each configuration namespace' do
3
+ Stingray::ControlApi::AFM.should_not be_nil
4
+ Stingray::ControlApi::AlertCallback.should_not be_nil
5
+ Stingray::ControlApi::AlertingAction.should_not be_nil
6
+ Stingray::ControlApi::AlertingEventType.should_not be_nil
7
+ Stingray::ControlApi::CatalogAptimizerProfile.should_not be_nil
8
+ Stingray::ControlApi::CatalogAuthenticators.should_not be_nil
9
+ Stingray::ControlApi::CatalogBandwidth.should_not be_nil
10
+ Stingray::ControlApi::CatalogJavaExtension.should_not be_nil
11
+ Stingray::ControlApi::CatalogMonitor.should_not be_nil
12
+ Stingray::ControlApi::CatalogPersistence.should_not be_nil
13
+ Stingray::ControlApi::CatalogProtection.should_not be_nil
14
+ Stingray::ControlApi::CatalogRate.should_not be_nil
15
+ Stingray::ControlApi::CatalogRule.should_not be_nil
16
+ Stingray::ControlApi::CatalogSLM.should_not be_nil
17
+ Stingray::ControlApi::CatalogSSLCertificateAuthorities.should_not be_nil
18
+ Stingray::ControlApi::CatalogSSLCertificates.should_not be_nil
19
+ Stingray::ControlApi::CatalogSSLClientCertificates.should_not be_nil
20
+ Stingray::ControlApi::CatalogSSLDNSSEC.should_not be_nil
21
+ Stingray::ControlApi::ConfExtra10.should_not be_nil
22
+ Stingray::ControlApi::ConfExtra.should_not be_nil
23
+ Stingray::ControlApi::Diagnose10.should_not be_nil
24
+ Stingray::ControlApi::Diagnose.should_not be_nil
25
+ Stingray::ControlApi::GLBService.should_not be_nil
26
+ Stingray::ControlApi::GlobalSettings.should_not be_nil
27
+ Stingray::ControlApi::Location.should_not be_nil
28
+ Stingray::ControlApi::Pool.should_not be_nil
29
+ Stingray::ControlApi::SystemAccessLogs.should_not be_nil
30
+ Stingray::ControlApi::SystemBackups.should_not be_nil
31
+ Stingray::ControlApi::SystemCache10.should_not be_nil
32
+ Stingray::ControlApi::SystemCache11.should_not be_nil
33
+ Stingray::ControlApi::SystemCache.should_not be_nil
34
+ Stingray::ControlApi::SystemCloudCredentials.should_not be_nil
35
+ Stingray::ControlApi::SystemConnections.should_not be_nil
36
+ Stingray::ControlApi::SystemLicenseKeys.should_not be_nil
37
+ Stingray::ControlApi::SystemLog.should_not be_nil
38
+ Stingray::ControlApi::SystemMachineInfo.should_not be_nil
39
+ Stingray::ControlApi::SystemManagement.should_not be_nil
40
+ Stingray::ControlApi::SystemRequestLogs.should_not be_nil
41
+ Stingray::ControlApi::SystemStats.should_not be_nil
42
+ Stingray::ControlApi::SystemSteelhead.should_not be_nil
43
+ Stingray::ControlApi::TrafficIPGroups.should_not be_nil
44
+ Stingray::ControlApi::Users.should_not be_nil
45
+ Stingray::ControlApi::VirtualServer.should_not be_nil
46
+ end
47
+
48
+ it 'should bubble up const missing errors for invalid configuration namespaces' do
49
+ expect { Stingray::ControlApi::FizzBuzz }.to raise_error
50
+ end
51
+ end
@@ -0,0 +1,7 @@
1
+ require 'stingray/exec/cli'
2
+
3
+ describe Stingray::Exec::Cli do
4
+ it 'should return zero on success' do
5
+ described_class.main(['two = 1 + 1']).should == 0
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ describe Stingray::Exec::VERSION do
2
+ it 'should be something sane' do
3
+ described_class.should_not =~ /^0\.0\./
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'rbconfig'
5
+ require 'simplecov'
6
+ require 'pry'
7
+
8
+ RSpec.configure do |c|
9
+ if !ENV['TRAVIS']
10
+ if RbConfig::CONFIG['host_os'] =~ /darwin/i
11
+ c.formatter = 'NyanCatMusicFormatter'
12
+ else
13
+ c.formatter = 'NyanCatFormatter'
14
+ end
15
+ end
16
+
17
+ unless ENV['STINGRAY_ENDPOINT']
18
+ c.filter_run_excluding :integration => true
19
+ end
20
+
21
+ c.before(:suite) do
22
+ require 'stingray/exec'
23
+ Stingray::Exec.configure
24
+ ENV['STINGRAY_SSL_VERIFY_NONE'] = '1'
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'stingray/exec/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "stingray-exec"
8
+ gem.version = Stingray::Exec::VERSION
9
+ gem.authors = ["Dan Buch"]
10
+ gem.email = ["d.buch@modcloth.com"]
11
+ gem.description = %q{Stingray Traffic Manager Control API Client}
12
+ gem.summary = %q{Talks to Riverbed Stingray Traffic Manager over its SOAP Control API}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/).reject do |f|
16
+ f =~ %r{^(
17
+ Vagrantfile|
18
+ install-stingray|
19
+ stingray_.*\.txt|
20
+ \.vagrant\.integration\.env
21
+ )}x
22
+ end
23
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
24
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
25
+ gem.require_paths = ["lib"]
26
+
27
+ gem.add_runtime_dependency 'savon', '~> 1.2'
28
+ gem.add_runtime_dependency 'pry', '~> 0.9'
29
+ end
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stingray-exec
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Dan Buch
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: savon
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.2'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.2'
30
+ - !ruby/object:Gem::Dependency
31
+ name: pry
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '0.9'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0.9'
46
+ description: Stingray Traffic Manager Control API Client
47
+ email:
48
+ - d.buch@modcloth.com
49
+ executables:
50
+ - stingray-exec
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - .local.integration.env
56
+ - .rspec
57
+ - .simplecov
58
+ - AUTHORS.md
59
+ - CONTRIBUTING.md
60
+ - Gemfile
61
+ - LICENSE.txt
62
+ - README.md
63
+ - Rakefile
64
+ - bin/stingray-exec
65
+ - examples/add-pool
66
+ - examples/bork
67
+ - examples/credentials.conf
68
+ - examples/delete-pool
69
+ - examples/list-pools
70
+ - examples/list-virtual-servers
71
+ - generate-actions.rb
72
+ - lib/stingray-exec.rb
73
+ - lib/stingray/control_api.rb
74
+ - lib/stingray/control_api/actions.rb
75
+ - lib/stingray/control_api/catalog_rule_methods.rb
76
+ - lib/stingray/control_api/endpoint.rb
77
+ - lib/stingray/control_api/generated-actions-9.0.yml
78
+ - lib/stingray/control_api/generated-actions-9.1.yml
79
+ - lib/stingray/control_api/pool_methods.rb
80
+ - lib/stingray/control_api/soap_helper_methods.rb
81
+ - lib/stingray/exec.rb
82
+ - lib/stingray/exec/cli.rb
83
+ - lib/stingray/exec/dsl.rb
84
+ - lib/stingray/exec/version.rb
85
+ - lib/stingray/junk.rb
86
+ - spec/integration/catalog_rule_spec.rb
87
+ - spec/integration/pool_spec.rb
88
+ - spec/integration/users_spec.rb
89
+ - spec/lib/stingray/control_api_spec.rb
90
+ - spec/lib/stingray/exec/cli_spec.rb
91
+ - spec/lib/stingray/exec/version_spec.rb
92
+ - spec/spec_helper.rb
93
+ - stingray-exec.gemspec
94
+ homepage: ''
95
+ licenses: []
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ segments:
107
+ - 0
108
+ hash: -1693318520406204840
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ! '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ segments:
116
+ - 0
117
+ hash: -1693318520406204840
118
+ requirements: []
119
+ rubyforge_project:
120
+ rubygems_version: 1.8.23
121
+ signing_key:
122
+ specification_version: 3
123
+ summary: Talks to Riverbed Stingray Traffic Manager over its SOAP Control API
124
+ test_files:
125
+ - spec/integration/catalog_rule_spec.rb
126
+ - spec/integration/pool_spec.rb
127
+ - spec/integration/users_spec.rb
128
+ - spec/lib/stingray/control_api_spec.rb
129
+ - spec/lib/stingray/exec/cli_spec.rb
130
+ - spec/lib/stingray/exec/version_spec.rb
131
+ - spec/spec_helper.rb