f5-icontrol 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51e1dd154ac05834c5bf6155a48cbf9d415454c7
4
- data.tar.gz: 3b5b67c1f8ef58a33683e0c5f3a71625d7dbb50b
3
+ metadata.gz: 18e1e516aa3f7ec9d11527b824e1348a22ea1716
4
+ data.tar.gz: c3506b0d44b7b498a52a3fbd277ae4cb322361ab
5
5
  SHA512:
6
- metadata.gz: '069bd45ae69fd3439eeda0d3eebebfdca592be929c2693cef9e66ab82337d3e0022446057999a4558150563df320fbf1e9d4de6d4b01a722c6083f98fd2539bd'
7
- data.tar.gz: 04ce250260edc91e65f80a89fd39217bf4aaf7f3d0f5c0e168acf713fe73b3e3b2c877cb0805c7582564eabe0874bee5d947c93c6830dfb1b57d479e0d91a32e
6
+ metadata.gz: 1c5c3d22af6f49421b7aef54229f82b773d6bcd566eac3451b1ce789c5cb3294e3604649e39ae92fa9186f78883217c3335ca355a0791b4959094a2736b2c756
7
+ data.tar.gz: 8e5a5204c08c572a8a764895cfd98a80819809d0b92136297dbdf25e073781cb9791f8d1bca12c9f6f15bcb81ede51f35051e75d819f0ac8e8151a7f16fbe496
data/README.md CHANGED
@@ -61,6 +61,28 @@ response = api.LocalLB.Pool.get_list
61
61
 
62
62
  See specs subdir for more examples, especially as it pertains to passing parameters.
63
63
 
64
+ ## Logging
65
+
66
+ This gem uses the [`Savon`](http://savonrb.com/) client to wrap the SOAP endpoints,
67
+ and it is sometimes useful to be able to see the SOAP request and response XML.
68
+
69
+ You can pass in a few options during configuration of the api client
70
+ which are forwarded to the internal `Savon` client:
71
+
72
+ ```Ruby
73
+ api = F5::Icontrol::API.new(
74
+ host: "hostname.of.bigip",
75
+ username: "username",
76
+ password: "password",
77
+
78
+ # Savon logging options
79
+ enable_logging: true, # defaults to: false
80
+ log_level: :debug, # defaults to: debug
81
+ pretty_print_xml: true, # defaults to: true
82
+ )
83
+
84
+ ```
85
+
64
86
  ## CLI
65
87
 
66
88
  There's a command line version that's still being roughed out. You'll need a `~/.f5.yml` file containing your login information:
@@ -8,6 +8,9 @@ module F5
8
8
  @username = params[:username]
9
9
  @password = params[:password]
10
10
  @hostname = params[:host] || params[:hostname]
11
+ @enable_logging = params[:enable_logging] || false
12
+ @log_level = params[:log_level] ? params[:log_level].to_sym : :debug
13
+ @pretty_print_xml = params[:pretty_print_xml] || true
11
14
  @client_cache = {}
12
15
  @api_path = api_path
13
16
  end
@@ -61,10 +64,10 @@ module F5
61
64
  endpoint: "https://#{@hostname || F5::Icontrol.configuration.host}#{endpoint}",
62
65
  ssl_verify_mode: :none,
63
66
  basic_auth: [@username || F5::Icontrol.configuration.username, @password || F5::Icontrol.configuration.password],
64
- #log: true,
65
- #logger: Logger.new(STDOUT),
66
- #pretty_print_xml: true,
67
- #log_level: :debug,
67
+ log: @enable_logging,
68
+ logger: Logger.new(STDOUT),
69
+ pretty_print_xml: @pretty_print_xml,
70
+ log_level: @log_level,
68
71
  namespace: "urn:iControl:#{api_namespace}",
69
72
  convert_request_keys_to: :none
70
73
  )
@@ -0,0 +1,12 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
3
+ module F5
4
+ module Icontrol
5
+ module Common
6
+ module EnabledState
7
+ STATE_DISABLED = EnumItem.new('STATE_DISABLED', 0)
8
+ STATE_ENABLED = EnumItem.new('STATE_ENABLED', 1)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ # This is a helper type to encapsulate iControl
2
+ # enumerations in a way which easily gives us
3
+ # access to the member as well as the value,
4
+ # since the SOAP API and the Savon serializers
5
+ # seem to use the string version of the member
6
+ # name rather than the value.
7
+ #
8
+ # Additional iControl enumerations can be generated
9
+ # using nimbletest.com/live with '\t' as a column
10
+ # separator and the following substitution pattern:
11
+ #
12
+ # # $2
13
+ # $0 = EnumItem.new('$0', '$1')
14
+ #
15
+ EnumItem = Struct.new(:member, :value) do
16
+ def to_s
17
+ self.member
18
+ end
19
+
20
+ def to_i
21
+ self.value
22
+ end
23
+ end
@@ -1,3 +1,5 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
1
3
  module F5
2
4
  module Icontrol
3
5
  module LocalLB
@@ -5,26 +7,22 @@ module F5
5
7
  # A list of possible values for an object's availability status.
6
8
  module AvailabilityStatus
7
9
  # Error scenario.
8
- AVAILABILITY_STATUS_NONE = 0
10
+ AVAILABILITY_STATUS_NONE = EnumItem.new('AVAILABILITY_STATUS_NONE', '0')
9
11
 
10
12
  # The object is available in some capacity.
11
- AVAILABILITY_STATUS_GREEN = 1
13
+ AVAILABILITY_STATUS_GREEN = EnumItem.new('AVAILABILITY_STATUS_GREEN', '1')
12
14
 
13
- # The object is not available at the current
14
- # moment, but may become available again even
15
- # without user intervention.
16
- AVAILABILITY_STATUS_YELLOW = 2
15
+ # The object is not available at the current moment, but may become available again even without user intervention.
16
+ AVAILABILITY_STATUS_YELLOW = EnumItem.new('AVAILABILITY_STATUS_YELLOW', '2')
17
17
 
18
- # The object is not available, and will require
19
- # user intervention to make this object available
20
- # again.
21
- AVAILABILITY_STATUS_RED = 3
18
+ # The object is not available, and will require user intervention to make this object available again.
19
+ AVAILABILITY_STATUS_RED = EnumItem.new('AVAILABILITY_STATUS_RED', '3')
22
20
 
23
21
  # The object's availability status is unknown.
24
- AVAILABILITY_STATUS_BLUE = 4
22
+ AVAILABILITY_STATUS_BLUE = EnumItem.new('AVAILABILITY_STATUS_BLUE', '4')
25
23
 
26
24
  # The object's is unlicensed.
27
- AVAILABILITY_STATUS_GRAY = 5
25
+ AVAILABILITY_STATUS_GRAY = EnumItem.new('AVAILABILITY_STATUS_GRAY', '5')
28
26
  end
29
27
  end
30
28
  end
@@ -1,17 +1,22 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
1
3
  module F5
2
4
  module Icontrol
3
5
  module LocalLB
4
- # https://devcentral.f5.com/wiki/iControl.LocalLB__ProfileContextType.ashx
5
- # A list of profile context types.
6
- module ProfileContextType
7
- # Profile applies to both client and server sides.
8
- PROFILE_CONTEXT_TYPE_ALL = 0
6
+ # https://devcentral.f5.com/wiki/iControl.LocalLB__ClientSSLCertificateMode.ashx
7
+ # A list of client-side SSL certificate modes.
8
+ module ClientSSLCertificateMode
9
+ # The client certificate is requested.
10
+ CLIENTSSL_CERTIFICATE_MODE_REQUEST = EnumItem.new('CLIENTSSL_CERTIFICATE_MODE_REQUEST', '0')
11
+
12
+ # The client certificate is required.
13
+ CLIENTSSL_CERTIFICATE_MODE_REQUIRE = EnumItem.new('CLIENTSSL_CERTIFICATE_MODE_REQUIRE', '1')
9
14
 
10
- # Profile applies to the client side only.
11
- PROFILE_CONTEXT_TYPE_CLIENT = 1
15
+ # The client certificate is ignored.
16
+ CLIENTSSL_CERTIFICATE_MODE_IGNORE = EnumItem.new('CLIENTSSL_CERTIFICATE_MODE_IGNORE', '2')
12
17
 
13
- # Profile applies to the server side only.
14
- PROFILE_CONTEXT_TYPE_SERVER = 2
18
+ # The client certificate processing is auto. As of version 11.0.0, certificate mode AUTO is equivalent to IGNORE.
19
+ CLIENTSSL_CERTIFICATE_MODE_AUTO = EnumItem.new('CLIENTSSL_CERTIFICATE_MODE_AUTO', '3')
15
20
  end
16
21
  end
17
22
  end
@@ -1,3 +1,5 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
1
3
  module F5
2
4
  module Icontrol
3
5
  module LocalLB
@@ -5,23 +7,16 @@ module F5
5
7
  # A list of possible values for enabled status.
6
8
  module EnabledStatus
7
9
  # Error scenario.
8
- ENABLED_STATUS_NONE = 0
10
+ ENABLED_STATUS_NONE = EnumItem.new('ENABLED_STATUS_NONE', '0')
9
11
 
10
- # The object is active when in Green
11
- # availability status. It may or may
12
- # not be active when in Blue
13
- # availability status.
14
- ENABLED_STATUS_ENABLED = 1
12
+ # The object is active when in Green availability status. It may or may not be active when in Blue availability status.
13
+ ENABLED_STATUS_ENABLED = EnumItem.new('ENABLED_STATUS_ENABLED', '1')
15
14
 
16
- # The object is inactive regardless
17
- # of availability status.
18
- ENABLED_STATUS_DISABLED = 2
15
+ # The object is inactive regardless of availability status.
16
+ ENABLED_STATUS_DISABLED = EnumItem.new('ENABLED_STATUS_DISABLED', '2')
19
17
 
20
- # The object is inactive regardless of
21
- # availability status because its parent
22
- # has been disabled, but the object
23
- # itself is still enabled.
24
- ENABLED_STATUS_DISABLED_BY_PARENT = 3
18
+ # The object is inactive regardless of availability status because its parent has been disabled, but the object itself is still enabled.
19
+ ENABLED_STATUS_DISABLED_BY_PARENT = EnumItem.new('ENABLED_STATUS_DISABLED_BY_PARENT', '3')
25
20
  end
26
21
  end
27
22
  end
@@ -1,3 +1,5 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
1
3
  module F5
2
4
  module Icontrol
3
5
  module LocalLB
@@ -5,13 +7,13 @@ module F5
5
7
  # A list of profile context types.
6
8
  module ProfileContextType
7
9
  # Profile applies to both client and server sides.
8
- PROFILE_CONTEXT_TYPE_ALL = 0
10
+ PROFILE_CONTEXT_TYPE_ALL = EnumItem.new('PROFILE_CONTEXT_TYPE_ALL', '0')
9
11
 
10
12
  # Profile applies to the client side only.
11
- PROFILE_CONTEXT_TYPE_CLIENT = 1
13
+ PROFILE_CONTEXT_TYPE_CLIENT = EnumItem.new('PROFILE_CONTEXT_TYPE_CLIENT', '1')
12
14
 
13
15
  # Profile applies to the server side only.
14
- PROFILE_CONTEXT_TYPE_SERVER = 2
16
+ PROFILE_CONTEXT_TYPE_SERVER = EnumItem.new('PROFILE_CONTEXT_TYPE_SERVER', '2')
15
17
  end
16
18
  end
17
19
  end
@@ -1,3 +1,5 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
1
3
  module F5
2
4
  module Icontrol
3
5
  module LocalLB
@@ -5,82 +7,82 @@ module F5
5
7
  # A list of profile types.
6
8
  module ProfileType
7
9
  # The TCP profile.
8
- PROFILE_TYPE_TCP = 0
10
+ PROFILE_TYPE_TCP = EnumItem.new('PROFILE_TYPE_TCP', '0')
9
11
 
10
12
  # The UDP profile.
11
- PROFILE_TYPE_UDP = 1
13
+ PROFILE_TYPE_UDP = EnumItem.new('PROFILE_TYPE_UDP', '1')
12
14
 
13
15
  # The FTP profile.
14
- PROFILE_TYPE_FTP = 2
16
+ PROFILE_TYPE_FTP = EnumItem.new('PROFILE_TYPE_FTP', '2')
15
17
 
16
18
  # The L4 translation profile.
17
- PROFILE_TYPE_FAST_L4 = 3
19
+ PROFILE_TYPE_FAST_L4 = EnumItem.new('PROFILE_TYPE_FAST_L4', '3')
18
20
 
19
21
  # The HTTP profile.
20
- PROFILE_TYPE_HTTP = 4
22
+ PROFILE_TYPE_HTTP = EnumItem.new('PROFILE_TYPE_HTTP', '4')
21
23
 
22
24
  # The server-side SSL profile.
23
- PROFILE_TYPE_SERVER_SSL = 5
25
+ PROFILE_TYPE_SERVER_SSL = EnumItem.new('PROFILE_TYPE_SERVER_SSL', '5')
24
26
 
25
27
  # The client-side SSL profile.
26
- PROFILE_TYPE_CLIENT_SSL = 6
28
+ PROFILE_TYPE_CLIENT_SSL = EnumItem.new('PROFILE_TYPE_CLIENT_SSL', '6')
27
29
 
28
30
  # The authorization profile.
29
- PROFILE_TYPE_AUTH = 7
31
+ PROFILE_TYPE_AUTH = EnumItem.new('PROFILE_TYPE_AUTH', '7')
30
32
 
31
33
  # The persistence profile.
32
- PROFILE_TYPE_PERSISTENCE = 8
34
+ PROFILE_TYPE_PERSISTENCE = EnumItem.new('PROFILE_TYPE_PERSISTENCE', '8')
33
35
 
34
36
  # The connection pool profile.
35
- PROFILE_TYPE_CONNECTION_POOL = 9
37
+ PROFILE_TYPE_CONNECTION_POOL = EnumItem.new('PROFILE_TYPE_CONNECTION_POOL', '9')
36
38
 
37
39
  # The stream profile.
38
- PROFILE_TYPE_STREAM = 10
40
+ PROFILE_TYPE_STREAM = EnumItem.new('PROFILE_TYPE_STREAM', '10')
39
41
 
40
42
  # The XML profile.
41
- PROFILE_TYPE_XML = 11
43
+ PROFILE_TYPE_XML = EnumItem.new('PROFILE_TYPE_XML', '11')
42
44
 
43
45
  # The FastHTTP profile.
44
- PROFILE_TYPE_FAST_HTTP = 12
46
+ PROFILE_TYPE_FAST_HTTP = EnumItem.new('PROFILE_TYPE_FAST_HTTP', '12')
45
47
 
46
48
  # The IIOP profile.
47
- PROFILE_TYPE_IIOP = 13
49
+ PROFILE_TYPE_IIOP = EnumItem.new('PROFILE_TYPE_IIOP', '13')
48
50
 
49
51
  # The RTSP profile.
50
- PROFILE_TYPE_RTSP = 14
52
+ PROFILE_TYPE_RTSP = EnumItem.new('PROFILE_TYPE_RTSP', '14')
51
53
 
52
54
  # The STATISTICS profile.
53
- PROFILE_TYPE_STATISTICS = 15
55
+ PROFILE_TYPE_STATISTICS = EnumItem.new('PROFILE_TYPE_STATISTICS', '15')
54
56
 
55
57
  # The HTTP class profile.
56
- PROFILE_TYPE_HTTPCLASS = 16
58
+ PROFILE_TYPE_HTTPCLASS = EnumItem.new('PROFILE_TYPE_HTTPCLASS', '16')
57
59
 
58
60
  # The DNS profile.
59
- PROFILE_TYPE_DNS = 17
61
+ PROFILE_TYPE_DNS = EnumItem.new('PROFILE_TYPE_DNS', '17')
60
62
 
61
63
  # The SCTP profile.
62
- PROFILE_TYPE_SCTP = 18
64
+ PROFILE_TYPE_SCTP = EnumItem.new('PROFILE_TYPE_SCTP', '18')
63
65
 
64
66
  # A loosely-typed profile.
65
- PROFILE_TYPE_INSTANCE = 19
67
+ PROFILE_TYPE_INSTANCE = EnumItem.new('PROFILE_TYPE_INSTANCE', '19')
66
68
 
67
69
  # The SIP profile.
68
- PROFILE_TYPE_SIPP = 20
70
+ PROFILE_TYPE_SIPP = EnumItem.new('PROFILE_TYPE_SIPP', '20')
69
71
 
70
72
  # The HTTP Compression profile.
71
- PROFILE_TYPE_HTTPCOMPRESSION = 21
73
+ PROFILE_TYPE_HTTPCOMPRESSION = EnumItem.new('PROFILE_TYPE_HTTPCOMPRESSION', '21')
72
74
 
73
75
  # The Web Acceleration profile.
74
- PROFILE_TYPE_WEBACCELERATION = 22
76
+ PROFILE_TYPE_WEBACCELERATION = EnumItem.new('PROFILE_TYPE_WEBACCELERATION', '22')
75
77
 
76
78
  # Profile type is unknown (or is unsupported by iControl).
77
- PROFILE_TYPE_UNKNOWN = 23
79
+ PROFILE_TYPE_UNKNOWN = EnumItem.new('PROFILE_TYPE_UNKNOWN', '23')
78
80
 
79
81
  # The RADIUS profile.
80
- PROFILE_TYPE_RADIUS = 24
82
+ PROFILE_TYPE_RADIUS = EnumItem.new('PROFILE_TYPE_RADIUS', '24')
81
83
 
82
84
  # The Diameter profile.
83
- PROFILE_TYPE_DIAMETER = 25
85
+ PROFILE_TYPE_DIAMETER = EnumItem.new('PROFILE_TYPE_DIAMETER', '25')
84
86
  end
85
87
  end
86
88
  end
@@ -0,0 +1,17 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
3
+ module F5
4
+ module Icontrol
5
+ module LocalLB
6
+ # https://devcentral.f5.com/wiki/iControl.LocalLB__ServerSSLCertificateMode.ashx
7
+ # A list of server-side SSL certificate modes.
8
+ module ServerSSLCertificateMode
9
+ # The certificate is required.
10
+ SERVERSSL_CERTIFICATE_MODE_REQUIRE = EnumItem.new('SERVERSSL_CERTIFICATE_MODE_REQUIRE', '0')
11
+
12
+ # The certificate is ignored.
13
+ SERVERSSL_CERTIFICATE_MODE_IGNORE = EnumItem.new('SERVERSSL_CERTIFICATE_MODE_IGNORE', '1')
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,5 @@
1
+ require 'f5/icontrol/common/enum_item'
2
+
1
3
  module F5
2
4
  module Icontrol
3
5
  module LocalLB
@@ -6,19 +8,19 @@ module F5
6
8
  # A list of source address translation types.
7
9
  module SourceAddressTranslationType
8
10
  # Translation type unknown (or unsupported by iControl).
9
- SRC_TRANS_UNKNOWN = 0
11
+ SRC_TRANS_UNKNOWN = EnumItem.new('SRC_TRANS_UNKNOWN', '0')
10
12
 
11
13
  # No translation is being used.
12
- SRC_TRANS_NONE = 1
14
+ SRC_TRANS_NONE = EnumItem.new('SRC_TRANS_NONE', '1')
13
15
 
14
16
  # The translation uses self IP addresses.
15
- SRC_TRANS_AUTOMAP = 2
17
+ SRC_TRANS_AUTOMAP = EnumItem.new('SRC_TRANS_AUTOMAP', '2')
16
18
 
17
19
  # The translation uses a SNAT pool of translation addresses.
18
- SRC_TRANS_SNATPOOL = 3
20
+ SRC_TRANS_SNATPOOL = EnumItem.new('SRC_TRANS_SNATPOOL', '3')
19
21
 
20
22
  # The translation uses an LSN pool of translation addresses.
21
- SRC_TRANS_LSNPOOL = 4
23
+ SRC_TRANS_LSNPOOL = EnumItem.new('SRC_TRANS_LSNPOOL', '4')
22
24
  end
23
25
  end
24
26
  end
@@ -1,5 +1,5 @@
1
1
  module F5
2
2
  module Icontrol
3
- VERSION = "0.2.5"
3
+ VERSION = "0.2.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: f5-icontrol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Walberg
@@ -156,11 +156,14 @@ files:
156
156
  - lib/f5/cli/application.rb
157
157
  - lib/f5/icontrol.rb
158
158
  - lib/f5/icontrol/api.rb
159
+ - lib/f5/icontrol/common/enabled_state.rb
160
+ - lib/f5/icontrol/common/enum_item.rb
159
161
  - lib/f5/icontrol/locallb/availability_status.rb
160
162
  - lib/f5/icontrol/locallb/client_ssl_certificate_mode.rb
161
163
  - lib/f5/icontrol/locallb/enabled_status.rb
162
164
  - lib/f5/icontrol/locallb/profile_context_type.rb
163
165
  - lib/f5/icontrol/locallb/profile_type.rb
166
+ - lib/f5/icontrol/locallb/server_ssl_certificate_mode.rb
164
167
  - lib/f5/icontrol/locallb/virtual_server/source_address_translation.rb
165
168
  - lib/f5/icontrol/version.rb
166
169
  - lib/wsdl/ASM.LoggingProfile.wsdl