Class: Nucleon::Action::Resource::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/nucleon/action/resource/run.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.describeObject


Info



10
11
12
# File 'lib/nucleon/action/resource/run.rb', line 10

def self.describe
  super(:resource, :run, 500)
end

Instance Method Details

#argumentsObject




28
29
30
# File 'lib/nucleon/action/resource/run.rb', line 28

def arguments
  [:provider, :operation]
end

#configureObject


Settings



17
18
19
20
21
22
23
24
# File 'lib/nucleon/action/resource/run.rb', line 17

def configure
  super do
    codes :run_failed

    register_str :provider, nil
    register_str :operation, nil
  end
end

#executeObject


Action operations



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/nucleon/action/resource/run.rb', line 35

def execute
  super do
    resource = nil

    if plan.execute(settings[:operation], true)
      resource = plan.create_resource(settings[:resource_config])
      resource.execute(settings[:operation])
    end

    myself.status = code.run_failed unless resource && resource.status == code.success
  end
end