{"type":"model","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/42552ab7-d679-37b0-afe0-7313ad2e8c01","info":{"title":"Service Health Heuristic Packages APIs","description":"APIs for requesting rule and metric data stored by the Crosswork Service Health application.","termsOfService":"terms-of-service","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"},"version":"7.1.0"},"security":[{"bearerAuth":[]}],"x-parser-conf":{"overview":{"markdownPath":"reference/ServiceHealth/sh_heuristic_packages_overview.md"}},"openapi":"3.0.1","servers":[{"url":"/crosswork/aa/hpmgr"}],"securitySchemes":{"bearerAuth":{"type":"apiKey","description":"Security token for authorizing requests for these APIs.","name":"Authorization","in":"header"}}},"spec":{"type":"object","properties":{"namespace":{"type":"string","description":"Namespace of the Heuristic Package Element."},"rules":{"type":"array","description":"Rules of the Heuristic Package Element.","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the rule. The name must be unique."},"namespace":{"description":"Namespace to which this rule belongs","type":"string"},"id":{"description":"Rule-id: UUID","type":"string"},"description":{"description":"Description of the rule class.","type":"string"},"match_criteria":{"type":"array","description":"Match criteria of the ruleClass","items":{"type":"object","properties":{"configSource":{"type":"string","description":"Match Criterion config source type","default":"SOURCE_TYPE_UNSPECIFIED","enum":["SOURCE_TYPE_UNSPECIFIED","SOURCE_TYPE_NSO","SOURCE_TYPE_CNC","SOURCE_TYPE_DYNAMIC_PAYLOAD"],"$$ref":"#/components/schemas/MatchCriterionConfigSourceType"},"configSubSource":{"description":"ConfigSubSource - defines the list of config subSources.\nConfigSubSource for the dynamic rule is not allowed to be explicitly mentioned as it gets inherited from\nthe parent service Rule.","type":"array","items":{"type":"string","description":"Match Criterion config subsource","default":"SUBSOURCE_SERVICE_CONFIG","enum":["SUBSOURCE_SERVICE_CONFIG","SUBSOURCE_DEVICE_CONFIG","SUBSOURCE_SERVICE_PLAN"],"$$ref":"#/components/schemas/MatchCriterionConfigSubSource"}},"matchType":{"type":"string","description":"Match Criterion match type","default":"MATCH_TYPE_UNSPECIFIED","enum":["MATCH_TYPE_UNSPECIFIED","MATCH_TYPE_XPATH","MATCH_TYPE_PARAM"],"$$ref":"#/components/schemas/MatchCriterionMatchType"},"match_expression":{"type":"string","description":"Match Expression"},"match_prefix":{"description":"Use match_prefix to identify the root for generating the xmlBlob for the ruleParams in Dynamic SubserviceClass","type":"string"},"match_params":{"type":"array","description":"This is an optional field, verified against the dynamic SubserviceClass ruleparams.","items":{"type":"string","description":"Items of match_params"}},"service_element_config":{"type":"array","description":"Service element config","items":{"type":"object","description":"Match Criterion Service Element configuration","properties":{"service_element_id":{"description":"ID for the Service Element rule","type":"string"},"service_element_rule":{"description":"Service Element rule","type":"string"},"namespace":{"description":"Namespace to which this Service Element rule belongs","type":"string"}},"$$ref":"#/components/schemas/MatchCriterionServiceElementConfiguration"}}},"description":"The ruleClass services to match.","$$ref":"#/components/schemas/RuleClassMatchCriterion"}},"dependencies":{"type":"array","description":"Dependencies of the ruleClass","items":{"type":"object","description":"Rule Class Dependency","properties":{"name":{"type":"string","description":"Name of RuleClassDependency"},"id":{"type":"string","description":"ID of RuleClassDependency"},"ss_class":{"type":"string","description":"Subservice Class of RuleClassDependency"},"namespace":{"type":"string","description":"Namespace of RuleClassDependency"},"type":{"type":"string","description":"Rule Class Dependency Type","default":"DEP_TYPE_NON_LIST","enum":["DEP_TYPE_NON_LIST","DEP_TYPE_LIST"],"$$ref":"#/components/schemas/RuleClassDependencyType"},"optional":{"description":"By default, all dependencies are treated as mandatory, so errors are thrown when a given dependency's parameters cannot be resolved. On the other hand, certain dependencies are conditional upon certain service config or oper data. In these cases, the dependencies should be set as optional, so they can be ignored silently when their respective parameters do not resolve.","type":"boolean"},"param_extraction_mechanism":{"type":"object","description":"Dependency Param Extraction Mechanism","properties":{"mode":{"type":"string","description":"Parameter Extraction mechanism mode","default":"EXTRACT_MODE_UNSPECIFIED","enum":["EXTRACT_MODE_UNSPECIFIED","EXTRACT_MODE_VALUE","EXTRACT_MODE_XPATH","EXTRACT_MODE_CUSTOM_PLUGIN","EXTRACT_MODE_CUSTOM_TEMPLATE"],"$$ref":"#/components/schemas/ParamExtractionMechanismMode"},"name":{"type":"string","description":"Name"},"namespace":{"type":"string","description":"Namespace"},"version":{"type":"string","description":"Version"},"validation_hash":{"type":"string","description":"Validation hash","format":"uint64"},"plugin_method":{"type":"string","description":"Plugin method"},"extracted_params":{"type":"array","description":"Extracted parameters","items":{"type":"string","description":"Items of Extracted parameters"}},"native_method":{"type":"string","description":"Native method"}},"$$ref":"#/components/schemas/DependencyParamExtractionMechanism"},"parameters":{"type":"array","description":"Parameters of RuleClassDependency","items":{"type":"object","description":"Dependency parameter","properties":{"name":{"type":"string","description":"Name of the Dependency parameter"},"iterator":{"type":"boolean","description":"This field is applicable only when the current dependency is of type 'list'. When set to True, one dependency shall be generated for each element in the extract_value."},"default_value":{"type":"string","description":"Set the default value for a given parameter, when it is possible that none of 'extraction_details' will be successful in extracting the value for this parameter. For example: In the case of Y.1731, a node may be configured only to measure Jitter but not Loss. In these cases, we still would like to spawn the Subservice related to Y.1731 but skip the Loss-related computations. Setting some default value allows the respective Subservice to tweak its eval expression accordingly. If the value could not be extracted and the default_value is not set, then Rule Dependency will be dropped if the dependency is optional. If Dependency is not optional, the failure will be generated and the Service will be marked as 'monitoring failed'."},"extraction_method":{"type":"string","description":"Dependency Parameter Type","default":"DEP_PARAM_UNSPECIFIED","enum":["DEP_PARAM_UNSPECIFIED","DEP_PARAM_VALUE","DEP_PARAM_XPATH","DEP_PARAM_PLUGIN_OUTPUT","DEP_PARAM_NATIVE_OUTPUT"],"$$ref":"#/components/schemas/DependencyParameterType"},"extraction_details":{"type":"array","description":"Extraction details","items":{"type":"object","description":"Parameter Extraction Detail","properties":{"description":{"type":"string","description":"Description"},"extract_value":{"type":"string","description":"Extract value"}},"$$ref":"#/components/schemas/ParameterExtractionDetail"}}},"$$ref":"#/components/schemas/DependencyParameter"}},"sub_dependencies":{"type":"array","description":"Subservice dependencies","items":{"type":"string"}},"soft_sub_dependencies":{"description":"The health of these dependencies does not affect the health of its parent subservice","type":"array","items":{"type":"string"}}},"$$ref":"#/components/schemas/RuleClassDependency"}},"soft_root_dependencies":{"description":"The fashion (graph of dependencies). The relationship between the dependencies can be hard or soft.","type":"array","items":{"type":"string","description":"Items of the soft_root_dependencies"}},"create_timestamp":{"type":"string","description":"Create timestamp of the ruleClass","format":"int64"},"update_timestamp":{"type":"string","description":"Update timestamp of the ruleClass","format":"int64"},"monitoring_type":{"type":"string","description":"Monitoring Type","default":"BASIC","enum":["BASIC","ADVANCED"],"$$ref":"#/components/schemas/MonitoringType"},"version":{"description":"Current version of the ruleClass","type":"string"}},"description":"Rule Class definition.","$$ref":"#/components/schemas/RuleClass"}},"profiles":{"type":"array","description":"Profiles of the Heuristic Package Element.","items":{"type":"object","description":"ConfigP rofile","properties":{"id":{"type":"string","description":"ID of ConfigProfile"},"name":{"type":"string","description":"Name of ConfigProfile"},"namespace":{"type":"string","description":"Namespace of ConfigProfile"},"description":{"type":"string","description":"Description of ConfigProfile"},"rules":{"type":"array","description":"Rules of ConfigProfile","items":{"type":"object","description":"RuleConfig Profile Candidate Rule","properties":{"name":{"type":"string","description":"Name of RuleConfigProfileCandidateRule"},"namespace":{"type":"string","description":"Namespace of RuleConfigProfileCandidateRule"}},"$$ref":"#/components/schemas/RuleConfigProfileCandidateRule"}},"values":{"description":"Subservices can potentially inherit multiple profiles when they are shared across different services. 'Precedence' determines which profile should be adopted by the Subservice. The key is the name of the config parameter (for example: the name of the Threshold constant). The key should be given in ALL CAPS.","type":"object","additionalProperties":{"type":"object","description":"RuleConfig Profile Config Param","properties":{"description":{"description":"The ruleConfig Description to be displayed in the Crosswork UI","type":"string"},"ui_tag":{"description":"UI tag will determine whether the constant needs to be displayed in the UI","type":"boolean"},"type":{"type":"string","description":"Config Param Type","default":"VAL_UNKNOWN","enum":["VAL_UNKNOWN","VAL_INT","VAL_FLOAT","VAL_STRING"],"$$ref":"#/components/schemas/ConfigParamType"},"int_val":{"type":"object","description":"Config Param Int value","properties":{"unit":{"type":"string","description":"Unit type","default":"NA","enum":["NA","MBPS","MSEC","USEC","SEC","PERCENT","GB","BYTES"],"$$ref":"#/components/schemas/UnitType"},"val":{"type":"string","description":"The type could be int and the unit could be millisecond.","format":"int64"}},"$$ref":"#/components/schemas/ConfigParamIntVal"},"float_val":{"type":"object","description":"Config Param Float value","properties":{"unit":{"type":"string","description":"Unit type","default":"NA","enum":["NA","MBPS","MSEC","USEC","SEC","PERCENT","GB","BYTES"],"$$ref":"#/components/schemas/UnitType"},"val":{"type":"number","description":"Float value","format":"float"}},"$$ref":"#/components/schemas/ConfigParamFloatVal"},"str_val":{"type":"string","description":"String value"}},"$$ref":"#/components/schemas/RuleConfigProfileConfigParam"}},"create_timestamp":{"description":"Create timestamp for ConfigProfile","type":"string","format":"int64"},"update_timestamp":{"description":"Update timestamp for ConfigProfile","type":"string","format":"int64"},"version":{"description":"Current version of the configProfile","type":"string"}},"$$ref":"#/components/schemas/RuleConfigProfile"}},"subservices":{"type":"array","description":"Subservices of the Heuristic Package Element.","items":{"type":"object","description":"Subservice class","properties":{"id":{"description":"The subservice class to be monitored (such as LinkHealth, IP-Reachability, etc.)","type":"string"},"name":{"type":"string","description":"The name of the subservice class"},"namespace":{"description":"The namespace to which the subservice class belongs","type":"string"},"description":{"description":"Description of the SubserviceClass.","type":"string"},"params":{"type":"array","description":"Contains the list of parameter keys that this subservice class uses. These need to be passed as arguments when instantiating the respective subservices.","items":{"type":"object","description":"The Heuristic Package Element parameter.","properties":{"name":{"type":"string","description":"Name of this parameter. Examples: DEVICE, IFNAME, IFENTRY, VPN."},"description":{"type":"string","description":"The description of the Heuristic Package Element parameter."},"type":{"type":"string","description":"ParamType allows Heuristic Package Manager to interpret the nature of the argument values passed while instantiating Heuristic Package Elements like Rule, Subservice etc.","default":"PARAM_TYPE_NON_LIST","enum":["PARAM_TYPE_NON_LIST","PARAM_TYPE_LIST"],"$$ref":"#/components/schemas/HPElemParamType"}},"$$ref":"#/components/schemas/HPElemParam"}},"live_metrics":{"type":"object","description":"Live metrics","additionalProperties":{"type":"object","description":"Use this object when a Subservice needs to report live (not necessarily real-time) metrics in addition to its overall health status. For example: A Subservice monitoring the health of SR Policies needs to report latency, jitter and packet loss. It also needs to report its consolidated health status, computed by comparing these metrics against threshold values. SubserviceClassLiveMetric allows a set of metrics to be identified as live metrics. The feed for these metrics will be reported periodically by Expression Tracker. These metrics will be persisted by Subservice instances to aid subsequent queries. If these metrics need to be aggregated at the service level, then you can do this by setting the service_level_aggregation_method. Aggregation is supported for metrics of the same type. In other words, if Latency is specified as a SubserviceClassLiveMetric and aggregation_method is set to, say, Average, then the average of Latency metrics is taken across all instances of this Subservice Class that belong to a given service instance.\n!! Caution: Please use Live Metrics sparingly as they can put significant stress on the system's CPU and memory resources. !!","properties":{"metric_label":{"description":"Metric label","type":"string"},"description":{"description":"Description","type":"string"},"threshold":{"type":"string","description":"Threshold"},"aggr_logic":{"type":"string","description":"Used to provide a benchmark reference to the user looking at the metric value. For example: threshold = 'LATENCY_MAX_THRESHOLD'. Similar to the constants specified in the eval_expression strings, this constant too should be resolvable by the respective nConfig Profile associated with the service. This field is optional and can be left empty.","default":"NONE","enum":["NONE","AVERAGE","MEDIAN","MODE"],"$$ref":"#/components/schemas/LiveMetricServiceLevelAggrLogic"}},"$$ref":"#/components/schemas/SubserviceClassLiveMetric"}},"root_expressions":{"type":"array","description":"Root expressions","items":{"type":"object","properties":{"eval_expression":{"type":"string","description":"Eval Expression"},"activate_condition":{"type":"string","description":"Activate Condition"}},"description":"Each SubserviceClass can contain a list of root expressions. The 'activate_condition' defined for each element will determine whether the computation, represented by 'eval_expression', will be made part of the overall compute expression tree of that Subservice instance. The 'activate_condition' should either be left empty or, if non-empty, should evaluate to 'true' to be part of the compute expression tree. When an element is part of the compute expression tree, then all corresponding metrics will be scheduled for collection. This conditional logic is handy when a network feature has multiple parts to be monitored and each of these parts can be selectively enabled or disabled by the Operator using service configuration. For example: Y.1731 monitoring for Latency, Jittter and Loss. Each of these can be selectively enabled or disabled via Y.1731 configuration. If only Latency probes are configured, then Y.1731-Subservice should only be scheduling jobs for latency and none for jitter or loss.","$$ref":"#/components/schemas/SubserviceClassRootExpression"}},"dynamic_config":{"type":"object","properties":{"rule_id":{"type":"string","description":"Dynamic dependency for a subservice. The subservice uses the rule ID to compute the dynamic subservices."},"rule_params":{"type":"object","additionalProperties":{"type":"string","description":"Additional properties"},"description":"The map of parameters needed to build the dynamic subservice. The key corresponds to ruleClass parameters and the value corresponds to SSClass parameters."},"rule_trigger_conditions":{"type":"object","description":"Dynamic Config Rule Trigger Conditions.","properties":{"description":{"type":"string","description":"Description"},"activate":{"type":"string","description":"Determines when to trigger the Rule and spawn child subservices."},"deactivate":{"type":"string","description":"Determines when to delete all the child subservices."},"update":{"type":"string","description":"Determines whether the current sub-graph needs to be evaluated with the new feed received."}},"$$ref":"#/components/schemas/DynamicConfigRuleTriggerConditions"}},"description":"Sample payload for dynamic_dependencies: \n\"dynamicConfig\": {\n\"ruleID\": \"rule.dynamic.l2vpn.sr.policy.subgraph system\",\n\"ruleParams\": [\n{\n\"serviceId\": \"vpn-id\"\n},\n{\n\"srpolicies\": \"srpolicy_list\"\n}\n],\n\"ruleTriggerConditions\": {\n\"description\": \"Activate when at least one dynamic SR Policy gets instantiated. Deactivate (sample for now) when a certain condition is met (3 policies). Update as long as the number of discovered policies is less than 20.\",\n\"activate\": \"Len(srpolicy_list) \u003e 0\",\n\"deactivate\": \"Len(srpolicy_list) \u003e 2\",\n\"update\": \"Delta(srpolicy_list) and Len(srpolicy_list) \u003c= 20\"\n}\n},","$$ref":"#/components/schemas/DynamicConfig"},"symptom":{"type":"object","properties":{"format_string":{"type":"string","description":"Format-string"},"level":{"type":"string","description":"Symptom level","default":"BROKEN","enum":["BROKEN","DEGRADED","WARNING","CRITICAL","INFO"],"$$ref":"#/components/schemas/SymptomLevel"},"priority":{"description":"The lower the value, higher the priority. The lowest valid value is 1, so the highest priority is represented by '1'. When this value is not explicitly defined in the SubserviceClass, the value defaults to '255' in the backend. This is the behavior even in cases where the priority in the SubserviceClass is explicitly defined as '0'.","type":"integer","format":"int64"},"preempt_priority":{"type":"integer","description":"Preempt priority is used to determine whether a symptom should preempt another symptom that belongs\nto the same preemption group. Example: When Interface Operational state is down due to Admin state\nbeing down, then User would need to see only Admin down symptom and not Operational down symptom.\nTo make this happen, we group Admin down and Operational down symptoms under one preemption group --\nany arbitrary string that identifies the group nature of these 2 symptoms. Then we assign higher\npremption priority, say 1, to Admin associated symptom and lower premption priority, say 2,\nto Oper associated symptom.\nBy default, no preemption is enabled i.e., all symptoms defined within a Subservice Class will\nbelong to the same group and have same default preempt_priority value 0.","format":"int64"},"preempt_group":{"type":"string","description":"preempt_group"},"raise_when":{"type":"boolean","description":"Determines whether to raise a symptom when its associated expression evaluates to true or false.\nDefault(false), raises symptom when the respective eval_expression evaluates to false.\nIf set to true, then symptom is raised when the respective eval_expression evaluates to true."}},"description":"The symptom text and the failed subexpressions.","$$ref":"#/components/schemas/SubserviceClassSymptom"},"dependencies":{"type":"array","description":"Dependencies","items":{"type":"object","description":"Subservice Class Dependency","properties":{"type":{"type":"string","description":"Dependency Type:\n - DEP_TYPE_EXPRESSION: DEP_TYPE_SUBSERVICE = 1. Not supported for MVP-1","default":"DEP_TYPE_UNSPECIFIED","enum":["DEP_TYPE_UNSPECIFIED","DEP_TYPE_EXPRESSION","DEP_TYPE_METRIC"],"$$ref":"#/components/schemas/SubserviceClassDependencyType"},"label":{"type":"string","description":"Label used to refer to this Dependency elsewhere, within this SubserviceType definition. The label acts as the key."},"eval_expression":{"description":"The compute-expression to be evaluated by this dependency. Note that this property is currently overloaded in order to provide ClassNames for Subservice or Metric types of dependencies. It may be better to have separate fields for this purpose. ","type":"string"},"namespace":{"type":"string","description":"In case of Metric and Rule Dependency types, specify the namespace. If not specified, it defaults to the current Subservice Class namespace."},"symptom":{"type":"object","properties":{"format_string":{"type":"string","description":"Format-string"},"level":{"type":"string","description":"Symptom level","default":"BROKEN","enum":["BROKEN","DEGRADED","WARNING","CRITICAL","INFO"],"$$ref":"#/components/schemas/SymptomLevel"},"priority":{"description":"The lower the value, higher the priority. The lowest valid value is 1, so the highest priority is represented by '1'. When this value is not explicitly defined in the SubserviceClass, the value defaults to '255' in the backend. This is the behavior even in cases where the priority in the SubserviceClass is explicitly defined as '0'.","type":"integer","format":"int64"},"preempt_priority":{"type":"integer","description":"Preempt priority is used to determine whether a symptom should preempt another symptom that belongs\nto the same preemption group. Example: When Interface Operational state is down due to Admin state\nbeing down, then User would need to see only Admin down symptom and not Operational down symptom.\nTo make this happen, we group Admin down and Operational down symptoms under one preemption group --\nany arbitrary string that identifies the group nature of these 2 symptoms. Then we assign higher\npremption priority, say 1, to Admin associated symptom and lower premption priority, say 2,\nto Oper associated symptom.\nBy default, no preemption is enabled i.e., all symptoms defined within a Subservice Class will\nbelong to the same group and have same default preempt_priority value 0.","format":"int64"},"preempt_group":{"type":"string","description":"preempt_group"},"raise_when":{"type":"boolean","description":"Determines whether to raise a symptom when its associated expression evaluates to true or false.\nDefault(false), raises symptom when the respective eval_expression evaluates to false.\nIf set to true, then symptom is raised when the respective eval_expression evaluates to true."}},"description":"The symptom text and the failed subexpressions.","$$ref":"#/components/schemas/SubserviceClassSymptom"},"param_map":{"description":"Map of dependency Subservice/Metric parameters to current Subservice Class parameters","type":"object","additionalProperties":{"type":"string"}},"id":{"description":"Unique ID allocated by Service Health","type":"string"}},"$$ref":"#/components/schemas/SubserviceClassDependency"}},"expr_cid":{"description":"ID allocated by HP for subservice expression","type":"string"},"create_timestamp":{"description":"The time when this SubserviceClass definition was created or last updated","type":"string","format":"int64"},"update_timestamp":{"type":"string","description":"Update Timestamp","format":"int64"},"tags":{"description":"The tags associate to the list of badges displayed in the UI. For example: To display the 'degraded' badge against the device icon when either the device or its service-related VPN-interface degrades, you can assign tags to those classes. The UI will leverage these tags to determine which of the subservices must be displayed with badges against the device.","type":"array","items":{"type":"string"}},"version":{"description":"The current version of the subServiceClass","type":"string"}},"$$ref":"#/components/schemas/SubserviceClass"}},"metrics":{"type":"array","description":"Metrics of the Heuristic Package Element.","items":{"type":"object","description":"MetricClass","properties":{"id":{"description":"ID of the MetricClass","type":"string"},"name":{"description":"Name of the MetricClass","type":"string"},"namespace":{"description":"Namespace to which MetricClass belongs","type":"string"},"description":{"type":"string","description":"Description of the MetricClass"},"display_label":{"description":"This display label shall be used as the 24hr Metric Chart label","type":"string"},"parameters":{"description":"Parameter defines the param and the corresponding description.","type":"object","additionalProperties":{"type":"object","description":"Metric class param","properties":{"description":{"type":"string","description":"Description of Metric class param"}},"$$ref":"#/components/schemas/MetricClassParam"}},"m_type":{"type":"object","properties":{"string_t":{"type":"object","properties":{"if_empty":{"type":"string","description":"if_empty: optional. The value to be associated to the metric if it returns an empty value. It is useful when no value is interesting information by itself, but it doesn't make sense for all metrics. If not empty then the value of this field shall be assigned as the default value for this metric."},"output_values":{"type":"array","description":"If the device feed is of the enum type, then they are converted to corresponding string values.\nThe expression enum { init, start, end } ==\u003e translates to string literals: 'init', 'start', 'end'. This field can be left empty, which makes it optional. If it is empty, the Service Health application will take all the values from the mapping field at face value and perform no validations. If this field is not empty, Service Health will check and validate whether all the values specified in the mapping are a subset of this list.","items":{"type":"string"}}},"description":"output_values: What values does this metric return? In case of list type: The possible values for each list element.","$$ref":"#/components/schemas/MetricClassStringType"},"bool_t":{"type":"object","description":"Metric calls Bool type","properties":{"if_empty":{"type":"string","description":"if_empty: optional. The value to be associated to the metric if it returns an empty value. It is useful when no value is interesting information by itself, but it doesn't make sense for all metrics. If the value is not empty, then the boolean equivalent value of this field shall be assigned as the default value for this metric. This field is intentionally not defined as of bool type, in order to distinguish it from the cases where the absence of a value is expected to be reported as a monitoring failure. Valid values to assign to this field are 'true' or 'false' only. Any other value will be treated as invalid."}},"$$ref":"#/components/schemas/MetricClassBoolType"},"int_t":{"type":"object","description":"Metric calls Int type","properties":{"if_empty":{"type":"string","description":"if_empty: optional. The value to be associated to the metric if it returns an empty value. It is useful when no value is interesting information by itself but it doesn't make sense for all metrics. If the value is not empty then the value of this field shall be assigned as the default value for this metric."},"output_values":{"type":"array","description":"Use this only when there are small number of discrete integer values. If the full range is needed or the set is too large to specify in the metric definition, then leave it as zero.","items":{"type":"string","format":"int64"}}},"$$ref":"#/components/schemas/MetricClassIntType"},"float_t":{"description":"Float types are used by counters. Hence they don't require constructs like 'if_empty' and 'output_values'.","type":"number","format":"float"}},"description":"The given metric can be of list (or non-list) of type bool, string, integer or float.","$$ref":"#/components/schemas/MetricClassMType"},"m_list":{"type":"boolean","description":"MList for MetricClass."},"cadence":{"description":"Polling frequency (in seconds) for this metric. The default cadence is 30sec. Any value less than or equal to 30 shall be defaulted to 30sec.","type":"integer","format":"int64"},"implementations":{"description":"The metric mplementation can be CLI, SNMP or MDT, along with their precedence.","type":"object","additionalProperties":{"type":"object","description":"Metric Class instance","properties":{"MDTMetric":{"type":"object","properties":{"sensor_path_exact":{"description":"Exact YANG path of the subtree to get the current metric.\n Examples:\n * `openconfig-interfaces:interfaces/interface[name=GigabitEthernet0/0/0/2]/\n subinterfaces/subinterface[index=600]/state/admin-status`\n (subtree of one node) the administrative status of subinterface 600 of interface GigabitEthernet0/0/0/2\n * `openconfig-interfaces:interfaces/interface[name=tunnel-ip13]/state/counters`\n (subtree of height one) all counters of interface tunne-ip13\n * `openconfig-interfaces:interfaces/interface[name=tunnel-ip13]/state/counters/in-errors`\n (subtree of one node) the number of input errors on ineterface tunnel-ip13","type":"string"},"sensor_path_config":{"description":"Longest prefix for which the target router will actually return some value when configured.\n Example: configuring the sensor path on a IOS-XRV router\n `openconfig-interfaces:interfaces/interface[name=tunnel-ip13]/state/counters/in-errors`\n will not work (not resolved). However, configuring the sensor path\n `openconfig-interfaces:interfaces/interface[name=tunnel-ip13]/state/counters`\n will return a bag contaning the wanted value. The pipeline would then retrieve the specific leaf under this subtree (in this case, the value of `in-errors`) and assign it to the metric.\nIn Crosswork, there is a limitation on the number of collection jobs that can be supported. Currently, the limit is about 1000 jobs. Because of this, Service Health needs to subscribe at the gather path level and perform filtering on the resultant metric bag to get to the desired leaf that corresponds to the given metric.\nHence, for all deployment purposes, this field should be set to a valid gather path. In the current example, that would be `openconfig-interfaces:interfaces/interface`.","type":"string"}},"description":"Metric collected using telemetry plugin.","$$ref":"#/components/schemas/MetricImplMdtMetric"},"SNMPMetric":{"type":"object","description":"Metric Impl SNMP metric","properties":{"oid_path_config":{"type":"string","description":"OID path config"},"oid_path_exact":{"type":"string","description":"OID path exact"}},"$$ref":"#/components/schemas/MetricImplSnmpMetric"},"GNMIMetric":{"type":"object","description":"Metric Impl gNMI metric","properties":{"sensor_path_exact":{"description":"MDT corresponding comments apply to below gNMI fields","type":"string"},"sensor_path_config":{"type":"string","description":"Sensor path config"},"origin":{"description":"Specifies the metric origin if it is different from the YANG module. For IOS-XE, the origin needs to be specified as \"rfc7951\".\nFor XR, this field can be left empty.\nWhen this field is left empty, Service Health will attempt to extract the YANG module name from the sensor path and use the module name as the value for the origin.","type":"string"}},"$$ref":"#/components/schemas/MetricImplGnmiMetric"},"GNMITemplateMetric":{"type":"object","properties":{"sensor_path_exact":{"type":"string","description":"Sensor path exact"},"sensor_path_config":{"type":"string","description":"Sensor path config"},"sensor_path_device_feed":{"type":"string","description":"Sensor path device feed"},"origin":{"description":"Specifies the metric origin if it is different from the YANG module. For IOS-XE, the origin needs to be specified as \"rfc7951\".\nFor XR, this field can be left empty.\nWhen this field is left empty, Service Health will attempt to extract the YANG module name from the sensor path and use the module name as the value for the origin.","type":"string"}},"description":"\"GNMITemplateMetric\": {\n \"sensor_path_exact\": \"Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/vrfs/vrf[vrf-name={vrf}]/sessions/session[neighbor-address={neighbor-ip}]/connection-state\",\n \"sensor_path_config\" : \"Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/vrfs/vrf[vrf-name={vrf}]/sessions/session[neighbor-address={neighbor-ip}]/connection-state\"\n \"sensor_path_device_feed\": \"Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/vrfs/vrf[vrf-name={vrf}]/sessions/session\"\n }","$$ref":"#/components/schemas/MetricImplGnmiTemplateMetric"},"CLITemplateMetric":{"type":"object","properties":{"sensor_path_config":{"type":"string","description":"Sensor path config"},"sensor_path_exact":{"type":"string","description":"Sensor path exact"},"device_package_name":{"type":"string","description":"Device package name"},"function_name":{"type":"string","description":"Function name"}},"description":"\"CLITemplateMetric\": {\n \"sensor_path_config\": \"show cef {prefix}\",\n \"sensor_path_exact\": \"route/next-hop\".\n \"device_package_name\": \"showcefprefix\",\n \"function_name\": \"getCefPrefixInfo\"\n }","$$ref":"#/components/schemas/MetricImplCliTemplateMetric"},"CLIMetric":{"type":"object","properties":{"sensor_path_config":{"type":"string","description":"Sensor path config"},"sensor_path_exact":{"type":"string","description":"Sensor path exact"},"device_package_name":{"type":"string","description":"Device package name"},"function_name":{"type":"string","description":"Function name"}},"description":"The non-parameterized CLI metric.","$$ref":"#/components/schemas/MetricImplCliMetric"},"precedence":{"description":"The higher the value, the higher the precedence","type":"integer","format":"int64"},"convert_args":{"type":"object","description":"Convert arguments","additionalProperties":{"type":"object","properties":{"arg_substitutes":{"type":"array","description":"Argument substitutes","items":{"type":"object","properties":{"from":{"type":"string","description":"Pattern to be replaced"},"to":{"type":"string","description":"Value to be replaced with"}},"description":"The arg_substitutes object identifies each pattern (map key) and the value it is to be replaced with (map value). It performs substitutions in the order in which it identifies the patterns.","$$ref":"#/components/schemas/ArgConversionsArgSubstitutes"}}},"description":"Convert the input argument to this Metric Class instance before substituting its value in the sensor paths and OIDs. These conversions are handy in scenarios like the following. \nLet's assume that the ServiceConfig uses ifName as the argument and its value as 'GigabitEthernet0/0/5 612', but the ifName value in the incoming SNMP feed is 'Gi0/0/5.SI.612'. If the pipeline attempts to find a match using the incoming ifName argument value as is, then the pipeline will not find a matching interface. This is where conversions come into play. The incoming argument value needs to go through some conversions before the resultant value can be used to filter the interface entry of interest from the incoming SNMP feed. \nIn this example scenario, the conversions of interest are:\n - Substitute 'GigabitEthernet' with 'Gi'\n - Substitute ' ' with '.SI.'\nThese conversions effectively transform 'GigabitEthernet0/0/5 612' into 'Gi0/0/5.SI.612'.","$$ref":"#/components/schemas/MetricImplArgConversions"}},"val_mapping":{"type":"object","properties":{"values":{"type":"object","description":"Properties","additionalProperties":{"type":"string","description":"Additional properties"}}},"description":"Maps the result of the metric to a normalized output value. This allows for consistent interpretation across devices\nExample:\n\"value_mapping\": {\n \"values\": {\n \"dest-active\": \"active\",\n \"dest-not-active\": \"not-active\"\n \"1\": \"active\",\n \"2\": \"not-active\"\n \"true\": \"active\"\n \"false\": \"not-active\"\n },\n \"default\": null\n}","$$ref":"#/components/schemas/MetricImplValueMapping"},"device_output_labels":{"type":"array","description":"Device output labels","items":{"type":"string","description":"Items of Device output labels"}},"post_processing_expr":{"type":"string","description":"Post processing expression"},"only_when":{"description":"The only_when condition expresses the condition that needs to be satisfied in order to select a given implementation.\nThe given implementation can have the highest precedence value but if the only_when condition is not satisfied then the respective implementation will not be selected.\nCurrently only below 2 conditions are supported:\n \"AddressFamily({\u003cmetric-param\u003e}) == 'ipv4'\"\n \"AddressFamily({\u003cmetric-param\u003e}) == 'ipv6'\"\nExample, say metric param name is 'peer-ip-addr', then valid only_when expressions are:\n \"AddressFamily({peer-ip-addr}) == 'ipv4'\"\n \"AddressFamily({peer-ip-addr}) == 'ipv6'\". The only_when condition helps abstract out ipv4 vs ipv6 implementation-specific differences, such as the MIB OID or YANG module, and so on.","type":"string"}},"$$ref":"#/components/schemas/MetricImpl"}},"matcher":{"description":"Matcher defines different implementation conditions.","type":"array","items":{"type":"object","description":"Metric class matcher","properties":{"implementation":{"type":"string","description":"Implementation of Metric class matcher"},"not_supported":{"description":"Set this flag to true when a given model/version is not supported for this metric. All unsupported metrics will be treated as a no-op equivalent value in their participating eval expressions.","type":"boolean"},"conditions":{"description":"Map key can be os_model, os_version","type":"object","additionalProperties":{"type":"object","description":"Metric class OS match","properties":{"type":{"description":"Type of match. Can be \"exact_match\" for os_model or \"version_range\" for os_version.","type":"string"},"match":{"description":"List of os_model or os_version to be matched","type":"array","items":{"type":"string","description":"Items of the os_mdoel list"}},"start":{"description":"Example:\na) If a path is valid for all versions starting from \"7.4.1.28I\" and above, then the version_range can be specified as:\n\"os_version\": {\n\"type\": \"version_range\",\n\"start\": \"7.4.1.28I\"\n}\nThe start version specified here is \"inclusive\"\nb) If a path is valid for all versions only up to \"7.4.1.27I\" and below then version_range can be\nspecified as:\n\"os_version\": {\n\"type\": \"version_range\",\n\"end\": \"7.4.1.27I\"\n}\nThe end version specified here is \"inclusive\"\nc) If a path is valid from version \"1.1.1\" to \"1.4.4\" and all in-between versions, then the range can be specified as:\n\"os_version\": {\n\"type\": \"version_range\",\n\"start\": \"1.1.1\"\n\"end\": \"1.4.4\"\n}\nBoth start and end version are \"inclusive\" i.e. start version \u003c= x \u003c= end version\nd) For \"os_version\", if the device version matches any version provided in the list of \"match\", OR if it satisfies the \"start\" and \"end\" version range requirement, then the device version is\nconsidered as a match. Both \"start\" and \"end\" versions are inclusive.\n\"os_version\": {\n\"type\": \"version_range\",\n\"match\": [\n\"6.6\",\n\"6.3\",\n\"6.5\"\n],\n\"start\": \"1.1.1\",\n\"end\": \"2.2.2\"\n}","type":"string"},"end":{"description":"Defines the end of os_version range","type":"string"}},"$$ref":"#/components/schemas/MetricClassOsMatch"}},"address_family":{"description":"Address family will indicate if the IP address is ipv4 or ipv6. If absent, the IP address should be considered ipv4.\n\"address_family\": \"AddressFamily(ipAddress) == ipv4\"\n\"address_family\": \"AddressFamily(ipAddress) == ipv6\".","type":"string"}},"$$ref":"#/components/schemas/MetricClassMatcher"}},"create_timestamp":{"description":"Create timestamp for MetricClass.","type":"string","format":"int64"},"update_timestamp":{"description":"Update timestamp for MetricClass.","type":"string","format":"int64"},"version":{"description":"Current version of the metricClass.","type":"string"}},"$$ref":"#/components/schemas/MetricClass"}},"plugins":{"type":"array","description":"Plugins of the Heuristic Package Element.","items":{"type":"object","properties":{"id":{"description":"Generated ID of the plugin","type":"string"},"name":{"description":"Name of the plugin","type":"string"},"namespace":{"description":"Namespace to which this plugin belongs","type":"string"},"content":{"description":"Content of the plugin file in byte format","pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","format":"byte"},"create_timestamp":{"description":"Create timestamp for the plugin","type":"string","format":"int64"},"update_timestamp":{"description":"Update timestamp for the plugin","type":"string","format":"int64"},"version":{"description":"current version of the plugin","type":"string"}},"description":"Plugin information.","$$ref":"#/components/schemas/Plugin"}}},"description":"Response providing the list of Heuristic Package definitions that match the given namespace.","$$ref":"#/components/schemas/HpResponse","title":"HpResponse"}}