E-Log Service¶
elog_client.py
Elog API client for posting entries and fetching user and logbook information.
test_proxy_connection()
¶
Tests proxy connectivity if a proxy is configured.
:return: A tuple of (success, error_message). If successful, error_message is None. If failed, error_message contains a detailed description of the failure.
Source code in trace/services/elog_client.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
get_user()
¶
Fetches the user information from the ELOG API. Also used to verify the API key. :return: A tuple containing the status code and the user data or exception.
Source code in trace/services/elog_client.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
post_entry(title, body, logbooks, image_bytes, config_file_path=None)
¶
Posts a new entry with image to the ELOG API.
:param title: The title of the entry. :param body: The body of the entry. :param logbooks: A list of logbook names to post the entry to. :param image_bytes: Bytes of the image to be attached to the entry. :param config_file: Optional, path of config file to attach. :return: A tuple containing the status code and the response data or exception.
Source code in trace/services/elog_client.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
get_logbooks()
¶
Fetches the list of logbooks from the ELOG API.
:return: A tuple containing the status code and a list of logbook names or an exception.
Source code in trace/services/elog_client.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |