Skip to content

Commit dd49e37

Browse files
committed
Fix rdoc in Server for Network Monitor attributes and move the query result status descriptions into its respective class
1 parent 0cc89f3 commit dd49e37

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

lib/softlayer/NetworkMonitor.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ def initialize(monitor_levels_data)
2020
# This struct represents a network monitor query result that shows the last
2121
# state of the network monitor
2222
class NetworkMonitorQueryResult < Struct.new(:finished_at, :responded_in, :response_status)
23+
##
24+
# This constant is a mapping of network monitor query result statuses to descriptions
25+
QUERY_RESULT_STATUS_DESCRIPTIONS = {
26+
0 => "Down/Critical: Server is down and/or has passed the critical response threshold (extremely long ping response, abnormal behavior, etc.).",
27+
1 => "Warning - Server may be recovering from a previous down state, or may have taken too long to respond.",
28+
2 => "Up",
29+
3 => "Not used",
30+
4 => "Unknown - An unknown error has occurred. If the problem persists, contact support.",
31+
5 => "Unknown - An unknown error has occurred. If the problem persists, contact support."
32+
}
33+
2334
def initialize(query_result_data)
2435
self.finished_at = query_result_data['finishTime']
2536
self.responded_in = query_result_data['responseTime']
@@ -60,15 +71,6 @@ def initialize(response_type_data)
6071
class NetworkMonitor < ModelBase
6172
include ::SoftLayer::DynamicAttribute
6273

63-
QUERY_RESULT_DESCRIPTIONS = {
64-
0 => "Down/Critical: Server is down and/or has passed the critical response threshold (extremely long ping response, abnormal behavior, etc.).",
65-
1 => "Warning - Server may be recovering from a previous down state, or may have taken too long to respond.",
66-
2 => "Up",
67-
3 => "Not used",
68-
4 => "Unknown - An unknown error has occurred. If the problem persists, contact support.",
69-
5 => "Unknown - An unknown error has occurred. If the problem persists, contact support."
70-
}
71-
7274
@@available_query_types = nil
7375
@@available_response_types = nil
7476

lib/softlayer/Server.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class Server < SoftLayer::ModelBase
5555

5656
##
5757
# The maximum network monitor query/response levels currently supported by the server
58-
#
58+
# :call-seq:
59+
# network_monitor_levels(force_update=false)
5960
sl_dynamic_attr :network_monitor_levels do |resource|
6061
resource.should_update? do
6162
@network_monitor_levels == nil
@@ -68,7 +69,8 @@ class Server < SoftLayer::ModelBase
6869

6970
##
7071
# A lsst of configured network monitors.
71-
#
72+
# :call-seq:
73+
# network_monitors(force_update=false)
7274
sl_dynamic_attr :network_monitors do |resource|
7375
resource.should_update? do
7476
@network_monitors == nil
@@ -88,6 +90,8 @@ class Server < SoftLayer::ModelBase
8890
##
8991
# :attr_reader:
9092
# The list of user customers notified on monitoring failures
93+
# :call-seq:
94+
# notified_network_monitor_users(force_update=false)
9195
sl_dynamic_attr :notified_network_monitor_users do |resource|
9296
resource.should_update? do
9397
#only retrieved once per instance

0 commit comments

Comments
 (0)