47 Database as a Service SSA User REST APIs

This chapter describes the resource models of Database as a Service (DBaaS) REST APIs for SSA user, and their responses.

The REST APIs for the SSA user are classified based on the database type. The first section in this chapter provides a summary of all the REST APIs in this chapter whereas the following sections cover the REST APIs based on the database type. The sections in this chapter are as follows:

47.1 Summary of Database as a Service SSA User REST APIs

The table below shows a summary of all the DBaaS SSA user REST APIs covered in this chapter.

Table 47-1 Summary of DBaaS SSA User REST APIs

Resource Data Model GET POST PUT DELETE

Cloud

Not applicable

Not supported

Not supported

Not supported

Service family type

Not applicable

Viewing Details of the Service Family Type Resource

Not supported

Not supported

Not supported

Service instance type

Not applicable

Viewing Details of the Service Instance Type Resource

Not supported

Not supported

Not supported

Service request

Not applicable

Viewing Details of a Service Requests Resource

Not applicable

Not applicable

Not applicable

Database zone

Table 47-2

Viewing Details of the DB Zone

Not supported

Not supported

Database platform template

Table 47-3

Viewing Details of the DB Platform Template Resource

Creating a Database by Passing a Request on the DB Platform Template

Not supported

Not supported

Database platform instance

Table 47-4

Viewing the Database Creation Details

Not supported

Deleting a Database Instance

Schema platform template

Table 47-30

Viewing Details of the Schema Platform Template Resource

Creating a Schema by Passing a Request on the Schema Platform Template

Not supported

Not supported

Schema platform instance

Table 47-31

Viewing Details of the Schema Service Creation

Object Missing

Not supported

Deleting a Schema Service

Pluggable database platform template

Table 47-43

Viewing Details of the Pluggable Db Platform Template Resource

Creating a Pluggable Database by Passing a Request on the Pluggable DB Platform Template

Not supported

Not supported

Pluggable database platform instance

Table 47-44

Viewing Details of the Pluggable Database Creation

Lifecycle operations on a Pluggable Database Instance

Not supported

Deleting a Pluggable Database Instance

Note:

In the table above, “supported" indicates that the operation is supported on the resource. However, there is no example in the chapter for this operation.

47.2 Database as a Service

This section describes the resource model for Database as a Service (DBaaS) REST APIs, and the REST request or response interactions.

This section contains the following topics:

Note:

DBaaS REST APIs are only supported by the Oracle Cloud Application plug-in versions:

  • 12.1.0.4.0 with patch # 16085618

  • 12.1.0.5.0 and higher

47.2.1 Database as a Service Resource Model

Cloud resources are organized by common service entities and specific services (for example, Database as a Service) provide resources by extending these common service entities. Figure 47-1 shows the DBaaS resource model:

Figure 47-1 Database as a Service Resource Model


dbaas resource model

The following sections describe the resources that are supported by the Database as a Service family type and provide examples of supported operations.

The resource models are:

47.2.1.1 DB Zone

DB Zone extends application/oracle.com.cloud.common.Zone. This resource represents the view of a PaaS Infrastructure Zone that supports DBaaS resources. DB Zone has the media type application/oracle.com.cloud.common.DbZone+json, and the URI format is /em/cloud/dbaas/zone/<zone id>.

The following table describes the DB Zone data model.

Table 47-2 DB Zone Data Model

Field Type Description Occurs

uri

URI

A GET against this URI refreshes the client representation of the Zone definition to this user.

1

name

String

Name of the Zone. SHALL be a UNICODE string to support different languages.

1

description

String

Human readable description of the Zone. SHALL be a UNICODE string to support different languages.

0..1

resource_state

ResourceState

The resource state of the resource.

1

service_family_type

String

The name of the service family type that this zone is associated with.

It is "dbaas" for this.

1

templates

Collection <ServiceTemplate>

Collection of the service templates that this zone supports and can be deployed into. Currently, DBPlatformTemplate is the only supported type.

1

service_instances

Collection <ServiceInstance>

Collection of the service instances that are created in this zone.

1

media_type

String

The media type of the resource.

1

type

String

The type of the zone which is “self_service_zone" by default.

1

context_id

String

Zone GUID

1

canonicalLink

URI

Can be used to perform cloud interactions like GET and POST.

1

default_db_size_name

String

Selected default database size.

1

db_sizes

List<Object>

List of available database sizes.

1

47.2.1.2 DB Platform Template

The DB Platform Template extends the Service Template resource. This resource represents service templates created for creating databases. The databases may be created using profiles which are created using database templates, rman backups, and SnapClone. It is permissible to accept the Service Template media type on an instance of DB Platform Template. It is a preconfigured deployable service that realizes a DB Platform Instance resource. DB Platform Template has the media type application/oracle.com.cloud.common.DbPlatformTemplate+json, and the URI format is /em/cloud/dbaas/dbplatformtemplate/<template id>.

The following table describes the DB Platform Template data model.

Table 47-3 DB Platform Template Data Model

Field Type Description Occurs

uri

URI

A GET against this URI refreshes the client representation of the resources accessible to this user.

1

name

String

A human readable name given to the template.

1

description

String

A brief description given to the template

0..1

created

Timestamp

Date and time, in ISO 8601 format, when the template was created/last modified.

1

zones

Collection <DbZone>

List of all zones on which this service template is published

1

resource_state

ResourceState

The validity of the fields on a GET should be guaranteed only when the resource state is READY. Otherwise, the client should not assume the validity of the fields.

1

service_family_type

String

Denotes the type of Service Template. For example, "dbaas".

1

service_instances

Collection <DBPlatformInstance>

All service instances created based on this DBPlatformTemplate.

1

media_type

String

The media type of the service template that this type represents.

1

db_type

String

Type of the Database when provisioned. It can have one of the two values: "oracle_database" and "rac_database".

1

instance_configurable_params

String[]

List of parameters required to provision a DbPlatformInstance from this template. Username, Password, SID and Service name in this case.

1

deployment_params

List<Object>

Description of the parameters which are required while creating a service instance.

1

type

String

The type of the service template which is "dbaas" by default.

1

subtype

String

The sub type of the instance created based on this template.

It has a value "db" in this case.

1

node_count

 

Number of Nodes. Implicit 1 for SI DB and explicit count for the RAC Db types.

0..1

db_version

String

Version of the database which can be created using this template.

0..1

context_id

URI

The unique id of the template.

1

canonicalLink

URI

Can be used to perform cloud interactions like GET and POST.

1

sid_option

String

Option for the ssa user to specify database SID while requesting DB. This field can have either of the following values:

  • 'ssauser' - SSA user needs to specify SID

  • 'prefix' - SSA user need not to specify SID

1

standby_enabled

String

Indicates whether standby is enabled in the template.

1

standbydbs

List<Object>

List of standby database configurations.

1

standby_protection_mode

String

Indicates the protection mode of the standby database.

1

db_sizes

List<Object>

List of available database sizes.

1

default_db_size_name

String

Selected default database size.

1

47.2.1.3 DB Platform Instance

The DB Platform Instance extends the Service Instance resource. It is linked to an Oracle Database Instance or Cluster Database target in Enterprise Manager Cloud Control. DB Platform Instance has the media type application/oracle.com.cloud.common.DbPlatformInstance+json, and the URI format is /em/cloud/dbaas/dbplatforminstance/byrequest/<request id>.

The following table describes the DB Platform Instance Data Model.

Table 47-4 DB Platform Instance Data Model

Field Type Description Occurs

uri

URI

A GET against this URI refreshes the client representation of the resources accessible to this user.

1

name

String

A human readable name given to the instance.

[POST]

1

destination_zone

Zone

The Zone to which the instance is deployed.

[POST]

1

media_type

String

Indicates the additional media type that clients can use to perform a GET.

1

available_space

Float

Available space for this database instance.

0..1

resource_state

ResourceState

The validity of the fields on a GET should be guaranteed only when the resource state is READY. Otherwise, the client should not assume the validity of the fields.

1

based_on

DbPlatformTemplate

The db platform template on which this instance is published.

1

connect_string

String

Connect String required to establish a connection to this database instance.

0..1

created

String

Time of creation.

1

target_type

String

Indicates the type of the database: "oracle_database" for Single Instance database and "rac_database" for RAC database.

1

status

String

Status of the Database instance.

1

db_version

String

Version of the Database.

0..1

last_backup

Timestamp

Time at which the last backup of this database was taken.

0..1

load

Float

Current average active sessions of this instance.

0..1

master_username

String

Name of the master user of this database.

1

total_sessions

Integer

Total number of sessions for this database

0..1

total_sga^

Float

Total SGA for this database.

0..1

up_time^

Integer

Total number of hours since when this database is up.

1

context_id

String

The request id of this instance.

1

canonicalLink

URI

Can be used to perform cloud interactions like GET and DELETE for this instance.

1

instances

List<Object>

List all the node level details of the database instance (exists only when the type is "rac_database").

0..1

measurable_attributes

List<Object>

List of all the attributes with their units which can be measured.

1

total_memory*^

String

Total memory used by the instance (node).

0..1

active_sessions*

Float

Current average active sessions for this instance (node).

0..1

cpu_utilization*^

Percentage

CPU utilization of this instance (node).

0..1

db_time*^

Float

Database time of this instance (node).

0..1

cpu_count*^

Integer

Number of CPU cores on the host on which the instance (node) is deployed.

0..1

allocated_sessions*

Integer

Number of sessions currently allocated.

0..1

name*

String

Name of the node (exists as an field in the list of "instances" field).

0..1

standby_databases

List<Object>

List of standby databases configured for this instance.

1

standby_database_configured

String

Indicates if standby database is configured for this service instance.

1

Note:

* In case of database instance type "oracle_database", the above fields exist as it is in the DBPlatformInstance Data model. In case of type "rac_database", these fields exist as part of "instances" field and occur for each node of the cluster database.

^ - These attributes can be measured in units and so are represented as Json Objects (like a map) having "name" (as the name of the attribute), "value" (as the value of the attribute) and "units" (as the unit of the attribute). Each such field is a list element of "measurable_attributes" field (which exists at instance level for oracle_database and at RAC node level in case of rac_database).

47.2.2 Supported Operations for Database as a Service Resources

The following table lists all the operations that are supported on the various Database as a Service resources.

Table 47-5 Supported Operations for DBaaS Resources

Resource GET POST PUT DELETE

Cloud

Yes

No

No

No

Service Family Type

Yes

No

No

No

DB Zone

Yes

Yes

No

No

DB Platform Template [Service Template]

Yes

Yes

No

No

DB Platform Instance [Service Instance]

Yes

Yes

No

Yes

47.2.3 Database as a Service REST API Examples

The following sections provide examples of interaction with Enterprise Manager Cloud Control with Cloud Application plug-in 12.1.0.4 and higher. The following examples are covered:

47.2.3.1 Viewing Details of All the Cloud Resources

Use the top level /em/cloud to introspect the Cloud resource. The operation explained herein lists all the resources accessible to the user.

Table 47-6 GET Request Configuration for Viewing Details of All the Cloud Resources

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the Cloud resource is shown below.

{
  "uri": "/em/cloud",
  "name": "Oracle Cloud by Enterprise Manager",
  "description": "This represents the Cloud resource of the Oracle Enterprise Manager Cloud Management solution",
  "resource_state": {
    "state": "READY"
  },
  "media_type": "application/oracle.com.cloud.common.Cloud+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud",
  "zones": {
    "media_type": "application/oracle.com.cloud.common.Zone+json",
    "total": "4",
    "elements": [
      {
        "uri": "/em/cloud/jaas/zone/9708491651C090AB4B847C2F3CD177DE",
        "name": "SLC00ECXY_ZONE",
        "media_type": "application/oracle.com.cloud.jaas.Zone+json",
        "service_family_type": "jaas",
        "type": "jaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/jaas/zone/9708491651C090AB4B847C2F3CD177DE"
      },
      {
        "uri": "/em/cloud/jaas/zone/B329742A13BE0D63703BF0C0E4F98FB9",
        "name": "SLC01NBV_ZONE",
        "media_type": "application/oracle.com.cloud.jaas.Zone+json",
        "service_family_type": "jaas",
        "type": "jaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/jaas/zone/B329742A13BE0D63703BF0C0E4F98FB9"
      },
      {
        "uri": "/em/cloud/dbaas/zone/9708491651C090AB4B847C2F3CD177DE",
        "name": "SLC00ECXY_ZONE",
        "description": "",
        "media_type": "application/oracle.com.cloud.common.DbZone+json",
        "service_family_type": "dbaas",
        "type": "self_service_zone",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/9708491651C090AB4B847C2F3CD177DE"
      },
      {
        "uri": "/em/cloud/dbaas/zone/B329742A13BE0D63703BF0C0E4F98FB9",
        "name": "SLC01NBV_ZONE",
        "description": "SLC01NBV_ZONE",
        "media_type": "application/oracle.com.cloud.common.DbZone+json",
        "service_family_type": "dbaas",
        "type": "self_service_zone",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/B329742A13BE0D63703BF0C0E4F98FB9"
      }
    ]
  },
  "service_templates": {
    "media_type": "application/oracle.com.cloud.common.ServiceTemplate+json",
    "total": "2",
    "elements": [
      {
        "uri": "/em/cloud/dbaas/dbplatformtemplate/DEC94FE6D49DAA21E040F20A60511D14",
        "name": "SLC01NBV_SNAPCLONE_ST",
        "description": "",
        "media_type": "application/oracle.com.cloud.common.DbPlatformTemplate+json",
        "service_family_type": "dbaas",
        "type": "dbaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatformtemplate/DEC94FE6D49DAA21E040F20A60511D14"
      },
      {
        "uri": "/em/cloud/dbaas/dbplatformtemplate/DECCA0E18357F28DE040F20A60514D49",
        "name": "SLC00ECXY_DBCA_ST",
        "description": "",
        "media_type": "application/oracle.com.cloud.common.DbPlatformTemplate+json",
        "service_family_type": "dbaas",
        "type": "dbaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatformtemplate/DECCA0E18357F28DE040F20A60514D49"
      }
    ]
  },
  "service_family_types": {
    "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
    "total": "4",
    "elements": [
      {
        "uri": "/em/cloud/service_family_type/jaas",
        "name": "jaas",
        "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
        "type": "jaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/jaas"
      },
      {
        "uri": "/em/cloud/service_family_type/dbaas",
        "name": "dbaas",
        "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
        "type": "dbaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/dbaas"
      },
      {
        "uri": "/em/cloud/service_family_type/opc",
        "name": "opc",
        "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
        "type": "opc",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/opc"
      },
      {
        "uri": "/em/cloud/service_family_type/iaas",
        "name": "iaas",
        "media_type": "application/oracle.com.cloud.iaas.IaasServiceFamilyType+json",
        "type": "iaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/iaas"
      }
    ]
  },
  "service_requests": {
    "media_type": "application/oracle.com.cloud.common.Request+json",
    "total": "1",
    "elements": [
      {
        "uri": "/em/cloud/request/DEC87CE5B1DA175DE040F20A605150F8",
        "name": "SLC01NBV_DBCA_ST - Mon Jun 10 00:20:08 PDT 2013_CREATE_20_25",
        "media_type": "application/oracle.com.cloud.common.Request+json",
        "status": "SUCCESS",
        "lifecycle_type": "CREATE",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/request/DEC87CE5B1DA175DE040F20A605150F8"
      }
    ]
  }
}

Note:

Even though the Accept type was not specified, the Web service still unambiguously returns the cloud resource as the "/em/cloud" address uniquely identifies the cloud as the default resource to be returned.

47.2.3.2 Filtering Output for Specific Resource Attributes

The following description indicates the interaction with the cloud resource for identifying specific attributes (service family type in this case):

Table 47-7 GET Request Configuration for Filtering Specific Resource Attributes

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud?service_family_types,name

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "name": "Oracle Cloud by Enterprise Manager",
  "service_family_types": {
    "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
    "total": "4",
    "elements": [
      {
        "uri": "/em/cloud/service_family_type/jaas",
        "name": "jaas",
        "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
        "type": "jaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/jaas"
      },
      {
        "uri": "/em/cloud/service_family_type/dbaas",
        "name": "dbaas",
        "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
        "type": "dbaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/dbaas"
      },
      {
        "uri": "/em/cloud/service_family_type/opc",
        "name": "opc",
        "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
        "type": "opc",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/opc"
      },
      {
        "uri": "/em/cloud/service_family_type/iaas",
        "name": "iaas",
        "media_type": "application/oracle.com.cloud.iaas.IaasServiceFamilyType+json",
        "type": "iaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/iaas"
      }
    ]
  }
} 

This feature, where only selective attributes are gathered and returned to the client, is supported on all the common resources.

47.2.3.3 Viewing Details of the Service Family Type Resource

The GET operation on the Service Family Type resource lists all the DBaaS resources accessible to a user. The configuration for the Service Family Type resource is as follows:

Table 47-8 GET Request Configuration for Viewing Details of the Service Family Type Resource

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/service_family_types/dbaas

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

X-specification-version: 10001
Content-Type: application/oracle.com.cloud.common.ServiceFamilyType+json; charset=ISO-8859-1
{
  "uri": "/em/cloud/service_family_type/dbaas",
  "name": "dbaas",
  "resource_state": {
    "state": "READY"
  },
  "media_type": "application/oracle.com.cloud.common.ServiceFamilyType+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/service_family_type/dbaas",
  "type": "dbaas",
  "service_templates": {
    "media_type": "application/oracle.com.cloud.common.ServiceTemplate+json",
    "total": "2",
    "elements": [
      {
        "uri": "/em/cloud/dbaas/dbplatformtemplate/DEC94FE6D49DAA21E040F20A60511D14",
        "name": "SLC01NBV_SNAPCLONE_ST",
        "description": "",
        "media_type": "application/oracle.com.cloud.common.DbPlatformTemplate+json",
        "service_family_type": "dbaas",
        "type": "dbaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatformtemplate/DEC94FE6D49DAA21E040F20A60511D14"
      },
      {
        "uri": "/em/cloud/dbaas/dbplatformtemplate/DECCA0E18357F28DE040F20A60514D49",
        "name": "SLC00ECXY_DBCA_ST",
        "description": "",
        "media_type": "application/oracle.com.cloud.common.DbPlatformTemplate+json",
        "service_family_type": "dbaas",
        "type": "dbaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatformtemplate/DECCA0E18357F28DE040F20A60514D49"
      }
    ]
  },
  "zones": {
    "media_type": "application/oracle.com.cloud.common.Zone+json",
    "total": "2",
    "elements": [
      {
        "uri": "/em/cloud/dbaas/zone/9708491651C090AB4B847C2F3CD177DE",
        "name": "SLC00ECXY_ZONE",
        "description": "",
        "media_type": "application/oracle.com.cloud.common.DbZone+json",
        "service_family_type": "dbaas",
        "type": "self_service_zone",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/9708491651C090AB4B847C2F3CD177DE"
      },
      {
        "uri": "/em/cloud/dbaas/zone/B329742A13BE0D63703BF0C0E4F98FB9",
        "name": "SLC01NBV_ZONE",
        "description": "SLC01NBV_ZONE",
        "media_type": "application/oracle.com.cloud.common.DbZone+json",
        "service_family_type": "dbaas",
        "type": "self_service_zone",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/B329742A13BE0D63703BF0C0E4F98FB9"
      }
    ]
  },
  "instance_types": {
    "media_type": "application/oracle.com.cloud.common.InstanceType+json",
    "total": "1",
    "elements": [
      {
        "uri": "/em/cloud/instance_type/dbPlatformInstance%40dbaas",
        "name": "dbPlatformInstance",
        "description": "Db Instance",
        "media_type": "application/oracle.com.cloud.common.InstanceType+json",
        "instance_media_type": "application/oracle.com.cloud.common.DbPlatformInstance+json",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/instance_type/dbPlatformInstance%40dbaas"
      }
    ]
  },
  "service_requests": {
    "media_type": "application/oracle.com.cloud.common.Request+json",
    "total": "1",
    "elements": [
      {
        "uri": "/em/cloud/request/DEC87CE5B1DA175DE040F20A605150F8",
        "name": "SLC01NBV_DBCA_ST - Mon Jun 10 00:20:08 PDT 2013_CREATE_20_25",
        "media_type": "application/oracle.com.cloud.common.Request+json",
        "status": "SUCCESS",
        "lifecycle_type": "CREATE",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/request/DEC87CE5B1DA175DE040F20A605150F8"
      }
    ]
  }
}

The media type application/oracle.com.cloud.common.ServiceFamilyType+json is returned automatically as the most detailed resource.

47.2.3.4 Viewing Details of the Service Instance Type Resource

A GET request on a Service Instance Type resource list all the supported services that are provided by a particular service family type.

Table 47-9 GET Request Configuration for Viewing Details of the Service Instance Type Resource

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/instance_type/dbPlatformInstance%40dbaas

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/instance_type/dbPlatformInstance%40dbaas" ,
  "name" : "dbPlatformInstance" ,
  "description" : "Db Instance" ,
  "media_type" : "application/oracle.com.cloud.common.InstanceType+json" ,
  "instance_media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" , ,
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/instance_type/dbPlatformInstance%40dbaas"
}

47.2.3.5 Viewing Details of a Service Requests Resource

A GET request on a Service Requests resource lists the details of a service request.

Table 47-10 GET Request Configuration for Viewing Details of a Service Request Resource

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/extws/cloudservices/ssa/cfw/v2/servicerequests/<request_id>

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
       "id": "21",
       "name": "Request a RAC One Database_CREATE_43_47#21",
       "status": "SUCCESS",
       "serviceType": "DB",
       "serviceFamily": "DBAAS",
       "actionName": "Create Database",
       "startDate": "2015-07-21T17:13:47Z",
       "createdOn": "2015-07-21T17:13:47Z",
       "createdBy": "SYSMAN",
       "owner": "SYSMAN",
       "canonicalLink":
       {
           "href": "https://blr.example.com:4473/em/websvcs/restful/extws/cloudservices/ssa/cfw/v2/servicerequests/21"
       },
       "description": "Create Database for "Request a RAC One Database".",
       "executionLogs": "https://blr.example.com:4473/em/websvcs/restful/extws/cloudservices/ssa/cfw/v2/servicerequests/21/logs"
    }

47.2.3.6 Viewing Details of the DB Zone

A GET request on a zone lists all the resources available in the zone. The DB zone resource configuration is as follows:

Table 47-11 GET Request Configuration for Viewing Details of the DB Zone

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/zone/B49F86387B81DAED9A3D672D722CF29D" ,
  "name" : "RAC SSAZONE" ,
  "description" : "SSA Zone with RAC Nodes" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "context_id" : "B49F86387B81DAED9A3D672D722CF29D" ,
  "media_type" : "application/oracle.com.cloud.common.DbZone+json" ,
  "service_family_type" : "dbaas" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/B49F86387B81DAED9A3D672D722CF29D" ,
  "type" : "self_service_zone" ,
  "service_instances" :     {
      "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
      "total" : "1" ,
      "elements" : 
      [
          {
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/1" ,
            "name" : "db000000.mycompany.com" ,
            "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
            "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/1" ,
            "type" : "rac_database"
          }
      ]
    } ,
  "templates" :     {
      "media_type" : "application/oracle.com.cloud.common.DbPlatformTemplate+json" ,
      "total" : "1" ,
      "elements" : 
      [
          {
            "uri" : "/em/cloud/dbaas/dbplatformtemplate/DE039DAC33FFEA6FE040E80A687848A6" ,
            "name" : "12101_RACFileSystem_ServiceTemplate" ,
            "description" : "12101 RAC FileSystem Service Template" ,
            "media_type" : "application/oracle.com.cloud.common.DbPlatformTemplate+json" ,
            "service_family_type" : "dbaas" ,
            "type" : "dbaas" ,
            "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatformtemplate/DE039DAC33FFEA6FE040E80A687848A6"
          }
      ]
    }
}

47.2.3.7 Viewing Details of the DB Platform Template Resource

A GET request on the DB Platform Template resource provides details of a DB Service Template.

As shown in previous examples, the elements in the collection shown all have media_type as an attribute to clearly indicate what its resource type is.

Table 47-12 GET Request Configuration for Viewing Details of the DB Platform Template Resource

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud//dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatformtemplate/F985CAE9AB916591E043A4BBF00A235D" ,
  "name" : "Platinum - Star Hotel Application on 2-node RAC Database with Multiple Standbys" ,
  "description" : "Provisions Star Hotel Application on 2-node 11.2.0.4 RAC Database with RAC & SI Standbys" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformTemplate+json" ,
  "service_family_type" : "dbaas" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatformtemplate/F985CAE9AB916591E043A4BBF00A235D" ,
  "type" : "dbaas" ,
  "created" : "2014-05-16T13:57:22+0000" ,
  "zones" :     {
      "media_type" : "application/oracle.com.cloud.common.DbZone+json" ,
      "total" : "1" ,
      "elements" : 
      [
          {
            "uri" : "/em/cloud/dbaas/zone/F985A268D9175B9FE043A4BBF00A3573" ,
            "name" : "Salt Lake City DC" ,
            "description" : "" ,
            "context_id" : "F985A268D9175B9FE043A4BBF00A3573" ,
            "media_type" : "application/oracle.com.cloud.common.DbZone+json" ,
            "service_family_type" : "dbaas" ,
            "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/F985A268D9175B9FE043A4BBF00A3573" ,
            "type" : "self_service_zone"
            "clusters_for_placement" : 
            [
                {
                  "clusterName" : "cluster1" ,
                  "hostsInCluster" : 
                  [
                    "abc.mycompany.com" ,
                    "def.mycompany.com" ,
                    "ghi.mycompany.com"
                  ]
                } ,
                {
                  "clusterName" : "cluster2" ,
                  "hostsInCluster" : 
                  [
                    "xyz.mycompany.com" ,
                    "pqr.mycompany.com"
                  ]
                }
            ]
          }
      ]
    } ,
  "service_instances" :     {
      "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
      "total" : "1" ,
      "elements" : 
      [
          {
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/1" ,
            "name" : "xxyy.example.com" ,
            "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
            "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/1" ,
            "target_type" : "rac_database"
          }
      ]
    } ,
  "deployment_params" : 
  [
      {
        "name" : "username" ,
        "description" : "Master account Username" ,
        "type" : "STRING" ,
        "require" : "true" ,
        "sensitive" : "false"
      } ,
      {
        "name" : "password" ,
        "description" : "Password for the Master account" ,
        "type" : "STRING" ,
        "require" : "true" ,
        "sensitive" : "true"
      } ,
      {
        "name" : "database_sid" ,
        "description" : "Database SID. Required only if sid_option is ssauser." ,
        "type" : "STRING" ,
        "require" : "true" ,
        "sensitive" : "false"
      } ,
      {
        "name" : "service_name" ,
        "description" : "Database Service Name" ,
        "type" : "STRING" ,
        "require" : "true" ,
        "sensitive" : "false"
      } ,
{
        "name" : "database_host_name" ,
        "description" : "Name of the host(s) to be chosen for creating the database instance. For RAC database instance, multiple host names can be provided as comma separated values." ,
        "type" : "STRING" ,
        "require" : "false" ,
        "sensitive" : "false"
      } ,
      {
        "name" : "standbydbs" ,
        "description" : "List of the standby databases. Required only if standby database is enabled and required" ,
        "type" : "LIST" ,
        "defaultValue" : 
        [
            {
              "name" : "standbydb_name" ,
              "description" : "Name of the standby database, specified in the standbydbs list" ,
              "type" : "STRING" ,
              "require" : "true" ,
              "sensitive" : "false"
            } ,
            {
              "name" : "standbydb_sid" ,
              "description" : "SID of the standby database" ,
              "type" : "STRING" ,
              "require" : "true" ,
              "sensitive" : "false"
            }
        ] ,
        "require" : "false" ,
        "sensitive" : "false"
      }
{
        "name" : "db_size_name" ,
        "description" : "DB Size name to be associated with the request" ,
        "type" : "STRING" ,
        "require" : "false" ,
        "sensitive" : "false"
      } ,
  ] ,
  "subtype" : "db" ,
  "db_type" : "rac_database" ,
  "node_count" : "2" ,
  "sid_option" : "ssauser" ,
  "standbydbs" : 
  [
      {
        "standbydb_name" : "Near DR" ,
        "standbydb_type" : "rac_database"
      } ,
      {
        "standbydb_name" : "Far DR" ,
        "standbydb_type" : "oracle_database"
      }
  ] ,
  "standby_enabled" : "true" ,
  "placement_option" : "SELECT_ORACLE_HOME_FROM_REQUEST" ,
  "standby_protection_mode" : "MAXIMIZE AVAILABILITY" ,
  "instance_configurable_params" :     {
      "username" : "" ,
      "password" : "" ,
      "database_sid" : "" ,
      "service_name" : ""
    }
}
"db_sizes" :
  [
      {
        "name" : "Large" ,
        "description" : "Large size database" ,
        "attributes" :
        [
            {
              "name" : "CPU" ,
              "value" : "0" ,
              "units" : "cores"
            } ,
            {
              "name" : "Memory" ,
              "value" : "8" ,
              "units" : "GB"
            } ,
            {
              "name" : "Storage" ,
              "value" : "500" ,
              "units" : "GB"
            }
        ]
      } ,
      {
        "name" : "Medium" ,
        "description" : "Medium size database" ,
        "attributes" :
        [
            {
              "name" : "CPU" ,
              "value" : "4" ,
              "units" : "cores"
            } ,
            {
              "name" : "Memory" ,
              "value" : "6" ,
              "units" : "GB"
            } ,
            {
              "name" : "Storage" ,
              "value" : "100" ,
              "units" : "GB"
            }
        ]
      } ,
      {
        "name" : "Small" ,
        "description" : "Small size database" ,
        "attributes" :
        [
            {
              "name" : "CPU" ,
              "value" : "2" ,
              "units" : "cores"
            } ,
            {
              "name" : "Memory" ,
              "value" : "4" ,
              "units" : "GB"
            } ,
            {
              "name" : "Storage" ,
              "value" : "50" ,
              "units" : "GB"
            }
        ]
      }
  ] ,
  "default_db_size_name" : "Small" ,
}

Note:

In the sample output shown above, the GET on the service template configured for a single instance database shows hosts_for_placement parameter instead of clusters_for_placement.

47.2.3.8 Creating a Database Instance

This section describes how to create a service instance using Cloud resources. As DB is a service instance in the service family type dbaas, you need to identify the zone of the same family type to create the database. There are two approaches to creating a database:

  1. By issuing a POST request on the DB Zone on which the database is to reside.
  2. By issuing a POST request on the DB Platform Template of which the database is to be based on.

Note the attributes in the submitted body for the POST. The pattern is the same for other service instance creations. Since the intention is clear, the zone attribute is not required while performing POST on the DB Zone. Similarly, the based_on attribute is not needed when performing POST on the DB Platform Template.

The two approaches to create a database are described in the following sections:

47.2.3.8.1 Creating a Database by Passing a Request on the DB Zone

The configuration for performing POST to the Db Zone is as follows:

Table 47-13 POST Request Configuration for Creating a Database by Passing a Request on the DB Zone

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
       "based_on": "/em/cloud/dbaas/dbplatformtemplate/4107",
       "name": "SI_12C_WE8MSWIN1252_AL16UTF16_8192_LRG_001",
       "description": "",
       "start_date": "2013-08-02T14:20:00ZAsia/Calcutta",
       "end_date": "2013-08-02T17:20:00ZAsia/Calcutta",
       "standby_required" : "true",
       "params":
       { 
            "username": "maoracle",
            "password": "maoracle" ,
            "database_sid" : "dngdb05h" ,
            "service_name" : "dngdb05h_svc",
                                                                                "common_domain_name" : "us.oracle.com",
 "standbydbs":
                   [
                        {
                         "standbydb_name":"standby",
                         "standbydb_sid":"dngdb06h"
                                "standbydb_domain_name":"us.oracle.com"
                        }                       
                   ]
       }
  }  

Request method

POST

Note:

In the body above start_date indicates the time, time zone and date when the request is scheduled to create the database and end_date indicates when the database should be deleted. These parameters are optional.

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/21" ,
  "name" : "Test_create_intance" ,
  "resource_state" :     {
      "state" : "INITIATED"
        "messages" : 
         [
          {
           "date" : "2014-11-25T09:52:49+0000" ,
           "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/22",       
           "text" : "Delete Request ID is : 22"
             }
              ]
    } ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "status" : "SCHEDULED"
}
47.2.3.8.2 Creating a Database by Passing a Request on the DB Platform Template

The configuration for performing POST to the DbPlatformTemplate is as follows:

Table 47-14 POST Request Configuration for Creating a Database by Passing a Request on the DB Platform Template

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
       "zone": "/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19",
       "name": "<Request name>",
       "description": "<Request Description>",
       "standby_required" : "true",
       "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",
         "database_host_name": "abc.mycompany.com,def.mycompany.com"
         " db_size_name": "Medium",
                   "standbydbs":
                   [
                        {
                         "standbydb_name":"STBY2",
                         "standbydb_sid":"stio62"
                        }                       
                   ]
"database_profile_version": "RMAN_06_27_2014_14_18_PM"
       }
}

Request method

POST

Note:

  • database_host_name parameter is mandatory if the service template is configured for custom placement.

  • The value for the database_host_name parameter should be a host present in the same zone.

  • For a SI database provide only one host name. For a RAC database the number of hosts provided should be equal to the number of nodes in the node_count, within the same zone that is specified, and in a single cluster.

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "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/23" ,
  "status" : "SCHEDULED"
}

The response shown above is the same as the previous version. If the zone is not specified, then it is not possible for the web service to determine where the DB should be deployed.

47.2.3.8.3 Creating a Container Database Instance

The configuration for performing POST to the Container Database Instance is as follows:

Table 47-15 POST Request Configuration for Creating a Container Database Instance

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{                           
        "based_on": "/em/cloud/dbaas/dbplatformtemplate/142",
        "name": "CDB instance request via REST",
        "description": "cdb using rest api",
        "params": {
                "database_sid":"rstcdb1",
                "username": "c##oracle",
                "password": "welcome",
                "service_name": "srvc_rstcdb1",
                "pdb_name": "rstcpdb1"
                                        }
}

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/21" ,
  "name" : "Test_create_intance" ,
  "resource_state" :     {
      "state" : "INITIATED"
        "messages" : 
         [
          {
           "date" : "2014-11-25T09:52:49+0000" ,
           "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/22",       
           "text" : "Delete Request ID is : 22"
             }
              ]
    } ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "status" : "SCHEDULED"
}

47.2.3.9 Viewing the Database Creation Details

After the POST is performed for the database creation, you can perform the GET operation on the resource identified by the return URI to keep track of the status.

Table 47-16 GET Request Configuration for Viewing the Database Creation Details

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

None

Request method

GET

A sample of the response received is shown below.

{
    "uri": "/em/cloud/dbaas/dbplatforminstance/byrequest/22",
    "name": "Test_create_intance_CREATE_55_42",
    "description": "Create Database for test.",
    "resource_state":
    {
      "state": "CREATING"
    },
    "context_id": "22",
    "media_type": "application/oracle.com.cloud.common.DbPlatformInstance+json",
    "status": "IN_PROGRESS",
    "created": "2013-06-07 23:09:04" ,
    "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/22"
}

Note that the resource_state attribute shows CREATING state to indicate that the database is being created. If the GET operation is performed after the database is created, the response displays the database resource in READY state, as shown below:

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "name" : "db000000.mycompany.com" ,
  "resource_state" :     {
      "state" : "READY"
        "messages" : 
         [
          {
           "date" : "2014-11-25T09:52:49+0000" ,
           "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/22",       
           "text" : "Delete Request ID is : 22"
             }
              ]
    } ,
  "context_id" : "22" , 
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-03 02:23:04" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E300FBE134EAB347E040F10A58535F16" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=cluster_name)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=db000000.mycompany.com)))" ,
  "target_type" : "rac_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/B49F86387B81DAED9A3D672D722CF29D" ,
  "total_sessions" : "165" ,
  "last_backup" : "null" ,
  "master_username" : "InstanceUser1" ,
  "db_version" : "12.1.0.1.0" ,
  "measurable_attributes" :
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "4778.555" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "699.813" ,
        "units" : "MB"
      }
  ] ,
  "instances" :
  [
      {
        "name" : "db000000. mycompany.com_db0000001" ,
        "average_active_sessions" : ".031" ,
        "allocated_sessions" : "70" ,
        "measurable_attributes" :  
        [
            {
              "name" : "cpu_utilization" ,
              "value" : "0.199" ,
              "units" : "%"
            } ,
            {
              "name" : "total_memory" ,
              "value" : "2723.867" ,
              "units" : "MB"
            } ,
            {
              "name" : "db_time" ,
              "value" : "3.103" ,
              "units" : "CentiSeconds Per Second"
            } ,
            {
              "name" : "cpu_count" ,
              "value" : "6" ,
              "units" : "Cores"
            }
        ]
      } ,
      {
        "name" : "db000000. mycompany.com_db0000002" ,
        "average_active_sessions" : ".007" ,
        "allocated_sessions" : "69" ,
        "measurable_attributes" :
        [
            {
              "name" : "cpu_utilization" ,
              "value" : "0.049" ,
              "units" : "%"
            } ,
            {
              "name" : "total_memory" ,
              "value" : "2705.378" ,
              "units" : "MB"
            } ,
            {
              "name" : "db_time" ,
              "value" : ".663" ,
              "units" : "CentiSeconds Per Second"
            } ,
            {
              "name" : "cpu_count" ,
              "value" : "6" ,
              "units" : "Cores"
            }
        ]
      },
        "standby_databases" : 
        [
         {
                "Target Name" : "xyxy.example.com" ,
                "Target Type" : "oracle_database" ,
                "Open Mode" : "MOUNTED"
        } ,
        {
                "Target Name" : "xxxy.example.com" ,
                "Target Type" : "rac_database" ,
                "Open Mode" : "READ ONLY"
        }
        ] ,
        "standby_database_configured" : "true"
  ]
}

The output in case of a single instance database (type:oracle_database) is as below:

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/81" ,
  "name" : "sidb0001.host1.mycompany.com" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "context_id" : "81" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/81" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-05 18:06:52" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E33736E8238CE06BE040F20A54666216" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= host1.mycompany.com)(PORT=1521)))(CONNECT_DATA=(SID=sidb0001)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/E33720BF45C45E24E040F20A54666214" ,
  "total_sessions" : "43" ,
  "last_backup" : "null" ,
  "master_username" : "InstanceUser1" ,
  "db_version" : "11.2.0.1.0" ,
  "average_active_sessions" : ".118" ,
  "allocated_sessions" : "42" ,
  "measurable_attributes" :
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "982.063" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "11.206" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "533.485" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "11.822" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "1" ,
        "units" : "Cores"
      }
  ],
        "standby_databases" : 
        [
                {
                "Target Name" : "xyxy.example.com" ,
                "Target Type" : "oracle_database" ,
                "Open Mode" : "MOUNTED"
                }       
        ] ,
        "standby_database_configured" : "true"
}

47.2.3.10 Updating a Database

A database which is associated to an older version of the image associated to the software pool, can be updated to the latest version (latest version of the Oracle home). To do so, execute the POST REST API shown below.

Note:

The database can be updated only to the latest version.

Table 47-17 POST Request Configuration for Updating a Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/21

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+jsonAccept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
"operation" : "UPDATE_DATABASE",
}

Request method

POST

A sample of the response received is shown below.

{
  "uri": "/em/cloud/dbaas/dbplatforminstance/byrequest/341",
  "name": "rac1.example.com",
  "resource_state": {
    "state": "INITIATED",
    "messages": [
      {
        "uri": "/em/cloud/dbaas/dbplatforminstance/byrequest/381",
        "text": "Successfully submitted ADD_STANDBY operation on service instance. Request id - 381.",
        "date": "2015-04-23T09:51:59+0000"
      }
    ]
  },
  "context_id": "341",
  "media_type": "application/oracle.com.cloud.common.DbPlatformInstance+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/341",
  "status": "RUNNING",
  "created": "2015-04-23 12:40:20.0",
  "based_on": "/em/cloud/dbaas/dbplatformtemplate/144D175E0DC07A7BE0535978B10AB9F1",
  "connect_string": "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=slc00eczeda-r)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=.us.example.com)))",
  "target_type": "rac_database",
  "destination_zone": "/em/cloud/dbaas/zone/715C91005BF1195AA6BFBC70654415E7",
  "total_sessions": "null",
  "last_backup": "null",
  "master_username": "ssauser1",
  "db_version": "null",
  "measurable_attributes": [
    {
      "name": "up_time",
      "value": "null",
      "units": "Hours"
    },
    {
      "name": "total_sga",
      "value": "null",
      "units": "MB"
    },
    {
      "name": "available_space",
      "value": "null",
      "units": "MB"
    }
  ],
  "instances": [
    {
      "name": "rac1.example.com_rac1nd2_1",
      "average_active_sessions": "null",
      "allocated_sessions": "null",
      "measurable_attributes": [
        {
          "name": "cpu_utilization",
          "value": "null",
          "units": "%"
        },
        {
          "name": "total_memory",
          "value": "null",
          "units": "MB"
        },
        {
          "name": "db_time",
          "value": "null",
          "units": "CentiSeconds Per Second"
        },
        {
          "name": "cpu_count",
          "value": "null",
          "units": "Cores"
        }
      ]
    }
  ],
  "standby_databases": [],
  "standby_database_configured": "false"
}

47.2.3.11 Deleting a Database Instance

The DELETE operation on the URI of the resource can be run to delete a DB Service Instance. The configuration values for the DELETE operation are:

Table 47-18 DELETE Request Configuration for Deleting a Database Instance

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

None

Request method

DELETE

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "name" : "db000000.mycompany.com" ,
  "resource_state" :     {
      "state" : "DESTROYING" ,
      "messages" :
      [
          {
            "text" : "Submit 'DELETE' operation on 'application/oracle.com.cloud.common.DbPlatformInstance+json' 'db000000.mycompany.com'.  The process has job id '41'" ,
            "date" : "2013-06-07T23:16:20+0000"
          }
      ]
    } ,
  "context_id" : "22" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "type" : "rac_database"
}

After a few minutes, the GET operation on the database URI will result in the following interaction:

Table 47-19 GET Request Configuration for Viewing the Database Creation Details

Feature Description

URI

/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

The web service responds with the following details:

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/23" ,
  "name" : "sidb0001.host1.mycompany.com" ,
  "resource_state" :     {
      "state" : "DESTROYING"
    } ,
  "context_id" : "23" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/23" ,
  "status" : "RUNNING" ,
  "created" : "2013-06-09 07:56:57" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/DEB2BDE2F773E356E040E50AD2E56BE9" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1.mycompany.com)(PORT=1521)))(CONNECT_DATA=(SID=sidb0001)))" ,
  "type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/DEB2E2920C20D2E1E040E50AD2E56BEF" ,
  "up_time" : "0" ,
  "load" : "0.156456056384199" ,
  "total_sessions" : "46" ,
  "total_sga" : "398.203125" ,
  "available_space" : "0.19097900390625" ,
  "last_backup" : "null" ,
  "master_username" : "InstanceUser1" ,
  "db_version" : "11.2.0.1.0" ,
  "active_sessions" : ".156" ,
  "cpu_utilization" : "5.35" ,
  "db_time" : "15.646" ,
  "cpu_count" : "1" ,
  "allocated_sessions" : "39" ,
  "total_memory" : "524.384 MB"
}

The database status indicates DELETED after the database is deleted.

47.2.3.12 Lifecycle operations on a Database Instance

The POST request on the URI of the resource can be issued to perform an operation on a database.

You can perform the following operations using a POST request:

47.2.3.12.1 Shutting down a Database

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-20 POST Request Configuration for Shutting Down a Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
        "operation" : "SHUTDOWN"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:12:30+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/127" ,
            "text" : "Successfully submitted SHUTDOWN operation on service instance. Request id - 127."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "62" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : ".01" ,
  "allocated_sessions" : "50" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "19" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "0.506" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "604.652" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "1.041" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}
47.2.3.12.2 Starting up a Database

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-21 POST Request Configuration for Starting a Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud//dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
        "operation" : "STARTUP"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:16:52+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/128" ,
            "text" : "Successfully submitted STARTUP operation on service instance. Request id - 128."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "STOPPED" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "null" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "null" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "null" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "null" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "null" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "null" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "null" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "null" ,
        "units" : "Cores"
      }
  ]
}
47.2.3.12.3 Scheduling a Backup of the Database

For scheduling a backup of the database the user has to provide the time at which backups needs to scheduled. This should be in the YYYY-MM-DDTHH:MM:SSZFullTimeZonename format.

For example, to schedule in PST time you should enter 2013-08-27T12:34:45ZAmerica/Los_Angeles. The time zone portion is optional. If you do not want to provide the time zone, then enter 2013-08-27T12:34:45Z.

If a POST request to schedule a backup has already been issued, the subsequent POST request to schedule the backup will reschedule the backup time as per the latest POST request.

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-22 POST Request Configuration for Scheduling a Backup of the Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
        "operation" : "BACKUP",
 "backup_schedule" : "2013-08-27T12:34:45ZAsia/Calcutta"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/129" ,
            "text" : "Successfully submitted BACKUP operation on service instance. Request id - 129."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xyxy.example.com)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}

After the backup is completed, the GET operation yields the response shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=slc01lxj.us.example.com)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "64" ,
  "last_backup" : "2013-08-27 07:24:04.0" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : ".027" ,
  "allocated_sessions" : "50" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "0.496" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "578.12" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "2.736" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ] ,
  "RMAN_backup_list" : 
  [
      {
        "Key" : "1" ,
        "Tag" : "ORA$OEM_LEVEL_0" ,
        "Completed Time" : "Aug 27, 2013 12:24:02 AM" ,
        "Contents" : "SPFILE,CONTROLFILE" ,
        "Status" : "AVAILABLE"
      }
  ]
}
47.2.3.12.4 Restoring a Database from a Backup

To restore a database from a backup, the user has to provide the point-in-time when the database is to be restored. The time mentioned should be in the YYYY-MM-DDTHH:MM:SSZFullTimeZonename format.

For example, to schedule in PST time you should enter 2013-08-27T12:34:45ZAmerica/Los_Angeles. Time zone is optional. If you do not want to provide the time zone, enter 2013-08-27T12:34:45Z.

The restore time is based on the backups available. Refer to RMAN_backup_list section in the output of the GET request.

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-23 POST Request Configuration for Restoring Database from a Backup

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
        "operation" : "RESTORE",
        "restore_date" : "2013-08-27T12:34:45Z"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/129" ,
            "text" : "Successfully submitted RESTORE operation on service instance. Request id - 130."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}
47.2.3.12.5 Adding a Standby Database

To add standby databases, input the standby databases which are configured in the service template. If the SID option in the service template is set as “Specified by user at request time", then provide the SID value.

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-24 POST Request Configuration for Adding a Standby Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
"operation" : "ADD_STANDBY",
"standbydbs":
   [
{
"standbydb_name":"STBY1",
"standbydb_sid":"stiq41"
}   
   ] 
}

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.abc.mycompany.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" :
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/129" ,
            "text" : "Successfully submitted ADD_STANDBY operation on service instance. Request id - 130."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" :
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}
47.2.3.12.6 Removing a Standby Database

To delete standby databases, input the standby databases which are created.

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-25 POST Request Configuration for Adding a Standby Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
"operation" : "DELETE_STANDBY",
"standbydbs":
   [
{
"standbydb_name":"xyxy.example.com",
"standbydb_type":"oracle_database"
}   
   ] 
}

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.abc.mycompany.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" :
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/129" ,
            "text" : "Successfully submitted DELETE_STANDBY operation on service instance. Request id - 130."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" :
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
     {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}
47.2.3.12.7 Refreshing a Database

The database can be refreshed to a new version of the profile by providing the name of the profile version.

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-26 POST Request Configuration for Adding a Standby Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
"operation" : "REFRESH_DATABASE",
"database_profile_version": "RMAN_06_27_2014_13_18_PM"
}

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.abc.mycompany.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" :
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/129" ,
            "text" : "Successfully submitted REFRESH_DATABASE operation on service instance. Request id - 130."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" :
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}

47.2.3.13 Lifecycle operations on a Snap clone Database Instance

The POST request on the URI of the resource can be run to perform an operation on a database. The following operations can be performed by using POST.

47.2.3.13.1 Creating a Snapshot

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-27 POST Request Configuration for Creating a Snapshot

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
        "operation" : "CREATE_PROFILE",
        "snapshot_name" : "test_API_export",
        "snapshot_desc" : "testing export option from APIs"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/129" ,
            "text" : "Successfully submitted CREATE_PROFILE operation on service instance. Request id - 130."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}

After the snapshot is created, the response of a GET operations yields the result shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/143" ,
            "text" : "Successfully submitted CREATE_PROFILE operation on service instance. Request id - 143."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
"snapclone_profile_list" : 
  [
      {
        "Name" : "test_API_export" ,
        "Description" : "testing export option from APIs" ,
        "URN" : "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbProfile:E4E9E7EE230BF965E040F20A60517256:0.1" ,
        "Submission Guid" : "DD269BBA774E0159E040F20A60513010" ,
        "Creation Date" : "Mon Aug 20 05:54:03 PDT 2013" ,
        "Status" : "Ready"
      }
  ]
}
47.2.3.13.2 Restoring from a Snapshot List

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-28 POST Request Configuration for Restoring from a Snapshot List

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
        "operation" : "RESTORE_PROFILE",
        "snapshot_urn" : "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbProfile:DECAD7B3145E6808E040F20A605130A2:0.1"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/144" ,
            "text" : "Successfully submitted RESTORE_PROFILE operation on service instance. Request id - 144."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}
47.2.3.13.3 Deleting a Snapshot

The configurations for the POST on a DbPlatformInstance is as follows:

Table 47-29 POST Request Configuration for Restoring from a Snapshot List

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json

Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

Body

{
        "operation" : " DELETE_PROFILE",
        "snapshot_urn" : "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbProfile:DECAD7B3145E6808E040F20A605130A2:0.1"        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "name" : "dbc00000.xyxy.example.com" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:17:56+0000" ,
            "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/148" ,
            "text" : "Successfully submitted DELETE_PROFILE operation on service instance. Request id - 148."
          }
      ]
    } ,
  "context_id" : "101" ,
  "media_type" : "application/oracle.com.cloud.common.DbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 05:09:13" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/E4D9626BC260F517E040F20A605152CD" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SID=dbc00000)))" ,
  "target_type" : "oracle_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "total_sessions" : "0" ,
  "last_backup" : "null" ,
  "master_username" : "test" ,
  "db_version" : "11.2.0.2.0" ,
  "average_active_sessions" : "null" ,
  "allocated_sessions" : "46" ,
  "measurable_attributes" : 
  [
      {
        "name" : "up_time" ,
        "value" : "0" ,
        "units" : "Hours"
      } ,
      {
        "name" : "total_sga" ,
        "value" : "398.203" ,
        "units" : "MB"
      } ,
      {
        "name" : "available_space" ,
        "value" : "537.172" ,
        "units" : "MB"
      } ,
      {
        "name" : "cpu_utilization" ,
        "value" : "null" ,
        "units" : "%"
      } ,
      {
        "name" : "total_memory" ,
        "value" : "575.043" ,
        "units" : "MB"
      } ,
      {
        "name" : "db_time" ,
        "value" : "null" ,
        "units" : "CentiSeconds Per Second"
      } ,
      {
        "name" : "cpu_count" ,
        "value" : "2" ,
        "units" : "Cores"
      }
  ]
}

47.3 Schema as a Service

This section describes the resource model for Schema as a Service (SchaaS) REST API and the REST request/response interactions.

Note:

SchaaS REST APIs are only supported by the Oracle Cloud Application plug-in version 12.1.0.6.0 and higher

This section contains the following topics:

47.3.1 Schema as a Service Resource Model

Cloud resources are organized by common service entities, and specific services (for example, Schema as a Service) provide resources by extending these common service entities. The figure below shows the SchaaS resource model.

Figure 47-2 Schema as a Service Resource Model


Schema as a Service Resource Model

The following sections describe the resources that are supported by the Schema as a Service REST APIs and provide examples of supported operations. Schema as a Service uses the same Cloud, Service Family, and DB Zone resources as described in Database as a Service Resource Model.

. The following resource models are described:

47.3.1.1 Schema Platform Template

The Schema Platform Template extends the Service Template resource. It represents the service template created for Schema Service creation. It can be a template for creating a schema service using profile based schemas (schema with data) or for creating a schemas service containing empty schemas.

It is permissible to accept the Service Template media type on an instance of Schema Platform Template. It is a preconfigured deployable service that realizes a Schema Platform Instance resource. Schema Platform Template has the media type application/oracle.com.cloud.common.SchemaPlatformTemplate and URI format /em/cloud/dbaas/schemaplatformtemplate/<template id>.

The following table describes the Schema Platform Template Data Model.

Table 47-30 Schema Platform Template Data Model

Field Type Description Occurs

uri

URI

A GET against this URI refreshes the client representation of the resources accessible to this user.

1

name

String

A human readable name given to the template.

1

description

String

A brief description given to the template.

0..1

created

Timestamp

Date and time, in ISO 8601 format, when the template was created/last modified.

1

resource_state

ResourceState

The validity of the fields on a GET should be guaranteed only when the resource state is READY. Otherwise, the client should not assume the validity of the fields.

1

zones

Collection <DbZone>

List of all zones configured for this template.

0..1

service_instances

Collection <SchemaPlatformInstance>

All service instances created based on this SchemaPlatformTemplate.

0..1

media_type

String

The media type of the service template that this type represents.

1

params

Object

List of parameters required to provision a Schema Platform Instance from this template.

1

deployment_params

List<Object>

Description of the parameters which are required while creating a service instance.

1

type

String

The type of the service template which is "dbaas" by default.

1

subtype

String

The sub type of the instance created based on this template.

It has a value "schema" in this case.

1

template_type

String

Type of this template based on how the template got created. It can have any of two values : "EMPTY_SCHEMAS" or "SCHEMAS_FROM_PROFILE".

1

max_number_of_schemas

Integer

Maximum number of schemas that can be created in a single instance request. This field exists only if template_type is "EMPTY_SCHEMAS".

0..1

workloads

List<Object>

List all the workloads defined for this template and list the attributes for each one of them.

0..1

canonicalLink

URI

Can be used to perform cloud interactions like GET and POST.

1

tablespace_list

List<Object>

List of tablespaces in schema.

1

47.3.1.2 Schema Platform Instance

The Schema Platform Instance extends the Service Instance resource. It is linked to Oracle Database Service target in Enterprise Manager Cloud Control. Schema Platform Instance has the media type application/oracle.com.cloud.common.SchemaPlatformInstance and URI /em/cloud/dbaas/schemaplatforminstance/byrequest/<request id>.

The following table describes the Schema Platform Instance data model:

Table 47-31 Schema Platform Instance Data Model

Field Type Description Occurs

uri

URI

A GET against this URI refreshes the client representation of the resources accessible to this user.

1

name

String

A human readable name given to the database service[POST]

1

destination_zone

Zone

The Zone to which the database service is deployed

[POST]

1

created

Timestamp

Date and time, in ISO 8601 format, when the template was created/last modified.

1

resource_state

ResourceState

The validity of the fields on a GET should be guaranteed only when the resource state is READY. Otherwise, the client should not assume the validity of the fields.

1

based_on

SchemaPlatformTemplate

The schema platform template on which this database service is published.

1

media_type

String

Indicates the additional media type that clients can use to perform a GET.

1

canonicalLink

URI

Can be used to perform cloud interactions like GET and POST.

1

type

String

Type of the database service. It has the default value "oracle_dbsvc".

1

connect_string

String

Connect String required to establish a connection to this database service.

0..1

status

String

Status of the database service.

1

db_version

String

Version of the database on which this service is running.

0..1

context_id

String

The request id of this database service.

1

47.3.2 Supported Operations for Schema as a Service Resources

The following table lists all the operations that are supported on the various Schema as a Service resources.

Table 47-32 Supported Operations

Resource Operations (GET, POST, PUT, and DELETE) POST PUT DELETE

Cloud

Yes

No

No

No

Service Family Type

Yes

No

No

No

DB Zone

Yes

Yes

No

No

Schema Platform Template [Service Template]

Yes

Yes

No

No

Schema Platform Instance [Service Instance]

Yes

Yes

No

Yes

47.3.3 Schema as a Service REST API Examples

The following sections provide examples of interaction with Enterprise Manager Cloud Control with Cloud Application plug-in 12.1.0.6 and higher. The examples for GET on cloud, GET on dbaas family type and GET on Db Zone are covered in the Dbaas REST APIs section. The following examples are covered:

47.3.3.1 Viewing Details of the Schema Platform Template Resource

A GET request on the Schema Platform Template resource provides the details of the resource.

Table 47-33 GET Request Configuration for Viewing Details of the Schema Platform Template Resource

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatformtemplate/DE3F8D882F132F45E040F00AAA2330C5

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "max_number_of_schemas" : "" ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformTemplate+json" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "tablespace_list" : 
  [
    "DUMPTBSP1" ,
    "DUMPTBSP2"
  ] ,
  "params" :     {
      "schema" : 
      [
          {
            "username" : "" ,
            "password" : "" ,
            "original_name" : "SCHEMA_USER_1"
          } ,
          {
            "username" : "" ,
            "password" : "" ,
            "original_name" : "SCHEMA_USER_2"
          }
      ] ,
      "service_name_prefix" : "" ,
      "workload_name" : "" ,
      "tablespaces" : 
      [
          {
            "old_tablespace_name" : "DUMPTBSP1" ,
            "new_tablespace_name" : ""
          } ,
          {
            "old_tablespace_name" : "DUMPTBSP2" ,
            "new_tablespace_name" : ""
          }
      ]
    } ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatformtemplate/FADFFB8A434244F1E043797EF00A63AE" ,
  "template_type" : "SCHEMAS_FROM_PROFILE" ,
  "type" : "dbaas" ,
  "zones" :     {
      "total" : "1" ,
      "media_type" : "application/oracle.com.cloud.common.DbZone+json" ,
      "elements" : 
      [
          {
            "media_type" : "application/oracle.com.cloud.common.DbZone+json" ,
            "context_id" : "2348838861AFF7BC02912C402605D49F" ,
            "description" : "SSA Zone with SI Nodes" ,
            "service_family_type" : "dbaas" ,
            "name" : "SI SSAZONE" ,
            "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/2348838861AFF7BC02912C402605D49F" ,
            "type" : "self_service_zone" ,
            "uri" : "/em/cloud/dbaas/zone/2348838861AFF7BC02912C402605D49F"
          }
      ]
    } ,
  "uri" : "/em/cloud/dbaas/schemaplatformtemplate/FADFFB8A434244F1E043797EF00A63AE" ,
  "service_instances" :     {
      "total" : "1" ,
      "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
      "elements" : 
      [
          {
            "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
            "name" : "SIFSDifftbspc" ,
            "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/1" ,
            "target_type" : "oracle_dbsvc" ,
            "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/1"
          }
      ]
    } ,
  "created" : "2014-06-02T19:38:04+0000" ,
  "description" : "11204 SIDB FileSystem Schema Service Template - Import Schema - Different TableSpace for Each Schema" ,
  "name" : "11204_SIFS_SCHEMATEMPLATE_IMPORTSCHEMA_DIFFTBSPC" ,
  "subtype" : "schema" ,
  "workloads" : 
  [
      {
        "description" : "LARGE" ,
        "name" : "LARGE" ,
        "attributes" : 
        [
            {
              "name" : "CPU" ,
              "value" : "1" ,
              "units" : "cores"
            } ,
            {
              "name" : "Memory" ,
              "value" : "1" ,
              "units" : "GB"
            } ,
            {
              "name" : "Storage" ,
              "value" : "10" ,
              "units" : "GB"
            }
        ]
      } ,
      {
        "description" : "MEDIUM" ,
        "name" : "MEDIUM" ,
        "attributes" : 
        [
            {
              "name" : "CPU" ,
              "value" : "0.5" ,
              "units" : "cores"
            } ,
            {
              "name" : "Memory" ,
              "value" : "0.5" ,
              "units" : "GB"
            } ,
            {
              "name" : "Storage" ,
              "value" : "5" ,
              "units" : "GB"
            }
        ]
      } ,
      {
        "description" : "SMALL" ,
        "name" : "SMALL" ,
        "attributes" : 
        [
            {
              "name" : "CPU" ,
              "value" : "0.3" ,
              "units" : "cores"
            } ,
            {
              "name" : "Memory" ,
              "value" : "0.3" ,
              "units" : "GB"
            } ,
            {
              "name" : "Storage" ,
              "value" : "3" ,
              "units" : "GB"
            }
        ]
      }
  ] ,
  "schema_list" : 
  [
    "SCHEMA_USER_1" ,
    "SCHEMA_USER_2"
  ] ,
  "deployment_params" : 
  [
      {
        "description" : "Master account schema. Not Required for the SCHEMAS_FROM_PROFILE Schema templates" ,
        "name" : "masterAccount" ,
        "require" : "false" ,
        "type" : "STRING" ,
        "sensitive" : "false"
      } ,
      {
        "description" : "Prefix for the service name instances" ,
        "name" : "service_name_prefix" ,
        "require" : "true" ,
        "type" : "STRING" ,
        "sensitive" : "false"
      } ,
      {
        "description" : "WorkLoad name to be associated with the request" ,
        "name" : "workload_name" ,
        "require" : "true" ,
        "type" : "STRING" ,
        "sensitive" : "false"
      } ,
      {
        "description" : "Common password for all schema users." ,
        "name" : "common_password" ,
        "require" : "false" ,
        "type" : "STRING" ,
        "sensitive" : "true"
      } ,
      {
        "description" : "List of schema to be created" ,
        "name" : "schema" ,
        "require" : "true" ,
        "defaultValue" : 
        [
            {
              "description" : "New schema name" ,
              "name" : "username" ,
              "require" : "true" ,
              "type" : "STRING" ,
              "sensitive" : "false"
            } ,
            {
              "description" : "Original schema name. Required only for the SCHEMAS_FROM_PROFILE Schema templates" ,
              "name" : "original_name" ,
              "require" : "false" ,
              "type" : "STRING" ,
              "sensitive" : "false"
            } ,
            {
              "description" : "Password for the schema. Required only if common_password is not specified." ,
              "name" : "password" ,
              "require" : "false" ,
              "type" : "STRING" ,
              "sensitive" : "true"
            }
        ] ,
        "type" : "LIST" ,
        "sensitive" : "false"
      } ,
      {
        "description" : "List of tablespaces remap. Required only for the SCHEMAS_FROM_PROFILE Schema templates." ,
        "name" : "tablespaces" ,
        "require" : "false" ,
        "defaultValue" : 
        [
            {
              "description" : "New tablespace name." ,
              "name" : "new_tablespace_name" ,
              "require" : "true" ,
              "type" : "STRING" ,
              "sensitive" : "false"
            } ,
            {
              "description" : "Original tablespace name." ,
              "name" : "old_tablespace_name" ,
              "require" : "true" ,
              "type" : "STRING" ,
              "sensitive" : "false"
            }
        ] ,
        "type" : "LIST" ,
        "sensitive" : "false"
      }
  ]
}

47.3.3.2 Creating a Schema Service

This section describes how to create a database service using the Cloud resources. As Database service is also a service instance in the service family type dbaas, you need to identify the zone of the same family type in which to create the database service. There are two approaches to creating a database service:

  • By passing a POST request on the DB Zone on which DB service is to be created

  • By passing a POST request on the Schema Platform Template resource of which the database service is to be based on

Note the attributes in the submitted body for the POST. The pattern is the same for other service instance creations. Since the intention is clear, the zone attribute is not required while performing the POST operation to the Db Zone. Similarly, the based_on attribute is not needed when performing the POST operation to the SchemaPlatformTemplate.

The following operations are described in this section:

47.3.3.2.1 Creating a Schema by Passing a Request on the DB Zone

The configuration for performing POST to DB Zone is as follows:

Table 47-34 POST Request Configuration for Creating a Schema by Passing a Request on the DB Zone

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body for a profile based schema template for multiple schemas

{
  "name" : "TestService0" ,
  "start_date": "2013-08-02T14:20:00ZAsia/Calcutta",
  "end_date": "2013-08-02T17:20:00ZAsia/Calcutta",
  "params" :     {
      "schema" :
      [
          {
            "username" : "Schema_User11_01" ,
            "password" : "Schema_User1" ,
            "tablespace_name" : "tbsp01"
          } ,
          {
            "username" : "Schema_User11_02" ,
            "password" : "Schema_User1" ,
            "tablespace_name" : "tbsp02"
          } ,
          {
            "username" : "Schema_User11_03" ,
            "password" : "Schema_User1" ,
            "tablespace_name" : "tbsp03"
          } ,
          {
            "username" : "Schema_User11_04" ,
            "password" : "Schema_User1" ,
            "tablespace_name" : "tbsp04"
          }
      ] ,
      "workload_name" : "default_workload" ,
      "service_name" : "TestService0" ,
      "masterAccount" : "Schema_User11_01"
    } ,
  "based_on" : "/em/cloud/dbaas/schemaplatformtemplate/DE3F8D882F132F45E040F00AAA2330C5"
}

Body for a profile based schema template for a single schema

{
  "name" : "TestService0" ,
  "start_date": "2013-08-02T14:20:00ZAsia/Calcutta",
  "end_date": "2013-08-02T17:20:00ZAsia/Calcutta",
  "params" :     {
      "schema" :
      [
          {
            "username" : "Schema_User11_01" ,
            "password" : "Schema_User1" ,
            "tablespace_name" : "tbsp01"
          } ,
      "workload_name" : "default_workload" ,
      "service_name" : "TestService0" ,
      "masterAccount" : "Schema_User11_01"
    } ,
  "based_on" : "/em/cloud/dbaas/schemaplatformtemplate/DE3F8D882F132F45E040F00AAA2330C5"
}

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/22" ,
  "name" : "TestRequest" ,
  "resource_state" :     {
      "state" : "INITIATED"
        "messages" : 
         [
          {
           "date" : "2014-11-25T09:52:49+0000" ,
           "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/22",
           "text" : "Delete Request ID is : 22"
             }
              ]
    } ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/22" ,
  "status" : "SCHEDULED"
}
47.3.3.2.2 Creating a Schema by Passing a Request on the Schema Platform Template

The configurations for performing POST to the Schema Platform Template is as follows:

Table 47-35 POST Request Configuration for Creating a Schema by Passing a Request on the Schema Platform Template

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body

{
  "based_on" : "/em/cloud/dbaas/schemaplatformtemplate/FADFFB8A434244F1E043797EF00A63AE" ,
  "name" : "Test Service" ,
  "params" :     {
      "schema" :
      [
          {
            "username" : "Schaas_API_User_1" ,
            "original_name" : "SCHEMA_USER_1" ,
            "password" : "sunset1"
          } ,
          {
            "username" : "Schaas_API_User_2" ,
            "original_name" : "SCHEMA_USER_2" ,
            "password" : "sunset1"
          }
      ] ,
      "workload_name" : "SMALL" ,
      "service_name" : "TestService" ,
      "masterAccount" : "Schema_User11_01",
      "tablespaces" :
      [
          {
            "old_tablespace_name" : "DUMPTBSP2" ,
            "new_tablespace_name" : "tablespace2"
          } ,
          {
            "old_tablespace_name" : "DUMPTBSP1" ,
            "new_tablespace_name" : "tablespace1"
          }
      ]
    }
"zone":"/em/cloud/dbaas/zone/9A71CBEABCA367D0D425697DC39B3AF9
}

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/23" ,
  "name" : "TestRequest" ,
  "resource_state" :     {
      "state" : "INITIATED"
    } ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/23" ,
  "status" : "SCHEDULED"
}

The response shown above is the same as the previous version. If the zone is not specified, then it is not possible for the web service to determine where the database service should be deployed.

47.3.3.3 Viewing Details of the Schema Service Creation

After the database service creation has been performed by performing the POST operation, you can perform the GET operation to get the resource identified by the return URI to keep track of the status.

Table 47-36 GET Request Configuration for Viewing Details of the Schema Service Creation

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatforminstance/byrequest/22

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body

None

Request method

GET

A sample of the response received is shown below.

{
    "uri": "/em/cloud/dbaas/schemaplatforminstance/byrequest/22",
    "name": "TestRequest_CREATE_55_42",
    "description": "Create Service for test.",
    "resource_state":
    {
      "state": "CREATING"
    },
    "context_id": "22",
    "media_type": "application/oracle.com.cloud.common.SchemaPlatformInstance+json",
    "status": "IN_PROGRESS",
    "created": "2013-06-07 23:09:04" ,
    "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/22"
}

Note that the resource_state attribute shows CREATING to indicate that the database service is being created. After the database service is created, the GET operation returns the database service resource with READY state, as shown below:

{
  "uri": "/em/cloud/dbaas/schemaplatforminstance/byrequest/22",
  "name": "Service_1_35E576F22E97E",
  "resource_state": {
    "state": "READY"
        "messages" : 
         [
          {
           "date" : "2014-11-25T09:52:49+0000" ,
              "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/22",       
           "text" : "Delete Request ID is : 22"
             }
              ]
  },
  "context_id": "22",
  "media_type": "application/oracle.com.cloud.common.SchemaPlatformInstance+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/22",
  "status": "RUNNING",
  "created": "2013-06-10 02:45:32",
  "based_on": "/em/cloud/dbaas/schemaplatformtemplate/DECA1100F797EF10E040F00AFBB123E7",
  "target_type": "oracle_dbsvc",
  "connect_string": "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=abc.mycompany.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=Service_1_35E576F22E97E.mycompany.com)))",
  "destination_zone": "/em/cloud/dbaas/zone/34C1FC23A7503E1CC9C490C9670635F9",
  "db_version": "11.2.0.3.0"
}

47.3.3.4 Deleting a Schema Service

The DELETE request can be issued on the URI of the resource to delete a database service. The configuration for the DELETE request is as follows:

Table 47-37 DELETE Request Configuration for Deleting a Schema Service

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatforminstance/byrequest/22

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body

None

Request method

DELETE

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/22" ,
  "name" : "Service_1_35E576F22E97E" ,
  "resource_state" :     {
      "state" : "DESTROYING" ,
      "messages" :
      [
          {
            "text" : "Submit 'DELETE' operation on 'application/oracle.com.cloud.common.SchemaPlatformInstance+json' 'Service_1_35E576F22E97E'.  The process has job id '41'" ,
            "date" : "2013-06-07T23:16:20+0000"
          }
      ]
    } ,
  "context_id" : "22" ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance +json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/22" ,
  "type" : "oracle_dbsvc"
}

After some time, a GET request on the database service URI results in the following interaction:

Table 47-38 GET Request Configuration for Viewing the Status of the Schema Service

Feature Description

URI

/em/cloud/dbaas/schemaplatforminstance/byrequest/22

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "uri": "/em/cloud/dbaas/schemaplatforminstance/byrequest/22",
  "name": "Service_1_35E576F22E97E",
  "resource_state": {
    "state": "DESTROYING"
  },
  "context_id": "2",
  "media_type": "application/oracle.com.cloud.common.SchemaPlatformInstance+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/2",
  "status": "RUNNING",
  "created": "2013-06-10 02:45:32",
  "based_on": "/em/cloud/dbaas/schemaplatformtemplate/DECA1100F797EF10E040F00AFBB123E7",
  "type": "oracle_dbsvc",
  "connect_string": "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1.mycompany.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=Service_1_35E576F22E97E.mycompany.com)))",
  "destination_zone": "/em/cloud/dbaas/zone/34C1FC23A7503E1CC9C490C9670635F9",
  "db_version": "11.2.0.3.0"
}

The status of the database service shows DELETED after the schema service is deleted.

47.3.3.5 Object Missing

This object is not available in the repository.

47.3.3.5.1 Exporting a Schema

For exporting schema, the user can optionally provide the date at which the export should be taken. The date and time should be in the YYYY-MM-DDTHH:MM:SSZFullTimeZonename format.

For example to schedule in PST time user should enter 2013-08-27T12:34:45ZAmerica/Los_Angeles.

However, the time zone is optional. If you do not want to provide the time zone, then enter: 2013-08-27T12:34:45Z.

The configurations for the POST on a SchemaPlatformInstance is described below:

Table 47-39 POST Request Configuration for Exporting a Schema

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.SchemaPlatformInstance +json

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body

{
        "operation" : "EXPORT",
        "profile_name" : "test_API_export",
        "profile_desc" : "testing export option from APIs",
        "export_schedule" : "2013-07-31T02:10:45ZAsia/Calcutta  "
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "name" : "Service_8E958EC718B11" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:34:43+0000" ,
            "text" : "Successfully submitted EXPORT operation on schema instance. Request id - 130." ,
            "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/130"
          }
      ]
    } ,
  "context_id" : "123" ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "target_type" : "oracle_dbsvc"
}

After the export operation is completed, a GET operation on schema service yields below output

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "name" : "Service_8E958EC718B11" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "context_id" : "123" ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 23:49:30" ,
  "based_on" : "/em/cloud/dbaas/schemaplatformtemplate/E4D9626BC252F517E040F20A605152CD" ,
  "target_type" : "oracle_dbsvc" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=Service_8E958EC718B11.us.example.com)))" ,
  "destination_zone" : "/em/cloud/dbaas/zone/675B859C36772FB7856771B1D57F79F8" ,
  "schema_list" : 
  [
      {
        "service_name_prefix" : "" ,
        "workload_name" : "" ,
        "schema" : 
        [
            {
              "username" : "" ,
              "original_name" : "schema200" ,
              "password" : ""
            }
        ]
      }
  ] ,
  "db_version" : "11.2.0.2.0" ,
  "export_dump_list" : 
  [
      {
        "name" : "test_API_export" ,
        "description" : "testing export option from APIs" ,
        "URN" : "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbProfile:E4E9E7EE230BF965E040F20A60517256:0.1" ,
        "status" : "Ready"
      }
  ]
}
47.3.3.5.2 Restoring a Schema from Exported Schema Dumps

The restore schema from dump activity is based on the available export dumps. Refer to export_dump_list section in the output of the GET request to view the URN of the dump.

The configurations for the POST on a SchemaPlatformInstance are described below:

Table 47-40 POST Request Configuration for Restoring a Schema from the Exported Schema Dumps

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.SchemaPlatformInstance +json

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body

{
        "operation" : "IMPORT",
        "profile_urn" : "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbProfile:DECB2AAA09CCD711E040F20A60514F92:0.1"
        }

Request method

POST

A sample of the response from the above interaction is shown below.

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "name" : "Service_8E958EC718B11" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:34:43+0000" ,
            "text" : "Successfully submitted IMPORT operation on schema instance. Request id - 132." ,
            "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/132"
          }
      ]
    } ,
  "context_id" : "123" ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "target_type" : "oracle_dbsvc"
}
47.3.3.5.3 Deleting the Exported Schema Dumps

Deleting the export dump depends on the available export dumps. Refer to export_dump_list section in the output of the GET request to view the URN of the dump.

The configuration for the POST on a SchemaPlatformInstance is as follows:

Table 47-41 POST Request Configuration for Deleting the Exported Schema Dumps

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.SchemaPlatformInstance +json

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body

{
        "operation" : "DELETE_EXPORT",
        "profile_urn" : "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbProfile:DECB2AAA09CCD711E040F20A60514F92:0.1"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "name" : "Service_8E958EC718B11" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:34:43+0000" ,
            "text" : "Successfully submitted DELETE_EXPORT operation on schema instance. Request id - 135." ,
            "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/135"
          }
      ]
    } ,
  "context_id" : "123" ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "target_type" : "oracle_dbsvc"
}
47.3.3.5.4 Changing Schema Passwords

The configuration for the POST on a SchemaPlatformInstance is as follows:

Table 47-42 POST Request Configuration for Changing the Schema Passwords

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/schemaplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.SchemaPlatformInstance +json

Accept: application/oracle.com.cloud.common.SchemaPlatformInstance+json

Body

{
        "operation" : "CHANGE_PWD",
        "schema_name" : "schema1",
        "new_password" : "welcome"
        }

Request method

POST

A sample of the response from the above interaction is shown below.

{
  "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "name" : "Service_8E958EC718B11" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:34:43+0000" ,
            "text" : "Successfully submitted CHANGE_PWD operation on schema instance. Request id - 136." ,
            "uri" : "/em/cloud/dbaas/schemaplatforminstance/byrequest/136"
          }
      ]
    } ,
  "context_id" : "123" ,
  "media_type" : "application/oracle.com.cloud.common.SchemaPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/123" ,
  "target_type" : "oracle_dbsvc"
}

47.4 Pluggable Database as a Service

This section describes the resource model for Pluggable Database as a Service (PdbaaS) REST API and the REST request/response interactions.

Note:

PdbaaS REST APIs are only supported by the Oracle Cloud Application plug-in version 12.1.0.7.0 and above.

47.4.1 Pluggable Database as a Service Resource Model

Cloud resources are organized by common service entities, and specific services (for example, Pluggable Database as a Service) provide resources by extending these common service entities. The figure below shows the PdbaaS resource model.

Figure 47-3 Pluggable Database as a Service Resource Model


Pluggable Database as a service resource model

The following sections describe the resources that are supported by the Pluggable Database as a Service REST APIs and provide examples of supported operations. Pluggable Database as a Service uses the same Cloud, Service Family, and DB Zone resources as described in Database as a Service Resource Model.

The following resource models are described in this section:

47.4.1.1 Pluggable DB Platform Template

The Pluggable Db Platform Template extends the Service Template resource. It represents the service template created for Pluggable Database creation. It can be a template for creating a pluggable database using profile based pluggable database (pdb with data) or for creating an empty pluggable database. It is permissible to accept the ServiceTemplate media type on an instance of Pluggable Db Platform Template. It is a preconfigured deployable service that realizes a Pluggable Db Platform Instance resource. Pluggable Db Platform Template has the media type application/oracle.com.cloud.common.PluggableDbPlatformTemplate+json and URI format /em/cloud/dbaas/pluggabledbplatformtemplate/<template id>.

The following table describes the Schema Platform Template Data Model.

Table 47-43 Pluggable DB Platform Template Data Model

Field Type Description Occurs

uri

URI

A GET against this URI refreshes the client representation of the resources accessible to this user.

1

name

String

A human readable name given to the template.

1

description

String

A brief description given to the template.

0..1

created

Timestamp

Date and time, in ISO 8601 format, when the template was created/last modified.

1

zones

Collection <DbZone>

List of all zones configured for this template.

0..1

resource_state

ResourceState

The validity of the fields on a GET should be guaranteed only when the resource state is READY. Otherwise, the client should not assume the validity of the fields.

1

service_instances

Collection <SchemaPlatformInstance>

All service instances created based on this SchemaPlatformTemplate.

0..1

media_type

String

The media type of the service template that this type represents.

1

params

Object

List of parameters required to provision a Schema Platform Instance from this template.

1

deployment_params

List<Object>

Description of the parameters which are required while creating a service instance.

1

type

String

The type of the service template which is "dbaas" by default.

1

subtype

String

The sub type of the instance created based on this template.

It has a value "schema" in this case.

1

template_type

String

Type of this template based on how the template got created. It can have any of two values : "EMPTY_SCHEMAS" or "SCHEMAS_FROM_PROFILE".

1

workloads

List<Object>

List all the workloads defined for this template and list the attributes for each one of them.

0..1

canonicalLink

URI

Can be used to perform cloud interactions like GET and POST.

1

number_of_tablespaces

String

Number of tablespaces.

1

47.4.1.2 Pluggable DB Platform Instance

The Pluggable Db Platform Instance extends the Service Instance resource. It is linked to Pluggable Database target in Enterprise Manager Cloud Control. Pluggable Db Platform Instance has the media type application/oracle.com.cloud.common.PluggableDbPlatformInstance+json and URI format /em/cloud/dbaas/pluggabledbplatforminstance/byrequest/<request id>.

The following table describes the Schema Platform Instance Data Model:

Table 47-44 Pluggable DB Platform Instance Data Model

Field Type Description Occurs

uri

URI

A GET against this URI refreshes the client representation of the resources accessible to this user.

1

name

String

A human readable name given given to the pluggable database

1

destination_zone

Zone

The Zone to which the pluggable database is deployed

1

media_type

String

Indicates the additional media type that clients can use to perform a GET.

1

resource_state

ResourceState

The validity of the fields on a GET should be guaranteed only when the resource state is READY. Otherwise, the client should not assume the validity of the fields.

1

based_on

PluggableDbPlatformTemplate

The pluggable db platform template on which this database service is published.

1

connect_string

String

Connect String required to establish a connection to this database service.

0..1

created

Timestamp

Date and time, in ISO 8601 format, when the template was created/last modified.

1

target_type

String

Target type of this service instance. It has the default value oracle_pdb

1

status

String

Status of the pluggable database.

1

db_version

String

Version of the database on which pluggable db is running.

0..1

context_id

String

The request id of this pluggable database.

1

canonicalLink

URI

Can be used to perform cloud interactions like GET and DELETE.

1

47.4.2 Supported Operations for Pluggable Database Resources

The following table lists all the operations that are supported on the various Pluggable Database as Service resources.

Table 47-45 Supported Operations

Resource GET POST PUT DELETE

Cloud

Yes

No

No

No

Service Family Type

Yes

No

No

No

DB Zone

Yes

Yes

No

No

PluggableDb Platform Template [Service Template]

Yes

Yes

No

No

PluggableDb Platform Instance [Service Instance]

Yes

Yes

No

Yes

47.4.3 Pluggable Database as a Service REST API Examples

The following sections provide examples of interaction with Enterprise Manager Cloud Control with Cloud Application plug-in 12.1.0.7 and higher. The examples for GET on cloud, GET on dbaas family type and GET on Db Zone are covered in the Dbaas REST APIs section. The following examples are covered:

47.4.3.1 Viewing Details of the Pluggable Db Platform Template Resource

A GET request on a Pluggable Db Platform Template provides the details about a Pluggable DB service template.

Table 47-46 GET Request Configuration for Viewing Details of the Pluggable DB Platform Template Resource

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/pluggabledbplatformtemplate/E32F474628FCCE5AE040E50ACA84603A

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "uri": "/em/cloud/dbaas/pluggabledbplatformtemplate/E32F474628FCCE5AE040E50ACA84603A",
  "name": "Sample PDB template",
  "description": "Sample PDB template",
  "resource_state": {
    "state": "READY"
  },
  "media_type": "application/oracle.com.cloud.common.PluggableDbPlatformTemplate+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatformtemplate/E32F474628FCCE5AE040E50ACA84603A",
  "type": "dbaas",
  "created": "2013-08-05T07:34:10+0000",
  "zones": {
    "media_type": "application/oracle.com.cloud.common.DbZone+json",
    "total": "1",
    "elements": [
      {
        "uri": "/em/cloud/dbaas/zone/76663B316DCB26E6836822224C7881E3",
        "name": "Ssa_zone1",
        "description": "Ssa_zone1",
        "context_id": "76663B316DCB26E6836822224C7881E3",
        "media_type": "application/oracle.com.cloud.common.DbZone+json",
        "service_family_type": "dbaas",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/zone/76663B316DCB26E6836822224C7881E3",
        "type": "self_service_zone"
        "target_nodes_for_placement": 
        [              "xyz.mycompany.com"            ]
      }
    ]
  },
  "service_instances": {
    "media_type": "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json",
    "total": "1",
    "elements": [
          {
            "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
            "name" : "database_MYPDB_000" ,
            "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7" ,
            "target_type" : "oracle_pdb" ,
            "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7"
          }
]
  },
  "number_of_tablespaces" : "1" ,
  "deployment_params": [
   {
        "description" : "Name of the additional service created as part of the pdb service request" ,
        "name" : "service_name" ,
        "require" : "true" ,
        "type" : "STRING" ,
        "sensitive" : "false"
      } ,
    {
      "name": "workload_name",
      "description": "WorkLoad name to be associated with the request",
      "type": "STRING",
      "require": "true",
      "sensitive": "false"
    },
    {
      "name": "username",
      "description": "Pluggable database admin username",
      "type": "STRING",
      "require": "true",
      "sensitive": "false"
    },
    {
      "name": "password",
      "description": "Pluggable database admin user password",
      "type": "STRING",
      "require": "true",
      "sensitive": "true"
    },
{
        "name" : "target_nodes_for_placement" ,
        "description" : "List of available Container Database(s) to be chosen for creating the Pluggable database instance." ,
        "type" : "STRING" ,
        "require" : "false" ,
        "sensitive" : "false"
      } ,
{
        "description" : "Name of Pluggable database" ,
        "name" : "pdb_name" ,
        "require" : "true" ,
        "type" : "STRING" ,
        "sensitive" : "false"
      } ,
      {
        "description" : "List of tablespace names. Required only for EMPTY_PDB templates" ,
        "name" : "tablespaces" ,
        "require" : "false" ,
        "type" : "LIST" ,
        "sensitive" : "false"
      },
{
      "name": "target_name",
      "description": "Target cdb name to be chosen for installing the pdb",
      "type": "STRING",
      "require": "false",
      "sensitive": "true"
      },
  ],
  "subtype": "pdb",
  "template_type": "PDB_FROM_PROFILE",
  "workloads": [
    {
      "name": "wl1",
      "description": "null",
      "attributes": [
        {
          "name": "CPU",
          "value": "1",
          "units": "cores"
        },
        {
          "name": "Memory",
          "value": "1",
          "units": "GB"
        },
        {
          "name": "Storage",
          "value": "1",
          "units": "GB"
        }
      ]
    }
  ],
  "params": {
    "workload_name": "",
    "placement_option" : "SELECT_TARGET_FROM_REQUEST" ,
    "username": "",
    "password": "",
    "pdb_name" : "" ,
    "service_name" : "" ,
    "tablespaces" :
      [      ]
  }
}

47.4.3.2 Creating a Pluggable Database

This section describes how to create a pluggable database using the Cloud resources.

As Pluggable Database is also a service instance in the service family type "dbaas", you need to identify the zone of the same family type in which to create the pluggable database. There are two approaches to create a pluggable database:

Note the attributes in the submitted body for the POST. The pattern is the same for other service instance creations. Because the intention is clear, the "zone" attribute is not required while POSTing to the Db Zone. Similarly, the "based_on" attribute is not needed when POSTing to the PluggableDbPlatformTemplate.

47.4.3.2.1 Creating a Pluggable Database by Passing a Request on the DB Zone

The following shows the configuration for POSTing to Db Zone:

Table 47-47 POST Request Configuration for Creating a Pluggable Database by Passing a Request on the DB Zone

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

{
  "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/FADF7229EB960330E043E176F00ADE61" ,
  "name" : "Test Service" ,
  "start_date": "2013-08-02T14:20:00ZAsia/Calcutta",
  "end_date": "2013-08-02T17:20:00ZAsia/Calcutta",
  "params" :     {
      "username" : "Pdbaas_API_User" ,
      "pdb_name" : "pdb_lrgemg880" ,
      "workload_name" : "Small" ,
      "service_name" : "TestService" ,
      "password" : "welcome1" ,
      "tablespaces" :
      [
        "tbsp1"
      ]
 "target_name " : "test_cdb"
    }
}

Request method

POST

A sample of the response received is shown below.

{
  "uri": "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31",
  "name": "Test Service",
  "resource_state": {
    "state": "INITIATED"
        "messages" : 
         [
          {
           "date" : "2014-11-25T09:52:49+0000" ,
              "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/22",       
           "text" : "Delete Request ID is : 22"
             }
              ]
  },
  "media_type": "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31",
  "status": "SCHEDULED"
}
47.4.3.2.2 Creating a Pluggable Database by Passing a Request on the Pluggable DB Platform Template

The following describes the configurations for POSTing to the PluggableDbPlatformTemplate:

Table 47-48 POST Request Configuration for Creating a Pluggable Database by Passing a Request on the Pluggable DB Platform Template

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/dbaas/pluggabledbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

{
  "zone": "/em/cloud/dbaas/zone/E125CDA8B810BB2F8ECE9867AFC25903",
  "name" : "Request for an Empty PDB BA",
  "end_date": "2015-11-20T17:20:00ZAsia/Calcutta", 
  "params" :     {
      "username" : "TestUser",
      "password" : "welcome1",
      "workload_name": "SmallPdb",
      "pdb_name" : "BoAPDB",
      "service_name" : "BoAPDB_Service" ,
      "tablespaces" : [ "pdb_tbs1", "pdb_tbs2" ] },
  "instance_target_properties": [
      { "name": "Department", "value": "Development" },
      { "name": "Comment", "value": "BofA testing" }
        ]
}

Request method

POST

Note:

The target_name property is a mandatory property if the custom placement option (SELECT_TARGET_OPTION) is set to "SELECT_TARGET_FROM_REQUEST" in the PDB service template. Also, the CDB name provided should be available in the chosen zone.

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/122" ,
  "name" : "Request for an Empty PDB BofA" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/123" ,
            "text" : "Delete Request ID is : 123" ,
            "date" : "2015-11-19T10:41:38+0000"
          }
      ]
    } ,
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/122" ,
  "status" : "SCHEDULED"
}

47.4.3.3 Viewing Details of the Pluggable Database Creation

A GET request on a Pluggable DB Platform Instance provides the status and other information about the resource.

Table 47-49 GET Request Configuration for Viewing Details of the Pluggable Database Creation

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

None

Request method

GET

A sample of the response received is shown below.

{
  "uri": "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31",
  "name": "Test Service_CREATE_11_53",
  "description": "Create Database for \"Test Service\".", 
  "resource_state":
    {
      "state": "CREATING"
    },
    "context_id": "31",
    "media_type": "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json",
    "status": "IN_PROGRESS",
    "created": "2013-06-07 23:09:04" ,
    "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31"
}

Note that the resource_state attribute shows CREATING state which indicates that the pluggable database is being created. After the pluggable database is created, the GET operation returns the pluggable database resource with READY state, as shown below:

{
  "destination_zone" : "/em/cloud/dbaas/zone/9A71CBEABCA367D0D425697DC39B3AF9" ,
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "db_version" : "12.1.0.1.0" ,
  "resource_state" :     {
      "state" : "READY"
        "messages" : 
         [
          {
           "date" : "2014-11-25T09:52:49+0000" ,
              "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/22",       
           "text" : "Delete Request ID is : 22"
             }
              ]
    } ,
  "status" : "RUNNING" ,
  "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/E33799E249513428E040F50A994210F5" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYPDB_000)(INSTANCE_NAME=t105kfv)(UR=A)(SERVER=DEDICATED)))" ,
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31" ,
  "context_id" : "31" ,
  "created" : "2013-08-05 17:30:30" ,
  "name" : "database_MYPDB_000" ,
  "target_type" : "oracle_pdb" 
}

47.4.3.4 Deleting a Pluggable Database Instance

The DELETE request on the URI of the resource can be issued to delete a pluggable database. For example, the following DELETE request is issued:

Table 47-50 DELETE Request Configuration for Deleting a Pluggable Database Instance

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

None

Request method

DELETE

A sample of the response received is shown below.

{
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "context_id" : "7" ,
  "resource_state" :     {
      "state" : "DESTROYING" ,
      "messages" :
      [
          {
            "text" : "Submit 'DELETE' operation on 'application/oracle.com.cloud.common.PluggableDbPlatformInstance+json' 'database_MYPDB_000'.  The process has job id '24'" ,
            "date" : "2013-08-05T17:35:56+0000"
          }
      ]
    } ,
  "name" : "database_MYPDB_000" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7" ,
  "target_type" : "oracle_pdb" ,
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7" 
}

After some time, the GET request on the database service URI will result in the following interaction:

Table 47-51 GET Request Configuration for Viewing Status of the DELETE Request

Feature Description

URI

/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/22

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Body

None

Request method

GET

A sample of the response received is shown below.

{  
  "destination_zone" : "/em/cloud/dbaas/zone/9A71CBEABCA367D0D425697DC39B3AF9" ,
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "db_version" : "12.1.0.1.0" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "status" : "DESTROYING" ,
  "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/E33799E249513428E040F50A994210F5" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYPDB_000)(INSTANCE_NAME=t105kfv)(UR=A)(SERVER=DEDICATED)))" ,
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7" ,
  "context_id" : "7" ,
  "created" : "2013-08-05 17:30:30" ,
  "name" : "database_MYPDB_000" ,
  "target_type" : "oracle_pdb"
}

Note that the status of the pluggable database will be "DELETED" once the pluggable database instance is deleted.

47.4.3.5 Lifecycle operations on a Pluggable Database Instance

The POST request on the URI of the resource can be issued to perform an operation on a pluggable database.

You can perform the following tasks using POST request:

47.4.3.5.1 Shutting Down a Pluggable Database

The following describes the configurations for the POST on a PluggableDbPlatformInstance:

Table 47-52 POST Request Configuration for Shutting Down a Pluggable Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

{
        "operation" : "SHUTDOWN"
        }

Request method

POST

A sample of the response received is from the above interaction is shown below.

{
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "name" : "database_PDBSERVICE_000" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T06:56:25+0000" ,
            "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/124" ,
            "text" : "Successfully submitted SHUTDOWN operation on service instance. Request id - 124."
          }
      ]
    } ,
  "context_id" : "81" ,
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 04:19:14" ,
  "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/E49AA1BAC2DBA0ECE040F20A60517942" ,
  "target_type" : "oracle_pdb" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= host1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=PDB_000)(INSTANCE_NAME=tbugt)(UR=A)(SERVER=DEDICATED)))" ,
  "destination_zone" : "/em/cloud/dbaas/zone/0129A72DB32D4199B59ABFA64085EAB3" ,
  "db_version" : "12.1.0.1.0"
}
47.4.3.5.2 Starting up a Pluggable Database

Table 47-53 POST Request Configuration for Shutting Down a Pluggable Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

{
        "operation" : "STARTUP"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "name" : "database_PDBSERVICE_000" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T06:58:58+0000" ,
            "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/125" ,
            "text" : "Successfully submitted STARTUP operation on service instance. Request id - 125."
          }
      ]
    } ,
  "context_id" : "81" ,
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "status" : "STOPPED" ,
  "created" : "2013-08-26 04:19:14" ,
  "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/E49AA1BAC2DBA0ECE040F20A60517942" ,
  "target_type" : "oracle_pdb" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST= host1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=PDB_000)(INSTANCE_NAME=tbugt)(UR=A)(SERVER=DEDICATED)))" ,
  "destination_zone" : "/em/cloud/dbaas/zone/0129A72DB32D4199B59ABFA64085EAB3" ,
  "db_version" : "12.1.0.1.0"
}
47.4.3.5.3 Scheduling a Backup for a Pluggable Database

The following describes the configurations for the POST on a PluggableDbPlatformInstance:

For scheduling backup user has to provide the time at which backups needs to scheduled. This should in format of YYYY-MM-DDTHH:MM:SSZFullTimeZonename.

For example to schedule in PST time user should give 2013-08-27T12:34:45ZAmerica/Los_Angeles

However timezone part is optional. If you do not want to provide it, you can do as follows: 2013-08-27T12:34:45Z

Table 47-54 POST Request Configuration for Scheduling a Backup for a Pluggable Database

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

{
        "operation" : "BACKUP",
 "backup_schedule" : "2013-08-27T12:34:45ZAsia/Calcutta"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "name" : "database_PDBSERVICE_000" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:01:15+0000" ,
            "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/126" ,
            "text" : "Successfully submitted BACKUP operation on service instance. Request id - 126."
          }
      ]
    } ,
  "context_id" : "81" ,
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 04:19:14" ,
  "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/E49AA1BAC2DBA0ECE040F20A60517942" ,
  "target_type" : "oracle_pdb" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=PDB_000)(INSTANCE_NAME=tbugt)(UR=A)(SERVER=DEDICATED)))" ,
  "destination_zone" : "/em/cloud/dbaas/zone/0129A72DB32D4199B59ABFA64085EAB3" ,
  "db_version" : "12.1.0.1.0"
"RMAN_backup_list" : 
  [
      {
        "Key" : "1" ,
        "Tag" : "ORA$OEM_LEVEL_0" ,
        "Completed Time" : "Aug 27, 2013 12:24:02 AM" ,
        "Contents" : "SPFILE,CONTROLFILE" ,
        "Status" : "AVAILABLE"
      }
  ]
}
47.4.3.5.4 Restoring a Pluggable Database from a Backup

The following describes the configurations for the POST on a PluggableDbPlatformInstance:

For restorting from backup ,the user has to provide the point-in-time to which database is to be restored. This should in format of YYYY-MM-DDTHH:MM:SSZFullTimeZonename.

For example to schedule in PST time user should give 2013-08-27T12:34:45ZAmerica/Los_Angeles

However timezone part is optional. If you do not want to provide it, you can do as follows: 2013-08-27T12:34:45Z

The restore time is based on backups available, please refer to RMAN_backup_list section in the output of GET request

Table 47-55 POST Request Configuration for Restoring a Pluggable Database from a Backup

Feature Description

URI

https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

Request headers

Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

Content-Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Accept: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

Body

{
        "operation" : "RESTORE",
        "restore_date" : "2013-08-27T12:34:45Z"
        }

Request method

POST

A sample of the response received is shown below.

{
  "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "name" : "database_PDBSERVICE_000" ,
  "resource_state" :     {
      "state" : "INITIATED" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T07:01:15+0000" ,
            "uri" : "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/146" ,
            "text" : "Successfully submitted RESTORE operation on service instance. Request id - 146."
          }
      ]
    } ,
  "context_id" : "81" ,
  "media_type" : "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/81" ,
  "status" : "RUNNING" ,
  "created" : "2013-08-26 04:20:14" ,
  "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/E49AA1BAC2DBA0ECE040F20A60517942" ,
  "target_type" : "oracle_pdb" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=PDB_000)(INSTANCE_NAME=tbugt)(UR=A)(SERVER=DEDICATED)))" ,
  "destination_zone" : "/em/cloud/dbaas/zone/0129A72DB32D4199B59ABFA64085EAB3" ,
  "db_version" : "12.1.0.1.0"
}