Python Applications API¶
Mission Application API for Python Mission Applications.
-
class
app_api.
Services
(service_config_filepath='/etc/kubos-config.toml')¶ Bases:
object
-
query
(service, query, timeout=10.0)¶ Send a GraphQL request to a service
Args:
- service (str): The service that the request should be sent to. Must be defined in
the system’s
config.toml
file - query (str): The GraphQL request
- timeout (int): The amount of time that this function should wait for a response from the service
- Returns:
- The JSON response from the service
- Raises:
- EnvironmentError: An error was returned within the JSON response from the service KeyError: The service value was invalid TimeoutError: The function timed out while waiting for a response from teh service TypeError: The query value was invalid
- service (str): The service that the request should be sent to. Must be defined in
the system’s
-
-
app_api.
logging_setup
(app_name, level=10)¶ Set up the logger for the program All log messages will be sent to rsyslog using the User facility. Additionally, they will also be echoed to
stdout
Args:
- app_name (
str
): The application name which should be used for all log messages - level (
logging.level
): The minimum logging level which should be recorded. Default: logging.DEBUG
- Returns:
- An initialized Logger object
- app_name (