Loading src/telemetry/backend/service/collectors/gnmi_oc/GnmiOpenConfigCollector.py +19 −10 Original line number Diff line number Diff line import pytz from datetime import datetime, timedelta import logging from typing import Dict, Optional, Tuple, List, Callable, Union, Any, Iterator from urllib import response # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging, pytz, queue from datetime import datetime from typing import Dict, Optional, Tuple, List, Union, Any, Iterator from pygnmi.client import gNMIclient from telemetry.backend.service.collector_api._Collector import _Collector from .PathMapper import PathMapper from .SubscriptionNew import Subscription from .KPI import KPI import queue from pygnmi.client import gNMIclient logging.basicConfig( level=logging.DEBUG, Loading src/telemetry/backend/service/collectors/gnmi_oc/KPI.py +15 −1 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from enum import IntEnum, unique @unique Loading @@ -11,4 +26,3 @@ class KPI(IntEnum): # TODO: verify KPI names and codes with KPI proto fi BYTES_DROPPED = 203 INBAND_POWER = 301 # TODO: Add more KPIs as needed, src/telemetry/backend/service/collectors/gnmi_oc/PathMapper.py +15 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging from typing import Dict, List, Optional, Union from .KPI import KPI Loading src/telemetry/backend/service/collectors/gnmi_oc/SubscriptionNew.py +14 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from google.protobuf.json_format import MessageToDict from pygnmi.client import gNMIclient # type: ignore Loading Loading
src/telemetry/backend/service/collectors/gnmi_oc/GnmiOpenConfigCollector.py +19 −10 Original line number Diff line number Diff line import pytz from datetime import datetime, timedelta import logging from typing import Dict, Optional, Tuple, List, Callable, Union, Any, Iterator from urllib import response # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging, pytz, queue from datetime import datetime from typing import Dict, Optional, Tuple, List, Union, Any, Iterator from pygnmi.client import gNMIclient from telemetry.backend.service.collector_api._Collector import _Collector from .PathMapper import PathMapper from .SubscriptionNew import Subscription from .KPI import KPI import queue from pygnmi.client import gNMIclient logging.basicConfig( level=logging.DEBUG, Loading
src/telemetry/backend/service/collectors/gnmi_oc/KPI.py +15 −1 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from enum import IntEnum, unique @unique Loading @@ -11,4 +26,3 @@ class KPI(IntEnum): # TODO: verify KPI names and codes with KPI proto fi BYTES_DROPPED = 203 INBAND_POWER = 301 # TODO: Add more KPIs as needed,
src/telemetry/backend/service/collectors/gnmi_oc/PathMapper.py +15 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging from typing import Dict, List, Optional, Union from .KPI import KPI Loading
src/telemetry/backend/service/collectors/gnmi_oc/SubscriptionNew.py +14 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from google.protobuf.json_format import MessageToDict from pygnmi.client import gNMIclient # type: ignore Loading