Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-1738

PAP: Policy Deployment from CLAMP fails as policy-type-version is required to not be null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: High High
    • Dublin Release
    • Dublin Release
    • None

      MariaDB [policyadmin]> select METADATA_KEY,METADATA from jpatoscapolicy_metadata;

       

      -------------------------------------------------------------------------------------+

      METADATA_KEY   METADATA                                                              

      -------------------------------------------------------------------------------------+

      policy-id      onap.restart.tca                                                     
      policy-version 1                                                                     
      policy-id      tca_k8s_vLoadBalancerMS_v1_0_vLoadBalancerMS0_k8s-tca-policy-04262019
      policy-version 1                                                                    
      policy-id      onap.scaleout.tca                                                    
      policy-version 1                                                                    

      -------------------------------------------------------------------------------------+

       

      This is the response from the api when creating the policy:

       

      {

        "tosca_definitions_version": "tosca_simple_yaml_1_0_0",

        "topology_template": {

          "policies": [

            {

              "onap.scaleout.tca": {

                "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",

                "properties": {

                  "tca_policy": "{domain=measurementsForVfScaling, metricsPerEventName=[{eventName=vLoadBalancer, controlLoopSchemaType=VNF, policyScope=type=configuration, policyName=onap.scaleout.tca, policyVersion=v0.0.1, thresholds=[

      {closedLoopControlName=ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3, closedLoopEventStatus=ONSET, version=1.0.2, fieldPath=$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated, thresholdValue=500.0, direction=LESS_OR_EQUAL, severity=MAJOR}

      , {closedLoopControlName=ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3, closedLoopEventStatus=ONSET, version=1.0.2, fieldPath=$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated, thresholdValue=5000.0, direction=GREATER_OR_EQUAL, severity=CRITICAL}]}]}"

                },

                "name": "onap.scaleout.tca",

                "version": "1.0.0",

                "metadata":

      {             "policy-id": "onap.scaleout.tca",             "policy-version": "1"           }

              }

            }

          ]

        },

        "name": "ToscaServiceTemplateSimple",

        "version": "1.0.0"

      }

       

      But pushing this:

       

      {

        "policies": [

         

      {       "policy-id": "onap.scaleout.tca",       "policy-version": 1     }

        ]

      }

      ================

      2019-05-03T20:29:47.490+00:00|WARN|PdpGroupDeployProvider|qtp1357700757-26] failed to deploy policy: ToscaPolicyIdentifierOptVersion(name=onap.scal
      [2019-05-03T20:29:47.496+00:00|WARN|ProviderBase|qtp1357700757-26] failed to deploy/undeploy policies
      java.lang.NullPointerException: version is marked @NonNull but is null
      at org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier.<init>(ToscaPolicyTypeIdentifier.java:44)
      at org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy.getTypeIdentifier(ToscaPolicy.java:89)
      at org.onap.policy.pap.main.rest.depundep.ProviderBase.processPolicy(ProviderBase.java:137)
      at org.onap.policy.pap.main.rest.depundep.PdpGroupDeployProvider.deploySimplePolicies(PdpGroupDeployProvider.java:419)
      at org.onap.policy.pap.main.rest.depundep.ProviderBase.process(ProviderBase.java:103)
      at org.onap.policy.pap.main.rest.depundep.PdpGroupDeployProvider.deployPolicies(PdpGroupDeployProvider.java:402)
      at org.onap.policy.pap.main.rest.depundep.PdpGroupDeployControllerV1.lambda$deployPolicies$1(PdpGroupDeployControllerV1.java:128)
      at org.onap.policy.pap.main.rest.depundep.PdpGroupDeployControllerV1.doOperation(PdpGroupDeployControllerV1.java:141)
      at org.onap.policy.pap.main.rest.depundep.PdpGroupDeployControllerV1.deployPolicies(PdpGroupDeployControllerV1.java:128)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            jhh jhh
            jhh jhh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: