Top Level Namespace

Defined Under Namespace

Modules: Flapjack, GLI Classes: Logger

Constant Summary collapse

ENTITY_PATTERN_FRAGMENT =

To see the state of the redis databases before and after, e.g. (using nodejs ‘npm install redis-dump -g’)

be ruby bin/flapjack migrate to_v2 --source=redis://127.0.0.1/7 --destination=redis://127.0.0.1/8
redis-dump -d 7 >~/Desktop/dump7.txt && redis-dump -d 8 >~/Desktop/dump8.txt

 Not migrated:
    current alertable/rollup status (these should reset on app start)
    notifications/alerts (see note above)
'[a-zA-Z0-9][a-zA-Z0-9\.\-_]*[a-zA-Z0-9]'
CHECK_PATTERN_FRAGMENT =
'.+'
ID_PATTERN_FRAGMENT =
'.+'
TAG_PATTERN_FRAGMENT =
'.+'

Instance Method Summary collapse

Instance Method Details

#common_arguments(cmd_type, gli_cmd) ⇒ Object



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/flapjack/cli/maintenance.rb', line 276

def common_arguments(cmd_type, gli_cmd)

  if [:show, :delete, :create].include?(cmd_type)
    gli_cmd.flag ['check', :c],
      :desc => 'The check for the maintenance window to occur on. This can ' +
        'be a string, or a Ruby regex of the form \'http*\' or \'[[:lower:]]\'',
      :required => :create.eql?(cmd_type)

    gli_cmd.flag ['reason', :r],
      :desc => 'The reason for the maintenance window to occur. This can ' +
        'be a string, or a Ruby regex of the form \'Downtime for *\' or ' +
        '\'[[:lower:]]\''

    gli_cmd.flag ['start', 'started', 'starting', :s],
      :desc => 'The start time for the maintenance window. This should ' +
               'be prefixed with "more than", "less than", "on", "before", ' +
               'or "after", or of the form "between T1 and T2"',
      :must_match => /^(?:more than|less than|on|before|after|between)\s+.+$/

    gli_cmd.flag ['duration', :d],
      :desc => 'The total duration of the maintenance window. This should ' +
               'be prefixed with "more than", "less than", or "equal to", ' +
               'or of the form "between M and N hours". This should be an ' +
               ' interval',
      :must_match => /^(?:more than|less than|equal to|between)\s+.+$/
  end

  if [:show, :delete].include?(cmd_type)
    gli_cmd.flag ['finish', 'finished', 'finishing', 'remain', 'remained', 'remaining', 'end', :f],
      :desc => 'The finishing time for the maintenance window. This should ' +
               'prefixed with "more than", "less than", "on", "before", or ' +
               '"after", or of the form "between T1 and T2"' ,
      :must_match => /^(?:more than|less than|on|before|after|between)\s+.+$/

    gli_cmd.flag ['state', :st],
      :desc => 'The state that the check is currently in',
      :must_match => %w(ok warning critical unknown)
  end

  if [:show, :delete, :create].include?(cmd_type)
    gli_cmd.flag ['type', :t],
      :desc          => 'The type of maintenance scheduled',
      :required      => true,
      :default_value => 'scheduled',
      :must_match    => %w(scheduled unscheduled)
  end

end