rsd-lib/rsd_lib/resources/v2_2/telemetry/trigger_schemas.py
Lin Yang ec67bbbd59 Add Telemetry Trigger in RSD 2.2
Change-Id: I5c8713e4c8f6cb26430c45551d77b16d51710ec4
2019-02-08 10:34:19 -08:00

93 lines
2.3 KiB
Python

# Copyright (c) 2019 Intel, Corp.
#
# 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.
metric_type_schema = {
'type': 'string',
'enum': ['Numeric', 'Discrete']
}
trigger_actions_schema = {
'type': 'array',
'items': {
'type': 'string',
'enum': ['Transmit', 'Log']
}
}
numeric_triggers_schema = {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'Name': {'type': 'string'},
'Value': {'type': 'number'},
'DirectionOfCrossing': {
'type': 'string',
'enum': ['Increasing', 'Decreasing']
},
'DwellTimMsec': {'type': 'number'},
'Severity': {'type': 'string'}
},
'additionalProperties': False
}
}
discrete_trigger_condition_schema = {
'type': 'string',
'enum': ['Specified', 'Changed']
}
discrete_triggers_schema = {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'Name': {'type': 'string'},
'Value': {'type': 'string'},
'DwellTimMsec': {'type': 'number'},
'Severity': {'type': 'string'}
},
'additionalProperties': False
}
}
status_schema = {
'type': 'object',
'properties': {
'State': {'type': 'string'},
'Health': {'type': 'string'},
'HealthRollup': {'type': 'string'}
},
'additionalProperties': False
}
wildcards_schema = {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'Name': {'type': 'string'},
'Keys': {'type': 'string'}
},
'additionalProperties': False
}
}
metric_properties_schema = {
'type': 'array',
'items': {
'type': 'string'
}
}