...
To publish a file to the PM-Mapper we can use the following example curl. Where <filename> Must begin with A or C and the file extension must be xml.
Code Blockexpand |
---|
|
curl -k -X PUT https://dcae-pm-mapper:8443/delivery/<filename> -H 'X-DMAAP-DR-META:{"productName": "targetNodeType","vendorName": "targetVendor","lastEpochMicrosec": "1538478000000","sourceName": "oteNB5309","startEpochMicrosec": "1538478900000","timeZoneOffset": "UTC+05:00","location": "ftpes://127.0.0.1:22/ftp/rop/A20161224.1045-1100.bin.gz","compression": "gzip","fileFormatType": "org.3GPP.32.435#measCollec","fileFormatVersion": "V9"}' -H "Content-Type:application/xml" --data-binary @<filename> -H 'X-ONAP-RequestID: 12345' -H 'X-DMAAP-DR-PUBLISH-ID: 12345' |
Note |
---|
|
The productName and targetVendor specified in X-DMAAP-DR-META must match the nfType and vendor specified during configuration of the PM-Mapper |
We can then check that the XML has been processed and published to Message Router as a VES event by curling the PM-Mapper topic on Message Router.
We first need to set up a subscriber to the PM-Mapper topic as this is not set up by default. We can do this with the following curl to Bus Controller:
Code Block |
---|
|
curl -X POST http://dmaap-bc:8080/webapi/mr_clients -H "Content-Type:application/json" --data @sub-client.json |
Expand |
---|
|
{ "dcaeLocationName": "san-franscisco", "fqtn": "org.onap.dmaap.mr.PM_MAPPER", "clientIdentity": "dcae@dcae.onap.org" "action": "sub" } |
Once the subscriber is set up, we can curl the topic on Message Router to retrieve the published event:
Code Block |
---|
|
curl -k https://message-router:3905/events/org.onap.dmaap.mr.PM_MAPPER -u 'dcae@dcae.onap.org:<dcae_password>' |
This VES event can then be compared to the filter specified during configuration of the PM-Mapper to verify that only the specified counters have been published.
|
<?xml version="1.0" encoding="UTF-8"?> <measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec"> <fileHeader dnPrefix="some dnPrefix" vendorName="Acme Ltd" fileFormatVersion="32.435 V10.0"> <fileSender localDn="Dublin"/> <measCollec beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> <managedElement swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="some Job Id"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> <repPeriod duration="PT900S"/> <measType p="1">a</measType> <measType p="2">b</measType> <measType p="3">c</measType> <measValue measObjLdn="some measObjLdn"> <r p="1">86</r> <r p="2">67</r> <r p="3">14</r> |
Expand |
---|
|
<?xml version="1.0" encoding="UTF-8"?> <measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec"> <fileHeader dnPrefix="some dnPrefix" vendorName="Acme Ltd" fileFormatVersion="32.435 V10.0"<suspect>false</suspect> </measValue> <fileSender localDn="Dublin"//measInfo> </measData> <fileFooter> <measCollec beginTimeendTime="2018-10-02T12:0015:00+01:00"/> </fileHeaderfileFooter> <measData> <managedElement swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="some Job Id"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> <repPeriod duration="PT900S"/> <measType p="1">a</measType> <measType p="2">b</measType> <measType p="3">c</measType> <measValue measObjLdn="some measObjLdn"> <r p="1">86</r> <r p="2">67</r> <r p="3">14</r> <suspect>false</suspect> </measValue> </measInfo> </measData> <fileFooter> <measCollec endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> </measCollecFile></measCollecFile> |
Code Block |
---|
|
curl -k -X PUT https://dcae-pm-mapper:8443/delivery/<filename> -H 'X-DMAAP-DR-META:{"productName": "AcmeNode","vendorName": "Acme","lastEpochMicrosec": "1538478000000","sourceName": "oteNB5309","startEpochMicrosec": "1538478900000","timeZoneOffset": "UTC+05:00","location": "ftpes://127.0.0.1:22/ftp/rop/A20161224.1045-1100.bin.gz","compression": "gzip","fileFormatType": "org.3GPP.32.435#measCollec","fileFormatVersion": "V9"}' -H "Content-Type:application/xml" --data-binary @<filename> -H 'X-ONAP-RequestID: 12345' -H 'X-DMAAP-DR-PUBLISH-ID: 12345' |
Note |
---|
|
The productName and targetVendor specified in X-DMAAP-DR-META must match the nfType and vendor specified during configuration of the PM-Mapper |
We can then check that the XML has been processed and published to Message Router as a VES event by curling the PM-Mapper topic on Message Router.
We first need to set up a subscriber to the PM-Mapper topic as this is not set up by default. We can do this with the following curl to Bus Controller:
Code Block |
---|
|
curl -X POST http://dmaap-bc:8080/webapi/mr_clients -H "Content-Type:application/json" --data @sub-client.json |
Expand |
---|
|
{ "dcaeLocationName": "san-franscisco", "fqtn": "org.onap.dmaap.mr.PM_MAPPER", "clientIdentity": "dcae@dcae.onap.org" "action": "sub" } |
Once the subscriber is set up, we can curl the topic on Message Router to retrieve the published event:
Code Block |
---|
|
curl -k https://message-router:3905/events/org.onap.dmaap.mr.PM_MAPPER -u 'dcae@dcae.onap.org:<dcae_password>' |
This VES event can then be compared to the filter specified during configuration of the PM-Mapper to verify that only the specified counters have been published.
Expand |
---|
title | Example key/value configuration in consul |
---|
|
{
"pm-mapper-filter": {
"filters": [
{
"pmDefVsn": "1.8",
"nfType": "AcmeNode",
"vendor": "Acme",
"measTypes": [
"a",
"c"
]
}
]
},
"trust_store_pass_path": "/opt/app/pm-mapper/etc/cert/trust.pass",
"key_store_path": "/opt/app/pm-mapper/etc/cert/cert.jks.b64",
"streams_subscribes": {
"dmaap_subscriber": {
"type": "data_router",
"dmaap_info": {
"username": "username",
"password": "password",
"location": "san-francisco",
"delivery_url": "https://dcae-pm-mapper:8443/delivery",
"subscriber_id": "1"
}
}
},
"trust_store_path": "/opt/app/pm-mapper/etc/cert/trust.jks.b64",
"streams_publishes": {
"dmaap_publisher": {
"aaf_password": "password",
"type": "message_router",
"dmaap_info": {
"topic_url": "http://message-router:3904/events/org.onap.dmaap.mr.PM_MAPPER",
"client_role": "org.onap.dmaap.mr.PM_MAPPER.pub",
"location": "san-francisco",
"client_id": "dcae@dcae.onap.org"
},
"aaf_username": "username"
}
},
"dmaap_dr_delete_endpoint": "https://dmaap-dr-node:8443/delete",
"key_store_pass_path": "/opt/app/pm-mapper/etc/cert/jks.pass",
"enable_http": false,
"dmaap_dr_feed_name": "bulk_pm_feed"
} |
...
Using the example type A file above, and the given example key/value configuration in consul, the PM Mapper will produce the following VES output, note that only counter "a" and "c" were mapped, as specified in the filter configuration.
...