RESTful endpoints Reference

These are the endpoints that essentially govern all user interaction/communication. The endpoints are callable internally through python, which allows for ‘local’ clients (such as the automator and comm module) to make api calls. These endpoints are also ‘exposed’ to the outside world via flask, which allows external clients to make api requests (such as the react app client).

Authentication

class groundstation.backend_api.auth.AuthLogin
post(local_data=None)

Endpoint for logging in

Parameters

local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple

class groundstation.backend_api.auth.AuthLogout

Communications

class groundstation.backend_api.communications.Communication
get(message_id)

Endpoint for getting a specific message

Parameters

message_id (int) – The message id

Returns

response_object, status_code

Return type

tuple (dict, int)

class groundstation.backend_api.communications.CommunicationList
get(local_data=None)

Endpoint for getting messages

Parameters

local_data (dict) – This should be used in place of the QUERY PARAMS that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

post(local_data=None)

Endpoint for posting a new message to communications table

Parameters

local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

Flightschedule

class groundstation.backend_api.flightschedule.FlightScheduleList
get(local_args=None)

Endpoint for getting a list of FlightSchedules

Parameters

local_args (dict) – This should be used in place of the QUERY PARAMS that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

post(local_data=None)

Endpoint for creating a new FlightSchedule

Parameters

local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

class groundstation.backend_api.flightschedule.Flightschedule
delete(flightschedule_id)

Endpoint for deleting a specific flightschedule

Parameters

flightschedule_id (int) – The flightschedule_id id

Returns

response_object, status_code

Return type

tuple (dict, int)

get(flightschedule_id)

Endpoint for getting a specific flightschedule

Parameters

flightschedule_id (int) – The flightschedule_id

Returns

response_object, status_code

Return type

tuple (dict, int)

patch(flightschedule_id, local_data=None)

Endpoint for patching a specific flightschedule

Parameters
  • flightschedule_id (int) – The flightschedule_id id

  • local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

Housekeeping

class groundstation.backend_api.housekeeping.HousekeepingLog
get(housekeeping_id)

Endpoint for getting a specific housekeeping log

Parameters

housekeeping_id (int) – The housekeeping_id

Returns

response_object, status_code

Return type

tuple (dict, int)

class groundstation.backend_api.housekeeping.HousekeepingLogList
get(local_args=None)

Endpoint for getting a list of housekeeping logs

Parameters

local_args (dict) – This should be used in place of the QUERY PARAMS that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

post(local_data=None)

Endpoint for creating a new Housekeeping log

Parameters

local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

Passovers

class groundstation.backend_api.passover.PassoverList

Endpoint for getting and receiving Passovers

get(local_args=None)

Endpoint for getting a list of passovers

Parameters

local_args (dict) – This should be used in place of the QUERY PARAMS that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

post(local_data=None)

Endpoint for creating a new passover

Parameters

local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

Telecommands

class groundstation.backend_api.telecommand.Telecommand
get(telecommand_id, local_args=None)

Endpoint for getting a single telecommand

Parameters
  • telecommand_id (int) – The id of the telecommand to get

  • local_args (dict) – This should be used in place of the QUERY PARAMS that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

class groundstation.backend_api.telecommand.TelecommandList
get()

Endpoint for getting all valid telecommands

Returns

response_object, status_code

Return type

tuple (dict, int)

post(local_data=None)

Endpoint for creating a new telecommand (virtually never used)

Parameters

local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

Users

class groundstation.backend_api.user.UserEntity
get(user_id, local_args=None)

Endpoint for getting a user

Parameters
  • user_id (int) – The id of the user to get

  • local_args (dict) – This should be used in place of the QUERY PARAMS that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)

class groundstation.backend_api.user.UserList
post(local_data=None)

Endpoint for creating a new user. WARNING: This currently should not be used for local calls, since it references flasks g.user which will only be set to a valid user when requests are made over http, refer to login_required decorator in groundstation.backend_api.utils. If you want to make a new user, its probably best to just make a new User object and save it in a shell.

Parameters

local_data (json_string) – This should be used in place of the POST body that would be used through HTTP, used for local calls.

Returns

response_object, status_code

Return type

tuple (dict, int)