Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content
  • Meter Data Service API Mock for TIBCO Cloud? Integration


    Deepesh Tiwari

    Table of Contents

     


    Meter Data Service API Mock creation to get quickly a validation Service. This Service will be used by the Customer On-Boarding TIBCO Cloud? Live Apps Sample to validate Meter Data.

    API Spec

    The full Swagger is stored on Git Hub, and available for Import into your TIBCO Cloud? Account: https://github.com/JGrotex/TCIAPIspecSamples/blob/master/MeterService_1498804832664.json

    REST Service Request

    Allows to request a single Meter by Serial Number {sn}

    1.thumb.png.2d7d1528e0c6fb75b44bd0e6372094ed.png

    REST Service Response

    Returns a single Meter with Serial Number and Type (just an example, feel free to add more Details), in case the Meter is not found there is a specific Response (204) with no Data defined.

    2.thumb.png.fd42bf569a5de2b7ee1775524ab23f00.png

    Mock App creation

    To create the Mock App from the API Spec, just click in the List of API's on "..." (Table right) and the Context Menu allows you to Create the Mock App ...

    3.png.fbb583bf1bcc3e21d401c1352a7d6baf.png

    Advanced Response Definition

    Switch to Advanced Mock, to not always just get the same response from the Service Mock. 

    4.thumb.png.3078d5d6f76a8aff8dd1f0ee2f3750a7.png

    Script to copy, any maybe you like to extend it with some more different responses ...

     if(req.params.sn=="123") {      res.status = 204;   } else {     res.status = 200;      res.body = {sn:req.params.sn, type:"Energy"};   }    return res; 

     

    Testing

    As a next step the Advanced Mock App can be tested using the Endpoint - View API URL

    5.thumb.png.8ff627f906d1938b972a7d1be49fad78.png

    Metrics

    Finally there are some Metrics and Logs available for the Mock App, but they are les important for testing.

    6.thumb.png.81e92742e295e8d95b2f44ac03ac66de.png

    tomainsamplepage_4.png.368517736c13c04e2044154c974c3379.png


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...