Douglas Henrique Koerich b6457447e6 Allow subscription to all nodes with '*'
The O-RAN standard was not being followed when resource address was
being specified with '*' as the "nodeName", which means that
subscription should be created to be notified about all nodes.

Test Plan:
PASS: Submitting POST request with '*' wildcard in resource address;
PASS: Rejecting POST for specific node when there is a subscription for
      '*' in repo;
PASS: Rejecting POST for current node ('.') when there is a subscription
      for '*' in repo.

Closes-Bug: #1996929
Signed-off-by: Douglas Henrique Koerich <douglashenrique.koerich@windriver.com>
Change-Id: Ifdaa2d2b9c9a45ad41981d2a75f7101bfa2f7c9c
2022-11-21 15:19:38 -03:00

50 lines
1.6 KiB
Python

#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
SPEC_VERSION = "1.0"
DATA_TYPE_NOTIFICATION = "notification"
DATA_TYPE_METRIC = "metric"
VALUE_TYPE_ENUMERATION = "enumeration"
VALUE_TYPE_METRIC = "metric"
PTP_V1_KEY = "ptp_notification_v1"
SOURCE_SYNC_ALL = '/sync'
SOURCE_SYNC_GNSS_SYNC_STATUS = '/sync/gnss-status/gnss-sync-status'
SOURCE_SYNC_PTP_CLOCK_CLASS = '/sync/ptp-status/clock-class'
SOURCE_SYNC_PTP_LOCK_STATE = '/sync/ptp-status/lock-state'
SOURCE_SYNC_OS_CLOCK = '/sync/sync-status/os-clock-sync-state'
SOURCE_SYNC_SYNC_STATE = '/sync/sync-status/sync-state'
SOURCE_SYNCE_CLOCK_QUALITY = '/sync/synce-status/clock-quality'
SOURCE_SYNCE_LOCK_STATE_EXTENDED = '/sync/synce-status/lock-state-extended'
SOURCE_SYNCE_LOCK_STATE = '/sync/synce-status/lock-state'
RESOURCE_ADDRESS_MAPPINGS = {
SOURCE_SYNC_ALL: 'sync',
SOURCE_SYNC_GNSS_SYNC_STATUS: 'gnss_sync_state',
SOURCE_SYNC_PTP_CLOCK_CLASS: 'ptp_clock_class',
SOURCE_SYNC_PTP_LOCK_STATE: 'ptp_lock_state',
SOURCE_SYNC_OS_CLOCK: 'os_clock_sync_state',
SOURCE_SYNC_SYNC_STATE: 'sync_state',
SOURCE_SYNCE_CLOCK_QUALITY: 'synce_clock_quality',
SOURCE_SYNCE_LOCK_STATE_EXTENDED: 'synce_lock_state_extended',
SOURCE_SYNCE_LOCK_STATE: 'synce_lock_state'
}
VALID_SOURCE_URI = {
SOURCE_SYNC_ALL,
SOURCE_SYNC_GNSS_SYNC_STATUS,
SOURCE_SYNC_PTP_CLOCK_CLASS,
SOURCE_SYNC_PTP_LOCK_STATE,
SOURCE_SYNC_OS_CLOCK,
SOURCE_SYNC_SYNC_STATE,
SOURCE_SYNCE_CLOCK_QUALITY,
SOURCE_SYNCE_LOCK_STATE_EXTENDED,
SOURCE_SYNCE_LOCK_STATE
}
WILDCARD_CURRENT_NODE = '.'
WILDCARD_ALL_NODES = '*'