How to interact with a REST API to generate notifications

Assignment Help Programming Languages
Reference no: EM132285559

Assignment -

Objective: The goal of this problem is to allow engineers to learn how to interact with a REST API to generate alarms /notifications (in this case, the problem will generate an email) to a platform. Also, this exercise also allows you to learn how to include an HTTP URL report within the notification (email or alarm) so the operator can understand the notification and take actions that provides notification. In addition, you will learn how extract/read the data from a postgres databases.

We will continue using the same EPA dataset we used before for our first problem to facilitate focus on the key learnings. This dataset has 332 probes which report Sulfate and Nitrate particulate measurements in the air (the unit of the measurement is not important, thus ignore). The clean data is hosted on a postgres database - read the section "Reading Data from Postgres database using R" to learn how to access the data.

Read before attempting the problem: Assume EPA announced that it had set the limits for sulfate and nitrate in the air as follows:

sulfate_thresh = 30

nitrate_thresh = 40

It has asked the developers to create an application that monitors the measurement files and report an alert to a central location when probes report sulfate and nitrate levels above the EPA specified thresholds.

Your job is to create an application that will generate an email notification through a REST API. The application will use an "Event Router" that will facilitate the creation of the email notification. The event router MUST receive a JSON document from your application using HTTP POST with a particular format shown below.

{

"email_addr":["your_email_address@"],

"event_id":"65",

"lcc_id":"list of probes exceeding EPA limit",

"node_id":"probe ID exceeding sulfate limit: [list of comma delimited probes] probe ID exceeding nitrate limit: [list of comma delimited probes]",

"opt_data":{

"field1":"Report url",

"field2":"insert URL of Shiny report "},

"site_id":"dummy"

}

REST API (Event Router): has developed an Event Router that provides a REST API to generate alarms & events to the operator (or emails) based on HTTP POST interactions. We will use this tool for this exercise.

Reading Data from Postgres database using R

When developing production application most of the time data will be hosted on a database. You should know how to access data from a database. In this exercise you will be retrieving the data from postgres database. You will be using "RPostgreSQL" package to access the database.

Problem - USE Shiny APP

Create the following 2 applications (Note you could write this in a single app if you like)

1. An R application which generates an email notification after processing all specdata files and provides a URL link with full reporting (output of the shiny app; 2nd application) for the operator

2. An R shiny app which provides full reporting for the specdata. This task will require you to create the shiny app which expose a URL on your local computer. This URL is the address to be included in the JSON document posted to the API. Below is a quick example of the Shiny App. Be creative in a way that you want to create the reporting. This is just an example.

a. HTML text at the beginning to show the probe ID which are exceeding EPA limits

b. Slider to select the probe ID

c. Which renders a reactive plot with trend of sulfate and nitrate over time - showing EPA threshold line.

Attachment:- Assignment File.rar

Reference no: EM132285559

Questions Cloud

Decision making are two benefits of effective communication : Stronger business relationships and stronger decision making are two benefits of effective communication.
Justify a change implementation plan for leading the change : Justify a change implementation plan for leading the change initiatives and helping the organization overcome any resistance to the changes.
Compare three common types of production processes : Two former surfers invented a material for surfboards that's lighter and stronger than anything manufacturers now use.
Define role of nurse in healthcare program implementation : What is the role of the nurse in healthcare program implementation? How does this role vary between design and implementation of healthcare programs? Can you.
How to interact with a REST API to generate notifications : The goal of this problem is to allow engineers to learn how to interact with a REST API to generate alarms /notifications to a platform
Important for use in making business decisions : Provide at least three relevant probabilities for the leader that will be important for use in making business decisions.
Politicians to set-up assistance for appalachia : In Chapter 14 of your textbook, Ronald Eller discusses the many initiatives by politicians to set-up assistance for Appalachia at both the state and federal
Decision-making and role of the organizational leader : Discuss the importance of decision-making and the role of the organizational leader.
What are the dimensions of team leadership : What is team leadership? What are and include examples of situations where it is frequently used? What are the dimensions of team leadership?

Reviews

len2285559

4/16/2019 11:36:06 PM

Need help with code for 2 problems; I understand some code will be missing due to privacy. Just use examples when needed. Looking for code structure of both problems. Need explanation of code. Using R studio., The event router MUST receive a JSON document from your application using HTTP POST with a particular format shown below. NOTE: Do not change the value of “event_id” as this is a key field for the event router to identify the JSON structure and generate the email accordingly. When developing production application most of the time data will be hosted on a database. You should know how to access data from a database.

Write a Review

Programming Languages Questions & Answers

  Create nested menus interface for a check-in hotel

Create a nested menus interface for a check-in and check-out hotel reservation system that can be used internationally. Use numbers to select a menu item.

  Develop pseudo-code for program to retrieve bytes

Develop the pseudo-code for a program that will retrieve 2 bytes (NUM1 and NUM2) from memory, determine which is closest to the numeric value 50.

  Develop an algorithm to move partially dead code

Develop an algorithm to move partially dead code, so expressions are evaluated only where they will eventually be used.

  Write program to permit user to enter last names

Write down the program which permits the user to enter last names of five candidates in local election and number of votes received by each candidate.

  Design-write program to enter score repetition structure

Design and write a program that asks the user to enter five test scores using a repetition structure. The program should display the letter grade for each score and the average test score at the end of the program.

  Write a program that will prompt for and read in a list

Write a program that will prompt for and read in a list of up to ten computer store names and the corresponding price that each store charges for a particular model of PC

  Create class to store the product name

Choose a fruit or vegetable product that you might commonly find at the farmers market (for example, tomatoes, potatoes, lettuce, apples, cantaloupes, etc). Create a class that stores the product name.

  Program for class quiz to implement measurable interface

State a class Quiz to implement Measurable interface. A quiz has a score and a letter grade (such as B+).

  Write program that will allow two users to play tic-tac-toe

BIS 320- Write a program that will allow two users to play tic-tac-toe. The program should ask for moves alternatively from player X and player O.

  Create an object oriented application to handle inventory

Working at the GM used car dealership you need to create an object oriented application to handle inventory. To start you create a detailed uml diagram that helps to plan your solution.

  The basics of multi-process application development

To master the basics of multi-process application development. To appreciate the performance and fault-tolerance bene_ts of multi-process applications.

  Program to read an employee-s number from keyboard

Write a program that reads an employee's number from the keyboard, number of hours worked and an hourly rate of pay.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd