Overview
The PM Subscription Handler (PMSH) is a micro service written in Python, which allows for the definition and unlocking of PM subscriptions on one or more network function (NF) instances.
Architecture Diagram
Artifacts
Deployment Prerequisite/dependencies
...
Following default configuration is loaded into pmsh (set in blueprint configuration)
Given that the steps above were used to configure the PMSH monitoring policy with administrativeState = LOCKED. The subscription has not yet been "activated" on the network function.
Activate an inactive subscription
If the subscription is in a LOCKED state (administrativeState=LOCKED) we can reconfigure PMSH to activate the subscription:
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Configuration |
---|
|
To simulate the event flow and trigger missing pmsh event, we can simulate a VES event into pmsh subscription topic (using curl).
Generate pmsh CL Onset
...
language | bash |
---|
theme | Midnight |
---|
title | Trigger a CL event via curl |
---|
linenumbers | true |
---|
...
language | bash |
---|
theme | Midnight |
---|
title | Logs showing event being processed |
---|
linenumbers | true |
---|
We can check that a new DCAE_CL_OUTPUT event has been published (make sure you target the correct DMaaP IP address)
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Fetch events from DCAE_CL_OUTPUT topic |
---|
linenumbers | true |
---|
|
curl http://10.12.5.8:30227/events/unauthenticated.DCAE_CL_OUTPUT/vv/1 |
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Published event |
---|
linenumbers | trueActivate Subscription |
---|
|
curl -X PUT \
http://<onap-ip>:<consul-port>/v1/kv/dcae-pmsh:policy \
-H 'Content-Type: application/json' \
-d '{
"subscription": {
"subscriptionName": "test-subscription",
"administrativeState": "UNLOCKED",
"fileBasedGP": 15,
"fileLocation": "/pm/pm.xml",
"nfFilter": {
"swVersions": [
"1.0.0"
],
"nfNames": [
"^pnf.*"
]
},
"measurementGroups": [{
"measurementGroup": {
"measurementTypes": [{
"measurementType": "countera"
},
{
"measurementType": "counterb"
}
],
"managedObjectDNsBasic": [{
"DN": "dna"
},
{
"DN": "dnb"
}
]
}
},
{
"measurementGroup": {
"measurementTypes": [{
"measurementType": "counterc"
},
{
"measurementType": "counterd"
}
],
"managedObjectDNsBasic": [{
"DN": "dnc"
},
{
"DN": "dnd"
}
]
}
}
]
}
}' |
We should then be able to see a CREATE event sent to message router:
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Get from MR |
---|
|
curl -k https://message-router:3905/events/unauthenticated.DCAE_CL_OUTPUT/1/1 |
If PMSH is working correctly we should see a CREATE event sent to message router:
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Response from MR |
---|
|
["{\"nfName\":\"pnf500\",\"policyName\":\"pmsh-operational-policy\",\"changeType\":\"CREATE\",\"subscription\":{\"administrativeState\":\"LOCKED\",\"subscriptionName\":\"test-subscription\",\"measurementGroups\":[{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"countera\"},{\"measurementType\":\"counterb\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dna\"},{\"DN\":\"dnb\"}]}},{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"counterc\"},{\"measurementType\":\"counterd\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dnc\"},{\"DN\":\"dnd\"}]}}],\"fileBasedGP\":15,\"fileLocation\":\"/pm/pm.xml\"},\"closedLoopControlName\":\"pmsh-control-loop\"}"] |
Deactivate an active subscription
If the subscription is in an UNLOCKED state (administrativeState=UNLOCKED) we can reconfigure PMSH to deactivate the subscription:
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Activate Subscription |
---|
|
curl -X PUT \
http://<onap-ip>:<consul-port>/v1/kv/dcae-pmsh:policy \
-H 'Content-Type: application/json' \
-d '{
"subscription": {
"subscriptionName": "test-subscription",
"administrativeState": "LOCKED",
"fileBasedGP": 15,
"fileLocation": "/pm/pm.xml",
"nfFilter": {
"swVersions": [
"1.0.0"
],
"nfNames": [
"^pnf.*"
]
},
"measurementGroups": [{
"measurementGroup": {
"measurementTypes": [{
"measurementType": "countera"
},
{
"measurementType": "counterb"
}
],
"managedObjectDNsBasic": [{
"DN": "dna"
},
{
"DN": "dnb"
}
]
}
},
{
"measurementGroup": {
"measurementTypes": [{
"measurementType": "counterc"
},
{
"measurementType": "counterd"
}
],
"managedObjectDNsBasic": [{
"DN": "dnc"
},
{
"DN": "dnd"
}
]
}
}
]
}
}' |
We should then be able to see a CREATE event sent to message router:
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Get from MR |
---|
|
curl -k https://message-router:3905/events/unauthenticated.DCAE_CL_OUTPUT/1/1 |
If PMSH is working correctly we should see a DELETE event sent to message router:
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Response from MR |
---|
|
["{\"nfName\":\"pnf500\",\"policyName\":\"pmsh-operational-policy\",\"changeType\":\"DELETE\",\"subscription\":{\"administrativeState\":\"LOCKED\",\"subscriptionName\":\"test-subscription\",\"measurementGroups\":[{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"countera\"},{\"measurementType\":\"counterb\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dna\"},{\"DN\":\"dnb\"}]}},{\"measurementGroup\":{\"measurementTypes\":[{\"measurementType\":\"counterc\"},{\"measurementType\":\"counterd\"}],\"managedObjectDNsBasic\":[{\"DN\":\"dnc\"},{\"DN\":\"dnd\"}]}}],\"fileBasedGP\":15,\"fileLocation\":\"/pm/pm.xml\"},\"closedLoopControlName\":\"pmsh-control-loop\"}"] |
Dynamic Configuration Update
...