Class: Sfn::Planner

Inherits:
Object
  • Object
show all
Defined in:
lib/sfn/planner.rb,
lib/sfn/planner/aws.rb

Overview

Interface for generating plan report

Direct Known Subclasses

Aws

Defined Under Namespace

Classes: Aws

Constant Summary collapse

RUNTIME_MODIFIED =

Value to flag runtime modification

'__MODIFIED_REFERENCE_VALUE__'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ui, config, arguments, stack, opts = {}) ⇒ self

Create a new planner instance

Parameters:

  • ui (Bogo::Ui)
  • config (Smash)
  • arguments (Array<String>)
  • stack (Miasma::Models::Orchestration::Stack)
  • opts (Hash) (defaults to: {})


32
33
34
35
36
37
38
# File 'lib/sfn/planner.rb', line 32

def initialize(ui, config, arguments, stack, opts={})
  @ui = ui
  @config = config
  @arguments = arguments
  @origin_stack = stack
  @options = opts
end

Instance Attribute Details

#argumentsArray<String> (readonly)

Returns CLI arguments.

Returns:

  • (Array<String>)

    CLI arguments



17
18
19
# File 'lib/sfn/planner.rb', line 17

def arguments
  @arguments
end

#configSmash (readonly)

Returns:

  • (Smash)


15
16
17
# File 'lib/sfn/planner.rb', line 15

def config
  @config
end

#optionsHash (readonly)

Returns custom options.

Returns:

  • (Hash)

    custom options



21
22
23
# File 'lib/sfn/planner.rb', line 21

def options
  @options
end

#origin_stackMiasma::Models::Orchestration::Stack (readonly)

Returns existing remote stack.

Returns:

  • (Miasma::Models::Orchestration::Stack)

    existing remote stack



19
20
21
# File 'lib/sfn/planner.rb', line 19

def origin_stack
  @origin_stack
end

#uiBogo::Ui (readonly)

Returns:

  • (Bogo::Ui)


13
14
15
# File 'lib/sfn/planner.rb', line 13

def ui
  @ui
end

Instance Method Details

#generate_plan(template, parameters) ⇒ Hash

Generate update report

Parameters:

  • template (Hash)

    updated template

  • parameters (Hash)

    runtime parameters for update

Returns:

  • (Hash)

    report

Raises:

  • (NotImplementedError)


46
47
48
# File 'lib/sfn/planner.rb', line 46

def generate_plan(template, parameters)
  raise NotImplementedError
end