TM Forum Community

 View Only
  • 1.  Querying in TMF677 - Usage consumption management API

    TM Forum Member
    Posted Jun 05, 2023 05:48

    Hi.

    In TMF677, There are two get APIs for retrieving and listing usage consumptions. For these two APIs, the querying mechanism is a bit confusing. In the specification, the example is given like this:
    GET /tmf-api/usageConsumption/v4/queryUsageConsumption?relatedParty[?(@referredType==Individual)].id=USER11333
    But in the topic header is given like: GET /queryUsageConsumption?fields=...&{filtering}
    Both queries are different when compared. Please let me know how querying can be implemented in this API. Thank you.


    #General

    ------------------------------
    Suganthan Chandrasekaran
    Blueoceandigital India Pvt Ltd
    ------------------------------


  • 2.  RE: Querying in TMF677 - Usage consumption management API

    TM Forum Member
    Posted Jun 06, 2023 02:40
    Edited by Vance Shipley Jun 13, 2023 23:02

    The TMF677 API provides one REST resource collection: /queryUsageConsumption 

    This is a collection of Task Resource entities. See TMF630 REST API Design Guidelines Part 1, Chapter 8. Task Resource Pattern.

    Each Task Resource entity represents a task which is run on the system producing the API.  You create a new entity with a POST operation to the Task Resource collection. The Task Resource Pattern supports both synchronous and asynchronous tasks.

    In the asynchronous case the response would have status code 202 Accepted and include the Location: header providing the URL of the newly created entity. The task may be retrieved later and the status attribute inspected to determine when it is complete.

    In the synchronous case the response would have status code 200 OK

    In both cases the Task Resource entity (i.e. QueryUsageConsumption) represents the task, including it's state, input and output. It seems that TMF677 only defines a synchronous model (it is missing the status attribute). For TMF677 the input for the task is provided in the searchCriteria attribute of the POST body. while the output is provided in the usageConsumption attribute of the response.

    The two GET operations you refer to are basically irrelevant in the synchronous model.  The first queries the Task Resource collection and the second retrieves a specific Task Resource.  These would be things you may do with an asynchronous model.



    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------