telemetry: error message handling part2
[csit.git] / resources / tools / telemetry / constants.py
1 # Copyright (c) 2022 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 """Constants used in telemetry.
15
16 "Constant" means a value that keeps its value since initialization. The value
17 does not need to be hard coded here, but can be read from environment variables.
18 """
19
20 class Constants:
21     """Constants used in telemetry.
22     1-10: Telemetry errors
23     11-50: VPP bundle error
24     51-100: Linux bundle errors"""
25
26     # Failed when processing data
27     err_telemetry_process = 1
28
29     # Failed to read YAML file
30     err_telemetry_yaml = 2
31
32     # Error executing bundle
33     err_telemetry_bundle = 3
34
35     # Could not connect to VPP
36     err_vpp_connect = 11
37
38     # Could not disconnect from VPP
39     err_vpp_disconnect = 12
40
41     # Failed when executing command
42     err_vpp_execute = 13
43
44     # Could not attach BPF events
45     err_linux_attach = 51
46
47     # Could not detach BPF events
48     err_linux_detach = 52
49