Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1.  curl -k --silent --user 'policyadmin:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes" -H "Accept: application/json" -H "Content-Type: application/json" -d @kpipolicytype.json
  2.  curl -k --silent --user 'policyadmin:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.monitoring.docker.kpims.app/versions/1.0.0/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @kpipolicyinstance.json
  3. curl --silent -k --user 'policyadmin:zb!XztG34' -X POST "https://policy-pap:6969/policy/pap/v1/pdps/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @deploykpipolicy.json

deploykpipolicy.json

Wiki Markup
{
   "policies":[
      {
         "policy-id":"com.Config_KPIMS_CONFIG_POLICY",
         "policy-version":1
      }
   ]
}

kpipolicytype.json

Wiki Markup
{
  "policy_types": {
    "onap.policies.monitoring.docker.kpims.app": {
      "derived_from": "onap.policies.Monitoring:1.0.0",
      "description": "KPI ms policy type",
      "properties": {
        "domain": {
          "required": true,
          "type": "string"
        },
		"methodForKpi":{
         "type":"list",
         "required":true,
         "entry_schema":{
         "type":"policy.data.methodForKpi_properties"
                    }
          }
       
      },
      "version": "1.0.0"
    }
  },
    "data_types": {
    "policy.data.methodForKpi_properties": {
      "derived_from": "tosca.nodes.Root",
      "properties": {
		     "eventName":{
                    "type":"string",
                    "required":true
                },
			 "controlLoopSchemaType":{
                    "type":"string",
                    "required":true
                },
			"policyScope":{
                    "type":"string",
                    "required":true
                },
			"policyName":{
                    "type":"string",
                    "required":true
                },
			"policyVersion":{
                    "type":"string",
                    "required":true
                },
			"kpis":{
                   "type":"list",
                   "required":true,
                   "entry_schema":{
                   "type":"policy.data.kpis_properties"
                    }
                }
		  
	  }
	},
	"policy.data.kpis_properties": {
      "derived_from": "tosca.nodes.Root",
      "properties": {
		     "measType":{
                    "type":"string",
                    "required":true
                },
			 "operation":{
                    "type":"string",
                    "required":true
                },
			"operands":{
                    "type":"string",
                    "required":true
                }
	  }
	}
	},
  "tosca_definitions_version": "tosca_simple_yaml_1_1_0"
}

kpipolicyinstance.json

Wiki Markup
{
  "name": "ToscaServiceTemplateSimple",
  "topology_template": {
    "policies": [
      {
        "com.Config_KPIMS_CONFIG_POLICY": {
		  "type": "onap.policies.monitoring.docker.kpims.app",
          "type_version": "1.0.0",
          "version": "1.0.0",
          "metadata": {
            "policy-id": "com.Config_KPIMS_CONFIG_POLICY",
            "policy-version": "1"
          },
          "name": "com.Config_KPIMS_CONFIG_POLICY",
          "properties": {
           "domain": "measurementsForKpi",
		   "methodForKpi": [
		   {
		   "eventName": "perf3gpp_CORE-AMF_pmMeasResult",
		   "controlLoopSchemaType": "SLICE",
		   "policyScope": "resource=networkSlice;type=configuration",
		   "policyName": "configuration.dcae.microservice.kpi-computation",
		   "policyVersion": "v0.0.1",
		     "kpis": [{
				 "measType": "AMFRegNbr",
				 "operation": "RATIO",
				 "operands": ["RM.RegisteredSubNbrMean"]}
				 ]
			}, 
			{
			 "eventName": "perf3gpp_RnNode-Slicing_pmMeasResult",
			 "controlLoopSchemaType": "SLICE",
			 "policyScope": "resource=networkSlice;type=configuration",
			 "policyName": "configuration.dcae.microservice.kpi-computation",
			 "policyVersion": "v0.0.1",
			 "kpis": [{
				 "measType": "PDUSessionEstSR",
				 "operation": "RATIO",
				 "operands": ["SM.PDUSessionSetupSucc","SM.PDUSessionSetupReq"]}
				 ]
			}
			]
        }
      }
	  }
    ]
     },
  "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
  "version": "1.0.0"
}


To create the dmaap topic - unauthenticated.DCAE_KPI_OUTPUT ::

...