Module: Apmate::CLI::Command::Get

Defined in:
lib/apmate/commands/get/artifact.rb,
lib/apmate/commands/get/artifact_name.rb,
lib/apmate/commands/get/artifact_environment.rb

Constant Summary collapse

ARTIFACT =
Cri::Command.define do
  name        'artifact'
  usage       'artifact <artifact_name>'
  summary     'Returns the requested artifact object from the datastore.'
  description 'Returns the requested artifact object from the datastore.'

  run do |opts, args, cmd|
    Apmate::Logger.log_level(opts)
    Apmate::Logger.verbosity(opts)
    Apmate::Logger.logger.debug "opts: #{opts}"
    Apmate::Logger.logger.debug "args: #{args}"
    Apmate::Logger.logger.debug "cmd: #{cmd.to_s}"
    if args.count == 1
      Apmate::CLI.apmate_get_artifact(args[0], opts)
    else
      cmd.run(['-h'])
    end
  end
end
ARTIFACT_NAME =
Cri::Command.define do
  name        'artifact_name'
  usage       'artifact_name <artifact_id> <group_id> <filename_extension>'
  summary     'Returns the requested artifact object name from the datastore.'
  description 'Returns the requested artifact object name from the datastore.'

  run do |opts, args, cmd|
    Apmate::Logger.log_level(opts)
    Apmate::Logger.verbosity(opts)
    Apmate::Logger.logger.debug "opts: #{opts}"
    Apmate::Logger.logger.debug "args: #{args}"
    Apmate::Logger.logger.debug "cmd: #{cmd.to_s}"
    if args.count == 3
      Apmate::CLI.apmate_get_artifact_name(args[0], args[1], args[2], opts)
    else
      cmd.run(['-h'])
    end
  end
end
ARTIFACT_ENVIRONMENT =
Cri::Command.define do
  name        'artifact_environment'
  usage       'artifact_environment <artifact_name> <environment_name>'
  summary     'Returns the requested artifact with it\'s environment data from the datastore.'
  description 'Returns the requested artifact with it\'s environment data from the datastore.'

  run do |opts, args, cmd|
    Apmate::Logger.log_level(opts)
    Apmate::Logger.verbosity(opts)
    Apmate::Logger.logger.debug "opts: #{opts}"
    Apmate::Logger.logger.debug "args: #{args}"
    Apmate::Logger.logger.debug "cmd: #{cmd.to_s}"
    if args.count == 2
      Apmate::CLI.apmate_get_artifact_environment(args[0], args[1], opts)
    else
      cmd.run(['-h'])
    end
  end
end