Class: Comet::ServerMetaVersionInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/comet/models/server_meta_version_info.rb

Overview

ServerMetaVersionInfo is a typed class wrapper around the underlying Comet Server API data structure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeServerMetaVersionInfo

Returns a new instance of ServerMetaVersionInfo.



100
101
102
# File 'lib/comet/models/server_meta_version_info.rb', line 100

def initialize
  clear
end

Instance Attribute Details

#authentication_roleObject

Returns the value of attribute authentication_role.



25
26
27
# File 'lib/comet/models/server_meta_version_info.rb', line 25

def authentication_role
  @authentication_role
end

#constellation_roleObject

Returns the value of attribute constellation_role.



35
36
37
# File 'lib/comet/models/server_meta_version_info.rb', line 35

def constellation_role
  @constellation_role
end

#constellation_role__legacyObject

Deprecated.

This member has been deprecated since Comet version 18.2.0 “Overseer Role” was the old name for the Constellation Role. This field is a duplicate of ConstellationRole for backward compatibility with earlier API consumers.



32
33
34
# File 'lib/comet/models/server_meta_version_info.rb', line 32

def constellation_role__legacy
  @constellation_role__legacy
end

#current_timeObject

The current time on the Comet Server host machine. Unix timestamp, in seconds. You can check this value to see if clock drift is occuring.



52
53
54
# File 'lib/comet/models/server_meta_version_info.rb', line 52

def current_time
  @current_time
end

#emails_sent_errorsObject

Returns the value of attribute emails_sent_errors.



73
74
75
# File 'lib/comet/models/server_meta_version_info.rb', line 73

def emails_sent_errors
  @emails_sent_errors
end

#emails_sent_successfullyObject

Returns the value of attribute emails_sent_successfully.



70
71
72
# File 'lib/comet/models/server_meta_version_info.rb', line 70

def emails_sent_successfully
  @emails_sent_successfully
end

#emails_waiting_in_queueObject

Returns the value of attribute emails_waiting_in_queue.



76
77
78
# File 'lib/comet/models/server_meta_version_info.rb', line 76

def emails_waiting_in_queue
  @emails_waiting_in_queue
end

#experimental_optionsObject

Returns the value of attribute experimental_options.



38
39
40
# File 'lib/comet/models/server_meta_version_info.rb', line 38

def experimental_options
  @experimental_options
end

#license_valid_untilObject

Unix timestamp, in seconds.



67
68
69
# File 'lib/comet/models/server_meta_version_info.rb', line 67

def license_valid_until
  @license_valid_until
end

#scheduled_email_thread_current_stateObject

Returns the value of attribute scheduled_email_thread_current_state.



79
80
81
# File 'lib/comet/models/server_meta_version_info.rb', line 79

def scheduled_email_thread_current_state
  @scheduled_email_thread_current_state
end

#scheduled_email_thread_last_calculate_duration_nanosObject

Returns the value of attribute scheduled_email_thread_last_calculate_duration_nanos.



82
83
84
# File 'lib/comet/models/server_meta_version_info.rb', line 82

def scheduled_email_thread_last_calculate_duration_nanos
  @scheduled_email_thread_last_calculate_duration_nanos
end

#scheduled_email_thread_last_wake_sent_emailsObject

Returns the value of attribute scheduled_email_thread_last_wake_sent_emails.



91
92
93
# File 'lib/comet/models/server_meta_version_info.rb', line 91

def scheduled_email_thread_last_wake_sent_emails
  @scheduled_email_thread_last_wake_sent_emails
end

#scheduled_email_thread_last_wake_timeObject

Returns the value of attribute scheduled_email_thread_last_wake_time.



88
89
90
# File 'lib/comet/models/server_meta_version_info.rb', line 88

def scheduled_email_thread_last_wake_time
  @scheduled_email_thread_last_wake_time
end

#scheduled_email_thread_waiting_untilObject

Returns the value of attribute scheduled_email_thread_waiting_until.



85
86
87
# File 'lib/comet/models/server_meta_version_info.rb', line 85

def scheduled_email_thread_waiting_until
  @scheduled_email_thread_waiting_until
end

#self_backupObject

This field is available in Comet 21.3.2 and later.



95
96
97
# File 'lib/comet/models/server_meta_version_info.rb', line 95

def self_backup
  @self_backup
end

#server_license_feature_setObject

Returns the value of attribute server_license_feature_set.



63
64
65
# File 'lib/comet/models/server_meta_version_info.rb', line 63

def server_license_feature_set
  @server_license_feature_set
end

#server_license_features_allObject

Returns the value of attribute server_license_features_all.



60
61
62
# File 'lib/comet/models/server_meta_version_info.rb', line 60

def server_license_features_all
  @server_license_features_all
end

#server_license_hashObject

A hash derived from the Comet Server’s serial number. You can check this value to see if two Comet Server endpoints point to an identical server.



57
58
59
# File 'lib/comet/models/server_meta_version_info.rb', line 57

def server_license_hash
  @server_license_hash
end

#server_start_hashObject

A GUID that was randomly generated when this Comet Server started up. You can check this value to see if the Comet Server has restarted.



47
48
49
# File 'lib/comet/models/server_meta_version_info.rb', line 47

def server_start_hash
  @server_start_hash
end

#server_start_timeObject

Unix timestamp, in seconds.



42
43
44
# File 'lib/comet/models/server_meta_version_info.rb', line 42

def server_start_time
  @server_start_time
end

#software_build_roleObject

Returns the value of attribute software_build_role.



28
29
30
# File 'lib/comet/models/server_meta_version_info.rb', line 28

def software_build_role
  @software_build_role
end

#storage_roleObject

Returns the value of attribute storage_role.



22
23
24
# File 'lib/comet/models/server_meta_version_info.rb', line 22

def storage_role
  @storage_role
end

#unknown_json_fieldsObject

Returns the value of attribute unknown_json_fields.



98
99
100
# File 'lib/comet/models/server_meta_version_info.rb', line 98

def unknown_json_fields
  @unknown_json_fields
end

#versionObject

Returns the value of attribute version.



16
17
18
# File 'lib/comet/models/server_meta_version_info.rb', line 16

def version
  @version
end

#version_codenameObject

Returns the value of attribute version_codename.



19
20
21
# File 'lib/comet/models/server_meta_version_info.rb', line 19

def version_codename
  @version_codename
end

Instance Method Details

#clearObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/comet/models/server_meta_version_info.rb', line 104

def clear
  @version = ''
  @version_codename = ''
  @experimental_options = []
  @server_start_time = 0
  @server_start_hash = ''
  @current_time = 0
  @server_license_hash = ''
  @server_license_feature_set = 0
  @license_valid_until = 0
  @emails_sent_successfully = 0
  @emails_sent_errors = 0
  @emails_waiting_in_queue = 0
  @scheduled_email_thread_current_state = 0
  @scheduled_email_thread_last_calculate_duration_nanos = 0
  @scheduled_email_thread_waiting_until = 0
  @scheduled_email_thread_last_wake_time = 0
  @self_backup = []
  @unknown_json_fields = {}
end

#from_hash(obj) ⇒ Object

Parameters:

  • obj (Hash)

    The complete object as a Ruby hash

Raises:

  • (TypeError)


133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/comet/models/server_meta_version_info.rb', line 133

def from_hash(obj)
  raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash

  obj.each do |k, v|
    case k
    when 'Version'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @version = v
    when 'VersionCodename'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @version_codename = v
    when 'StorageRole'
      @storage_role = v
    when 'AuthenticationRole'
      @authentication_role = v
    when 'SoftwareBuildRole'
      @software_build_role = v
    when 'OverseerRole'
      @constellation_role__legacy = v
    when 'ConstellationRole'
      @constellation_role = v
    when 'ExperimentalOptions'
      if v.nil?
        @experimental_options = []
      else
        @experimental_options = Array.new(v.length)
        v.each_with_index do |v1, i1|
          raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String

          @experimental_options[i1] = v1
        end
      end
    when 'ServerStartTime'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @server_start_time = v
    when 'ServerStartHash'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @server_start_hash = v
    when 'CurrentTime'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @current_time = v
    when 'ServerLicenseHash'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @server_license_hash = v
    when 'ServerLicenseFeaturesAll'
      @server_license_features_all = v
    when 'ServerLicenseFeatureSet'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @server_license_feature_set = v
    when 'LicenseValidUntil'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @license_valid_until = v
    when 'EmailsSentSuccessfully'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @emails_sent_successfully = v
    when 'EmailsSentErrors'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @emails_sent_errors = v
    when 'EmailsWaitingInQueue'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @emails_waiting_in_queue = v
    when 'ScheduledEmailThreadCurrentState'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @scheduled_email_thread_current_state = v
    when 'ScheduledEmailThreadLastCalculateDurationNanos'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @scheduled_email_thread_last_calculate_duration_nanos = v
    when 'ScheduledEmailThreadWaitingUntil'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @scheduled_email_thread_waiting_until = v
    when 'ScheduledEmailThreadLastWakeTime'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @scheduled_email_thread_last_wake_time = v
    when 'ScheduledEmailThreadLastWakeSentEmails'
      @scheduled_email_thread_last_wake_sent_emails = v
    when 'SelfBackup'
      if v.nil?
        @self_backup = []
      else
        @self_backup = Array.new(v.length)
        v.each_with_index do |v1, i1|
          @self_backup[i1] = Comet::SelfBackupStatistics.new
          @self_backup[i1].from_hash(v1)
        end
      end
    else
      @unknown_json_fields[k] = v
    end
  end
end

#from_json(json_string) ⇒ Object

Parameters:

  • json_string (String)

    The complete object in JSON format

Raises:

  • (TypeError)


126
127
128
129
130
# File 'lib/comet/models/server_meta_version_info.rb', line 126

def from_json(json_string)
  raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String

  from_hash(JSON.parse(json_string))
end

#to_hHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



275
276
277
# File 'lib/comet/models/server_meta_version_info.rb', line 275

def to_h
  to_hash
end

#to_hashHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/comet/models/server_meta_version_info.rb', line 240

def to_hash
  ret = {}
  ret['Version'] = @version
  ret['VersionCodename'] = @version_codename
  ret['StorageRole'] = @storage_role
  ret['AuthenticationRole'] = @authentication_role
  ret['SoftwareBuildRole'] = @software_build_role
  ret['OverseerRole'] = @constellation_role__legacy
  ret['ConstellationRole'] = @constellation_role
  unless @experimental_options.nil?
    ret['ExperimentalOptions'] = @experimental_options
  end
  ret['ServerStartTime'] = @server_start_time
  ret['ServerStartHash'] = @server_start_hash
  ret['CurrentTime'] = @current_time
  ret['ServerLicenseHash'] = @server_license_hash
  ret['ServerLicenseFeaturesAll'] = @server_license_features_all
  ret['ServerLicenseFeatureSet'] = @server_license_feature_set
  ret['LicenseValidUntil'] = @license_valid_until
  ret['EmailsSentSuccessfully'] = @emails_sent_successfully
  ret['EmailsSentErrors'] = @emails_sent_errors
  ret['EmailsWaitingInQueue'] = @emails_waiting_in_queue
  ret['ScheduledEmailThreadCurrentState'] = @scheduled_email_thread_current_state
  ret['ScheduledEmailThreadLastCalculateDurationNanos'] = @scheduled_email_thread_last_calculate_duration_nanos
  ret['ScheduledEmailThreadWaitingUntil'] = @scheduled_email_thread_waiting_until
  ret['ScheduledEmailThreadLastWakeTime'] = @scheduled_email_thread_last_wake_time
  ret['ScheduledEmailThreadLastWakeSentEmails'] = @scheduled_email_thread_last_wake_sent_emails
  ret['SelfBackup'] = @self_backup
  @unknown_json_fields.each do |k, v|
    ret[k] = v
  end
  ret
end

#to_json(options = {}) ⇒ String

Returns The complete object as a JSON string.

Returns:

  • (String)

    The complete object as a JSON string



280
281
282
# File 'lib/comet/models/server_meta_version_info.rb', line 280

def to_json(options = {})
  to_hash.to_json(options)
end