Академический Документы
Профессиональный Документы
Культура Документы
Table of Contents
– REST APIs
– Supported Operations
– Examples
1
2/15/2013
Deploy
2
2/15/2013
Integrate existing IT
infrastructures and resources
with cloud workflows
Connecting different cloud
services together
Create a custom self service
portal for cloud workflows
Oracle Cloud Standards Team is participating in and driving adoption of Oracle Cloud
API in emerging industry cloud standards
As these standards are released, adopted by ISO and receive market adoption Oracle
will implement for EM and other products
Three Cloud API standards
Cloud Storage: Cloud Data Management Interface (CDMI) from the Storage Networking
Industry Association (SNIA); recently adopted by ISO
IaaS: Cloud Infrastructure Management Interface (CIMI) from the Distributed Management
Task Force (DMTF); Release 1.0 issued, release 1.1 in development.
PaaS: Cloud Application Management for Platforms (CAMP) from the Organization for the
Advancement of Structured Information Standards (OASIS); release 1.0 in development.
3
2/15/2013
EM 12c exposes REST APIs for operations that can be performed by a cloud
self service user
The RESTful API enables integration to perform the following:
– Browse templates that contain definitions and metadata of a logical unit of service
– Deploy a template into the cloud and form an IT topology on demand
– Perform operations (such as ONLINE, OFFLINE) on the resources
The API is based on the HTTP (version 1.1) protocol and GET, POST, PUT,
and DELETE requests are all used
4
2/15/2013
Infrastructure as a Service
(IaaS)
5
2/15/2013
Requirements
Infrastructure as a Service on x86
Licenses
– Oracle Cloud Management Pack for Oracle Database for Database Assemblies
– Oracle Cloud Management Pack for Oracle Middleware for Weblogic Assemblies
– Template provisioning is part of base Enterprise Manager
Product Version:
– EM 12cR2
Resource Model
Infrastructure as a Service (IaaS)
• VM Template: Oracle VM
Template
6
2/15/2013
Resource Model
IaaS Resource Specifications
URI
Resource Media Type
[https://example.us.oracle.com]
VM Template
/em/cloud/iaas/servicetemplate/vm/<template id> application/oracle.com.cloud.common.VMTemplate+json
[Service Template]
Assembly Template
/em/cloud/iaas/servicetemplate/assembly/<template id> application/oracle.com.cloud.common.AssemblyTemplate+json
[Service Template]
VM
/em/cloud/iaas/server/byrequest/<request id> application/oracle.com.cloud.common.VM+json
[Service Instance]
Assembly Instance
/em/cloud/iaas/assemblyrequest/<request id> application/oracle.com.cloud.common.AssemblyInstance+json
[Service Instance]
Supported Operations
Infrastructure as a Service (IaaS)
List all IaaS Zones in the Cloud
List all Service Templates (are either VM Templates and Assembly Templates)
List all Service Instances (are either VMs or Assembly Instances)
Request Service Instances in a IaaS Zone
Deploy VM Templates or Assembly Templates
Change VM status
Change VM size
Delete Service Instances
7
2/15/2013
Supported Operations
Infrastructure as a Service (IaaS)
Operations
Resource Description
GET POST PUT DELETE
Examples
Creating a service instance: VM Creation
URL:
https://example.oracle.com/em/cloud/iaas/zone/D73AF0D42C8459E11419862797D1F37D
8
2/15/2013
Examples
Creating a service instance: VM Creation (Cont'd)
URL:
https://example.oracle.com/em/cloud/iaas/servicetemplate/vm/oracle%3AdefaultServ
ice%3Aem%3Aprovisioning%3A1%3Acmp%3AVirtualization%3ATemplate%3AC76CEB5563EA5E13
E040578CDA817FAF%3A0.1
2. POST to the VM Template Headers:
from which the VM is to be Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=
deployed Content-Type: application/oracle.com.cloud.common.VM+json
Body:
Inputs: {
• IaaS Zone "zone":"/em/cloud/iaas/zone/D73AF0D42C8459E11419862797D1F37D",
"cpu" : [2,0],
• CPU and Memory "memory" : "512",
• VM name prefix "params":{
• VNC and root passwords "server_prefix":"STPOST",
"vnc_password":"welcome1",
"root_password":"welcome1"
}
}
Examples URL:
https://example.oracle.com/em/cloud/iaas/server/vm/C5CA59AF9386975E8AEA45B0F04
Changing VM Size 0F095?resource_state
Headers:
Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=
Content-Type: application/oracle.com.cloud.common.VM+json
Body:
{
"cpu":[1,0], "memory":"1024"
The CPU and Memory of a VM }
can be adjusted to increase or
decrease the capacity. EXAMPLE RESPONSE
{
For example, to adjust the VM's "resource_state" : {
CPU to 1 vCPU and increase the "state" : "READY" ,
"messages" :
memory from 512 to 1024, a PUT [
request can be issued. {
"text" : "'PUT' resource operation on
'application/oracle.com.cloud.common.VM' identified by
'C5CA59AF9386975E8AEA45B0F040F095' is successfully submitted with reference
'106'" ,
"date" : "2012-08-20T01:15:28+0000"
}
]
}
}
9
2/15/2013
Database as a Service
(DBaaS)
Requirements
Database as a Service
Licenses
– Oracle Cloud Management Pack for Oracle Database
Product Version:
– EM 12cR2 with Oracle Cloud Application plug-in 12.1.0.4 and patch 16085618
– EM 12cR2 with Oracle Cloud Application plug-in 12.1.0.5*
10
2/15/2013
Supported Operations
Database as a Service
List all PaaS infrastructure zones (or just zone) used for DBaaS
List all database service templates
List all databases
– Deployed to a zone
– Deployed using a database service template
Request databases by deploying service templates
Monitor and manage databases
Delete databases
Resource Models
Database as a Service
DB Platform Template
• Database Service Template
DB Platform Instance
• Single Instance or RAC
Database
DBaaS Zone
• PaaS Infrastructure Zone
that allows Database requests
11
2/15/2013
Resource Models
DBaaS REST Operations
Operations
Resource Description
GET POST PUT DELETE
Resource Models
DBaaS Resource Specifications
URI
Resource Media Type
[https://example.us.oracle.com]
DB Platform Template
/em/cloud/dbaas/dbplatformtemplate/<template id> application/oracle.com.cloud.common.DbPlatformTemplate+json
[Service Template]
DB Platform Instance
/em/cloud/dbaas/dbplatforminstance/byrequest/<request id> application/oracle.com.cloud.common.DbPlatformInstance+json
[Service Instance]
12
2/15/2013
Examples
Creating a DB Platform Instance: DB Creation
URL:
https://example.oracle.com/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19
There are two ways to
provision a Database Headers:
Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=
service: Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json
Accept: application/oracle.com.cloud.common.DbPlatformInstance+json
1. POST to the DBaaS Zone on
Body:
which DB is to reside. {
"based_on":
Inputs: "/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456",
"name": "<Request name>",
• DB platform template "description": "<Request Description>",
• Request name "params":
• Request description {
"username": "Master Account username for the DB",
• Master account username "password": "Password for the Master Account on the DB"
and password }
}
Examples
Creating a DB Platform Instance: DB Creation (Cont'd)
URL:
https://example.oracle.com/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE04
0F00AEF252456
Inputs: Body:
{
• DBaaS Zone "zone": "/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19",
• Request name "name": "<Request name>",
• Request description "description": "<Request Description>",
"params":
• Master account username {
and password "username": "Master Account username for the DB",
"password": "Password for the Master Account on the DB"
}
}
13
2/15/2013
Examples URL:
https://example.oracle.com/em/cloud/dbaas/dbplatforminstance/byrequest/7
Java as a Service
(JaaS)
14
2/15/2013
Requirements
Java as a Service
Licenses
– Oracle Cloud Management Pack for Oracle Middleware
Product Version:
– EM 12cR2 with Oracle Cloud Application plug-in 12.1.0.5
Supported Operations
Java as a Service
List all PaaS infrastructure zones (or just zone) used for JaaS
List all Java Service Templates
List all Java Instances
– Deployed to a zone
– Deployed using a Java Service Template
15
2/15/2013
Supported Operations
Java as a Service (cont’d)
Resource Models
Java as a Service
JaaS Zone
• PaaS Infrastructure Zone
that allows Java requests
16
2/15/2013
Resource Models
JaaS REST Operations
Operations
Resource Description
GET POST PUT DELETE
Java Platform Template A Java platform template represents the definition of the
[Service Template] deployable middleware service
Java Platform Instance A Java platform instance describes the metadata about
[Service Instance] databases deployed using the service templates.
Resource Models
JaaS REST Operations
Operations
Resource Description
GET POST PUT DELETE
Application Instance
Component
Represents the application component in the software library
Application Instance Represents an instance of the Component Deployed in a
Deployment Middleware
17
2/15/2013
Resource Models
JaaS Resource Specifications
URI
Resource Media Type
[https://example.us.oracle.com]
Resource Models
JaaS Resource Specifications (Cont'd)
URI
Resource Media Type
[https://example.us.oracle.com]
18
2/15/2013
Response:
{
POST on "uri" : "/em/cloud/jaas/javaplatforminstancerequest/14" ,
"name" : “accountsinstance_Create_20120717_045804697" ,
JavaPlatformTemplate URI to "resource_state" : {
create JavaPlatformInstance "state" : "INITIATED" ,
"messages" :
[
{
Inputs: "text" : “progress" ,
• Name “date" : "2012-07-17T09:16:13+0000"
}
• zone ]
},
"context_id": "1”,
"media_type": "application/oracle.com.cloud.jaas.JavaPlatformInstance+json" ,
"service_family_type": "jaas" ,
"status": "SCHEDULED"
}
GET on URL
Examples httpd://example.oracle.com/em/cloud/jaas/javaplatforminstance/960A4A8244145EC7949303B4ECD650D
Headers
Authorization: Basic xxxxxxx
GET JaaS Instance Accept: application/oracle.com.cloud.jaas.JavaPlatformInstance+json
{
"uri" : "/em/cloud/jaas/javaplatforminstance/960A4A8244145EC7949303B4EC0" , "data_sources" : {
"name" : "jb__sd_platform_12_24_2012_13_38_28" , "media_type" : "application/oracle.com.cloud.jaas.DataSource+json" ,
"resource_state" : { "total" : "0" ,
"state" : "READY" "elements" :
}, [ ]
"context_id" : "960A4A8244145EC7949303B4ECD650D0" , },
"media_type" : "application/oracle.com.cloud.jaas.JavaPlatformInstance+json" , "jdbc_drivers" :
"service_family_type" : "jaas" , [
"status"
. : "RUNNING" , "com.ddtek.jdbc.oracle.OracleDriver" ,
"zone" : { "oracle.jdbc.xa.client.OracleXADataSource" ,
"uri" : "/em/cloud/jaas/zone/A1B44A4EBCC4563125D9D0A3AAE4FD51" , "oracle.jdbc.OracleDriver" ,
"name" : "Zone1" , "com.ddtek.jdbcx.oracle.OracleDataSource"
"context_id" : "A1B44A4EBCC4563125D9D0A3AAE4FD51" , ],
"media_type" : "application/oracle.com.cloud.jaas.Zone+json" , "server_count" : "1" ,
"service_family_type" : "jaas" "application_instance_deployments" : {
}, "media_type" :
"based_on" : { "application/oracle.com.cloud.jaas.ApplicationInstanceDeployment+json" ,
"uri" : "/em/cloud/jaas/javaplatformtemplate/D016AADD465462ACE040F20" , "total" : "0" ,
"name" : "PS4_LowHeapTemplate" , "elements" :
"context_id" : "D016AADD465462ACE040F20AD18167BA" , [ ]
"media_type" : "application/oracle.com.cloud.jaas.JavaPlatformTemplate+json" , }
"service_family_type" : "jaas" }
},
19
2/15/2013
Metering/Showback API
emcli get_metering_data
[-start_date=<start date in mmddyyyy> [-end_date=<end_date in mmddyyyy>]] [ -
target_type=<target type> [-target_name= <target name> ] ] [ -cost_center=<cost center
emcli verb to retrieve name> ] [ -charge]
hourly data and perform:
Example:
•emcli get_metering_data -start_date=01152011 -end_date=02152011 -
• Rollup aggregation target_type=oracle_database: Returns metering information for all Oracle DB targets
• Integration with billing (active or enabled in Chargeback) that are owned by the logged in user, starting from 15th
January 2011 until the 15th February 2011
systems
• Showback over sliding •emcli get_metering_data -target_type=host target_name=my_host -
cost_center=organization1: Returns metering and charge information for "my_host" target
time windows (of type host) for the current report cycle for "organization1" cost-center
20
2/15/2013
References
21
2/15/2013
22