Thanks Sebastien,

Unfortunately it didn't work. I tried different combinations of parameters. 
Interestingly I had this working on bit older Frankfurt lab from a month ago. 
And now exact same policy is rejected on more recent lab.

Is there someone from POLICY team who can give some hints? Policy component 
rejects policies submitted from CLAMP. Error details are below.

Regards
-Lukasz
________________________________
Od: Determe, Sebastien <[email protected]>
Wysłane: wtorek, 2 czerwca 2020 09:44
Do: Grech, Lukasz (Nokia - PL/Wroclaw) <[email protected]>; 
[email protected] <[email protected]>
Temat: RE: [POLICY][CLAMP] Error when submitting to Policy Engine #clamp #policy


Lukasz,



Here is an example of what we had for scaleout (try to put v0.0.1 for 
policyVersion)

Otherwise you can look at the logs in policy-api container but I don’t think 
you will get more details than what is returned by the api.



{

  "tca_policy": {

    "domain": "measurementsForVfScaling",

    "metricsPerEventName": [

      {

        "policyScope": "DCAE",

        "thresholds": [

          {

            "version": "1.0.2",

            "severity": "MAJOR",

            "thresholdValue": 200,

            "closedLoopEventStatus": "ONSET",

            "closedLoopControlName": "LOOP_test-vLB",

            "direction": "LESS_OR_EQUAL",

            "fieldPath": 
"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta"

          }

        ],

        "eventName": "vLoadBalancer",

        "policyVersion": "v0.0.1",

        "controlLoopSchemaType": "VM",

        "policyName": "DCAE.Config_tca-hi-lo"

      }

    ]

  }

}



Seb



From: Grech, Lukasz (Nokia - PL/Wroclaw) <[email protected]>
Sent: Monday, June 1, 2020 1:57 PM
To: Determe, Sebastien <[email protected]>; 
[email protected]
Subject: ODP: [POLICY][CLAMP] Error when submitting to Policy Engine #clamp 
#policy



Thanks Sebastien for help. Here's the policy:



{

  "tca_policy": {

    "domain": "measurementsForVfScaling",

    "metricsPerEventName": [

      {

        "policyScope": "testPolicyScope",

        "thresholds": [

          {

            "version": "1",

            "severity": "CRITICAL",

            "thresholdValue": 30,

            "closedLoopEventStatus": "ONSET",

            "closedLoopControlName": "LOOP_lg-aa-loop-50",

            "direction": "LESS",

            "fieldPath": 
"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta"

          }

        ],

        "eventName": "vFirewallBroadcastPackets",

        "policyVersion": "1.0.0",

        "controlLoopSchemaType": "VM",

        "policyName": "testPolicyScope"

      }

    ]

  }

}



As a note, we had something similar working in Dublin, now I'm trying to "map 
it" to Frankfurt. Not sure about all the fields though, I'm not that familiar 
with ctrl-loops to be honest.



BTW. Is there any way for me to understand what's the problem with this policy? 
Asking Policy team each time doesn't seem too optimal ;) Maybe there's some log 
or something that I can check?



Regards

-Lukasz





________________________________

Od: Determe, Sebastien 
<[email protected]<mailto:[email protected]>>
Wysłane: piątek, 29 maja 2020 15:55
Do: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>; Grech, 
Lukasz (Nokia - PL/Wroclaw) 
<[email protected]<mailto:[email protected]>>
Temat: RE: [CLAMP][POLICY] Error when submitting to Policy Engine #clamp #policy



Lukasz,



Policy rejects the TCA monitoring policy 
(onap.policies.monitoring.cdap.tca.hi.lo.app, APP box in clamp).

It means there is an issue with the configuration of it,

Could you copy paste the JSON config you have (click on the monitoring policy 
box and then click on the button EDIT JSON at the very top of the dialog)? so 
that may be someone from policy can have a look



Thanks,

Seb



From: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>> On Behalf Of 
Grech, Lukasz (Nokia - PL/Wroclaw)
Sent: Friday, May 29, 2020 3:24 PM
To: [email protected]<mailto:[email protected]>
Subject: [onap-discuss] [CLAMP][POLICY] Error when submitting to Policy Engine 
#clamp #policy



Hi



I have a ctrl-loop created in CLAMP. I get an error when submitting policies to 
Policy Engine:



------------------------------------------------------------------------------------------------------------

SUBMIT request failed, Error reported: 
org.apache.camel.http.common.HttpOperationFailedException: HTTP operation 
failed invoking 
https://policy-api.onap:6969/policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies?connectionTimeToLive=5000<https://urldefense.proofpoint.com/v2/url?u=https-3A__policy-2Dapi.onap-3A6969_policy_api_v1_policytypes_onap.policies.monitoring.cdap.tca.hi.lo.app_versions_1.0.0_policies-3FconnectionTimeToLive-3D5000&d=DwQFBA&c=LFYZ-o9_HUMeMTSQicvjIg&r=zwceF46ESLyNVseh8BvkF2DZfq1KdUHuJhDK-s-uR2g&m=ASSza3uzGGGQ19KWgtv_4qDxTwayAYUfhb_GMyg96Jc&s=7Rfo7WCPpYCUtBsyEp3Iq2bb5Ma7JpSh8rpArvErp5I&e=>
 with statusCode: 406 - Body: {"code":"NOT_ACCEPTABLE","error":"\n***validation 
of model failed***\nPfConceptKey(name=ToscaServiceTemplateSimple, 
version=1.0.0):org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate:INVALID:no
 policy types are defined on the service template for the policies in the 
topology 
template\n********************************","details":["\n***validation of 
model failed***\nPfConceptKey(name=ToscaServiceTemplateSimple, 
version=1.0.0):org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate:INVALID:no
 policy types are defined on the service template for the policies in the 
topology template\n********************************"]}

------------------------------------------------------------------------------------------------------------



I looked for this message "no policy types are defined..." in Policy code and 
it seems it comes from service template validation 
(JpaToscaServiceTemplate.validatePolicyTypesInPolicies()). And it seems it's 
raised when there are no policy types defined in the template (if I get this 
right). However I looked in to the template generated by SDC and it looks like 
policy types are imported there. I'm attaching CSAR exported from SDC.



Could you give me a hint what might be wrong?



Thanks

-Lukasz



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#21249): https://lists.onap.org/g/onap-discuss/message/21249
Mute This Topic: https://lists.onap.org/mt/74652485/21656
Mute #clamp: https://lists.onap.org/mk?hashtag=clamp&subid=2740164
Mute #policy: https://lists.onap.org/mk?hashtag=policy&subid=2740164
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to