Method: OpenC3::Api#get_command

Defined in:
lib/openc3/api/cmd_api.rb

#get_command(target_name, command_name, scope: $openc3_scope, token: $openc3_token) ⇒ Hash

Returns a hash of the given command

Parameters:

  • target_name (String)

    Name of the target

  • command_name (String)

    Name of the packet

Returns:

  • (Hash)

    Command as a hash

Since:

  • 5.0.0



155
156
157
158
159
160
# File 'lib/openc3/api/cmd_api.rb', line 155

def get_command(target_name, command_name, scope: $openc3_scope, token: $openc3_token)
  target_name = target_name.upcase
  command_name = command_name.upcase
  authorize(permission: 'cmd_info', target_name: target_name, scope: scope, token: token)
  TargetModel.packet(target_name, command_name, type: :CMD, scope: scope)
end