{"type":"api","title":"Update the given rule class","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":{"tags":["AaHeuristicPackage"],"summary":"Update the given rule class.","operationId":"AaHeuristicPackage_UpdateRuleClass","requestBody":{"description":"The RuleClass request parameter.","content":{"application/json":{"schema":{"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"},"example":{"name":"Rule-L2VPN-NM-P2P","namespace":"custom","description":"Rule to generate Assurance Graph for L2VPN NM P2P Services.","matchCriteria":[{"configSource":"SOURCE_TYPE_NSO","matchType":"MATCH_TYPE_XPATH","matchExpression":"//vpn-service[@xmlns='urn:ietf:params:xml:ns:yang:ietf-l2vpn-ntw']/vpn-svc-type[text()='vpn-common:t-ldp']"}],"dependencies":[{"name":"FallbackPathHealthLocal","ssClass":"subservice.fallback.path.health","namespace":"custom","optional":true,"healthScoreWeight":50,"paramExtractionMechanism":{"mode":"EXTRACT_MODE_XPATH"},"parameters":[{"name":"device","extractionMethod":"DEP_PARAM_XPATH","extractionDetails":[{"extractValue":"//vpn-service/vpn-nodes/vpn-node[1]/vpn-node-id"}]},{"name":"peer-device","extractionMethod":"DEP_PARAM_XPATH","extractionDetails":[{"extractValue":"//vpn-service/vpn-nodes/vpn-node[2]/vpn-node-id"}]},{"name":"fallback-enabled","extractionMethod":"DEP_PARAM_XPATH","extractionDetails":[{"description":"Fallback for SR Policy","extractValue":"//vpn-service/vpn-nodes/vpn-node[1]/te-service-mapping/te-mapping/sr-policy[not(fallback)]"},{"description":"Fallback for RSVP tunnel","extractValue":"//vpn-service/vpn-nodes/vpn-node[1]/te-service-mapping/te-mapping/te-tunnel-list[not(fallback)]"}]}],"subDependencies":[]}]}}},"required":true},"responses":{"200":{"description":"OK. The request was successful. The result is contained in the response body.","content":{"application/json":{"schema":{"type":"object","description":"Response for the Heuristic Package Element CRUD.","properties":{"status":{"type":"string","description":"Response status for the Heuristic Package Element CRUD.","default":"RESP_STATUS_UNKNOWN","enum":["RESP_STATUS_UNKNOWN","RESP_STATUS_SUCCESS","RESP_STATUS_ERROR"],"$$ref":"#/components/schemas/HpCrudResponseStatus"},"error_description":{"description":"The reason for the error.","type":"string"},"name":{"description":"The name of the Heuristic Package Element.","type":"string"},"namespace":{"description":"The namespace of the Heuristic Package Element.","type":"string"}},"$$ref":"#/components/schemas/HpCrudResponse"},"example":{"data":[{"status":"RESP_STATUS_SUCCESS","name":"rule.sample","namespace":"custom"}]}}}},"default":{"description":"An empty response.","content":{"application/json":{"schema":{"type":"object","description":"Runtime error","properties":{"error":{"type":"string","description":"Error of Runtime error"},"code":{"type":"integer","description":"Code of Runtime error","format":"int32"},"message":{"type":"string","description":"Message of Runtime error"},"details":{"type":"array","description":"Details of Runtime error","items":{"type":"object","description":"ProtobufAny","properties":{"type_url":{"type":"string","description":"Type-url of ProtobufAny"},"value":{"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$","type":"string","description":"Value of ProtobufAny","format":"byte"}},"$$ref":"#/components/schemas/protobufAny"}}},"$$ref":"#/components/schemas/runtimeError"},"example":{"data":[{"status":"RESP_STATUS_SUCCESS"}]}}}}},"x-codegen-request-body-name":"body","__originalOperationId":"AaHeuristicPackage_UpdateRuleClass","security":[{"bearerAuth":[]}],"method":"put","path":"/updateRule"}}