User manual Scilab Cloud API

Similar documents
User manual Scilab Cloud API

This project will use an API from to retrieve a list of movie posters to display on screen.

Accessing the Progress OpenEdge AppServer. From Progress Rollbase. Using Object Script

Working Bootstrap Contact form with PHP and AJAX

Nick Terkay CSCI 7818 Web Services 11/16/2006

Project Part 2 (of 2) - Movie Poster And Actor! - Lookup

LEARN HOW TO USE CA PPM REST API in 2 Minutes!

Xignite CloudStreaming overview

Dingle Coderdojo 6. Project Part 2 (of 2) - Movie Poster And Actor! - Lookup. Week 6

Ten good practices for ASP.NET MVC applications

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services

MIGRATING MOBILE APPS. How to migrate Rollbase and OpenEdge Mobile Apps to the Telerik Platform

Lab 03 Finish and Deploy an Application. Lab 3-1: Add DELETE to the Spring Boot REST Application

Asema IoT Central Integration and migration. English

Viostream Upload Widget

Mixed Signals Using Fusion s Signals API

SCRIPT REFERENCE. UBot Studio Version 4. The Browser Commands

AT&T Smart Cities With M2X & Flow Designer

Ajax- XMLHttpResponse. Returns a value such as ArrayBuffer, Blob, Document, JavaScript object, or a DOMString, based on the value of

Topic: Google Drive. Instructional Technology Services Google Drive Faculty Help. Required information for Google account:

UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2016 EXAMINATIONS. CSC309H1 S Programming on the Web Instructor: Ahmed Shah Mashiyat

A WEB APPLICATION FOR ONLINE POLLING. A Thesis. Presented to the. Faculty of. San Diego State University. In Partial Fulfillment

Sticky Notes for Cognos Analytics by Tech Data BSP Software

WP Voting Plugin - Ohiowebtech Video Extension - Youtube Documentation

Key Challenges with the Current RFQ Process

Weather Report in SAP ByDesign

Salesforce IoT REST API Getting Started Guide

Valkyrie REST Server

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER Hypermedia API Tools for Sling (HApi) Andrei Dulvac, Adobe

Coveo Platform 7.0. Yammer Connector Guide

INTRODUCTION TO WEB DEVELOPMENT IN C++ WITH WT 4

Assignment: Seminole Movie Connection

EPHP a tool for learning the basics of PHP development. Nick Whitelegg School of Media Arts and Technology Southampton Solent University

EMARSYS FOR MAGENTO 2

Web 2.0 Attacks Explained

jquery Basic HTTP communication

Design Document V2 ThingLink Startup

owncloud Android App Manual

PROCE55 Mobile: Web API App. Web API.

WorldSpace Attest Quick Start Guide

Paythru Remote Fields

SharePoint 2013 CRUD on List Items Using REST Services & jquery

Getting Started with the ArcGIS Server JavaScript API

IBM Lotus Quickr Customization

Adobe Marketing Cloud Best Practices Implementing Adobe Target using Dynamic Tag Management

Unable To Access An Error Message. Corresponding To Your Field Name. Codeigniter >>>CLICK HERE<<<

FREE AJAX SUITE. User Guide FOR MAGENTO 2. Version: Release Date: Product Page: Ajax Suite. Support:

Making a live edit contact list with Coldbox REST & Vue.js

This document is published by Appiyo Technologies Pte., Ltd., without any warranty.

REST API Developer Preview

PHP. MIT 6.470, IAP 2010 Yafim Landa

Lab 4: create a Facebook Messenger bot and connect it to the Watson Conversation service

Tutorials Php Y Jquery Mysql Database Without Refreshing Code

0. Introduction On-demand. Manual Backups Full Backup Custom Backup Store Your Data Only Exclude Folders.

Errors Message Bad Authentication Data Code 215 User_timeline

ExtraHop 7.3 ExtraHop Trace REST API Guide

Zumobi Brand Integration(Zbi) Platform Architecture Whitepaper Table of Contents

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

ArcGIS for Server Administration API for C# Developers. Philip

DreamFactory Security Guide

Elementary! Incorporating BlueMix, Node-RED and Watson in Domino applications

Quant Investment Analytics on Google Sheets (Cloud Analytics) VBA to Google Apps Script Cloud based financial engineering solutions

Integrating the Quotation page with your site

SLI Learning Search Connect For Magento 2

We currently are able to offer three different action types:

PostgreSQL as REST API Server without coding. Priya

Microsoft. Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lab 1: Getting Started with IBM Worklight Lab Exercise

Description: This feature will enable user to send messages from website to phone number.

Session 5. Web Page Generation. Reading & Reference

Black Box DCX3000 / DCX1000 Using the API

Spring Data JPA, Spring Boot, Oracle, AngulerJS 적용게시판실습 게시판리스트보기.

StorageGRID Webscale NAS Bridge Management API Guide

WeChat Adobe Campaign Integration - User Guide

IBM Bluemix Node-RED Watson Starter

Ninox API. Ninox API Page 1 of 15. Ninox Version Document version 1.0.0

Sparrow Client (Front-end) API

GEL Scripts Advanced. Your Guides: Ben Rimmasch, Yogesh Renapure

Jquery Ajax Json Php Mysql Data Entry Example

The Now Platform Reference Guide

WebSphere Puts Business In Motion. Put People In Motion With Mobile Apps

HCA Tech Note 502. HCA Cloud Developer Access (as of 12-April-2018)

CSS (Cascading Style Sheets)

Developing ASP.NET MVC 5 Web Applications

Chapter6: Bootstrap 3. Asst.Prof.Dr. Supakit Nootyaskool Information Technology, KMITL

Creating Organization Charts for IBM Connections using JavaScript and Google Charts

20486-Developing ASP.NET MVC 4 Web Applications

Qlik Analytics Platform

Performance Platform Documentation

Composer Help. Web Request Common Block

Web Development and HTML. Shan-Hung Wu CS, NTHU

Installation & Configuration Guide Enterprise/Unlimited Edition

IBM Image-Analysis Node.js

uick Start Guide 1. Install Oracle Java SE Development Kit (JDK) version or later or 1.7.* and set the JAVA_HOME environment variable.

CS 498RK FALL RESTFUL APIs

Lecture 7. Action View, Bootstrap & Deploying 1 / 40

Alteryx Technical Overview

Graphing Data from MYSQL By Javier Montiel Urbina


Methods to Transmit LabView Data to Google Sheet

Transcription:

User manual Scilab Cloud API Scilab Cloud API gives access to your engineering and simulation knowledge through web services which are accessible by any network-connected machine. Table of contents Before deployment... 2 Model your algorithms with Scilab function... 2 Package your functions in a toolbox... 2 Upload your functions through Scilab Cloud... 3 Integration of the API in a third part code... 5 Data management on Scilab Cloud... 6 URL to call the web service... 6 Integration in a web application... 7 Authentification... 7 Function call... 8 Debugging... 9 Integration in Google Spreadsheet... 10 Add a picklist... 10 Add Macros, Menu, and Scilab Custom functions... 10 1 Scilab Cloud API User Manual v3 2017-03-19

Already selected by clients such as Sanofi, Scilab Cloud allows you to: - Easily collaborate with colleagues and partners who don t need to master Scilab - Centralize your data and your algorithms - Protect the intellectual property of your simulation and post-processing codes - Simplify and control your application or API deployment Before deployment Model your algorithms with Scilab function Write each function that you want to expose as a web service, in a separate script file with the extension.sci. This script has to start with the command function and ends with the command endfunction. For more details on how to write functions in Scilab: https://help.scilab.org/doc/5.5.2/en_us/functions.html Package your functions in a toolbox In order to distribute the Scilab functions called from Scilab Cloud API, the developer of the functions will need to follow a formalism in the development of its code. The functions written in Scilab will need to be packaged in our ATOMS format (AuTomatic modules Management for Scilab), in order to expose the functions as web services. This view shows how the code is being structured on the side of the Scilab ATOMS toolbox. All the function need to be saved individually in.sci files in the macros folder. For more information on how to package your application in an ATOMS toolbox, please refer to this link: https://wiki.scilab.org/howto/create%20a%20toolbox 2 Scilab Cloud API User Manual v3 2017-03-19

Upload your functions through Scilab Cloud To access the Scilab Cloud administration interface, you have to contact the Scilab team and subscribe to a Scilab Cloud account: team@scilab.io This will give you access to the following administration interface: 3 Scilab Cloud API User Manual v3 2017-03-19

In the Web services menu, you will have the ability to upload new versions of your web service, in the format of a toolbox described previously. By clicking on settings on the production version, you can choose the functions to expose as a web service: 4 Scilab Cloud API User Manual v3 2017-03-19

Integration of the API in a third part code Any third part code can call your web service as a classic REST API, with a HTTP request at https://scilab.cloud/rest/auth Here is an example how to authenticate yourself with a shell command in your terminal: curl -v -H "Accept: application/json" -H "Content-type: application/json" -POST -d '{"email": "email", "password":"password"}' https://scilab.cloud/rest/auth After this phase of authentication, you have to include the token that you ve been delivered in every request that you make to the web service. This token is active for 1 day. The data send via the HTTP request should be provided as JSON (in the current version of Scilab Cloud API). Here is an example: data = { inputs: [ ["therm.sod"], [symbol], [Tstart, Tstep, Tend] ], files: ['/home/therm.sod'], token: token }; 5 Scilab Cloud API User Manual v3 2017-03-19

Data management on Scilab Cloud You can attach files to your HTTP request, that are located on your Scilab Cloud storage, to perform computation on those files. This is a view of your data management interface in your User profile: URL to call the web service There are two scenarios of use of your web service, depending on the stage of its life: Development version, to test your web service before setting it in production Production version, for your final end user, may they be humans or machines For the development version, the URL to provide is structure as followed: https://scilab.cloud/rest/<entity_name>/<toolbox_name>/<uri_version>/<function> In our example, it gives the following URL: https://scilab.cloud/rest/scilab/therm/2/symbol In the production version, the only different is that there are no <URI version> 6 Scilab Cloud API User Manual v3 2017-03-19

Integration in a web application In this example, we will detail how to integrate Scilab Cloud API with a web application written in html and javascript. Authentification Implementation in HTML <div class="col-md-offset-3 col-md-6 title">authentification</div> <div class="col-md-offset-3 col-md-2"> <input class="form-control" type="text" placeholder="email" id="inputuser"></input> </div> <div class="col-md-2"> <input class="form-control" type="password" placeholder="password" id="inputpassword"></input> </div> <div class="col-md-2"> 7 Scilab Cloud API User Manual v3 2017-03-19

<button class="form-control col-md-12 btn btn-primary" id="btnlogin">login</button> </div> Implementation in Javascript: var token; $('#btnlogin').click(function(e) { $('#btnlogin').text('login'); var addr = $("input:checked").val(); $('#inputs').text(''); $('#outputs').text(''); var data = { email: $('#inputuser').val(), password: $('#inputpassword').val() }; var start = new Date().getTime(); $.ajax({ url: addr + "/rest/auth", contenttype: 'application/json', method: "POST", data: JSON.stringify(data) }).done(function(v) { var end = new Date().getTime(); var time = end - start; $('#btnlogin').text('login (' + (time/1000) + ' s)'); token = v.token; $('#outputs').text(token); }).fail(function(v) { token = ''; $('#outputs').text('login failed'); }).always(function() { }); }); Function call Then you can add a simple button updating a list of items contained in the file therm.sod located in the data repository of the user: <button type="button" class="form-control btn btn-primary" id="btnupdate">update symbol list</button> 8 Scilab Cloud API User Manual v3 2017-03-19

$('#btnupdate').click(function(e) { $('#btnupdate').text('update symbol list'); var addr = $("input:checked").val(); var data = { inputs: [ ["therm.sod"] ], files: ['/home/therm.sod'], token: token }; $('#outputs').text(''); $('#inputs').text(json.stringify(data, null, 2)); var start = new Date().getTime(); $.ajax({ url: addr + "/rest/scilab/therm/symbol", contenttype: 'application/json', method: "POST", data: JSON.stringify(data) }).done(function(v) { var end = new Date().getTime(); var time = end - start; $('#outputs').text(json.stringify(v.outputs, null, 2)); $('#btnupdate').text('update symbol list (' + (time/1000) + ' s)'); $('#selectsymbol option').remove(); var opt = v.outputs[0]; for(var i = 0 ; i < opt.length ; ++i) { $('#selectsymbol').append('<option value="' + opt[i] + '">' + opt[i] + '</option>'); } }).fail(function(v) { $('#outputs').text(v.responsetext); }).always(function() { }); }); The result of this function is to feed the following fields with the data found in the file therm.sod Debugging The last part of every function described so far is to display in a textarea for debugging: 9 Scilab Cloud API User Manual v3 2017-03-19

<div class="container"> <div class="col-md-offset-2 col-md-4">inputs</div> <div class="col-md-4">outputs</div> <textarea readonly class="col-md-offset-2 col-md-4"id="inputs" style="font-family: monospace"></textarea> <textarea readonly class="col-md-4" id="outputs" style="font-family: monospace"></textarea> </div> Integration in Google Spreadsheet Add a picklist https://support.google.com/docs/answer/186103 Add Macros, Menu, and Scilab Custom functions https://developers.google.com/apps-script/quickstart/macros 10 Scilab Cloud API User Manual v3 2017-03-19