Open APIs

 View Only
  • 1.  Query regarding creating resource asynchronously

    TM Forum Member
    Posted Nov 30, 2020 16:01
    Hi,

    As per the Create Resource Patterns in TMF630_REST_API_Design_Guidelines_3.0_Part_1 _R17.5.1 - "If operation is async, a Monitor resources MUST be returned."
    And the monitor resource attributes contain "href - The reference to this monitor" and "sourceHref - The monitored resource href"

    Question - Can the monitored resource (i.e. sourceHref) itself be queried back to track the progress of the operation i.e. without creating an explicit monitor resource ? 
    I am trying to understand the need for an explicit monitor resource. Can you please clarify ?

    Thanks,
    Jeevan Mohite

    ------------------------------
    Jeevan Mohite
    BT Group plc
    ------------------------------


  • 2.  RE: Query regarding creating resource asynchronously

    Posted Dec 02, 2020 12:58
    Hi Jeevan,

    If you query sourceHref, you could only find out if the operation is completed or not.
    For example, for a GET /sourceHref following a POST (create single resource), I would expect the server to return either 404 (if creation is still in progress) or 200 (if creation has been completed).

    The monitor can provide much more detailed status (such as queued, validated, approved, %X completed, etc.), depending on the implementation.

    You may also check out the "Notification Patterns" section of the design guidelines, if you haven't yet.

    P.S. There is a newer version (4.0.0) of design guidelines.

    Regards,

    ------------------------------
    Şanver Narin
    PiA-TEAM INC.
    ------------------------------



  • 3.  RE: Query regarding creating resource asynchronously

    TM Forum Member
    Posted Dec 03, 2020 05:18
    Hi Jeevan,
    There are benefits in using Monitor pattern as Sanver was also suggesting. However, please have a look at the Notification pattern which is yet another way of informing what happening with the resource due to the async process.
    As you were asking about look at the resource to determine the progress, this may not be a scalable approach to perform GET on the resource to understand the progress of the async request.

    ------------------------------
    Varun Nair
    Telstra Corporation
    Note: This is an opinion based on my research and not an official TMF response.
    ------------------------------