RHub & Notification Framework Post Deployment Activities

This section covers the Post Deployment steps for RHub on PAAS:

Contents

  1. RHub on PAAS - Deployment Engineer Activities
    1. Setup WAF rules
    2. Values for default RHub instance
    3. Notification Framework
  2. RHub on PAAS - Installation Engineer Activities
    1. Notification Framework
    2. Create User data store (UDS) objects in the environment
  3. Appendix
    1. File structure and details of RHub Configuration
      1. Swagger URLs for APIs

RHub on PAAS - Deployment Engineer Activities

Setup WAF rules

Following patterns of URL has to be added in the Application Gateway WAF policy for the core platform.

Please fine the following screenshot for reference.

Execute the Sync operation once this is done to make sure the communication in between applications is works fine.

Values for default RHub instance

During the start up of the CHub application, its creating a RHub default instance. The values for creating default instances are:

Notification Framework

Steps to be done in the target environment:

Setup Offline Token

RHub on PAAS - Installation Engineer Activities

Notification Framework

  1. The notification framework APIs will be available in the platform as part of the deployment. Please note that the Notification framework is not integrated with any of the applications.

  2. In order to test the notification framework apis, the Rhub should be synced with a valid inapp flow.

  3. Please refer the attached configuration json to create a flow in rhub.configuration json

  4. Please do the following modification in the rhub configuration file before adding it to the configuration text area. Details about the rhub configuration file is explained in the Appendix section.

    1. In the adapters section change the URL of all the adapters into the respective environment’s url. For example, the URL for oauth_basic adapter

    2. In the queue adapter section, we are configuring a flow to insert the notification into the InApp database collections.

      • Change the queue_host url to respective environment’s URL. The value of queue_host is used to generate the connection string to establish connection to rabbitmq.

        • In DEV - amqp://admin:j5c6ym6nFm8M2Yia@smartopsv1-dev03-rabbitmq:5672

        • In QA - amqp://admin:j5c6ym6nFm8M2Yia@smartopsv1-qa01-rabbitmq:5672

        • In Stage - amqp://admin:j5c6ym6nFm8M2Yia@smartopsv1-<<>>-rabbitmq:5672

        • In Prod - amqp://admin:j5c6ym6nFm8M2Yia@smartopsv1-<<>>-rabbitmq:5672

      • The flow_url is used to execute a flow to POST a notification to the InApp notification collections. So the flow_url should be defined in the flow section of the configuration and it should be used in the queue adapter. Change the flow_url to respective environments valid url. For example

      • The url parameter is used to configure the api to be called when the flow is executed to insert notification to the InApp notification database. The API URL should be valid url of the InApp Notification’s POST Notification API.

Create User data store (UDS) objects in the environment

 

Appendix

File structure and details of RHub Configuration

Rhub configuration is the json file which keeps the settings of RHub and adapters. It stores the declaration of adapters, flow configuration.

Sample queue configuration 

  "queue2": { 

    "queue_host": "amqp://username:password@<<env>>-rabbitmq:5672/notification", 

    "queue_type": "rabbit", 

    "queue_name": "email", 

    "flow": "send mail flow", 

    "flow_url": "https://<<hostname>>/orchestrator/rhub/execute/send_mail_flow", 

    "payload": { 

      "executionId": "email", 

      "correlationId": "email", 

      "input_array": [ 

        { 

          "message": "$input.body.message", 

          "to": "$input.body.meta", 

          "subject": "$input.body.subject" 

        } 

      ] 

    }, 

    "sensitivePayload": { 

      "api_token": "jwt generated by notification framework", 

      "token": "Basic amF5OmhlbGwwd29ybGQ=" 

    }, 

    "attachments": {} 

  } 

send_email adapter configuration

"send_mail": { 

    "id": "send_mail", 

    "url": "http://smartopsv1-<<env>>-rhub-adapters-send-mail-rest:9001", 

    "state": { 

      "is_trigger": false, 

      "email_config": { 

     "API-Key": "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", 

        "sender": "smartopsnotifications@gmail.com" 

      } 

    }, 

    "meta": { 

      "storage_credentials": [ 

        { 

          "username": "send_mail", 

          "password": "liamdnes", 

          "acls": { 

            "read": true 

          } 

        } 

      ] 

    } 

  } 

 

Sample flow for send email 

  "id": "send_mail_flow", 

  "required-role": [ 

    "admin", 

    "cms_processor" 

  ], 

  "auth": { 

    "adapterId": "oauth_basic", 

    "source": "oauthadapter", 

    "sensitivepayload": { 

      "token": "$input.body.sensitivepayload.token" 

    } 

  }, 

  "variables": { 

    "API-KEY": "https://covid-19-data.p.rapidapi.com/totals", 

    "key2": { 

      "dateparam": "20/02/20201", 

      "subkey2": "value" 

    } 

  }, 

  "steps": [ 

    { 

      "id": "step_1", 

      "type": "SYNC", 

      "adapterId": "send_mail", 

      "name": "invoke sync1", 

      "description": "", 

      "payload": { 

        "response": { 

          "data": "json" 

        }, 

        "headers": {}, 

        "input_array": "$input.body.payload.input_array" 

      }, 

      "sensitivepayload": {}, 

      "executionId": "$input.body.payload.executionId", 

      "correlationId": "$input.body.payload.correlationId", 

      "attachments": [] 

    } 

  ], 

  "type": "SYNC", 

  "responsepayload": { 

    "correlationId": "$step.step_1.correlationId", 

    "mailresponse": "$step.step_1.payload.response.data" 

  }, 

  "responseStatus": {} 

Please don’t make any change in the username & password of any adapters, rhub components. This is one of the item we are planning in the upcoming releases.

Swagger URLs for APIs