oracle enterprise manager 12c cloud api's

29
EM12C Cloud API’s for database creation DBaaS : Database as a Service Johan Louwers

Upload: johan-louwers

Post on 13-Jul-2015

230 views

Category:

Technology


11 download

TRANSCRIPT

Page 1: Oracle Enterprise Manager 12C cloud API's

EM12C Cloud API’s for database creationDBaaS : Database as a Service

Johan Louwers

Page 2: Oracle Enterprise Manager 12C cloud API's

2Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Oracle Enteprise Manager 12C cloud API’s for

database as a service

Example variable

Case(s)

1. Use Oracle EM12C cloud API’s from a portal for creating a new

database

2. Use Oracle EM12C cloud API’s as part of a bigger external flow

requiring database creation.

Page 3: Oracle Enterprise Manager 12C cloud API's

3Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

Example variable

Case(s)

1. Within the “calling application” users can request the creation of a

new database as a standalone action.

2. 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.

Page 4: Oracle Enterprise Manager 12C cloud API's

4Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

Input required.

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

calling application.

•Inputs are specified in the next slides

Page 5: Oracle Enterprise Manager 12C cloud API's

5Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

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

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

Page 6: Oracle Enterprise Manager 12C cloud API's

6Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Sample response :

{"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"}

Example variable

!! required to request status of creation process in step 3 !!

Page 7: Oracle Enterprise Manager 12C cloud API's

7Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

Page 8: Oracle Enterprise Manager 12C cloud API's

8Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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

Page 9: Oracle Enterprise Manager 12C cloud API's

9Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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)

Can be delivered manually by DBaaS team or can be

queried via API’s

Page 10: Oracle Enterprise Manager 12C cloud API's

10Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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.

Page 11: Oracle Enterprise Manager 12C cloud API's

11Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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.

Page 12: Oracle Enterprise Manager 12C cloud API's

12Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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.

Page 13: Oracle Enterprise Manager 12C cloud API's

13Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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.

Page 14: Oracle Enterprise Manager 12C cloud API's

14Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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.

Page 15: Oracle Enterprise Manager 12C cloud API's

15Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

FQDN

•FQDN of the EM12C server

Page 16: Oracle Enterprise Manager 12C cloud API's

16Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

curl example :

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/CC3BBB665A6BC6FFE040F00AEF252456

Example variable

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)

Can be delivered manually by DBaaS team or can be

queried via API’s

Page 17: Oracle Enterprise Manager 12C cloud API's

17Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

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.

Example variable

Page 18: Oracle Enterprise Manager 12C cloud API's

18Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

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

Page 19: Oracle Enterprise Manager 12C cloud API's

19Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

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

Request headers : Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

BODY :

!! ID from response message (A) !!

Page 20: Oracle Enterprise Manager 12C cloud API's

20Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

curl example :

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

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

Page 21: Oracle Enterprise Manager 12C cloud API's

21Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

curl example :

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

FQDN

•FQDN of the EM12C server

Page 22: Oracle Enterprise Manager 12C cloud API's

22Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

Sample response :

{"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 !!

Page 23: Oracle Enterprise Manager 12C cloud API's

23Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

Sample response :

{"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.example.company.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=TESTNAME.exampl

<SNIP>

!! Indicating creation is done !!

Page 24: Oracle Enterprise Manager 12C cloud API's

24Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

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.

• 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)

Page 25: Oracle Enterprise Manager 12C cloud API's

25Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

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.

"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”}

]

Page 26: Oracle Enterprise Manager 12C cloud API's

26Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

S

E

1 A

2

3 B

Calling application Oracle EM12C Sub-flow from calling application to request databases creation

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

Example variable

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.

Page 27: Oracle Enterprise Manager 12C cloud API's

More information

Page 28: Oracle Enterprise Manager 12C cloud API's

28Copyright © 2014 Capgemini. All rights reserved.

Capgemini : Database as a Service – Johan Louwers. | 2014

EM12C API – Database creation

https://docs.oracle.com/cd/E24628_01/doc.121/e28814/dbaas_ssa_user_

api.htm#EMCLO1148

Page 29: Oracle Enterprise Manager 12C cloud API's

The information contained in this presentation is proprietary.

© 2014 Capgemini. All rights reserved.

Rightshore® is a trademark belonging to Capgemini.

www.capgemini.com

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.