Record Formats and Schemas
Request and response records are sent in JSON format.
Figure 1 shows the schema of request and response records.
Requests
Request Record Properties describes the HTTP requests received by SBA Gateway and sent to the Kafka topic specified with the
gateway.external.kafka.topic.single
property.
Property | Description |
---|---|
body | The HTTP request body as a JSON object. |
headers | The HTTP request headers as a JSON object. |
method | The HTTP method used in the request. Valid values are
GET , POST , or
PUT . |
operationName | The service operation name. |
recordType | A value of request indicates that this is from
an HTTP request. |
source | Indicates if the request is from the engine (CHF) or the client
(NFConsumer). Valid values are CHF or
NFConsumer . |
uri | The URI of the request. |
The following is an example of an HTTP request record:
{
"headers": {
"Accept": "*/*",
"Connection": "keep-alive",
"User-Agent": "PostmanRuntime/7.26.8",
"Postman-Token": "83da9a2b-1695-4bf8-92a3-69bead036013",
"Host": "localhost:9098",
"Accept-Encoding": "gzip, deflate, br",
"Content-Length": "445",
"Content-Type": "application/json"
},
"method": "POST",
"recordType": "request",
"operationName": "Nchf_ConvergedCharging_Create",
"source": "NFConsumer",
"body": {
"subscriberIdentifier": "imsi-15",
"nfConsumerIdentification": {
"nFName": "686fa0cc-92f2-4285-a839-f182c3745c00",
"nFIPv4Address": "192.168.1.76",
"nFIPv6Address": "192.168.1.76",
"nodeFunctionality": "SMF"
},
"invocationTimeStamp": "2019-08-13T16:10:11Z",
"invocationSequenceNumber": 1,
"multipleUnitUsage": [
{
"ratingGroup": 1,
"requestedUnit": {
"totalVolume": 10485760
}
}
]
},
"uri": "/nchf-convergedcharging/v2/chargingdata"
}
Responses
Response Properties describes the HTTP responses sent by MATRIXX Engine in response to an HTTP request and sent to the Kafka topic specified with the
gateway.external.kafka.topic.response
property.
Property | Description |
---|---|
body | The HTTP response body as a JSON object. |
headers | The HTTP response headers as a JSON object. |
operationName | The service operation name. |
reason | Indicates the reason for the engine response. |
recordType | A value of response indicates that this is from
an HTTP response. |
source | Indicates if the request is from the engine (CHF) or the client
(NFConsumer). Valid values are CHF , or
NFConsumer . |
statusCode | The status code of the response. Valid values are HTTP status codes. |
The following is an example of an HTTP response record:
{
"headers": {
"Connection": "keep-alive",
"Content-Length": "75",
"Date": "Thu, 21 Jan 2021 10:43:38 GMT",
"Location": "https://localhost:9099/nchf-convergedcharging/v2/chargingdata/171299012216803",
"Content-Type": "application/json"
},
"reason": "Created",
"recordType": "response",
"operationType": "Nchf_ConvergedCharging_Create",
"source": "NFConsumer",
"body": {
"invocationSequenceNumber": 1,
"invocationTimeStamp": "2019-08-13T16:10:11Z"
},
"statusCode": 201
}
Combined Request-Response Record
Combined request-response records consist of a request property with the JSON-formatted request and a response property with the JSON-formatted response, as shown in the following example:
{
"request": {
"headers": {
"Accept": "*/*",
"Connection": "keep-alive",
"Host": "localhost:9098",
"Accept-Encoding": "gzip, deflate, br",
"Content-Length": "445",
"Content-Type": "application/json"
},
"method": "POST",
"recordType": "request",
"operationType": "Nchf_ConvergedCharging_Create",
"source": "NFConsumer",
"body": {
"subscriberIdentifier": "imsi-15",
"nfConsumerIdentification": {
"nFName": "686fa0cc-92f2-4285-a839-f182c3745c00",
"nFIPv4Address": "192.168.1.76",
"nFIPv6Address": "192.168.1.76",
"nodeFunctionality": "SMF"
},
"invocationTimeStamp": "2019-08-13T16:10:11Z",
"invocationSequenceNumber": 1,
"multipleUnitUsage": [
{
"ratingGroup": 1,
"requestedUnit": {
"totalVolume": 10485760
}
}
]
},
"uri": "/nchf-convergedcharging/v2/chargingdata"
},
"response": {
"headers": {
"Connection": "keep-alive",
"Content-Length": "75",
"Date": "Thu, 21 Jan 2021 10:43:38 GMT",
"Location": "https://localhost:9099/nchf-convergedcharging/v2/chargingdata/171299012216803",
"Content-Type": "application/json"
},
"reason": "Created",
"recordType": "response",
"operationType": "Nchf_ConvergedCharging_Create",
"source": "NFConsumer",
"body": {
"invocationSequenceNumber": 1,
"invocationTimeStamp": "2019-08-13T16:10:11Z"
},
"statusCode": 201
}
}
Service Operation Name
The OperationName
field is determined by the request handler and
specific parameter conditions, such as HttpMethod
. Service Operation Names lists the names and combinations.
operationName Value | Handler | Conditions |
---|---|---|
Nchf_ConvergedCharging_Create | ChargingDataHandler | Operation=CREATE |
Nchf_ConvergedCharging_Update | ChargingDataHandler | Operation=UPDATE |
Nchf_ConvergedCharging_Release | ChargingDataHandler | Operation=DELETE |
Nchf_SpendingLimitControl_Subscribe | SpendingLimitControlSubscriptionHandler | HttpMethod=POST |
Nchf_SpendingLimitControl_Update | SpendingLimitControlSubscriptionHandler | HttpMethod=PUT |
Nchf_SpendingLimitControl_Unsubscribe | SpendingLimitControlSubscriptionHandler | HttpMethod=DELTE |
Request/Response Body
The Kafka producer attempts to parse the body of a request or response to include in the record. Malformed Request Properties describes the properties used to handle a malformed JSON string.
Property | Description |
---|---|
bodyString | Holds the contents of the original malformed string body. |
For example, a non-JSON request would produce a record similar to the following:
{
"headers": {
"Accept": "*/*",
"Connection": "keep-alive",
"User-Agent": "PostmanRuntime/7.26.8",
"Postman-Token": "d43b8b6c-3c1c-412d-afb3-d1ef7d4be305",
"Host": "localhost:9098",
"Accept-Encoding": "gzip, deflate, br",
"Content-Length": "444",
"Content-Type": "application/json"
},
"method": "POST",
"recordType": "request",
"body": {
"bodyString": "{\n subscriberIdentifier\" : \"imsi-15\",\n \"nfConsumerIdentification\" : {\n \"nFName\" : \"686fa0cc-92f2-4285-a839-f182c3745c00\",\n \"nFIPv4Address\" : \"192.168.1.76\",\n \"nFIPv6Address\" : \"192.168.1.76\",\n \"nodeFunctionality\" : \"SMF\"\n },\n \"invocationTimeStamp\" : \"2019-08-13T16:10:11Z\",\n \"invocationSequenceNumber\" : 1,\n \"multipleUnitUsage\" : [ {\n \"ratingGroup\" : 1,\n \"requestedUnit\" : {\n \"totalVolume\" : 10485760\n }\n } ]\n}\n"
},
"uri": "/nchf-convergedcharging/v2/chargingdata"
}