TC2.25 - Registering external MicroService calling RestCall services, using it on IOT applications

Test Case Title

TC2.25 - Registering external MicroService calling RestCall services, using it on IOT applications

Goal

I can:

Register an external service as a Rest Call

Create a microservice starting from a rest call of an external MicroService

build IoT applications using Microservices performing RestCall in simple manner

Prerequisites

Using a PC or Mobile with a web browser.

Simple skill on use IotBlocks on Nodered.

The following functionalities are available only for specific Snap4city users with specific privileges.

Expected successful result

Being able to implement your IoT application quickly and easily

   

 

Example 1: Create a Microservice from an external Rest Call (Method Get No Authorization)

  1. For this example we use the Rest Call https://servicemap.disit.org/WebAppGrafo/api/v1/feedback/last/, a Smart City API to request the last feedback sent by the users to service map.
  2. The Rest Call needs as parameters the format of the response and the language of the user.
  3. To create the microservice,  make the login on the snap4city portal
  4. Click on the ‘Resource Manager: Process Loader > MicroServices fot IOT Applications’ menu to view all own resources and the related metadata
  5. Click on the Button (‘Add Microservice') button

Fig: Upload button.

  1. A pop up will open: fill the fields and press the ‘Confirm’ button. For example, if you want to create a Microservice:
  2. When the confirm button is clicked the Microservices is created and a Final User can contact the administrator to insert the node inside the nodered interface:
  3. The administrator make the Microservice accessible to the user:
  4. And in this example we create a simple flow to show the functionalities offers by this microservice. Inserting these configurations:
  5. And create this simple flow:
  6. Pressing on the button of the node labelled as timestamp, in the debug tab it is possible to see the result of the Rest Call:


Example 2: Create a Microservice from a Rest Call (Method Get WITH AUTHORIZATION)

  1. Follow the previous example until the point 5.
  2. A pop up will open: fill the fields and press the ‘Confirm’ button. For example, if you want to create a Microservice:
    1. App Type: Microservice
    2. Description: Retrieve last tweet and retweet related to a channel
    3. Nature: Services
    4. Sub-Nature: Social Media
    5. Micro Service Title: twitter-last-channel
    6. Help: Retrieve last tweet and retweet related to a channel
    7. url: https://www.disit.org/rttv/query/select.php
    8. parameter: TwRtwChannel
    9. Method: GET
    10. Authentication: Yes

  1. When the confirm button is clicked the Microservices is created and a Final User can contact the administrator to insert the node inside the NodeRED interfaces
  2. The administrator make the Microservice accessible to the user:
  3. Differently to the previous node in this case in the configuration tab must be inserted also the username and the password to allow the access to the rest call
  4. Creating a simple flow like the previous:
  5. Pressing on the button of the node labelled as timestamp, in the debug tab it is possible to see the result of the Rest Call: