Skip Headers
Oracle® Enterprise Manager Cloud Administration Guide
12c Release 2 (12.1.0.2)

Part Number E28814-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

21 Database as a Service APIs

Note:

DBaaS APIs are supported only with the Enterprise Manager for Oracle Cloud 12.1.0.3 plug-in.

This chapter describes the Database as a Service (DBaaS) APIs. It contains the following sections:

Operations on ServiceTemplate Resources

This section describes the operations that can be performed on a ServiceTemplate resource, such as viewing the attributes of the service template and the definition of the service template. It contains the following sections:

Retrieving Service Template Details

The GET command has the following characteristics:

  • Synopsis

    GET {URI of a Service template instance}

  • Request Headers:

    Host, X-Cloud-Client-Specification-Version, Authorization, Accept

  • Request Message Body:

    N/A

  • Response Headers

    Content-Length, Content-Type, Content-Location, Cache-Control

  • Response Message Body

    ServiceTemplate

  • Response Status

    200, 400, 401, 403, 404

Example Request: Retrieve the Information About a Service Template

GET /templates/items/t833
 Host: cloudcompany.com
 Authorization: Basic xxxxxxxxxx
 Accept: application/oracle.com.cloud.common.ServiceTemplate+json
 X-Cloud-Client-Specification-Version: 0.1

Example Response:

HTTP/1.1 200 OK
 Content-Type: application/oracle.com.cloud.common.application/oracle.com.cloud.common.ServiceTemplate+json
 Content-Location: /templates/items/t833
 Content-Length: nnn
 {
    “uri” : “…”,
    “name” : “Oracle EM NextGen Demo in a box”,
    “description” : “Template that can be deployed into complete EM
     Next Generation Demo system with…” ,
    “type” : “VMTemplate” ,
    “created” : “February 22, 2010 15:34:34 GMT” ,
    “definition” : “<xml><some_definition/>…</xml>” ,
    “tags” : [“ABC”, “EM”, “Next Gen”, “My note”, … ] ,
    “resource_state” : [
        “state” : “READY”
    ]
 }

Deleting a Service Template

The cloud service provider may allow users to delete the service templates, based on the provider specified accessibility rules. However, since there may be active instances referencing to the service template, the cloud service provider may reserve the right to remove only the visibility of the service template from any menus. In that case, subsequent GET requests to a deleted service template may still be valid.

The command has the following characteristics:

  • Synopsis

    DELETE {URI of a service template}

  • Request Headers:

    Host, X-Cloud-Client-Specification-Version, Authorization

  • Request Message Body:

    N/A

  • Response Headers

    N/A

  • Response Message Body

    N/A

  • Response Status

    200, 401, 403, 404, 410

Example Request: Delete a Service Template

DELETE /templates/items/t903
 Host: cloudcompany.com
 Authorization: Basic xxxxxxxxxx
 X-Cloud-Client-Specification-Version: 0.1

Example Response:

HTTP/1.1 200 OK

Operations on DbPlatformInstance Resources

This chapter describes the operations that an be performed on a DbPlatformInstance resource, such as creating a new DbPlatformInstance, retrieving all the DbPlatformInstances from a virtual data center, and deleting a DbPlatformInstance.

This chapter contains the following sections:

Creating a New DbPlatformInstance

A DbPlatformInstance can be provisioned based on a DbPlatformTemplate. The following example request uses POST on ZONE_1 URI with the based_on attribute set to the DbPlatformTemplate URI.

Example Request: POST the following payload to /em/cloud/dbzone/D7EEE339C1249F83FC4587C722EB20B5

POST /em/cloud/dbzone/D7EEE339C1249F83FC4587C722EB20B5 Host: cloudcompany.com Authorization: Basic xxxxxxxxxx Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json Accept: application/oracle.com.cloud.common.DbPlatformInstance +json{   "name" : "Database 11.2.0.3.0 Instance for SSA_USER_1",   "description" : "Instance 2 of  Oracle Database 11.2.0.1.0" ,   "based_on" : "/em/cloud/dbplatformtemplate/B59EDC65951039E8E040E50A8F5B0435",    "params" : {        "username": "xxx",        "password" : "yyy"    } }

Example Response:

HTTP/1.1 200 OK Content-Type: application/oracle.com.cloud.common.DbPlatformInstance +json Content-Location: /em/cloud/dbplatforminstance/byrequest/41 Content-Length: nnn {   "uri" : "/em/cloud/dbplatforminstance/byrequest/41",   "name" : "SSA_USER_1 - Thu Jan 05 02:53:24 PST 2012",   "status" : "SCHEDULED",   "resource_state" : {       "state" : "INITIATED"   } }

Retrieving all the DbPlatformInstances in a Virtual Data Center

The following shows an example request and response to retrieve the information about a Small Database Service Template for an SSA_USER_ROLE.

Example Request:

GET /em/cloud/vdc/default/D7EEE339C1249F83FC4587C722EB20B5 Host: cloudcompany.com Authorization: Basic xxxxxxxxxx Accept: application/oracle.com.cloud.common.VDC+json

Example Response:

HTTP/1.1 200 OK Content-Type: application/oracle.com.cloud.common.VDC+json Content-Location: /em/cloud/vdc/default/D7EEE339C1249F83FC4587C722EB20B5 Content-Length: nnn {   "uri" : "/em/cloud/vdc/default/D7EEE339C1249F83FC4587C722EB20B5",   "name" : "Oracle Enterprise Manager Virtual Data Center on Zone  ZONE_1",   "dbplatform_instances" : { "uri" : " /em/cloud/vdc/default/D7EEE339C1249F83FC4587C722EB20B5/dbplatform_instances",  "name" : "DbPlatform Instances in ZONE_1",       "total" : "1",  "elements" : [           "uri" : "/em/cloud/dbplatforminstance/52A5283827BEDAC79AFEE2A0BFFF531A",        "name" : "Dbf54e97.sta00434.us.oracle.com",     "based_on": "/em/cloud/dbplatformtemplate/B59EDC65951039E8E040E50A8F5B0435",     "destination_zone" : "/em/cloud/dbzone/D7EEE339C1249F83FC4587C722EB20B5",        "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sta00434.us.oracle.com)(PORT=1521)))(CONNECT_DATA=(SID=DBf54e97)))",   "status" : "RUNNING",           "created" : "2012-01-04 01:35:12"               "resource_state" : {                              "state" : "READY"                }       ]}

Deleting a DbPlatformInstance

The following shows an example request and response to deleting a DbPlatformInstance.

Example Request: Delete a DbPlatformInstance

DELETE /em/cloud/dbplatforminstance/52A5283827BEDAC79AFEE2A0BFFF531A Host: cloudcompany.com Authorization: Basic xxxxxxxxxx Accept: application/oracle.com.cloud.common.DbPlatformInstance +json{   "uri" : "/em/cloud/dbplatforminstance/52A5283827BEDAC79AFEE2A0BFFF531A"   "name" : "Dbf54e97.sta00434.us.oracle.com",   "resource_state" : {      "state" : "DESTROYING"    } }

Example Response:

HTTP/1.1 200 OK Content-Type: application/oracle.com.cloud.common.DbPlatformInstance +json Content-Location: /em/cloud/dbplatforminstance/52A5283827BEDAC79AFEE2A0BFFF531A Content-Length: nnn {   "uri" : "/em/cloud/dbplatforminstance/52A5283827BEDAC79AFEE2A0BFFF531A",   "name" : "Dbf54e97.sta00434.us.oracle.com",   "resource_state" : {       "state" : "DESTROYING"   }}

Operations on DbPlatformTemplate Resources

This section describes the operations that an be performed on a DbPlatformTemplate resource, such as getting all the DbPlatformTemplates in the cloud and retrieving information about DbPlatformTemplates. It contains the following sections:

Retrieving all the DbPlatformTemplates in the Cloud

This operation is performed by issuing a GET request on Cloud resource and filtering Collection<ServiceTemplates> by type = "dbaas".

Example Request: Retrieve the information about all DbPlatformTemplates

GET /em/cloud Host: cloudcompany.com Authorization: Basic xxxxxxxxxx Accept: application/oracle.com.cloud.common.Cloud+json

Example Response:

HTTP/1.1 200 OK Content-Type: application/oracle.com.cloud.common.Cloud+json Content-Location: cloudcompany.com Content-Length: nnn {   "uri" : "/em/cloud",   "name" : "Oracle Cloud Service Provider",   "service_templates" : {            "uri" : "/em/cloud/collection/servicetemplates",        "total" : "1" , "elements" : [           "name" :  "Small Database Service Template for SSA_USER_ROLE_1",           "uri": "/em/cloud/dbplatformtemplate/B59EDC65951039E8E040E50A8F5B0435",         "type" : "dbaas"        ]    },    "resource_state" : {     "state" : "READY"    }
}

Retrieving Information about a DbPlatformTemplate

The following shows an example request and response to retrieve the information about Small Database Service Template for an SSA_USER_ROLE.

Example Request:

GET /em/cloud/dbplatformtemplate/B59EDC65951039E8E040E50A8F5B0435 Host: cloudcompany.com Authorization: Basic xxxxxxxxxx Accept: application/oracle.com.cloud.common.DbPlatformTemplate+json

Example Response:

HTTP/1.1 200 OK Content-Type: application/oracle.com.cloud.common.DbPlatformTemplate+json Content-Location: /em/cloud/dbplatformtemplate/B59EDC65951039E8E040E50A8F5B0435 Content-Length: nnn {   "uri" : "/em/cloud/dbplatformtemplate/B59EDC65951039E8E040E50A8F5B0435",   "name" : "Small Database Service Template for SSA_USER_ROLE_1",   "description" : "Small Database Service Template for SSA_USER_ROLE_1"    "created" : "February 22, 2011 15:34:34 GMT" ,    "db_version" : "11.2.0.3.0",   "db_type" : "dbTypeSI",   "storage_type" : "File System",   "backup_enabled" : "false",   "total_memory" : "3660",   "block_size" : "8192",   "cpu" : "4",   "processes" : "150 ",   "type" : "dbaas",   "instance_configurable_params" : ["username", "password"],   "zones" : {      "uri" : "/em/cloud/dbplatformtemplate/zones/
        B59EDC65951039E8E040E50A8F5B0435"       "type" : "dbZone" ,       "total" : "1" ,      "elements" : [            {                        "uri" : "/em/cloud/dbzone/D7EEE339C1249F83FC4587C722EB20B5",      
                      "name" : "ZONE_1"         }       ]    }