Class: EtnaApp::Magma::Project::Create

Inherits:
Etna::Command show all
Includes:
WithEtnaClients, WithLogger
Defined in:
lib/commands.rb

Instance Attribute Summary

Attributes inherited from Etna::Command

#parent

Instance Method Summary collapse

Methods included from WithLogger

#logger

Methods included from WithEtnaClients

#environment, #exit, exit, #janus_client, #magma_client, #metis_client, #polyphemus_client, #token

Methods inherited from Etna::Command

#completions, #fill_in_missing_params, #find_command, #initialize, parent_scope, #setup

Methods included from Etna::CommandOrExecutor

#command_name, #completions_for, #desc, #flag_argspec, #flag_as_parameter, included, #parse_flags, #program_name, #usage

Constructor Details

This class inherits a constructor from Etna::Command

Instance Method Details

#execute(project_name, project_name_full) ⇒ Object



302
303
304
305
306
307
308
309
310
311
312
# File 'lib/commands.rb', line 302

def execute(project_name, project_name_full)
  create_args = {project_name: project_name, project_name_full: project_name_full}
  Etna::Clients::Magma::ProjectValidator.new(**create_args).validate!("#{program_name} args invalid!")

  create_project_workflow = Etna::Clients::Magma::CreateProjectWorkflow.new(
      magma_client: magma_client,
      janus_client: janus_client,
      **create_args
  )
  create_project_workflow.create!
end