Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Developing RESTful
Services
w/Oracle REST Data Serv...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
whoami
 a tools geek since 2001
 blogs at thatjeff...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The preceding is intended to ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
REST is Ubiquitous…What is REST?
Ove...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
REST…What is it and why should we care?
REST has be...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
REpresentational State Transfer (REST) is Everywher...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle REST Data Services (ORDS)
• ORDS Enables Dev...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
What is ORDS?
• Java JEE mid tier application, e.g....
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• JavaScript Object Notation
– Derived from JS, but...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Supports Multiple Oracle Data Stores
10
Oracle
REST...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Going from REST to the Database & Back
• Let’s revi...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
The Resource Collection
A RESTful Design Pattern
12
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Resource Collection Pattern
• MASTER RESOURCE: call...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Example REST Resource
Resource has:
- tabular data
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Ok, Let’s Get to the Good Stuff!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ORDS is THE REST Solution for Oracle Database
• Cus...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
AUTO REST for Tables
Examples
17
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Auto enablement of RESTful request modules,
publishe...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
ORDS.E...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Retrieve the Collection Metadata
METHOD : GET
RESPO...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Retrieve the Collection (Table – All of the Rows)
2...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Retrieve a Detail Resource (Table – A Specific Row)...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Apply Predicates to Your Collection (Table – Where/...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Add a Row
24
METHOD : POST
REQUEST BODY : JSON
RESP...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Update a Row
25
METHOD : PUT /:PK
REQUEST BODY : JS...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Delete a Row
METHOD : DELETE /:ID
RESPONSE: 200 OK
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Batch Load
METHOD : POST /batchload
REQUEST BODY : ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
A Quick Review…
DELETE
POST
GET
PUT
/some/collectio...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Database Resources available via REST/ORDS
• AUTO R...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
• Execute via POST
• Pass parameters via BODY {JSON}...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Execute a Stored Procedure
METHOD : POST
REQUEST BOD...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle REST Data Services: RESTful Services
When AUT...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
REST Development – in Oracle SQL Developer
Oracle SQ...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
REST Development – in Oracle SQL Developer
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
REST Development – CLI?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ALL APIs and No APPS Makes REST a Boring Boy…
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Using Oracle JET with ORDS
Building rich web & mobi...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle JET & Oracle REST Data Services
• Both Oracl...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
<script type="text/javascript" language="javascript...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Powered by Oracle JET, ORDS, REST, and the Oracle P...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
REST API for the Database Itself
41
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
A customer asked for REST services that could be us...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• Take existing, internal APIs and ‘clean up’ for p...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Lifecycle Is Critical – Automate Everything
Operati...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
The ‘Buckets’
Security
Instance
VM
DB
Backup
Perf
S...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Automatic API Doc
Gen via Swagger
• Inventory REST ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Securing REST APIs
47
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ORDS is Flexible - Security
Caveats
• Almost all de...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
First Party Authentication
• Oracle REST Data Servi...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
About OAuth 2.0
• IETF standard for securing access...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
External Authentication
• Comes in many flavors, fo...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Learn More
About Oracle REST Data Services
oracle.c...
Upcoming SlideShare
Loading in …5
×

REST Enabling Your Oracle Database

34,454 views

Published on

A quick review of REST and then onto how to make your Oracle tables and view available to REST applications using Oracle SQL Developer and Oracle REST Data Services.

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • How to do this on Oracle 10g database?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Njce! Thanks for sharing.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • IT #Tutorials (Videos and Books) for just $7.95 http://www.dbmanagement.info/Tutorials/Index.htm
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

REST Enabling Your Oracle Database

  1. 1. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Developing RESTful Services w/Oracle REST Data Services (ORDS) & Oracle SQL Developer
  2. 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | whoami  a tools geek since 2001  blogs at thatjeffsmith.com tweets at @thatjeffsmith  Product Manager for  SQL Developer  SQLcl  SQL Developer Data Modeler  Oracle REST Data Services
  3. 3. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  4. 4. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Program Agenda REST is Ubiquitous…What is REST? Overview of ORDS (flexible, extensible, secure) Automatic REST Feature for Tables: Examples 1 2 3 4 5
  5. 5. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | REST…What is it and why should we care? REST has become a foundational part of web application stacks 5
  6. 6. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | REpresentational State Transfer (REST) is Everywhere • REST is easy to grasp, easy to learn and easy to use – Small uniform set of operations: GET, POST, PUT, DELETE etc that work similarly across all APIs – Small set of uniform status codes: 200, 201, 404, 500, … – URLs & hyperlinks encourage stateless behavior, easy to dive in and test out APIs – Text based protocol with simple request/response model, easy to introspect and understand – Accessible from any application platform or programming language • Like HTTP, TCP & Unix, REST has become a foundational part of the computing world 6 REST APIs are the norm, and will continue to be for the foreseeable
  7. 7. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle REST Data Services (ORDS) • ORDS Enables Developers With Database Skills to Develop REST and JSON APIs for Oracle Database – Just need SQL, PL/SQL, and Oracle Database knowledge – Low code solution… – …no need to learn Java! • ORDS enables data access developers to – Automatically generate REST APIs for basic functions on tables and views • GET (query), PUT (insert), POST (update), etc. – Write REST APIs that call custom SQL queries and PL/SQL procedures 7 So How Does ORDS Fit Into This?
  8. 8. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | What is ORDS? • Java JEE mid tier application, e.g., WebLogic, Tomcat, Glassfish – Also supports “Standalone” mode for development via embedded Jetty • For input, maps/binds URI to SQL and PL/SQL • For output, transforms results to JSON and other formats 8 Oracle REST Data ServicesHTTP(S) client Oracle Database SQLMap & BindURI JSON Transform to JSON SQL Result Set
  9. 9. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | • JavaScript Object Notation – Derived from JS, but many languages have native support • Lighter than XML • Easy for humans to read/write • Easy for machines to parse/generate What is JSON? (JAY-sun)
  10. 10. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Supports Multiple Oracle Data Stores 10 Oracle REST Data Service REST Oracle NoSQL Database Oracle Database 12c (Document Store) Oracle Database (Relational)
  11. 11. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Going from REST to the Database & Back • Let’s review quickly how the Resource Collection Model works • Sending data up to the database via ORDS and receiving data back relies on this model
  12. 12. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | The Resource Collection A RESTful Design Pattern 12
  13. 13. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Resource Collection Pattern • MASTER RESOURCE: called the Collection URI: A Table (or View) https://site.com/ords/hr/employees/ • DETAIL RESOURCE; called the Item URI: A Record in Said Table (or View) https://site.com/ords/hr/employees/:id (:id => Primary Key) 13
  14. 14. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Example REST Resource Resource has: - tabular data - nested data - hyperlinks
  15. 15. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Ok, Let’s Get to the Good Stuff!
  16. 16. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | ORDS is THE REST Solution for Oracle Database • Custom SQL and PL/SQL – Data binding or OWA Toolkit (HTP.P) • Auto Table Enablement – CRUD + Bulk Load • Auto PL/SQL Enablement (RPC) – Full to and from JSON support • Full SQL Scripting – sqldev/sqlcl library via REST • Predefined OS Command – Initially used in DBAAS Monitor • Native Java Code – Get Info directly from JDBC properties
  17. 17. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | AUTO REST for Tables Examples 17
  18. 18. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Auto enablement of RESTful request modules, publishes these URI Handlers for Tables & Views Requires ZERO code • Table Metadata • Get ( Select ) • Query ( Filtering ) • Insert • Update • Delete • Bulk load Auto Table/VIEW APIs/REST End Points
  19. 19. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | DECLARE PRAGMA AUTONOMOUS_TRANSACTION; BEGIN ORDS.ENABLE_OBJECT(p_enabled => TRUE, p_schema => 'HR', p_object => 'DEPARTMENTS', p_object_type => 'TABLE', p_object_alias => 'depts', p_auto_rest_auth => FALSE); commit; END; GUI & PL/SQL APIs Available
  20. 20. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Retrieve the Collection Metadata METHOD : GET RESPONSE: 200 OK • JSON • Collection (Schema) • Canonical • Describes (Table) Screenshots demonstrate REST calls using POSTMAN
  21. 21. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Retrieve the Collection (Table – All of the Rows) 21 200 JSON METHOD : GET RESPONSE: 200 OK • JSON • More? • Next Page • First Page • Described By • Self
  22. 22. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Retrieve a Detail Resource (Table – A Specific Row) 22 METHOD : GET /:PK RESPONSE: 200 OK • JSON • Self • Described By • Collection
  23. 23. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Apply Predicates to Your Collection (Table – Where/Order) METHOD : GET /?q={pred} RESPONSE: 200 OK • JSON • More? • Next Page • First Page • Described By • Self ?q={"department_id": { "$lt": 3} } … WHERE DEPARTMENT_ID < 3 FULL Docs/Examples
  24. 24. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Add a Row 24 METHOD : POST REQUEST BODY : JSON RESPONSE: 201 Created • Location (Header) • JSON (Body)
  25. 25. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Update a Row 25 METHOD : PUT /:PK REQUEST BODY : JSON RESPONSE: 200 OK • Location (Header) • JSON (Body)
  26. 26. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Delete a Row METHOD : DELETE /:ID RESPONSE: 200 OK • JSON (Body)
  27. 27. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Batch Load METHOD : POST /batchload REQUEST BODY : CSV RESPONSE: 200 OK • Text (Body)
  28. 28. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | A Quick Review… DELETE POST GET PUT /some/collection/ ‘Read’ a Collection /some/collection/:id ‘Update’ an Item /some/collection/:id ‘Read’ an Item /some/collection/ ‘Add’ an Item /some/collection/:id ‘Delete’ an Item GET
  29. 29. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Database Resources available via REST/ORDS • AUTO REST Tables and Views – Available TODAY • SQL & PL/SQL Code Blocks – Available TODAY • AUTO RPC Store Procedures
  30. 30. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Execute via POST • Pass parameters via BODY {JSON} • Output returned as {JSON} – REFCURSORs? Check! – Complex types, SDO_GEOMETRY, Intervals, Custom types? Check! Auto-Publish URI’s for PL/SQL Programs Remote Procedure Call (RPC) AUTO Support for PL/SQL Programs
  31. 31. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Execute a Stored Procedure METHOD : POST REQUEST BODY : JSON RESPONSE: 200 OK • JSON (Body)
  32. 32. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle REST Data Services: RESTful Services When AUTO is Not Enough RESTful Services • Execute any SQL or PL/SQL • Module => Template(s) => Handler(s) • PL/SQL API and GUI Support • SECURE! Priv & Role Driven • Supports OAUTH2 • Example (DOCS)
  33. 33. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | REST Development – in Oracle SQL Developer Oracle SQL Developer version 4.2
  34. 34. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | REST Development – in Oracle SQL Developer
  35. 35. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | REST Development – CLI?
  36. 36. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | ALL APIs and No APPS Makes REST a Boring Boy…
  37. 37. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Using Oracle JET with ORDS Building rich web & mobile apps using REST APIs 37
  38. 38. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle JET & Oracle REST Data Services • Both Oracle JET & Oracle REST Data Services comply with the Oracle REST Standard, as do many other Oracle products that offer a REST API. • The centrepiece of this standard is the Collection Resource Pattern we discussed earlier • Oracle JET provides rich functionality for interacting with REST Collections • This makes it super-easy to wire JET UIs and ORDS APIs together 38 Meant to go together
  39. 39. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | <script type="text/javascript" language="javascript"> $(document).ready(function() { $.getJSON("http://servername/ords/db/demo/emp", function(data) { $(data.items).each(function (index, value) { $("#rpt").append( '<tr>' + '<td class="text-center"><a href="form.html#' + value.empno + '">Edit</a></td>' + '<td class="text-right">' + value.empno + '</td>' + '<td class="text-center">' + value.dname + '</td>' + '<td class="text-left">' + value.ename + '</td>' + '<td class="text-left">' + value.job + '</td>' + '<td class="text-right">' + value.sal + '</td>' + '<td class="text-right">' + value.sal_diff + '</td>' + '<td class="text-right">' + value.comm + '</td> + '<td class="text-center">' + value.rank + '</td>' + '</tr>'); }); }); });
  40. 40. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Powered by Oracle JET, ORDS, REST, and the Oracle Public Cloud
  41. 41. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | REST API for the Database Itself 41
  42. 42. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | A customer asked for REST services that could be used to • INSTALL Oracle • CREATE DATABASE PUT /database/ ?
  43. 43. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | • Take existing, internal APIs and ‘clean up’ for public consumption • Consistent URIs for Cloud (across services) and On Premises • Deploy via ORDS Updates • ORDS Dev Calendar to Synch up with Cloud, Quarterly Updates • Prioritize around Lifecyle Operations • APIs will have Swagger style Oracle DOCs treatment The Plan
  44. 44. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Lifecycle Is Critical – Automate Everything Operational ‘Buckets’ • VM • Database • Backup & Recovery • Instance Management • Security • Performance • Features
  45. 45. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | The ‘Buckets’ Security Instance VM DB Backup Perf State(start, stop, status), Shape(current, change), Image(copy, move, drop, snapshot… Params(list, change), State(create, drop, clone, start, stop, relocate, plug, unplug…) Locations(list, update), Windows(list, update), Backups(list, details), Backup(now, backup to trace)… Sessions(List, Kill, Trace), Pools(Flush), Logging(Current, Switch), Storage(tblspc-add, edit, list) Auditing(Trails, ChangeSettings, Delete), User(list, create, drop, list privs, grant/revoke priv), Roles(list, create, drop…) AWR, ADDM, ASH, SQL Tuning Advisor, RTSM
  46. 46. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Automatic API Doc Gen via Swagger • Inventory REST API • Descriptions • Examples • Test via Curl • Oracle Docs Integration
  47. 47. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Securing REST APIs 47
  48. 48. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | ORDS is Flexible - Security Caveats • Almost all dev/demo/blog is done with security off & with HTTP • Always, always, always secure REST services and run with HTTPS
  49. 49. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | First Party Authentication • Oracle REST Data Services specific solution • Only available to the author of the API, application must be deployed on same origin as API • https://example.com/api & https://example.com/app ✓ • https://api.example.com & https://app.example.com ✗ • User enters credentials in sign-in form, ORDS issues cookie, cookie is only validated by ORDS if the request is determined to originate from the from the same origin as the REST Service. 49
  50. 50. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | About OAuth 2.0 • IETF standard for securing access to REST APIs • Comes in two forms: • Two Legged - For Business to Business, server to server applications • Example: Sync HR data between internal applications • Three Legged - For Business to Consumer, app to end-user applications • Example: Share subset of HR data with external benefits provider after employee approves access. • Third party registers client, issued credentials, uses credentials to acquire access token, uses access token with request to prove authorization 50
  51. 51. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | External Authentication • Comes in many flavors, for example: • Oracle Access Manager - SSO cookie at Oracle OHS server level authenticates users stored in Oracle Identity Manager • ORDS does not perform authentication, just authorization. • Usually relies on HTTP cookies, need to restrict CORS allowed Origins to avoid CSRF 51 APEX Authentication too (read users from a db table)
  52. 52. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Learn More About Oracle REST Data Services oracle.com/rest @OracleREST @cdivilly @krisrice @thatjeffsmith

×