Nothing Special   »   [go: up one dir, main page]

Oracle DBaaS OEM WebServices

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29
At a glance
Powered by AI
The document discusses using the Oracle EM12C cloud API to programmatically create and manage databases as a service. It outlines the main API endpoints and parameters required to initiate and check the status of database creation requests.

The EM12C cloud API allows external applications to programmatically create and manage databases in the cloud as a service without having to directly provision and manage the underlying infrastructure.

The main steps are: 1) Call the creation API endpoint to initiate the request, 2) Poll a status API to check when creation is complete, 3) Additional APIs can be used to obtain information about and manage the created database.

EM12C Cloud APIs for database creation

DBaaS : Database as a Service


Johan Louwers

EM12C API Database creation

Calling application

Oracle Enteprise Manager 12C cloud APIs for


database as a service

Oracle EM12C

S
Case(s)

2
3

Use Oracle EM12C cloud APIs from a portal for creating a new
database

Use Oracle EM12C cloud APIs as part of a bigger external flow


requiring database creation.

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation

S
Case(s)

2
3

Within the calling application users can request the creation of a


new database as a standalone action.

Within in overall flow in the calling application the need arises to


create a new database as part of a larger request flow. For
example creating application server, database server and deploy
an application.

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(S) Start of sub-flow for database creation.

Input required.

A number of inputs are needed from a request form in the custom


calling application.
Inputs are specified in the next slides

2
3

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

URI :
/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

2
3

Request headers :
Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=
Content-Type:
application/oracle.com.cloud.common.DbPlatformInstance+json
BODY :
{
"zone": "/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19",
"name": "<Request name>",
"description": "<Request Description>",
"params":
{
"username": "Master Account username for the DB",
"password": "Password for the Master Account on the DB",
"database_sid" : "Database SID" ,
"service_name" : "Name of the additional service to be created"
}
}

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

Sample response :
{

2
3

"uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/1171" ,
"name" : "Test_create_intance" ,
"resource_state" :
{
"state" : "INITIATED"
} ,
"media_type" :
"application/oracle.com.cloud.common.DbPlatformInstance+json" ,
"canonicalLink" :
"/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/
dbplatforminstance/byrequest/1171" ,
"status" : "SCHEDULED"
}
!! required to request status of creation process in step 3 !!

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Username:password
Username & password of the self service user (inside OEM) who is
requesting the new database to be created.
Needs to be provided from a free text fields in the custom request
form within the calling application

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Zone ID
Needs to be provided as the value of a dropdown menu in the custom
request form within the calling application where the visible text is a
meaningful text to humans. (when only one zone is available this could be a static hidden
value in the form)

Example variable

Can be delivered manually by DBaaS team or can be


queried via APIs
Capgemini : Database as a Service Johan Louwers. | 2014
Copyright 2014 Capgemini. All rights reserved.

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Name
Name of the request. (possible naming convention 20 chars long & no spaces)
Needs to be provided from a free text field in the custom request form
within the calling application.

Will require java-script to enforce naming convention.


Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

10

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Description
Description of the request. (possible naming convention 50 chars long & no special chars)
Needs to be provided from a free text field in the custom request form
within the calling application.

Will require java-script to enforce naming convention.


Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

11

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Username (DB)
Master account username for the database. (possible naming convention 10 chars
long & no special chars)

Needs to be provided from a free text field in the custom request form
within the calling application.

Will require java-script to enforce naming convention.


Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

12

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Password (DB)
Master account password for the database. (possible naming convention min 8
chars long, should include at least one capital letter and a number)

Needs to be provided from a free password field in the custom


request form within the calling application.

Will require java-script to enforce naming convention.


Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

13

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Service name
Service name for the database. (possible naming convention min 10 chars long, should
all be capital letters, no special chars)

Needs to be provided from a free field in the custom request form


within the calling application.

Will require java-script to enforce naming convention.


Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

14

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

FQDN
FQDN of the EM12C server

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

15

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(1) Call EM12C API (A) for database creation

curl example :

2
3

curl -k -u username:password -X POST -H "Content-Type:


application/oracle.com.cloud.common.DbPlatformInstance+json" -d
"{\"zone\":\"/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19\",\"
name\":\"REQUEST_TESTDB\",\"description\":\ TEST DATABASE CREATE
\",\"params\":{\"username\":\TEST_ADMIN\",\"password\":\TEST_PASSWD\"
,\"service_name\":\"TESTNAME\"}}"
https://example.company.com:7799/em/cloud/dbaas/dbplatformtemplate/CC3B
BB665A6BC6FFE040F00AEF252456

Template ID
Needs to be provided as the value of a dropdown menu in the custom
request form within the calling application where the visible text is a
meaningful text to humans. (when only one template is available this could be a static
hidden value in the form)

Example variable

Can be delivered manually by DBaaS team or can be


queried via APIs
Capgemini : Database as a Service Johan Louwers. | 2014
Copyright 2014 Capgemini. All rights reserved.

16

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(2) Database creation takes, depending on the platform,
from a couple of seconds to a couple of minutes. Wait timer
for 3 minutes is advised before continuing to the next step.

2
3

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

17

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

!! If the request is NOT completed return to step 2 !!

2
3

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

18

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

URI :
/em/cloud/dbaas/dbplatforminstance/byrequest/1171

Request headers :
Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

BODY :

2
3

!! ID from response message (A) !!

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

19

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

curl example :

curl -k -u username:password
https://example.company.com.nl:7799/em/cloud/dbaas/dbplatforminstance/b
yrequest/1171

2
3

Username:password
Username & password of the self service user (inside OEM) who is
requesting the new database to be created.
Is already provided as part of input for step 1 Needs to be provided
from a free text fields in the custom request form within the calling
application

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

20

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

curl example :

curl -k -u username:password
https://example.company.com.nl:7799/em/cloud/dbaas/dbplatforminstance/b
yrequest/1171

2
3

FQDN
FQDN of the EM12C server

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

21

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

Sample response :
{

2
3

"uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/1171" ,
"name" : "REQUEST_TESTDB_CREATE_31_41" ,
"description" : "Create Database for \"REQUEST_TESTDB\"." ,
"resource_state" :
{
"state" : "CREATING"
} ,
"context_id" : "1171" ,
"media_type" :
"application/oracle.com.cloud.common.DbPlatformInstance+json" ,
"canonicalLink" :
"/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/
dbplatforminstance/byrequest/1171" ,
"status" : "IN_PROGRESS" ,
"created" : "2014-11-24 18:31:43.0"
}
!! Indicating creation is not ready, return to step 2 !!

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

22

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

Sample response :
{

2
3

"uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/1171" ,
"name" : "DBNAME.example.company.com" ,
"resource_state" :
{
"state" : "READY"
} ,
"context_id" : "1171" ,
"media_type" :
"application/oracle.com.cloud.common.DbPlatformInstance+json" ,
"canonicalLink" :
"/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/
dbplatforminstance/byrequest/1171" ,
"status" : "RUNNING" ,
"created" : "2014-11-24 18:40:41.0" ,
"based_on" :
"/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456" ,
"connect_string" :
"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=somehost.examp
le.company.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=TESTNAME.exampl
<SNIP>

Example variable

!! Indicating creation is done !!

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

23

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

Additional information.

2
3

Some examples of additional information in the response which can


be used in the calling application for next steps or to inform the
requesting user.
Name
: full database name
Created
: creation date of database
connect_string
: connection string for connecting to the database
master_username
: username of the database master account
db_version
: version of the database
standby_database_configured : standby database created (Boolean)

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

24

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(3) Call EM12C API (B) for database creation process status

Additional information.

Some examples of additional information in the response which can


be used in the calling application for next steps or to inform the
requesting user.

2
3

"measurable_attributes" :
[
{"name:"up_time,"value:"0,"units:"Hours} ,
{"name:"total_sga,"value:"4077.703,"units:"MB} ,
{"name:"available_space,"value:"1056.813,"units:"MB} ,
{"name:"cpu_utilization,"value:"0.071,"units:"%} ,
{"name:"total_memory,"value:"4253.839,"units:"MB} ,
{"name:"db_time,"value:".117,"units:"CentiSeconds Per Second},
{"name":"cpu_count","value":"2","units":"Cores}
]

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

25

EM12C API Database creation

Calling application

Oracle EM12C

Sub-flow from calling application to request databases creation


(E) End of sub-flow for database creation.

Next step.

The full end-to-end flow in the calling application can continue.

User could/should be informed on the details of the created database.

2
3

Example variable

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

26

More information

EM12C API Database creation


https://docs.oracle.com/cd/E24628_01/doc.121/e28814/dbaas_ssa_user_
api.htm#EMCLO1148

Capgemini : Database as a Service Johan Louwers. | 2014


Copyright 2014 Capgemini. All rights reserved.

28

About Capgemini
With almost 140,000 people in over 40 countries, Capgemini is
one of the world's foremost providers of consulting, technology
and outsourcing services. The Group reported 2013 global
revenues of EUR 10.1 billion.
Together with its clients, Capgemini creates and delivers
business and technology solutions that fit their needs and drive
the results they want. A deeply multicultural organization,
Capgemini has developed its own way of working, the
Collaborative Business Experience, and draws on
Rightshore, its worldwide delivery model.
Learn more about us at www.capgemini.com.

www.capgemini.com
The information contained in this presentation is proprietary.
2014 Capgemini. All rights reserved.
Rightshore is a trademark belonging to Capgemini.

You might also like