icontrol 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/lib/icontrol/arx.rb +38 -8
  2. data/lib/icontrol/arx/api.rb +1 -0
  3. data/lib/icontrol/arx/chassis.rb +11 -0
  4. data/lib/icontrol/arx/export.rb +4 -1
  5. data/lib/icontrol/arx/file_change_notification.rb +25 -4
  6. data/lib/icontrol/arx/file_server.rb +2 -0
  7. data/lib/icontrol/arx/namespace.rb +2 -0
  8. data/lib/icontrol/arx/network.rb +3 -0
  9. data/lib/icontrol/arx/policy.rb +3 -0
  10. data/lib/icontrol/arx/share.rb +2 -0
  11. data/lib/icontrol/arx/virtual_service.rb +3 -0
  12. data/lib/icontrol/arx/volume.rb +2 -0
  13. data/lib/icontrol/asm.rb +18 -3
  14. data/lib/icontrol/asm/object_params.rb +12 -6
  15. data/lib/icontrol/asm/policy.rb +118 -79
  16. data/lib/icontrol/asm/system_configuration.rb +27 -19
  17. data/lib/icontrol/asm/web_application.rb +74 -52
  18. data/lib/icontrol/asm/web_application_group.rb +33 -24
  19. data/lib/icontrol/base.rb +1 -0
  20. data/lib/icontrol/base/exception.rb +1 -0
  21. data/lib/icontrol/base/icontrol/local_lb/pool.rb +7 -0
  22. data/lib/icontrol/base/icontrol_overlay.rb +6 -0
  23. data/lib/icontrol/base/predeclarations.rb +5 -4
  24. data/lib/icontrol/base/struct.rb +6 -2
  25. data/lib/icontrol/common.rb +55 -4
  26. data/lib/icontrol/global_lb.rb +22 -3
  27. data/lib/icontrol/global_lb/application.rb +63 -44
  28. data/lib/icontrol/global_lb/data_center.rb +82 -58
  29. data/lib/icontrol/global_lb/dnssec_key.rb +152 -90
  30. data/lib/icontrol/global_lb/dnssec_zone.rb +55 -35
  31. data/lib/icontrol/global_lb/globals.rb +662 -430
  32. data/lib/icontrol/global_lb/link.rb +181 -131
  33. data/lib/icontrol/global_lb/monitor.rb +174 -104
  34. data/lib/icontrol/global_lb/pool.rb +290 -203
  35. data/lib/icontrol/global_lb/pool_member.rb +118 -71
  36. data/lib/icontrol/global_lb/region.rb +37 -25
  37. data/lib/icontrol/global_lb/rule.rb +53 -37
  38. data/lib/icontrol/global_lb/server.rb +176 -124
  39. data/lib/icontrol/global_lb/topology.rb +41 -27
  40. data/lib/icontrol/global_lb/virtual_server.rb +118 -84
  41. data/lib/icontrol/global_lb/wide_ip.rb +168 -117
  42. data/lib/icontrol/local_lb.rb +81 -10
  43. data/lib/icontrol/local_lb/klass.rb +233 -153
  44. data/lib/icontrol/local_lb/monitor.rb +158 -96
  45. data/lib/icontrol/local_lb/nat.rb +74 -52
  46. data/lib/icontrol/local_lb/node_address.rb +123 -86
  47. data/lib/icontrol/local_lb/pool.rb +229 -164
  48. data/lib/icontrol/local_lb/pool_member.rb +134 -76
  49. data/lib/icontrol/local_lb/profile_auth.rb +103 -75
  50. data/lib/icontrol/local_lb/profile_client_ssl.rb +284 -201
  51. data/lib/icontrol/local_lb/profile_diameter.rb +113 -71
  52. data/lib/icontrol/local_lb/profile_dns.rb +65 -46
  53. data/lib/icontrol/local_lb/profile_fast_http.rb +265 -178
  54. data/lib/icontrol/local_lb/profile_fast_l4.rb +283 -194
  55. data/lib/icontrol/local_lb/profile_ftp.rb +81 -58
  56. data/lib/icontrol/local_lb/profile_http.rb +701 -433
  57. data/lib/icontrol/local_lb/profile_http_class.rb +169 -121
  58. data/lib/icontrol/local_lb/profile_iiop.rb +87 -63
  59. data/lib/icontrol/local_lb/profile_one_connect.rb +99 -71
  60. data/lib/icontrol/local_lb/profile_persistence.rb +326 -203
  61. data/lib/icontrol/local_lb/profile_radius.rb +94 -62
  62. data/lib/icontrol/local_lb/profile_rtsp.rb +207 -129
  63. data/lib/icontrol/local_lb/profile_sctp.rb +231 -167
  64. data/lib/icontrol/local_lb/profile_server_ssl.rb +268 -189
  65. data/lib/icontrol/local_lb/profile_sip.rb +145 -99
  66. data/lib/icontrol/local_lb/profile_stream.rb +71 -51
  67. data/lib/icontrol/local_lb/profile_tcp.rb +455 -296
  68. data/lib/icontrol/local_lb/profile_udp.rb +109 -78
  69. data/lib/icontrol/local_lb/profile_user_statistic.rb +77 -46
  70. data/lib/icontrol/local_lb/profile_xml.rb +116 -79
  71. data/lib/icontrol/local_lb/ram_cache_information.rb +43 -20
  72. data/lib/icontrol/local_lb/rate_class.rb +523 -318
  73. data/lib/icontrol/local_lb/rule.rb +53 -37
  74. data/lib/icontrol/local_lb/snat.rb +96 -65
  75. data/lib/icontrol/local_lb/snat_pool.rb +54 -39
  76. data/lib/icontrol/local_lb/snat_pool_member.rb +22 -15
  77. data/lib/icontrol/local_lb/snat_translation_address.rb +94 -69
  78. data/lib/icontrol/local_lb/virtual_address.rb +99 -70
  79. data/lib/icontrol/local_lb/virtual_server.rb +358 -243
  80. data/lib/icontrol/lt_config.rb +8 -1
  81. data/lib/icontrol/lt_config/field.rb +87 -53
  82. data/lib/icontrol/lt_config/klass.rb +59 -43
  83. data/lib/icontrol/management.rb +80 -38
  84. data/lib/icontrol/management/ccldap_configuration.rb +218 -144
  85. data/lib/icontrol/management/change_control.rb +67 -41
  86. data/lib/icontrol/management/crldp_configuration.rb +73 -52
  87. data/lib/icontrol/management/crldp_server.rb +55 -39
  88. data/lib/icontrol/management/db_variable.rb +32 -21
  89. data/lib/icontrol/management/event_notification.rb +19 -8
  90. data/lib/icontrol/management/event_subscription.rb +121 -74
  91. data/lib/icontrol/management/key_certificate.rb +235 -138
  92. data/lib/icontrol/management/ldap_configuration.rb +249 -179
  93. data/lib/icontrol/management/license_administration.rb +97 -56
  94. data/lib/icontrol/management/named.rb +103 -67
  95. data/lib/icontrol/management/ocsp_configuration.rb +33 -24
  96. data/lib/icontrol/management/ocsp_responder.rb +294 -165
  97. data/lib/icontrol/management/partition.rb +42 -23
  98. data/lib/icontrol/management/provision.rb +73 -39
  99. data/lib/icontrol/management/radius_configuration.rb +85 -57
  100. data/lib/icontrol/management/radius_server.rb +51 -37
  101. data/lib/icontrol/management/resource_record.rb +163 -121
  102. data/lib/icontrol/management/snmp_configuration.rb +675 -390
  103. data/lib/icontrol/management/tacacs_configuration.rb +99 -67
  104. data/lib/icontrol/management/tmos_module.rb +20 -8
  105. data/lib/icontrol/management/user_management.rb +198 -124
  106. data/lib/icontrol/management/view.rb +33 -24
  107. data/lib/icontrol/management/zone.rb +49 -34
  108. data/lib/icontrol/management/zone_runner.rb +11 -7
  109. data/lib/icontrol/networking.rb +31 -4
  110. data/lib/icontrol/networking/admin_ip.rb +92 -71
  111. data/lib/icontrol/networking/arp.rb +41 -28
  112. data/lib/icontrol/networking/i_session_advertised_route.rb +47 -32
  113. data/lib/icontrol/networking/i_session_local_interface.rb +72 -52
  114. data/lib/icontrol/networking/i_session_peer_discovery.rb +105 -68
  115. data/lib/icontrol/networking/i_session_remote_interface.rb +105 -76
  116. data/lib/icontrol/networking/interfaces.rb +241 -142
  117. data/lib/icontrol/networking/packet_filter.rb +111 -69
  118. data/lib/icontrol/networking/packet_filter_globals.rb +39 -28
  119. data/lib/icontrol/networking/port_mirror.rb +39 -27
  120. data/lib/icontrol/networking/profile_gre.rb +63 -41
  121. data/lib/icontrol/networking/profile_ipip.rb +38 -25
  122. data/lib/icontrol/networking/profile_wccpgre.rb +85 -55
  123. data/lib/icontrol/networking/route_domain.rb +70 -44
  124. data/lib/icontrol/networking/route_table.rb +128 -91
  125. data/lib/icontrol/networking/self_ip.rb +57 -39
  126. data/lib/icontrol/networking/self_ip_port_lockdown.rb +34 -22
  127. data/lib/icontrol/networking/stp_globals.rb +115 -63
  128. data/lib/icontrol/networking/stp_instance.rb +166 -68
  129. data/lib/icontrol/networking/trunk.rb +165 -101
  130. data/lib/icontrol/networking/tunnel.rb +77 -52
  131. data/lib/icontrol/networking/vlan.rb +140 -98
  132. data/lib/icontrol/networking/vlan_group.rb +145 -101
  133. data/lib/icontrol/system.rb +70 -33
  134. data/lib/icontrol/system/cluster.rb +103 -81
  135. data/lib/icontrol/system/config_sync.rb +128 -72
  136. data/lib/icontrol/system/connections.rb +27 -17
  137. data/lib/icontrol/system/disk.rb +134 -67
  138. data/lib/icontrol/system/failover.rb +44 -27
  139. data/lib/icontrol/system/geo_ip.rb +16 -5
  140. data/lib/icontrol/system/inet.rb +47 -30
  141. data/lib/icontrol/system/internal.rb +13 -9
  142. data/lib/icontrol/system/services.rb +75 -42
  143. data/lib/icontrol/system/software_management.rb +132 -83
  144. data/lib/icontrol/system/statistics.rb +443 -298
  145. data/lib/icontrol/system/system_info.rb +137 -95
  146. data/lib/icontrol/web_accelerator/applications.rb +17 -10
  147. data/lib/icontrol/web_accelerator/policies.rb +13 -9
  148. data/lib/icontrol/web_accelerator/proxy_message.rb +11 -7
  149. data/spec/icontrol/local_lb/pool_member_spec.rb +495 -0
  150. data/spec/icontrol/local_lb/profile_http_class_spec.rb +514 -0
  151. metadata +10 -4
@@ -7,25 +7,28 @@ module IControl::WebAccelerator
7
7
 
8
8
  ##
9
9
  # Delete a namd Policy.
10
- # @raise [IControl::Common::AccessDenied] raised if the client credentials are not valid.
11
- # @raise [IControl::Common::InvalidArgument] raised if one of the arguments is invalid.
12
- # @raise [IControl::Common::OperationFailed] raised if an operation error occurs.
10
+ # @rspec_example
11
+ # @raise [IControl::IControl::Common::AccessDenied] raised if the client credentials are not valid.
12
+ # @raise [IControl::IControl::Common::InvalidArgument] raised if one of the arguments is invalid.
13
+ # @raise [IControl::IControl::Common::OperationFailed] raised if an operation error occurs.
13
14
  def delete_policy
14
15
  super
15
16
  end
16
17
 
17
18
  ##
18
19
  # Get a list of Policies present on this WebAccelerator.
20
+ # @rspec_example
19
21
  # @return [String]
20
- # @raise [IControl::Common::AccessDenied] raised if the client credentials are not valid.
21
- # @raise [IControl::Common::InvalidArgument] raised if one of the arguments is invalid.
22
- # @raise [IControl::Common::OperationFailed] raised if an operation error occurs.
22
+ # @raise [IControl::IControl::Common::AccessDenied] raised if the client credentials are not valid.
23
+ # @raise [IControl::IControl::Common::InvalidArgument] raised if one of the arguments is invalid.
24
+ # @raise [IControl::IControl::Common::OperationFailed] raised if an operation error occurs.
23
25
  def list
24
26
  super
25
27
  end
26
28
 
27
29
  ##
28
30
  # Gets the version information for this interface.
31
+ # @rspec_example
29
32
  # @return [String]
30
33
  def version
31
34
  super
@@ -33,9 +36,10 @@ module IControl::WebAccelerator
33
36
 
34
37
  ##
35
38
  # Import a Policy onto this WebAccelerator.
36
- # @raise [IControl::Common::AccessDenied] raised if the client credentials are not valid.
37
- # @raise [IControl::Common::InvalidArgument] raised if one of the arguments is invalid.
38
- # @raise [IControl::Common::OperationFailed] raised if an operation error occurs.
39
+ # @rspec_example
40
+ # @raise [IControl::IControl::Common::AccessDenied] raised if the client credentials are not valid.
41
+ # @raise [IControl::IControl::Common::InvalidArgument] raised if one of the arguments is invalid.
42
+ # @raise [IControl::IControl::Common::OperationFailed] raised if an operation error occurs.
39
43
  # @param [Hash] opts
40
44
  # @option opts [String] :filename The filename of the Policy file to install. Length limit: 255.
41
45
  # @option opts [boolean] :overwrite If true, the imported policy will overwrite any existing policy of the same name.
@@ -1,21 +1,24 @@
1
1
  module IControl::WebAccelerator
2
2
  ##
3
- # The ProxyMessage interface enables you to send Invalidations to the WAM on the other Active BIG-IP to invalidate content.
3
+ # The ProxyMessage interface enables you to send Invalidations to the WAM on the other
4
+ # Active BIG-IP to invalidate content.
4
5
  class ProxyMessage < IControl::Base
5
6
 
6
7
  set_id_name "invalidation_message"
7
8
 
8
9
  ##
9
10
  # Invalidates the WA content after receiving an ESI Invaidation.
10
- # @raise [IControl::Common::AccessDenied]
11
- # @raise [IControl::Common::InvalidArgument]
12
- # @raise [IControl::Common::OperationFailed] raised if an operation error occurs.
11
+ # @rspec_example
12
+ # @raise [IControl::IControl::Common::AccessDenied]
13
+ # @raise [IControl::IControl::Common::InvalidArgument]
14
+ # @raise [IControl::IControl::Common::OperationFailed] raised if an operation error occurs.
13
15
  def esi_invalidate_content
14
16
  super
15
17
  end
16
18
 
17
19
  ##
18
20
  # Gets the version information for this interface.
21
+ # @rspec_example
19
22
  # @return [String]
20
23
  def version
21
24
  super
@@ -23,9 +26,10 @@ module IControl::WebAccelerator
23
26
 
24
27
  ##
25
28
  # Invalidates the content on the peer pvac after receiving a trigger in a HTTP request.
26
- # @raise [IControl::Common::AccessDenied]
27
- # @raise [IControl::Common::InvalidArgument]
28
- # @raise [IControl::Common::OperationFailed] raised if an operation error occurs.
29
+ # @rspec_example
30
+ # @raise [IControl::IControl::Common::AccessDenied]
31
+ # @raise [IControl::IControl::Common::InvalidArgument]
32
+ # @raise [IControl::IControl::Common::OperationFailed] raised if an operation error occurs.
29
33
  def invalidate_content
30
34
  super
31
35
  end
@@ -0,0 +1,495 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__),"..","..",'/spec_helper'))
2
+
3
+ TEST_POOL_NAME = "test_pool"
4
+
5
+ describe IControl::LocalLB::PoolMember do
6
+
7
+ use_vcr_cassette "IControl::LocalLB::PoolMember", :record => :all, :match_requests_on => [:uri, :method, :body] # Change :record => :new_episodes when done
8
+ before(:each) do
9
+ IControl::LocalLB::Pool.create(:pool_name => TEST_POOL_NAME,
10
+ :lb_method => IControl::LocalLB::LBMethod::LB_METHOD_ROUND_ROBIN,
11
+ :members => [{:address => "192.168.50.1",:port => "80"},
12
+ {:address => "192.168.50.2",:port => "80"},
13
+ {:address => "192.168.50.3",:port => "80"},
14
+ {:address => "192.168.50.4",:port => "80"},
15
+ {:address => "192.168.50.5",:port => "80"},
16
+ {:address => "192.168.50.6",:port => "80"}
17
+ ])
18
+ @pool = IControl::LocalLB::Pool.find(TEST_POOL_NAME)
19
+ @members = @pool.members
20
+ end
21
+
22
+ after(:each) do
23
+ @pool.delete_pool
24
+ end
25
+
26
+ describe "#all_statistics" do
27
+ it "should return without raising any exception" do
28
+ lambda { @members.all_statistics }.should_not raise_exception
29
+ end
30
+
31
+ it "Gets the statistics for all pool members of the specified pools." do
32
+ @members.all_statistics.should_not be_nil
33
+ end
34
+
35
+ it "works this way" do
36
+ statistics = @members.all_statistics
37
+ # => <IControl::LocalLB::PoolMember::MemberStatistics:0x9c4cd78 ... >
38
+ statistics.statistics.first.statistics.first.type
39
+ # => :STATISTIC_SERVER_SIDE_BYTES_IN
40
+ statistics.statistics.first.member.address
41
+ # => 192.168.50.1
42
+ end
43
+
44
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberStatistics" do
45
+ @members.all_statistics.class.should == IControl::LocalLB::PoolMember::MemberStatistics
46
+ end
47
+ end
48
+
49
+ describe "#connection_limit" do
50
+ it "should return without raising any exception" do
51
+ lambda { @members.connection_limit }.should_not raise_exception
52
+ end
53
+
54
+ it "Gets the connection limits for all members in the specified pools." do
55
+ @members.connection_limit.should_not be_nil
56
+ end
57
+
58
+ it "works this way" do
59
+ connection_limits = @members.connection_limit
60
+ # => [<IControl::LocalLB::PoolMember::MemberConnectionLimit ... >,...]
61
+ connection_limits.first.member.address
62
+ # => 192.168.50.1
63
+ connection_limits.first.connection_limit
64
+ # => 0
65
+ end
66
+
67
+ it "returns an instance of MemberConnectionLimit[]" do
68
+ @members.connection_limit.first.class.should == IControl::LocalLB::PoolMember::MemberConnectionLimit
69
+ end
70
+ end
71
+
72
+ describe "#dynamic_ratio" do
73
+ it "should return without raising any exception" do
74
+ lambda { @members.dynamic_ratio }.should_not raise_exception
75
+ end
76
+
77
+ it "Gets the dynamic ratios for all members of the specified pools." do
78
+ @members.dynamic_ratio.should_not be_nil
79
+ end
80
+
81
+ it "works this way" do
82
+ dynamic_ratios = @members.dynamic_ratio
83
+ # => [#<IControl::LocalLB::PoolMember::MemberDynamicRatio:0xa11f210 ... >,...]
84
+ dynamic_ratios.first.member.address
85
+ # => 192.168.50.1
86
+ dynamic_ratios.first.dynamic_ratio
87
+ # => 1
88
+ end
89
+
90
+ it "returns an instance of MemberDynamicRatio[]" do
91
+ @members.dynamic_ratio.first.class.should == IControl::LocalLB::PoolMember::MemberDynamicRatio
92
+ end
93
+ end
94
+
95
+ describe "#monitor_association" do
96
+ it "should return without raising any exception" do
97
+ lambda { @members.monitor_association }.should_not raise_exception
98
+ end
99
+
100
+ it "Gets the monitor associations used by the specified pool members, i.e. the monitor rules used by the pool members." do
101
+ @members.monitor_association.should_not be_nil
102
+ end
103
+
104
+ it "works this way" do
105
+ monitor_associations = @members.monitor_association
106
+ # => [#<IControl::LocalLB::PoolMember::MemberMonitorAssociation:0x9a31070..>,...]
107
+ monitor_associations.first.member.ipport.address
108
+ # => 192.168.50.1
109
+ monitor_associations.first.monitor_rule.type
110
+ # => :MONITOR_RULE_TYPE_UNDEFINED
111
+ monitor_associations.first.monitor_rule.quorum
112
+ # => 0
113
+ end
114
+
115
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberMonitorAssociation[]" do
116
+ @members.monitor_association.first.class.should == IControl::LocalLB::PoolMember::MemberMonitorAssociation
117
+ end
118
+ end
119
+
120
+ describe "#monitor_instance" do
121
+
122
+ before(:each) do
123
+ IControl::LocalLB::Pool.set_monitor_association(:monitor_association => {:pool_name => TEST_POOL_NAME,:monitor_rule => {:type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,:monitor_templates => ["tcp"],:quorum => 0} })
124
+ end
125
+
126
+ it "should return without raising any exception" do
127
+ lambda { @members.monitor_instance }.should_not raise_exception
128
+ end
129
+
130
+ it "Gets the monitor instance information for the pool members in the specified pools." do
131
+ @members.monitor_instance.should_not be_nil
132
+ end
133
+
134
+ it "works this way" do
135
+ monitor_instances = @members.monitor_instance
136
+ # => [#<IControl::LocalLB::PoolMember::MemberMonitorInstanceState:0xa067f34...>,...]
137
+ monitor_instances.first.member.address
138
+ # => 192.168.50.1
139
+ monitor_instances.first.monitor_instances
140
+ # => #<IControl::LocalLB::MonitorInstanceState:0xaafa76c @attributes={:instance=>#<IControl::LocalLB::MonitorInstance:0xaafa924
141
+ # @attributes={:template_name=>"tcp", :instance_definition=>#<IControl::LocalLB::MonitorIPPort:0xaafa960
142
+ # @attributes={:address_type=>:ATYPE_EXPLICIT_ADDRESS_EXPLICIT_PORT, :ipport=>#<IControl::Common::IPPortDefinition:0xaafa99c
143
+ # @attributes={:address=>"192.168.50.1", :port=>"80", :id=>nil}>, :id=>nil}>, :id=>nil}>, :instance_state=>:INSTANCE_STATE_CHECKING,
144
+ # :enabled_state=:STATE_ENABLED...
145
+ end
146
+
147
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberMonitorInstanceState[]" do
148
+ @members.monitor_instance.first.class.should == IControl::LocalLB::PoolMember::MemberMonitorInstanceState
149
+ end
150
+ end
151
+
152
+ describe "#monitor_status" do
153
+
154
+ before(:each) do
155
+ IControl::LocalLB::Pool.set_monitor_association(:monitor_association => {:pool_name => TEST_POOL_NAME,:monitor_rule => {:type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,:monitor_templates => ["tcp"],:quorum => 0} })
156
+ end
157
+
158
+ it "should return without raising any exception" do
159
+ lambda { @members.monitor_status }.should_not raise_exception
160
+ end
161
+
162
+ it "Gets the monitor/availability status for all members of the specified pools." do
163
+ @members.monitor_status.should_not be_nil
164
+ end
165
+
166
+ it "works this way" do
167
+ statuses = @members.monitor_status
168
+ # => [#<IControl::LocalLB::PoolMember::MemberMonitorStatus:0xae9433c...>,...]
169
+ statuses.first.member.address
170
+ # => 192.168.50.1
171
+ statuses.first.monitor_status
172
+ # => MONITOR_STATUS_ADDRESS_DOWN
173
+ end
174
+
175
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberMonitorStatus[]" do
176
+ @members.monitor_status.first.class.should == IControl::LocalLB::PoolMember::MemberMonitorStatus
177
+ end
178
+ end
179
+
180
+ describe "#object_status" do
181
+ it "should return without raising any exception" do
182
+ lambda { @members.object_status }.should_not raise_exception
183
+ end
184
+
185
+ it "Gets the object statuses for all members of the specified pools." do
186
+ @members.object_status.should_not be_nil
187
+ end
188
+
189
+ it "works this way" do
190
+ object_statuses = @members.object_status
191
+ # => [#<IControl::LocalLB::PoolMember::MemberObjectStatus:0xa0d06b0 ...>,...]
192
+ object_statuses.first.member.address
193
+ # => 192.168.50.1
194
+ object_statuses.first.object_status
195
+ # => #<IControl::LocalLB::ObjectStatus:0xa0d06ec @attributes={:availability_status=>:AVAILABILITY_STATUS_RED,
196
+ # :enabled_status=>:ENABLED_STATUS_ENABLED, :status_description=>"Parent down", :id=>nil}>
197
+ end
198
+
199
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberObjectStatus[]" do
200
+ @members.object_status.first.class.should == IControl::LocalLB::PoolMember::MemberObjectStatus
201
+ end
202
+ end
203
+
204
+ describe "#priority" do
205
+ it "should return without raising any exception" do
206
+ lambda { @members.priority }.should_not raise_exception
207
+ end
208
+
209
+ it "Gets the priorities for all members in the specified pools." do
210
+ @members.priority.should_not be_nil
211
+ end
212
+
213
+ it "works this way" do
214
+ priorities = @members.priority
215
+ # => [#<IControl::LocalLB::PoolMember::MemberPriority:0xa37148c...>,...]
216
+ priorities.first.member.address
217
+ # => 192.168.50.1
218
+ priorities.first.priority
219
+ # => 1
220
+ end
221
+
222
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberPriority[]" do
223
+ @members.priority.first.class == IControl::LocalLB::PoolMember::MemberPriority
224
+ end
225
+ end
226
+
227
+ describe "#ratio" do
228
+ it "should return without raising any exception" do
229
+ lambda { @members.ratio }.should_not raise_exception
230
+ end
231
+
232
+ it "Gets the ratios for all members in the specified pools." do
233
+ @members.ratio.should_not be_nil
234
+ end
235
+
236
+ it "works this way" do
237
+ ratios = @members.ratio
238
+ # => [#<IControl::LocalLB::PoolMember::MemberRatio:0xb27ea4c ...>,...]
239
+ ratios.first.member.address
240
+ # => 192.168.50.1
241
+ ratios.first.ratio
242
+ # => 1
243
+ end
244
+
245
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberRatio[]" do
246
+ @members.ratio.first.class.should == IControl::LocalLB::PoolMember::MemberRatio
247
+ end
248
+ end
249
+
250
+ describe "#session_enabled_state" do
251
+ it "should return without raising any exception" do
252
+ lambda { @members.session_enabled_state }.should_not raise_exception
253
+ end
254
+
255
+ it "Note: This function has been deprecated. Please use get_session_status. Gets the session states for all members of the specified pools." do
256
+ @members.session_enabled_state.should_not be_nil
257
+
258
+ end
259
+
260
+ it "works this way" do
261
+ @members.session_enabled_state.first.session_state
262
+ # => :STATE_ENABLED
263
+ end
264
+
265
+ it "returns an instance of IControl::LocalLB::PoolMember::MemberSessionState[]" do
266
+ @members.session_enabled_state.first.class.should == IControl::LocalLB::PoolMember::MemberSessionState
267
+ end
268
+ end
269
+
270
+ describe "#session_status" do
271
+ it "should return without raising any exception" do
272
+ lambda { @members.session_status }.should_not raise_exception
273
+ end
274
+
275
+ it "Gets the session status for all members of the specified pools." do
276
+ @members.session_status.should_not be_nil
277
+ end
278
+
279
+ it "works this way" do
280
+ @members.session_status.first.session_status
281
+ # => :SESSION_STATUS_ENABLED
282
+ end
283
+
284
+ it "returns an instance of MemberSessionStatus[]" do
285
+ @members.session_status.first.class.should == IControl::LocalLB::PoolMember::MemberSessionStatus
286
+ end
287
+ end
288
+
289
+ describe "#statistics" do
290
+ it "should return without raising any exception" do
291
+ lambda { @members.statistics(:members => [{:address => "192.168.50.1",:port => 80}] )}.should_not raise_exception
292
+ end
293
+
294
+ it "Gets the statistics for the specified set of pool members." do
295
+ @members.statistics(:members => [{:address => "192.168.50.1",:port => 80}] ).should_not be_nil
296
+ end
297
+
298
+ it "works this way" do
299
+ statistics = @members.statistics(:members => [{:address => "192.168.50.1",:port => 80}] ).statistics.statistics
300
+ # => [#<IControl::Common::Statistic:0xb783434 @attributes={:type=>:STATISTIC_SERVER_SIDE_BYTES_IN, :value=>#<IControl::Common::ULong64:0xb783484 @attributes={:high=>"0", :low=>"0"}>,...
301
+ end
302
+
303
+ it "returns an instance of MemberStatistics" do
304
+ @members.statistics(:members => [{:address => "192.168.50.1",:port => 80}] ).class.should == IControl::LocalLB::PoolMember::MemberStatistics
305
+ end
306
+ end
307
+
308
+ describe "#version" do
309
+ it "should return without raising any exception" do
310
+ lambda { @members.version }.should_not raise_exception
311
+ end
312
+
313
+ it "Gets the version information for this interface." do
314
+ @members.version.should_not be_nil
315
+ end
316
+
317
+ it "works this way" do
318
+ @members.version
319
+ # => BIG-IP_v10.0.1
320
+ end
321
+
322
+ it "returns an instance of String" do
323
+ @members.version
324
+ end
325
+ end
326
+
327
+ describe "#remove_monitor_association" do
328
+
329
+ before(:each) do
330
+ IControl::LocalLB::Pool.set_monitor_association(:monitor_association => {
331
+ :pool_name => TEST_POOL_NAME,
332
+ :monitor_rule => {:type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,
333
+ :monitor_templates => ["tcp"],
334
+ :quorum => 0
335
+ }
336
+ })
337
+ end
338
+
339
+
340
+
341
+ it "Removes the monitor associations for the specified pool members. Depending on the monitor association removal rule specified, this basically deletes any explicit monitor associations between a pool member and a monitor rule and thus causing the pool member to use the default monitor association of its parent pool, or this will delete any monitor association for the pool members altogether, i.e. the specified pool members will no longer be monitored." do
342
+ previous_value = @members.monitor_association.first.monitor_rule.type
343
+ @members.remove_monitor_association(:monitor_associations => [{:member => {
344
+ :address_type => IControl::LocalLB::AddressType::ATYPE_EXPLICIT_ADDRESS_EXPLICIT_PORT,
345
+ :ipport => {:address => "192.168.50.1",:port => 80}},
346
+ :removal_rule => IControl::LocalLB::MonitorAssociationRemovalRule::REMOVE_ALL_MONITOR_ASSOCIATION}])
347
+
348
+ @members.monitor_association.first.monitor_rule.type.should_not == previous_value
349
+ @members.monitor_association.first.monitor_rule.type.should == IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_NONE
350
+ end
351
+
352
+ it "works this way" do
353
+ previous_value = @members.monitor_association.first.monitor_rule.type
354
+ # => ...IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE...
355
+ @members.remove_monitor_association(:monitor_associations => [{:member => {
356
+ :address_type => IControl::LocalLB::AddressType::ATYPE_EXPLICIT_ADDRESS_EXPLICIT_PORT,
357
+ :ipport => {:address => "192.168.50.1",:port => 80}},
358
+ :removal_rule => IControl::LocalLB::MonitorAssociationRemovalRule::REMOVE_ALL_MONITOR_ASSOCIATION}])
359
+ @members.monitor_association.first.monitor_rule.type
360
+ # => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_NONE
361
+ end
362
+ end
363
+
364
+ describe "#reset_statistics" do
365
+ it "Resets the statistics for the specified set of pool members." do
366
+ lambda { @members.reset_statistics(:members => [{:address => "192.168.1.50",:port => 80}]) }.should_not raise_exception
367
+ end
368
+
369
+ it "works this way" do
370
+ @members.reset_statistics(:members => [{:address => "192.168.1.50",:port => 80}])
371
+ end
372
+ end
373
+
374
+ describe "#set_connection_limit" do
375
+ it "Sets the connection limits for the specified pool members." do
376
+ previous_value = @members.connection_limit.first.connection_limit
377
+ lambda { @members.set_connection_limit(:limits => [{:member => {:address => "192.168.50.1",:port => 80},
378
+ :connection_limit => 10}]) }.should_not raise_exception
379
+ @members.connection_limit.first.connection_limit.should_not == previous_value
380
+ @members.connection_limit.first.connection_limit.should == 10
381
+ end
382
+
383
+ it "works this way" do
384
+ @members.set_connection_limit(:limits => [{
385
+ :member => {:address => "192.168.50.1",:port => 80},
386
+ :connection_limit => 10}
387
+ ])
388
+ # => Sets the connection limit if no exception is thrown
389
+ end
390
+ end
391
+
392
+ describe "#set_dynamic_ratio" do
393
+ it "Sets the dynamic ratios for the specified pool members." do
394
+ previous_value = @members.dynamic_ratio.first.dynamic_ratio
395
+ lambda { @members.set_dynamic_ratio(:dynamic_ratios => [{:member => {:address => "192.168.50.1",:port => 80},
396
+ :dynamic_ratio => 10}]) }.should_not raise_exception
397
+ @members.dynamic_ratio.first.dynamic_ratio.should_not == previous_value
398
+ @members.dynamic_ratio.first.dynamic_ratio.should == 10
399
+ end
400
+
401
+ it "works this way" do
402
+ lambda { @members.set_dynamic_ratio(:dynamic_ratios => [{:member => {:address => "192.168.50.1",:port => 80},
403
+ :dynamic_ratio => 10}]) }.should_not raise_exception
404
+ # => Sets the dynamic ratio is no exception is thrown
405
+ end
406
+ end
407
+
408
+ describe "#set_monitor_association" do
409
+ it "Sets/creates the monitor associations for the specified pool members. This basically creates the monitor associations between a pool member and a monitor rule." do
410
+ @members.monitor_instance.first.monitor_instances.should be_nil
411
+ @members.set_monitor_association(:monitor_associations => [{:member => {
412
+ :address_type => IControl::LocalLB::AddressType::ATYPE_EXPLICIT_ADDRESS_EXPLICIT_PORT,
413
+ :ipport => {:address => "192.168.50.1",:port => 80}},
414
+ :monitor_rule => {
415
+ :type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,
416
+ :monitor_templates => ["tcp"],
417
+ :quorum => 0 }
418
+ }])
419
+ @members.monitor_instance.first.monitor_instances.should_not be_nil
420
+ end
421
+
422
+ it "works this way" do
423
+ @members.set_monitor_association(:monitor_associations => [{:member => {
424
+ :address_type => IControl::LocalLB::AddressType::ATYPE_EXPLICIT_ADDRESS_EXPLICIT_PORT,
425
+ :ipport => {:address => "192.168.50.1",:port => 80}},
426
+ :monitor_rule => {
427
+ :type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,
428
+ :monitor_templates => ["tcp"],
429
+ :quorum => 0 }
430
+ }])
431
+ end
432
+ end
433
+
434
+ describe "#set_monitor_state" do
435
+ it "Sets the monitor/availability states for the specified pool members." do
436
+ previous_value = @members.object_status.first.object_status.status_description
437
+ lambda { @members.set_monitor_state(:monitor_states => [{:member => {:address => "192.168.50.1",:port => 80},
438
+ :monitor_state => IControl::Common::EnabledState::STATE_DISABLED}]) }.should_not raise_exception
439
+ @members.object_status.first.object_status.status_description.should_not == previous_value
440
+ @members.object_status.first.object_status.status_description.should == "Forced down"
441
+ end
442
+
443
+ it "works this way" do
444
+ @members.set_monitor_state(:monitor_states => [{:member => {:address => "192.168.50.1",:port => 80},
445
+ :monitor_state => IControl::Common::EnabledState::STATE_DISABLED}])
446
+ end
447
+ end
448
+
449
+ describe "#set_priority" do
450
+ it "Sets the priorities for the specified pool members." do
451
+ previous_value = @members.priority.first.priority
452
+ lambda { @members.set_priority(:priorities => [{:member => {:address => "192.168.50.1",:port => 80},
453
+ :priority => 10}]) }.should_not raise_exception
454
+ @members.priority.first.priority.should_not == previous_value
455
+ @members.priority.first.priority.should == 10
456
+ end
457
+
458
+ it "works this way" do
459
+ @members.set_priority(:priorities => [{:member => {:address => "192.168.50.1",:port => 80},
460
+ :priority => 10}])
461
+ end
462
+ end
463
+
464
+ describe "#set_ratio" do
465
+ it "Sets the ratios for the specified pool members." do
466
+ previous_value = @members.ratio.first.ratio
467
+ lambda { @members.set_ratio(:ratios => [{:member => {:address => "192.168.50.1",:port => 80},
468
+ :ratio => 10}]) }.should_not raise_exception
469
+ @members.ratio.first.ratio.should_not == previous_value
470
+ @members.ratio.first.ratio.should == 10
471
+ end
472
+
473
+ it "works this way" do
474
+ @members.set_ratio(:ratios => [{:member => {:address => "192.168.50.1",:port => 80},
475
+ :ratio => 10}])
476
+ # Sets the ratio for a member
477
+ end
478
+ end
479
+
480
+ describe "#set_session_enabled_state" do
481
+ it "Sets the session states for the specified pool members. If session state is enabled or true, this means that new sessions will be allowed to be established with the pool members." do
482
+ previous_value = @members.object_status.first.object_status.enabled_status
483
+ lambda { @members.set_session_enabled_state(:session_states => [{:member => {:address => "192.168.50.1",:port => 80},
484
+ :session_state => IControl::Common::EnabledState::STATE_DISABLED}]) }.should_not raise_exception
485
+ @members.object_status.first.object_status.enabled_status.should_not == previous_value
486
+ @members.object_status.first.object_status.enabled_status.should == IControl::Common::EnabledStatus::ENABLED_STATUS_DISABLED
487
+ end
488
+
489
+ it "works this way" do
490
+ @members.set_session_enabled_state(:session_states => [{:member => {:address => "192.168.50.1",:port => 80},
491
+ :session_state => IControl::Common::EnabledState::STATE_DISABLED}])
492
+ # => This disables the member monitor
493
+ end
494
+ end
495
+ end