Class: UuAppstudio::Cmd::AppboxExtractController

Inherits:
UU::OS::CMD::AsyncCommandController
  • Object
show all
Defined in:
app/controllers/appbox/extract.rb

Constant Summary

CONTROLLER_URL_PATH =
'Appbox/extract'

Instance Method Summary collapse

Instance Method Details

#on_exec(ctx) ⇒ Object

Parameters:

  • ctx (UU::OS::CMD::CommandContext)


13
14
15
16
17
18
19
20
21
# File 'app/controllers/appbox/extract.rb', line 13

def on_exec(ctx)
  UuAppstudio::Cmd::InputMethods.cmd(ctx) do
    app_card_uri = UuAppstudio::Cmd::Helpers.main_entity_uri(ctx)
    # validate parameters
    UuAppstudio::Model::ExtractAppbox.extract_all(app_card_uri, {:dryRun => true}.merge(ctx.parameters))
    # get queue_uri from configuration
    return ctx.invoke_async(UuAppstudio::Cmd::Helpers.message_bus_uri)
  end
end

#on_exec_async(ctx) ⇒ Object

Parameters:

  • ctx (UU::OS::CMD::CommandContext)


24
25
26
27
28
29
# File 'app/controllers/appbox/extract.rb', line 24

def on_exec_async(ctx)
  UuAppstudio::Cmd::InputMethods.cmd(ctx) do
    app_card_uri = UuAppstudio::Cmd::Helpers.main_entity_uri(ctx)
    return UuAppstudio::Model::ExtractAppbox.extract_all(app_card_uri, ctx.parameters)
  end
end