#NEWLINE# @ rpcmethod ( name = 'configuration.sc.create' , signature = [ 'String' , 'String' , 'String' ] , login_required = satnet_settings . JRPC_LOGIN_REQUIRED ) #NEWLINE# def create( identifier , callsign , tle_id , **kwargs ) : #NEWLINE# #INDENT# 'JRPC test: configuration.sc.create\n    Creates a new ground station with the given configuration.\n    User name must be obtained from the request, since this has already been\n    validated by the authentication backend\n\n    :param identifier: Identifier of the Spacecraft\n    :param callsign: Callsign string of the Spacecraft\n    :param tle_id: Identifier of the TLE associated with the Spacecraft\n    :param kwargs: Additional JRPC parameters dictionary\n    ' #NEWLINE# try : #NEWLINE# #INDENT# ( user , username ) = account_models . get_user ( http_request = kwargs . get ( 'request' , None ) ) #NEWLINE# sc = segments . Spacecraft . objects . create ( tle_id , username = username , identifier = identifier , callsign = identifier ) #NEWLINE# #UNINDENT# except Exception as ex : #NEWLINE# #INDENT# logger . exception ( ex ) #NEWLINE# raise ex #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# segment_serializers . SC_ID_K : str ( sc . identifier ) , #NEWLINE# #UNINDENT# }