The primary feature for Oracle REST Data Services (ORDS) is serving up REST APIs for your Oracle Database.
- REST APIs for the data, code, and objects in your Oracle schema
- REST APIs for the database itself
What I’m going to talk about today is the point where those two topics come together.
What does this mean?
It means that we have REST APIs you can use to manage your schema based REST APIs!
If we pull up the OpenAPI Spec in Swagger Tools, I can see in version 23.1 of the DBAPI, we have a new section labeled, ‘ORDS REST Services.’
61 Endpoints, give or take…
Wait, how did I pull those up?
Well you can cheat and go straight to the Docs. Or, if you have an install of ORDS with the DBAPI enabled, you can go to a URL that looks like this:
‘jefe’ is the Alias for my REST Enabled Schema user. That user will be used to AUTH my requests to those end points.
Taking a test drive
Tell me about my schema
In terms of ORDS, what’s going on?
This is a GET request, so I can call it from my browser.
Let’s Create a new REST Module
Let’s look at my list of modules from say, SQL Developer (Desktop), and see what it looks like.
I mean, it should have a default pagesize of 18, and ZERO templates, handlers, or parameters.
There it is!
Now why do you suppose we built REST APIs to manage our REST APIs, Clients, Privileges, and Roles?
We’re using these REST APIs to power the REST Workshop in SQL Developer Web!
Pretty cool, right?
It’s gets even cooler, because we drink our own champagne, so to speak.
In the REST Workshop, and all over SQL Developer Web we have a ‘Show Code’ toggle. This allows us to show you HOW we are going to do the work for you.
In the prior POST, in my payload I had an attribute labeled, “run_mode” set to NULL.
What is run mode??
Let’s look at the ORDS Docs.
Let’s find out!
The response is just some text.
Does this look familiar?
So we enhanced our APIs to be able to instead generate the PLSQL API calls that ORDS would use to do the work shown in the REST web screens.