A RESTful Web Service Interface to the ATLAS COOL Database



Similar documents
Designing RESTful Web Applications

Cyber Security Challenge Australia 2014

XML Processing and Web Services. Chapter 17

REST web services. Representational State Transfer Author: Nemanja Kojic

A Model of the Operation of The Model-View- Controller Pattern in a Rails-Based Web Server

WIRIS quizzes web services Getting started with PHP and Java

General principles and architecture of Adlib and Adlib API. Petra Otten Manager Customer Support

Getting Started with the icontact API

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

Web Services Tutorial

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Sage CRM Connector Tool White Paper

FileMaker Server 9. Custom Web Publishing with PHP

SIM Configuration Guide. February 2015 Version 1 Document Reference: 8127

Technical documentation

API documentation - 1 -

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

FileMaker Server 15. Custom Web Publishing Guide

Distribution and Integration Technologies

Webmail Using the Hush Encryption Engine

Cloud Powered Mobile Apps with Microsoft Azure

FileMaker Server 14. Custom Web Publishing Guide

Drupal CMS for marketing sites

Server-side Development using Python and SQL

Web Development using PHP (WD_PHP) Duration 1.5 months

Abstract. Description

Terms and Definitions for CMS Administrators, Architects, and Developers

This section will describe the different functions that can be used by the Interspire Marketer XML API.

HTTP - METHODS. Same as GET, but transfers the status line and header section only.

Performance Testing for Ajax Applications

REST vs. SOAP: Making the Right Architectural Decision

10CS73:Web Programming

IBM DB2 XML support. How to Configure the IBM DB2 Support in oxygen

FileMaker Server 13. Custom Web Publishing with XML

The end. Carl Nettelblad

A Comparison of Service-oriented, Resource-oriented, and Object-oriented Architecture Styles

Other Language Types CMSC 330: Organization of Programming Languages

Short notes on webpage programming languages

Network Activity D Developing and Maintaining Databases

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

Web Design Technology

Cloud Elements! Marketing Hub Provisioning and Usage Guide!

ASP.NET Using C# (VS2012)

JobScheduler Web Services Executing JobScheduler commands

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Portals and Hosted Files

Building native mobile apps for Digital Factory

MAIL1CLICK API - rel 1.35

About This Document 3. Integration and Automation Capabilities 4. Command-Line Interface (CLI) 8. API RPC Protocol 9.

DIPLOMA IN WEBDEVELOPMENT

Architecture and Mode of Operation

An Oracle White Paper June RESTful Web Services for the Oracle Database Cloud - Multitenant Edition

IT6503 WEB PROGRAMMING. Unit-I

Intruduction to Groovy & Grails programming languages beyond Java

Leveraging Cloud Storage Through Mobile Applications Using Mezeo Cloud Storage Platform REST API. John Eastman Mezeo

AdFalcon Mobile Web API Integration Developer's Guide. AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group

Cite My Data M2M Service Technical Description

CERTIFIED MULESOFT DEVELOPER EXAM. Preparation Guide

Cloud Elements! Events Management BETA! API Version 2.0

Project 2: Web Security Pitfalls

ConvincingMail.com Marketing Solution Manual. Contents

Cloud Elements ecommerce Hub Provisioning Guide API Version 2.0 BETA

Application note: Connecting the to a Database

Pentesting Web Frameworks (preview of next year's SEC642 update)

Chapter 22 How to send and access other web sites

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

Cloud Powered Mobile Apps with Azure

Manage Workflows. Workflows and Workflow Actions

metaengine DataConnect For SharePoint 2007 Configuration Guide

Ruby on Rails Secure Coding Recommendations

Databricks Cloud Platform Native REST API 1.0

Overview Document Framework Version 1.0 December 12, 2005

70-487: Developing Windows Azure and Web Services

X-POS GUIDE. v3.4 INSTALLATION SmartOSC and X-POS

Using Netbeans and the Derby Database for Projects Contents

Databricks Cloud Platform Native REST API 1.1

Qlik REST Connector Installation and User Guide

FileMaker Server 13. Custom Web Publishing with PHP

Microsoft.Realtests v by.ERICA.50q

ANDROID APPS DEVELOPMENT FOR MOBILE GAME

Why API? Using the REST API in an education environment. JAMF Software, LLC

Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5

WebSphere Commerce V7 Feature Pack 5

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Developing Microsoft SharePoint Server 2013 Advanced Solutions. Version: Demo. Page <<1/8>>

Programming Autodesk PLM 360 Using REST. Doug Redmond Software Engineer, Autodesk

Using the vcenter Orchestrator HTTP-REST Plug-In 1.0.x

EZcast technical documentation

Bubble Code Review for Magento

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com

Anne-Catherine Le Bihan Antonio Pierro. Big thanks to Vincenzo Innocente for his help

Up and Running with LabVIEW Web Services

OData in a Nutshell. August 2011 INTERNAL

Axway API Gateway. Version 7.4.1

How To Use Query Console

Transcription:

A RESTful Web Service Interface to the ATLAS COOL Database Shaun Roe CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 1

COOL (see talk by A. Valassi, this conference) COOL: A database schema and API designed to be technology neutral (Oracle/MySQL/SQLite) Data structure is hierarchical: Originally in C++, its methods are exposed in Python, in the PyCool module. High Voltage values from the Detector Control System of Atlas SemiConductor Tracker http://lcgapp.cern.ch/doxygen/cool/cool_2_6_0/doxygen/html/ CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 2

RESTful REST noun verb e.g. sending a form e.g. A browser normally GETs a web page 404 Not Found Accept: text/html REpresentational State Transfer Roy Fielding s dissertation: http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 3

Motivation Rewind to 2006 People want data from Cool on the web! Solutions: Use their own SQL from PHP/Python Use a shell script to set up environment, then run the Cool api behind some custom code Use a cron job to generate local html files..and people want to insert data from the web, too. CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 4

Aim: Universal Web Service Identify resources with url e.g. http://server/database/schema/dbname/some/folder/path/timespan/0-100/channels/23 Accept: text/xml Use xml as the data transport format. GET retrieves the values POST creates the channel in a folder PUT updates the channel DELETE deletes the channel from the folder Multi-channel uploads/downloads should be possible. DB Modification should be protected. Additional resources to be matched to a url: Database nodelist, folder description, folder payload definition, list of channels in a folder, list of tags; it should be possible to create and delete databases, folders. CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 5

Data format: XML <channels server="atlas_coolprod" schema="atlas_coolofl_dcs" dbname="comp200" folder="sct/dcs/ CHANSTAT" since="1226271600000000000" until="1226274125000000000" tag="" version="single > <channel id="138950656" since="1226270581000000000" until="1226274125000000000"> <value name="lvchstat_recv">193</value> <value name="state">17</value> </channel> <channel id="138950656" since="1226274125000000000" until="1226277728000000000"> <value name="lvchstat_recv">193</value> <value name="state">17</value> </channel> </channels> XML Schema Description Definition of an XSD schema allows validation of data format on upload, or type-ahead and documentation tooltips in an editor: What about JSON? (see later) Namespaces? JavaScript Object Notation (oxygen editor) CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 6

Implementation: CherryPy www.cherrypy.org CherryPy is a Python application server. It is very easy to install and use. The Routes module (from Ruby) allows automatic or manual mapping of Python classes and methods to URLs: d.connect('folder_payload','/:server/:schema/:dbname/*folderpath/ payload',controller=restcontroller,action='folderpayload ) maps this http://myserver.cern.ch/cooldb/atlas_coolprod/atlas_cool_sct/dcsp200/sct/dcs/hv/payload to this def folderpayload(self, server, schema, dbname, folderpath): The http headers and the methods are also available and can be used to route the URL to the appropriate Python method; other modules for security, caching etc are available. CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 7

Examples, curl Command line examples http://curl.haxx.se/ CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 8

In the wild examples /** * @author formica */ public class CherryPyClient { private String name = "user.name"; private String psswd = "mypass"; private String readnodeurl = "http://server/atlas_sct_commcond_dev/roetest/branch/trial1/payload"; private String writenodeurl = http://server/atlas_sct_commcond_dev/roetest/branch/trial1/timespan/0-100; public String coolgetcherrypy() { try { URL url = new URL(this.readnodeUrl); java.net.urlconnection conn = url.openconnection(); InputStream is = (InputStream) conn.getinputstream(); BufferedReader in = new BufferedReader(new InputStreamReader(is)); String inputline = in.readline(); is.close(); return inputline; } } catch (Exception e) { e.printstacktrace(); } return "none"; httpheaders={'accept':'text/xml'} textdata=none request=urllib2.request(url,textdata, httpheaders) u=urllib2.urlopen(request) xmldocstring = u.read() return xmldocstring $header=array('accept: text/xml'); // $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER,$header); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $format=requested_format(); $http_result = curl_exec($ch); if ($format!= 'text/xml'){ $dom=domxml_open_mem($http_result); } curl_close($ch); CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 9 PHP

Example: Run List Search for runs matching criteria, display results; Uses an Ajax request to get the CherryPy XML. XML is inserted directly in the XHTML page, and associated with an XSLT stylesheet to format it as a table Client-side Local server side extensible Stylesheet Language for Transformations CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 10

Plans, conclusion Use of CherryPy allowed rapid development of a web service interface to Cool which greatly simplified conditions access and adheres to RESTful principles. It was used during 2008 as the engine for the run list query page, for various dcs retrieval services, and for insertion of detector status and calibration data; its adoption is growing as a part of web information collations in the detector subsystems. Future extensions include extra methods for tag viewing, and more flexible output format (e.g. JSON, zipped format ) CHEP'09 Prague A RESTful Web Service... (Shaun Roe, Atlas) 11