Versions Compared

Key

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

...

Code Block
languagejava
titleExample payload with "applicaiton/vnd.onap.drools+text" Content-Type
linenumberstrue
collapsetrue
package org.onap.policy.controlloop.ran;

import org.onap.policy.controlloop.ran.event.SampleMsEvent;
import org.onap.policy.controlloop.ran.Enodeb;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

declare Params
  closedLoopControlName: String
end

rule "SETUPINIT"
  when
  then
    Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
    logger.info("{}: {}", params.getClosedLoopControlName(), drools.getRule().getName());
  
    Params params = new Params();
    params.setClosedLoopControlName("example-name");
    insert(params);
end

rule "EVENT"
  when
    $params : Params( $clName : getClosedLoopControlName() )
    $event : SampleMsEvent( closedLoopControlName == $clName )
  then
    Logger logger = LoggerFactory.getLogger(drools.getRule().getPackage());
    logger.info("{}: {}", params.getClosedLoopControlName(), drools.getRule().getName());

    Enodeb enb = new Enodeb($event);
    enb.reboot();
    retract($event);
end

...

Code Block
languagexml
titleExample payload with "application/vnd.onap.drools.mvn+xml" Content-Type
linenumberstrue
collapsetrue
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

  <dependencies>
    <dependency>
      <groupId>org.onap.policy.native</groupId>
      <artifactId>policy-ran-optimization</artifactId>
      <version>1.0.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

</project>

...

Code Block
languagejs
titleExample XACML PDP status message when it registers itself with PAP
collapsetrue
{
  "pdpType": "xacml",
  "state": "PASSIVE",
  "healthy": "HEALTHY",
  "supportedPolicyTypes": [
    {
      "name": "onap.Monitoring",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.monitoring.cdap.tca.hi.lo.app",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.monitoring.docker.sonhandler.app",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.controlloop.guard.FrequencyLimiter",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.controlloop.guard.MinMax",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.controlloop.guard.Blacklist",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.controlloop.guard.coordination.FirstBlocksSecond",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.AffinityPolicy",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.DistancePolicy",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.HpaPolicy",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.OptimizationPolicy",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.PciPolicy",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.QueryPolicy",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.SubscriberPolicy",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.Vim_fit",
      "version": "1.0.0"
    },
    {
      "name": "onap.policies.optimization.VnfPolicy",
      "version": "1.0.0"
    }
  ],
  "supportedContentTypes": [
    {
      "name": "application/xacml+xml; version=3.0",
      "version": "1.0.0"
    }
  ],
  "policies": [],
  "messageName": "PDP_STATUS",
  "requestId": "77f42778-f19a-47a6-a9a1-984cbb125d96",
  "timestampMs": 1571244733313,
  "name": "FLCDTL02JH7358"
}

...

Code Block
languagejs
titleExample Drools PDP status message when it registers itself with PAP
collapsetrue
{
  "pdpType": "drools",
  "state": "PASSIVE",
  "healthy": "HEALTHY",
  "supportedPolicyTypes": [
    {
      "name": "onap.policies.controlloop.Operational",
      "version": "1.0.0"
    }
  ],
  "supportedContentTypes": [
    {
      "name": "application/vnd.onap.drools+text",
      "version": "1.0.0"
    },
    {
      "name": "application/vnd.onap.drools.mvn+xml",
      "version": "1.0.0"
    }
  ],
  "policies": [],
  "messageName": "PDP_STATUS",
  "requestId": "8ae9fe00-8979-460f-83b2-92d7bd517c34",
  "timestampMs": 1571244753326,
  "name": "XGIQPQ96FL9182"
}

...

Code Block
languagejs
linenumberstrue
collapsetrue
{
    "groups": [
        {
            "name": "defaultGroup",
            "description": "The default group that registers all supported policy types and pdps.",
            "pdpGroupState": "ACTIVE",
            "properties": {},
            "pdpSubgroups": [
                {
                    "pdpType": "apex",
                    "supportedPolicyTypes": [
                        {
                            "name": "onap.policies.controlloop.operational.Apex",
                            "version": "1.0.0"
                        }
                    ],
                    "supportedContentTypes": [
                        {
                            "name": "application/vnd.onap.apex+json",
                            "version": "1.0.0"
                        }
                    ],
                    "policies": [],
                    "currentInstanceCount": 0,
                    "desiredInstanceCount": 1,
                    "properties": {},
                    "pdpInstances": [
                        {
                            "instanceId": "apex_35",
                            "pdpState": "ACTIVE",
                            "healthy": "HEALTHY",
                            "message": "Pdp Heartbeat"
                        }
                    ]
                },
                {
                    "pdpType": "drools",
                    "supportedPolicyTypes": [
                        {
                            "name": "onap.policies.controlloop.Operational",
                            "version": "1.0.0"
                        }
                    ],
                    "supportedContentTypes": [
                        {
                            "name": "application/vnd.onap.drools+text",
                            "version": "1.0.0"
                        },
                        {
                            "name": "application/vnd.onap.drools.mvn+xml"
                            "version": "1.0.0"
                        }
                    ],
                    "policies": [],
                    "currentInstanceCount": 0,
                    "desiredInstanceCount": 1,
                    "properties": {},
                    "pdpInstances": [
                        {
                            "instanceId": "dev-policy-drools-0",
                            "pdpState": "ACTIVE",
                            "healthy": "HEALTHY"
                        }
                    ]
                },
                {
                    "pdpType": "xacml",
                    "supportedPolicyTypes": [
                        {
                            "name": "onap.policies.controlloop.guard.FrequencyLimiter",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.controlloop.guard.MinMax",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.controlloop.guard.Blacklist",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.controlloop.guard.coordination.FirstBlocksSecond",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.Monitoring",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.monitoring.cdap.tca.hi.lo.app",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.monitoring.docker.sonhandler.app",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.AffinityPolicy",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.DistancePolicy",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.HpaPolicy",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.OptimizationPolicy",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.PciPolicy",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.QueryPolicy",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.SubscriberPolicy",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.Vim_fit",
                            "version": "1.0.0"
                        },
                        {
                            "name": "onap.policies.optimization.VnfPolicy",
                            "version": "1.0.0"
                        }
                    ],
                    "supportedContentTypes": [
                        {
                            "name": "application/xacml+xml; version=3.0",
                            "version": "1.0.0"
                        }
                    ],
                    "policies": [],
                    "currentInstanceCount": 1,
                    "desiredInstanceCount": 1,
                    "properties": {},
                    "pdpInstances": [
                        {
                            "instanceId": "dev-policy-policy-xacml-pdp-558c478477-g85jl",
                            "pdpState": "ACTIVE",
                            "healthy": "HEALTHY"
                        }
                    ]
                }
            ]
        }
    ]
}

...

Code Block
languagejs
titleexample-controller.rest.json
collapsetrue
{
    "controller.name": "example-controller",
    
    "ueb.source.topics": "EXAMPLE-SOURCE-TOPIC",
    "ueb.source.topics.EXAMPLE-SOURCE-TOPIC.servers": "example-dmaap-server",
    "ueb.source.topics.EXAMPLE-SOURCE-TOPIC.events": "example-source-event-class",
    
    "ueb.sink.topics": "EXAMPLE-SINK-TOPIC",
    "ueb.sink.topics.EXAMPLE-SINK-TOPIC.servers": "example-dmaap-server",
    "ueb.sink.topics.EXAMPLE-SINK-TOPIC.events": "example-sink-event-class",
    
    "rules.groupId": "org.onap.policy.controlloop",
    "rules.artifactId": "policy-ran-optimization",
    "rules.version": "1.0.0-SNAPSHOT"
}

...