Skip Headers
Oracle® Enterprise Manager Cloud Administration Guide
12c Release 3 (12.1.0.3)

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

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

27 Database as a Service Family APIs

This chapter describes the resource models for Database as a Service (DBaaS) API, Schema as a Service APIs, and the REST request/response interactions.The following topics are covered:

27.1 REST APIs for SSA User Flows

This section covers the following topics:

27.1.1 Database as a Service API

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

This section contains the following topics:

Note:

DBaaS 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

27.1.1.1 Resource Model for Database as a Service

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. The figure below shows the DBaaS resource model:

Figure 27-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 following resource models are described.

27.1.1.1.1 DB Zone

This 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 following media type and payload:

  • Media Type: application/oracle.com.cloud.common.DbZone+json

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/zone/<zone id>

The following table describes the DB Zone Data Model.

Table 27-1 DB Zone Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

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

description

String

0..1

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

resource_state

ResourceState

1

The resource state of the resource.

context_id

String

1

Zone GUID

resource_state

ResourceState

1

The resource state of the resource.

service_family_type

String

1

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

It is "dbaas" for this.

templates

Collection <ServiceTemplate>

1

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

service_instances

Collection <ServiceInstance>

1

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

media_type

String

1

The media type of the resource.

canonicalLink

URI

1

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


27.1.1.1.2 DBPlatformTemplate

The DBPlatformTemplate extends the ServiceTemplate resource. This resource represents service templates created for creating databases. The databases may be created using profiles created using database templates, rman backups, and SnapClone. It is permissible to accept the ServiceTemplate media type on an instance of DBPlatformTemplate. It is a preconfigured deployable service that realizes a DBPlatformInstance resource. DBPlatformTemplate has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.DbPlatformTemplate+json

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/dbplatformtemplate/<template id>

The following table describes the DBPlatformTemplate Data Model.

Table 27-2 DBPlatformTemplate Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

A human readable name given to the template.

description

String

0..1

A brief description given to the template

resource_state

ResourceState

1

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.

service_family_type

String

1

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

service_instances

Collection <DBPlatformInstance>

1

All service instances created based on this DBPlatformTemplate.

media_type

String

1

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

created

Timestamp

1

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

zones

Collection <DbZone>

1

List of all zones on which this service template is published

db_type

String

1

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

instance_configurable_params

String[]

1

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

type

String

1

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

node_count

 

0..1

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

canonicalLink

URI

1

Can be used to perform cloud interactions like GET and POST

deployment_params

List<Object>

1

Description of the parameters (username and password) which are required while creating a service instance.

subtype

String

1

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

It has a value "db" in this case.

context_id

URI

1

The unique id of the template.


27.1.1.1.3 DBPlatformInstance

The DBPlatformInstance extends the ServiceInstance resource. It is linked to an Oracle Database Instance or Cluster Database target in Enterprise Manager Cloud Control. DBPlatformInstance has the following media type and payload:

This section contains the following sections:

  • Media Type: application/oracle.com.cloud.common.DbPlatformInstance+json

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/dbplatforminstance/byrequest/<request id>

The following table describes the DBPlatformInstance Data Model.

Table 27-3 DBPlatformInstance Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

A human readable name given to the instance.

[POST]

destination_zone

Zone

1

The Zone to which the instance is deployed.

[POST]

media_type

String

1

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

available_space

Float

0..1

Available space for this database instance.

resource_state

ResourceState

1

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.

based_on

DbPlatformTemplate

1

The db platform template on which this instance is published.

connect_string

String

0..1

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

created

String

1

Time of creation.

type

String

0..1

Type of the database : "oracle_database" for SIDB and "rac_database" for RAC

status

String

1

Status of the Database instance.

db_version

String

0..1

Version of the Database.

last_backup

Timestamp

0..1

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

load

Float

0..1

Current average active sessions of this instance.

master_username

String

1

Name of the master user of this database.

total_sessions

Integer

0..1

Total number of sessions for this database

total_sga

Float

0..1

Total SGA for this database.

up_time

String

1

Uptime in hours for the Service Instance.

context_id

String

1

The request id of this instance.

canonicalLink

URI

1

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

instances

List<Object>

0..1

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

total_memory*

String

0..1

Total memory used by the instance (node).

active_sessions*

Float

0..1

Current average active sessions for this instance (node).

cpu_utilization*

Percentage

0..1

CPU utilization of this instance (node).

db_time*

Float

0..1

Database time of this instance (node).

cpu_count*

Integer

0..1

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

allocated_sessions*

Integer

0..1

Number of sessions currently allocated.

name*

String

0..1

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


Note:

* In the case of database instance type "oracle_database", these fields exist as it is in the DBPlatformInstance Data model. In the 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).

27.1.1.2 Supported Operations for DBaaS Resources

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

Table 27-4 Supported Operations

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

Cloud

GET

Service Family Type

GET

DB Zone

GET, POST

DB Platform Template [Service Template]

GET, POST

DB Platform Instance [Service Instance]

GET, , POST, DELETE


27.1.1.3 Database as a Service API Examples

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

  • GET on Cloud to list all resources accessible to a user.

  • Filtering API output for specific resource attributes.

  • GET on Service Family Type to list all DBaaS resources accessible to a user.

  • GET on Service Instance Type to list all supported service.

  • GET on DB Zone to list all resources contained in a zone.

  • GET on DB Platform Template to get details about a DB s.ervice template

  • Creating Databases

    1. POST on DB Zone by selecting a DB service template

    2. POST on DB Platform Template by selecting a DB Zone

  • GET on DB Platform Template to get details about a DB service template.

  • DELETE on DB Platform Instance to retire a database.

  • Lifecycle operations on a Database Instance.

  • Lifecycle operations on a Snapcloned Database Instance.

27.1.1.3.1 Cloud

Use the top level /em/cloud to introspect the Cloud resource.

  • URL

    https://example.us.oracle.com/em/cloud

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=X-specification-Version: 10001

  • Method

    GET

The following returns the Cloud resource:

{
  "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.
27.1.1.3.2 Filtering Output for Specific Resource Attributes

The following shows interaction with the Cloud resource picking up specific attributes:

  • URL

    https://example.us.oracle.com/em/cloud?service_family_types,name

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

Here are the selective attributes:

{
  "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 is supported on all the common resources where only selective attributes will be gathered and returned to the client.

27.1.1.3.3 Service Family Type Resource

The following describes the Service Family Type resource.

  • URL

    https://example.us.oracle.com/em/cloud/service_family_type/dbaas

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

The following shows the returned headers and content for this interaction:

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.

27.1.1.3.4 Service Instance Type resource

This is the resource that describes the type of services that are provided by a particular Service Family Type.

  • URL

    https://example.us.oracle.com/em/cloud/instance_type/dbPlatformInstance%40dbaas

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

The following shows the Service Instance Type resource:

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

This describes the Zone resource.

  • URL

    https://example.us.oracle.com/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

The following is the Zone resource, automatically cast to the application/oracle.com.cloud.common.DbZone+json media type:

{
  "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"
          }
      ]
    }
}
27.1.1.3.6 DB Platform Template Resource

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.

  • URL

    https://example.oracle.com/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

This is the resource returned as the complete DbPlatformTemplate resource:

{
  "uri" : "/em/cloud/dbaas/dbplatformtemplate/DE039DAC33FFEA6FE040E80A687848A6" ,
  "name" : "12101_RACFileSystem_ServiceTemplate" ,
  "description" : "12101 RAC FileSystem Service Template" ,
  "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/DE039DAC33FFEA6FE040E80A687848A6" ,
  "type" : "dbaas" ,
  "created" : "2013-05-31T12:35:20+0000" ,
  "zones" :     {
      "media_type" : "application/oracle.com.cloud.common.DbZone+json" ,
      "total" : "1" ,
      "elements" : 
      [
          {
            "uri" : "/em/cloud/dbaas/zone/B49F86387B81DAED9A3D672D722CF29D" ,
            "name" : "RAC SSAZONE" ,
            "description" : "SSA Zone with RAC Nodes" ,
            "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"
          }
      ]
    } ,
  "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"
      }
  ] ,
  "subtype" : "db" ,
  "db_type" : "rac_database" ,
  "node_count" : "2" ,
  "instance_configurable_params" :     {
      "username" : "" ,
      "password" : ""
    }
}
27.1.1.3.7 Creating Databases

This section describes how to create a service instance using the 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 in which to create the DB. There are two approaches to creating a DB:

  1. POST to the Db Zone on which the database is to reside

  2. POST to the DbPlatformTemplate 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. 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 DbPlatformTemplate. The following operations are described:

POST to the Db Zone

The following shows the configuration for POSTing to the Db Zone:

  • URL

    https://example.oracle.com/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

  • 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/CC3BBB665A6BC6FFE040F00AEF252456",
           "name": "<Request name>",
           "description": "<Request Description>",
           "params":
           { 
                "username": "Master Account username for the DB",
                "password": "Password for the Master Account on the DB"
           }
      }  
    
  • Method

    POST

The following is the response from the above interaction:

{
  "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/22" ,
  "status" : "SCHEDULED"
}

POST to the DbPlatformTemplate

The following describes the configuration for POSTing to the DbPlatformTemplate:

  • URL

    https://example.oracle.com/em/cloud/dbaas/dbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

  • 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>",
           "params":
           { 
                "username": "Master Account username for the DB",
                "password": "Password for the Master Account on the DB"
           }
    }
    
  • Method

    POST

The following is the response from the above interaction:

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

This response 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.

27.1.1.3.8 Polling the Database Creation

Once the database creation has been POSTed, you can GET the resource identified by the return URI to keep track of the status.

  • URL

    https://example.oracle.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

  • Method

    GET

The following is the response:

{
    "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 is showing "CREATING" state to indicate that the database is still being created. Once the database is created, the same GET will return the database resource with "READY" state, as shown below:

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/22" ,
  "name" : "db000000.mycompany.com" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "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-06-07 23:14:04" ,
  "based_on" : "/em/cloud/dbaas/dbplatformtemplate/DE9845B82981CF0CE040E80AD87838C9" ,
  "connect_string" : "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=cluster-r)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=db000000.mycompany.com)))" ,
  "type" : "rac_database" ,
  "destination_zone" : "/em/cloud/dbaas/zone/B49F86387B81DAED9A3D672D722CF29D" ,
  "up_time" : "0" ,
  "load" : "0.1801962347135334" ,
  "total_sessions" : "155" ,
  "total_sga" : "4778.5546875" ,
  "available_space" : "0.68255615234375" ,
  "instances" :
  [
      {
        "name" : "db000000.mycompany.com_db0000001" ,
        "total_memory" : "2672.286 MB" ,
        "active_sessions" : ".037" ,
        "cpu_utilization" : "1.106" ,
        "db_time" : "3.66" ,
        "cpu_count" : "2" ,
        "allocated_sessions" : "63"
      } ,
      {
        "name" : "db000000.mycompany.com_db0000002" ,
        "total_memory" : "2676.052 MB" ,
        "active_sessions" : ".144" ,
        "cpu_utilization" : "4.225" ,
        "db_time" : "14.359" ,
        "cpu_count" : "2" ,
        "allocated_sessions" : "65"
      }
  ] ,
  "last_backup" : "null" ,
  "master_username" : "InstanceUser1" ,
  "db_version" : "11.2.0.3.0"
}

The output in case of single instance database (type:oracle_database) :

{
  "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/23" ,
  "name" : "sidb0001.host1.mycompany.com" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "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"
}
27.1.1.3.9 Deleting a Database Instance

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

  • URL

    https://example.oracle.com/em/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

  • Method

    DELETE

The following Web service response with code 200 is returned:

{
  "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 some time, the GET request on the database URI will result in the following interaction:

  • URL

    https://example.oracle.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

The Web service returns the following:

{
  "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 "status" of the databse will be "DELETED" once the database is DELETED.

27.1.1.3.10 10. 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 POST request

Shutdown Database

The following describes the configurations for the POST on a DbPlatformInstance

  • URL: https://example.mycompany.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI= Content-Type: application/oracle.com.cloud.common.DbPlatformInstance+json Accept: application/oracle.com.cloud.common.DbPlatformInstance+json

  • Body

    {
            "operation" : "SHUTDOWN"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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"
          }
      ]
    }
    

Startup Database

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

  • URL: https://example.mycompany.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • Headers: Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

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

  • Body

    {
            "operation" : "STARTUP"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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"
          }
      ]
    }
    

Schedule Backup

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

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, then you can do the following: 2013-08-27T12:34:45Z

  • URL: https://example.mycompany.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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=slc01lxj.us.oracle.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 job completes, performing a GET on instance yields below result

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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.oracle.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"
          }
      ]
    }
    

Restore From Backup

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

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.

  • URL: https://example.mycompany.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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"
          }
      ]
    }
    
27.1.1.3.11 11. Lifecycle operations on a Snapcloned Database Instance

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

  • Create snapshot

  • Restore from snapshot list

  • Delete snapshot

Create Snapshot

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

  • URL: https://example.mycompany.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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 create snapshot operation completes, performing a GET on instance yields below result

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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"
          }
      ]
    }
    

Restore from Snapshot List

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

  • URL: https://example.mycompany.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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"
          }
      ]
    }
    

Delete Snapshot

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

  • URL: https://example.mycompany.com/em/cloud/dbaas/dbplatforminstance/byrequest/7

  • 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"   }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri" : "/em/cloud/dbaas/dbplatforminstance/byrequest/101" ,
      "name" : "dbc00000.slc01lxj.us.oracle.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"
          }
      ]
    }
    

27.1.2 Schema as a Service API

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

This section contains the following topics:

Note:

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

27.1.2.1 Resource Model for Schema as a Service

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 27-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 APIs and provide examples of supported operations. Schema as a Service uses the same Cloud, Service Family, and DB Zone resources as described in Section 27.1.1.1, "Resource Model for Database as a Service".

. The following resource models are described:

27.1.2.1.1 Schema PlatformTemplate

The SchemaPlatformTemplate extends the ServiceTemplate 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 ServiceTemplate media type on an instance of SchemaPlatformTemplate. It is a preconfigured deployable service that realizes a SchemaPlatformInstance resource. SchemaPlatformTemplate has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.SchemaPlatformTemplate

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/schemaplatformtemplate/<template id>

The following table describes the SchemaPlatformTemplate Data Model.

Table 27-5 SchemaPlatformTemplate Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

A human readable name given to the template.

description

String

0..1

A brief description given to the template.

created

Timestamp

1

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

resource_state

ResourceState

1

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.

zones

Collection <DbZone>

0..1

List of all zones configured for this template.

service_instances

Collection <SchemaPlatformInstance>

0..1

All service instances created based on this SchemaPlatformTemplate.

media_type

String

1

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

canonicalLink

URI

1

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

params

Object

1

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

deployment_params

List<Object>

1

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

type

String

1

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

subtype

String

1

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

It has a value "schema" in this case.

template_type

String

1

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

max_number_of_schemas

Integer

0..1

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

workloads

List<Object>

0..1

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


27.1.2.1.2 SchemaPlatformInstance

The SchemaPlatformInstance extends the ServiceInstance resource. It is linked to Oracle Database Service target in Enterprise Manager Cloud Control. SchemaPlatformInstance has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.SchemaPlatformInstance

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/schemaplatforminstance/byrequest/<request id>

The following table describes the SchemaPlatformInstance Data Model:

Table 27-6 SchemaPlatformInstance Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

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

destination_zone

Zone

1

The Zone to which the database service is deployed

[POST]

created

Timestamp

1

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

resource_state

ResourceState

1

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.

based_on

SchemaPlatformTemplate

1

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

media_type

String

1

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

canonicalLink

URI

1

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

type

String

1

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

connect_string

String

0..1

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

status

String

1

Status of the database service.

db_version

String

0..1

Version of the database on which this service is running.

context_id

String

1

The request id of this database service.


27.1.2.2 Supported Operations

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

Table 27-7 Supported Operations

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

Cloud

GET

Service Family Type

GET

DB Zone

GET, POST

Schema Platform Template [Service Template]

GET, POST

Schema Platform Instance [Service Instance]

GET, POST, DELETE


27.1.2.3 Schema as a Service API Examples

The following sections provide examples of interaction with Enterprise Manager Cloud Control 12.1.0.3 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 APIs section. The following examples are covered:

  • GET on Schema Platform Template to get details about a Schema service template

  • Creating Database Services

    • POST on Db Zone by selecting a Schema service template

    • POST on Schema Platform Template by selecting a Db Zone

  • GET on Schema Platform Instance to get status and other information about a database service

  • DELETE on Schema Platform Instance to drop a database service

  • Lifecycle operations on a Schema Service

27.1.2.3.1 Schema Platform Template Resource
  • URL

    https://example.mycompany.com/em/cloud/dbaas/schemaplatformtemplate/DE3F8D882F132F45E040F00AAA2330C5

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

This is the resource returned as the complete SchemaPlatformTemplate resource:

{
  "uri": "/em/cloud/dbaas/schemaplatformtemplate/DE3F8D882F132F45E040F00AAA2330C5",
  "name": "Template Schema Si",
  "description": "",
  "resource_state": {
    "state": "READY"
  },
  "media_type": "application/oracle.com.cloud.common.SchemaPlatformTemplate+json",
  "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatformtemplate/DE3F8D882F132F45E040F00AAA2330C5",
  "type": "dbaas",
  "created": "2013-06-03T11:51:20+0000",
  "zones": {
    "media_type": "application/oracle.com.cloud.common.DbZone+json",
    "total": "1",
    "elements": [
      {
        "uri": "/em/cloud/dbaas/zone/34C1FC23A7503E1CC9C490C9670635F9",
        "name": "Zone Si",
        "description": "",
        "context_id": "34C1FC23A7503E1CC9C490C9670635F9",
        "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/34C1FC23A7503E1CC9C490C9670635F9",
        "type": "self_service_zone"
      }
    ]
  },
  "service_instances": {
    "media_type": "application/oracle.com.cloud.common.SchemaPlatformInstance+json",
    "total": "1",
    "elements": [
      {
        "uri": "/em/cloud/dbaas/schemaplatforminstance/byrequest/61",
        "name": "Service_1_2AEE494EE0994",
        "media_type": "application/oracle.com.cloud.common.SchemaPlatformInstance+json",
        "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/schemaplatforminstance/byrequest/61",
        "target_type": "oracle_dbsvc"
      }
    ]
  },
  "deployment_params": [
    {
      "name": "masterAccount",
      "description": "Master account schema. Not Required for the SCHEMAS_FROM_PROFILE Schema templates",
      "type": "STRING",
      "require": "false",
      "sensitive": "false"
    },
    {
      "name": "service_name_prefix",
      "description": "Prefix for the service name instances",
      "type": "STRING",
      "require": "true",
      "sensitive": "false"
    },
    {
      "name": "workload_name",
      "description": "WorkLoad name to be associated with the request",
      "type": "STRING",
      "require": "true",
      "sensitive": "false"
    },
    {
      "name": "schema",
      "description": "List of schema to be created",
      "type": "LIST",
      "defaultValue": [
        {
          "name": "username",
          "description": "New schema name",
          "type": "STRING",
          "require": "true",
          "sensitive": "false"
        },
        {
          "name": "original_name",
          "description": "Original schema name. Required only for the SCHEMAS_FROM_PROFILE Schema templates",
          "type": "STRING",
          "require": "false",
          "sensitive": "false"
        },
        {
          "name": "password",
          "description": "Password for the schema",
          "type": "STRING",
          "require": "true",
          "sensitive": "true"
        }
      ],
      "require": "true",
      "sensitive": "false"
    }
  ],
  "subtype": "schema",
  "template_type": "EMPTY_SCHEMAS",
  "max_number_of_schemas": "4",
  "workloads": [
    {
      "name": "WL_112",
      "description": "null",
      "attributes": [
        {
          "name": "CPU",
          "value": "0.1",
          "units": "cores"
        },
        {
          "name": "Memory",
          "value": "0.1",
          "units": "GB"
        },
        {
          "name": "Storage",
          "value": "10",
          "units": "GB"
        }
      ]
    }
  ],
  "params": {
    "masterAccount": "",
    "service_name_prefix": "",
    "workload_name": "",
    "schema": [
      {
        "username": "",
        "password": ""
      },
      {
        "username": "",
        "password": ""
      }
    ]
  }
}
27.1.2.3.2 Creating Database Services

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:

  • POST to the Db Zone on which db service is to be created

  • POST to the SchemaPlatformTemplate 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. 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 SchemaPlatformTemplate. The following operations are described:

POST to the Db Zone

The following shows the configuration for POSTing to Db Zone:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

  • 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

    {
        "based_on": "/em/cloud/dbaas/schemaplatformtemplate/DE3F8D882F132F45E040F00AAA2330C5",
        "name": "TestRequest",
        "params": {
            "workload_name": "WL_112",
            "service_name_prefix": "Service_1",
            "masterAccount": " SchemaUser1",
            "schema": [
                {
                    "username": " SchemaUser1",
                    "password": "welcome1"
                },
                {
                    "username": " SchemaUser2",
                    "password": "welcome1"
                }
            ]
        }
    }
    
  • Method

    POST

The following is the response from the above interaction:

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

POST on SchemaPlatformTemplate

The following describes the configurations for POSTing to the SchemaPlatformTemplate:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/schemaplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

  • 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

    {
        "zone": "/em/cloud/dbaas/zone/34C1FC23A7503E1CC9C490C9670635F9",
        "name": "TestRequest",
        "params": {
            "workload_name": "WL_112",
            "service_name_prefix": "Service_1",
            "masterAccount": "SchemaUser1",
            "schema": [
                {
                    "username": "SchemaUser1",
                    "password": "welcome"
                },
                {
                    "username": "SchemaUser2",
                    "password": "welcome"
                }
            ]
        }
    }
    
  • Method

    POST

The following is the response from the above interaction:

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

This response 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.

Polling the Schema Service Creation

Once the database service creation has been POSTed, you can GET the resource identified by the return URI to keep track of the status.

  • URL

    https://example.mycompany.com/em/cloud/dbaas/schemaplatforminstance/byrequest/22

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

  • Method

    GET

The following is the response:

{
    "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 is showing "CREATING" state to indicate the database Service is still being created. Once the database service is created, the same GET will return 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"
  },
  "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"
}

Deleting a Schema Service

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

  • URL

    https://example.mycompany.com/em/cloud/dbaas/schemaplatforminstance/byrequest/22

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

  • Method

    DELETE

The following Web service response with code 200 is returned:

{
  "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, the GET request on the database service URI will result in the following interaction:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/schemaplatforminstance/byrebyrequest/22

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

The Web service returns the following:

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

Please note the status of the database service will be DELETED once the schema service is deleted.

Lifecycle Operations On a Schema Service

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

The following operations can be performed using POST request:

  • Export Schema

  • Restore from exported schema dumps

  • Delete Exported Schema dump

  • Change Schema Password

27.1.2.3.3 Export Schema

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

For exporting schema ,the user can optionally provide the date at which the export should be taken. 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, then do as follows: 2013-08-27T12:34:45Z

  • URL https://example.mycompany.com/em/cloud/dbaas/schemaplatforminstance/byrequest/7

  • 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   "
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "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.oracle.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"
          }
      ]
    }
    
27.1.2.3.4 Restore from Exported Schema Dumps

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

The restore from dump is based on export dumps available; please refer to export_dump_list section in the output of GET request to get the URN of the dump.

  • URL https://example.mycompany.com/em/cloud/dbaas/schemaplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "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"
    }
    
27.1.2.3.5 Delete Exported Schema Dumps

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

The delete of export dump is based on export dumps available; please refer to export_dump_list section in the output of GET request to get the URN of the dump

  • URL https://example.mycompany.com/em/cloud/dbaas/schemaplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "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"
    }
    
27.1.2.3.6 Change Schema Passwords

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

  • URL https://example.mycompany.com/em/cloud/dbaas/schemaplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

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

27.1.3 Pluggable Database as a Service API

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

Note:

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

27.1.3.1 Resource Model for Pluggable Database as a Service

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 27-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 the Pluggable Database as a Service APIs and provide examples of supported operations. the Pluggable Database as a Service uses the same Cloud, Service Family, and DB Zone resources as described in Section 27.1.1.1, "Resource Model for Database as a Service".

. The following resource models are described:

27.1.3.1.1 PluggableDbPlatformTemplate

The PluggableDbPlatformTemplate extends the ServiceTemplate 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 PluggableDbPlatformTemplate. It is a preconfigured deployable service that realizes a PluggableDbPlatformInstance resource. PluggableDbPlatformTemplate has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.PluggableDbPlatformTemplate+json

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/schemaplatformtemplate/<template id>

The following table describes the SchemaPlatformTemplate Data Model.

Table 27-8 SchemaPlatformTemplate Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

A human readable name given to the template.

description

String

0..1

A brief description given to the template.

created

Timestamp

1

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

zones

Collection <DbZone>

0..1

List of all zones configured for this template.

resource_state

ResourceState

1

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.

service_instances

Collection <SchemaPlatformInstance>

0..1

All service instances created based on this SchemaPlatformTemplate.

media_type

String

1

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

params

Object

1

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

deployment_params

List<Object>

1

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

type

String

1

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

subtype

String

1

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

It has a value "schema" in this case.

template_type

String

1

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

workloads

List<Object>

0..1

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

canonicalLink

URI

1

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


27.1.3.1.2 PluggableDbPlatformInstance

The PluggableDbPlatformInstance extends the ServiceInstance resource. It is linked to Pluggable Database target in Enterprise Manager Cloud Control. PluggableDbPlatformInstance has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.PluggableDbPlatformInstance+json

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/schemaplatforminstance/byrequest/<request id>

The following table describes the SchemaPlatformInstance Data Model:

Table 27-9 SchemaPlatformInstance Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

A human readable name given given to the pluggable database

destination_zone

Zone

1

The Zone to which the pluggable database is deployed

media_type

String

1

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

resource_state

ResourceState

1

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.

based_on

PluggableDbPlatformTemplate

1

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

connect_string

String

0..1

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

created

Timestamp

1

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

target_type

String

1

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

status

String

1

Status of the pluggable database.

db_version

String

0..1

Version of the database on which pluggable db is running.

context_id

String

1

The request id of this pluggable database.

canonicalLink

URI

1

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


27.1.3.2 Operations Supported on Resources

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

Table 27-10 Supported Operations

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

Cloud

GET

Service Family Type

GET

DB Zone

GET, POST

PluggableDb Platform Template [Service Template]

GET, POST

PluggableDb Platform Instance [Service Instance]

GET, POST, DELETE


27.1.3.3 API Examples

The following sections provide examples of interaction with Enterprise Manager Cloud Control 12.1.0.3 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 APIs section. The following examples are covered:

  • GET on Pluggable Db Platform Template to get details about a Pluggable Db service template

  • Creating Pluggable Database

    • POST on Db Zone by selecting a Pluggable Db service template

    • POST on Pluggable Db Platform Template by selecting a Db Zone

  • GET on Pluggable Db Platform Instance to get status and other information about a pluggable database

  • DELETE on Pluggable Db Platform Instance to drop a pluggable database

  • Lifecycle operations on a Pluggable Database Instance

27.1.3.3.1 Pluggable Db Platform Template Resource
  • URL

    https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatformtemplate/E32F474628FCCE5AE040E50ACA84603A

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

    This is the resource returned as the complete PluggableDbPlatformTemplate resource:

    {
      "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"
          }
        ]
      },
      "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"
              }
    ]
      },
      "deployment_params": [
        {
          "name": "service_name_prefix",
          "description": "Prefix for the service name instances",
          "type": "STRING",
          "require": "true",
          "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"
        }
      ],
      "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": {
        "service_name_prefix": "",
        "workload_name": "",
        "username": "",
        "password": ""
      }
    }
    
27.1.3.3.2 Creating 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.

POST to the DB Zone

The following shows the configuration for POSTing to Db Zone:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/zone/82CF1C28FA20A183C99D138FF8065F19

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

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

  • Body

    {
      "based_on" : "/em/cloud/dbaas/pluggabledbplatformtemplate/E33799E249513428E040F50A994210F5" ,
      "name" : "Test Service" ,
      "params" :     {
          "username" : "SampleUser1" ,
          "password" : "welcome1" ,
          "service_name_prefix" : "TestService" ,
          "workload_name" : "w11" 
        }
    }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri": "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31",
      "name": "Test Service",
      "resource_state": {
        "state": "INITIATED"
      },
      "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"
    }
    

POST to the PluggableDbPlatformTemplate

The following describes the configurations for POSTing to the PluggableDbPlatformTemplate:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatformtemplate/CC3BBB665A6BC6FFE040F00AEF252456

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

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

  • Body

    {
      "zone": "/em/cloud/dbaas/zone/34C1FC23A7503E1CC9C490C9670635F9" ,
      "name" : "Test Service" ,
      "params" :     {
          "username" : "SampleUser2" ,
          "password" : "welcome1" ,
          "service_name_prefix" : "TestService" ,
          "workload_name" : "w11" 
        }
    }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
      "uri": "/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/32",
      "name": "Test Service",
      "resource_state": {
        "state": "INITIATED"
      },
      "media_type": "application/oracle.com.cloud.common.PluggableDbPlatformInstance+json",
      "canonicalLink": "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/32",
      "status": "SCHEDULED"
    }
    

    This response 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 pluggable database should be deployed.

27.1.3.3.3 Polling the Pluggable Database Creation
  • URL

    https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/31

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

  • Method

    GET

    The following is the response:

    {
      "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 is showing "CREATING" state to indicate the pluggable database is still being created. Once the pluggable database is created, the same GET will return 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"
        } ,
      "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" 
    }
    
27.1.3.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:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

  • Method

    DELETE

    The following Web service response with code 200 is returned:

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

    • URL

      https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/22

    • Headers

      Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    • Method

      GET

      The Web service returns the following:

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

27.1.3.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:

Shutdown Pluggable Database

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

  • URL: https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

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

  • Body

    {
            "operation" : "SHUTDOWN"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

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

Startup Pluggable Database

  • URL: https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

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

  • Body

    {
            "operation" : "STARTUP"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

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

Schedule Backup for 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

  • URL: https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

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

Restore the Backed up Pluggable Database

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

  • URL: https://example.mycompany.com/em/cloud/dbaas/pluggabledbplatforminstance/byrequest/7

  • 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"
            }
    
  • Method

    POST

    The following is the response from the above interaction:

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

27.2 REST APIs for Administrator Flows

This section covers the following:

27.2.1 PaaSZone APIs

PaasZones is a collection resource representing a Cloud Administrator's view of all the accessible PaasZone resources. PaaSZones has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.PaaSZones+json

  • Support Payload: json

  • URI Format: em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/

The following table describes the PaaSZones data model.

Table 27-11 PaaSZones Data Model

Field Name Occurs

Name

String

1

Displays name of this collection resource.

Type

String

1

Type of this collection resource.

hasMore

Boolean

1

Indicates whether there are more elements in the collection.

Count

Integer

1

Number of elements returned.

Items

Collection <PaaSZone>

1

List of PaasZone resources. If there are no intances, the items will be present but will be empty.

totalCount

Integer

1

Total number of PaaSZone resources.

canonicalLink

URI

1

A GET against this URI refreshes the client representation of this resource.

selfLink

URI

1

Refers to the resource equivalent to the containing elements.


27.2.1.1 Supported Operations

The following table lists all the operations that are supported on the PaaSZones resources.

Table 27-12 Supported Operations

Resource Operations
 

GET

POST

PUT

DELETE

PaaSZones

X

X

X

X


27.2.1.2 PaaSZone

This resource represents a PaaS Infrastructure Zone. PaaSZone has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.PaaSZone+json

  • Supported Payload: json

  • URI Format: em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/{zoneId}

The following table describes the PaaSZone data model.

Table 27-13 PaaSZone Data Model

Field Name Occurs

Name

String

1

A human readable name given to the PaaS Zone.

ID

String

1

Zone ID. GET method will have value for this element.

Description

String

0..1

As brief description given to the zone.

Credential

String

1

Global Named Credentials to be used for provisioning in this PaaS Infrastructure Zone.

Members

Collection <String>

1

Members of PaaS Zone. They can be either Host members or Oracle VM Zone members.

memberType

String

1

The target type of the members of PaaS Zone. It can be either "host" for Host members or "oracle_vm_zone" for Oracle VM Zone members.

Constraints

Collection <Software Pool>

0..1

Placement Policy Constraints allow the cloud administrator to set maximum thresholds for any host.

Roles

Collection <String>

0..1

SSA roles that can access this PaaS Infrastructure Zone.

Pools

Collection <Software Pool>

0..1

Software Pools associated with this PaaS Zone

membersToAdd

Collection <String>

0..1

Host or Oracle VM Zone targets to be added to an existing PaaS Zone while editing it

membersToRemove

Collection <String>

0..1

Host or Oracle VM Zone targets to be removed from an existing PaaS Zone while editing it.

rolesToAdd

Collection <String>

0..1

SSA roles to be added while editing a PaaS Zone.

rolesToRemove

Collection <String>

0..1

SSA roles to be deleted while editing a PaaS Zone.


27.2.1.3 Supported Operations

The following table lists all the operations that are supported on the PaaSZone resources.

Table 27-14 Supported Operations

Resource Operations
 

GET

POST

PUT

DELETE

PaaSZones

X

X

X

X


27.2.1.4 API Examples

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

  • GET on PaasZones to get zone details

  • Create Zone

  • Update Zone

  • Delete Zone

27.2.1.4.1 PaaSZones Resource
  • URL

    https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

  • Method

    GET This is the resource returned as the complete PaasZones resource:

Status 200 OK 
Content-Type: application/json  
{
  "name" : "Paas Zones",
  "type" : "Paas Infrastructure Zone",
  "hasMore" : false,
  "count" : 4,
  "items" : [ {
    "name" : "pzone1",
    "id" : "A3CF2D49CFF3F3E664D073303EA51F8E",
    "type" : "self_service_zone",
    "canonicalLink" : 
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/p
aaszones/A3CF2D49CFF3F3E664D073303EA51F8E"
\  }, {
    "name" : "Test Zone 2",
    "id" : "EF3830C71CC54B50B963376F9217AB95",
    "type" : "self_service_zone",
    "description" : "with MAX_CPU_UTILIZATION ",
    "canonicalLink" :
 "https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/EF3830C71CC54B50B963376F9217AB95"
  }, {
    "name" : "test paas zone",
    "id" : "5D7548C1B879A51CFD894CEA8D5FB19B",
    "type" : "self_service_zone",
    "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/5D7548C1B879A51CFD894CEA8D5FB19B"
  }, {
    "name" : "Test Zone",
    "id" : "CACBB07A674F280DF84FC4CBFA76DFA7",
    "type" : "self_service_zone",
    "description" : "with MAX_CPU_UTILIZATION ",
    "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/CACBB07A674F280DF84FC4CBFA76DFA7"
  } ],
  "totalCount" : 4,
  "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones",
  "selfLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones"
}
27.2.1.4.2 GET on PaaSZone Resource

The GET request on the PaasZone resource can be issued to retrieve its details. The following shows the configuration for GET to PaaSZone.

  • URL

    https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/ A3CF2D49CFF3F3E664D073303EA51F8E

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Method

    GET

The following is the response from the above interaction:

Status 200 OK 
Content-Type: application/json
{
  "name" : "pzone1",
  "description" : "This zone contains Host members",
  "type" : "PaaS Infrastructure Zone",
  "id" : "A3CF2D49CFF3F3E664D073303EA51F8E",
  "credential" : "SXAASJUNITHOSTCRED",
  "members" : {
    "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/A3CF2D49CFF3F3E664D073303EA51F8E/members",
    "memberType" : "host",
    "numberOfHostMembers" : "2"
  },
  "constraints" : {
    "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/A3CF2D49CFF3F3E664D073303EA51F8E/constraints",
    "numberOfConstraints" : "2"
  },
  "roles" : {
    "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/A3CF2D49CFF3F3E664D073303EA51F8E/roles",
    "numberOfUserRoles" : "1"
  },
  "pools" : {
    "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/A3CF2D49CFF3F3E664D073303EA51F8E/pools",
    "numberOfSoftwarePools" : "0"
  },
  "createdOn" : "2013-05-22 01:50:30",
  "createdBy" : null,
  "modifiedOn" : null,
  "modifiedBy" : null,
  "owner" : "SYSMAN",
  "etag" : null,
  "lastModified" : null,
  "canonicalLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/A3CF2D49CFF3F3E664D073303EA51F8E",
  "selfLink" :
"https://example.oracle.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
paaszones/A3CF2D49CFF3F3E664D073303EA51F8E"
27.2.1.4.3 Create Zone

A PaaS Zone is created with a POST request on the PaasZones collection resource.

The following shows the configuration for POST to PaaSZones:

  • URL https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

  • Body

    {
        "name":"My Test Zone",
        "description":"This is a TestZone",
        "credential":"NCAIME",
        "memberType":"host",
        "members":[
            "slc05gvt.us.oracle.com"
        ],
        "constraint":[
            {
                "name":"MAX_CPU_UTILIZATION",
                "value":"85"
            },
            {
                "name":"MAX_MEMORY_ALLOCATION",
                "value":"95"
            }
        ],
        "roles":[
            "SSACOREROLE1",
            "SSACOREROLE2"
        ],
        
    }
    
  • Method

    POST

    The following is the response from the above interaction:

    Status 201 Created 
    Content-Type: application/json
    {
      "name" : "My Test Zone",
      "description" : "This is a TestZone",
      "type" : "PaaS Infrastructure Zone",
      "id" : "DDBFEFDAD2AE6490E040F00AA37D4C67",
      "credential" : "NCAIME",
      "members" : {
        "canonicalLink" : 
    "https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
    paaszones/DDBFEFDAD2AE6490E040F00AA37D4C67/members",
        "memberType" : "host",
        "numberOfHostMembers" : "1"
      },
      "constraints" : {
        "canonicalLink" : 
    "https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
    paaszones/DDBFEFDAD2AE6490E040F00AA37D4C67/constraints",
        "numberOfConstraints" : "2"
      },
      "roles" : {
        "canonicalLink" : 
    "https://cloudcompany.com.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/DDBFEFDAD2AE6490E040F00AA37D4C67/roles",
        "numberOfUserRoles" : "2"
      },
      "pools" : {
        "canonicalLink" : 
    "https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/DDBFEFDAD2AE6490E040F00AA37D4C67/pools",
        "numberOfSoftwarePools" : "0"
      },
      "createdOn" : "2013-05-27 20:57:18",
      "createdBy" : null,
      "modifiedOn" : null,
      "modifiedBy" : null,
      "owner" : "SYSMAN",
      "etag" : null,
      "lastModified" : null,
      "canonicalLink" : 
    "https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
    paaszones/DDBFEFDAD2AE6490E040F00AA37D4C67",
      "selfLink" : 
    "https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/
    paaszones/DDBFEFDAD2AE6490E040F00AA37D4C67"
    }
    
27.2.1.4.4

Update Zone

The PUT request with payload updates an existing PaaS Infrastructure Zone.

The following shows the configuration for PUT to PaasZones:

  • URL https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    {    "name":"My Test Zone",
        "credential":"NCAIME2",
        "description":"Description_01",
        "membersToAdd":[
            "somehost.com",
            "someotherhost.com"
        ],
        "membersToRemove":[
            "removehost.com",
            "removeotherhost2.com"
        ]
        ,
        "rolesToAdd":[
            "ROLE_1",
            "ROLE_2"
        ],
        "rolesToRemove":[
            "ROLE_1_1",
            "ROLE_2_1"
        ],
        "constraints":[
            {
                "name":"MAX_MEMORY_ALLOCATION",
                "value":"80"
            },
             {
                "name":"MAX_CPU_UTILIZATION",
                "value":"80"
            }
        ]
    }
    
  • Method

    PUT

    The following is the response from the above interaction:

    Status 200 OK
    Content-Type: application/json
    {
      "message" : "PaaS Infrastructure Zone "My Test Zone" updated successfully."
    }
    
27.2.1.4.5 Delete Zone

The DELETE request on the URI of the PAASZONE can be issued to delete a PaasZone Instance.The following shows the configuration for deleting in PaasZone:

  • URL

    https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/paaszones/DDBFEFDAD2AE6490E040F00AA37D4C67

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    DELETE

The following is the response from the above interaction:

Status 200 OK 
Content-Type: application/json
{
  "message" : "PaaS Infrastructure Zone  "DDBFEFDAD2AE6490E040F00AA37D4C67" deleted    successfully."
}

27.2.2 Pool APIs

This section covers the following:

27.2.2.1 Software Pools

SoftwarePools is a collection resource representing an SSA Administrator's view of all the accessible SoftwarePool resources. SoftwarePools has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.SoftwarePools +json

  • Supported Payload: json

  • URI Format: em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/

The following table describes the SoftwarePools data model.

Table 27-15 SoftwarePools Data Model

Field Name Occurs

Name

String

1

Displays name of this collection resource.

Type

String

1

Type of this collection resource.

hasMore

Boolean

1

Indicates whether there are more elements in the collection.

Count

Integer

1

Number of elements returned.

Items

Collection <PaaSZone>

1

List of PaasZone resources. If there are no intances, the items will be present but will be empty.

totalCount

Integer

1

Total number of PaaSZone resources.

canonicalLink

URI

1

A GET against this URI refreshes the client representation of this resource.

selfLink

URI

1

Refers to the resource equivalent to the containing elements.


27.2.2.1.1 Supported Operations

The following table lists all the operations that are supported on the SoftwarePools resources.

Table 27-16 Supported Operations

Resource Operations
 

GET

POST

PUT

DELETE

PaaSZones

X

X

X

X


27.2.2.2 SoftwarePool

A SoftwarePool resource represents a collection of homogeneous servers or clusters that are used to service requests within a PaaS Infrastructure Zone. All members within a SoftwarePool must be of the same type and must belong to the same PaaS Infrastructure Zone.SoftwarePool has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.SoftwarePool+json

  • Supported Payload: json

  • URI Format: em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepool/{poolId}

The following table describes the SoftwarePool data model.

Table 27-17 SoftwarePool Data Model

Field Name Occurs

Name

String

1

A human readable name given to the SoftwarePool.

ID

String

1

Pool GUID that uniquely identifies the resource.

Description

String

0..1

As brief description given to the software pool.

poolTargetType

String

1

Target type of the Software Pool to be created. Example : "oracle_cloud_zone" for Database Pool, "schaas_pool" for Schema Pool, “pdbaas_pool” for Pluggable Database Pool.

paasZone

String

1

Name of the PaaS Zone associated with this Software Pool.

Members

Collection <String>

1

Members of PaaS Zone. They can be either Host members or Oracle VM Zone members.

memberType

String

1

The target type of the members of PaaS Zone. It can be either "host" for Host members or "oracle_vm_zone" for Oracle VM Zone members.

Constraints

Collection <Entity Value Holder>

0..1

Placement Policy Constraints for a software pool allow the self service administrator to set maximum ceilings for resource utilization.

Filters

Collection <EntityValueHolder>

1

Filters on a Software Pool restrict the addition of member targets to it with a set criteria.

Properties

Collection <String>

1

Additional properties that need to be specified for a specific pool target type.

membersToAdd

Collection <String>

0..1

Targets to be added to an existing Software Pool while editing it.

membersToRemove

Collection <String>

0..1

Targetst to be removed from an existing Software Pool while editing it.

canonicalLink

URI

1

A GET against this URI refreshes the client representation of this resource.


27.2.2.2.1 Supported Operations

The following table lists all the operations that are supported on the SoftwarePool resources.

Table 27-18 Supported Operations

Resource Operations
 

GET

POST

PUT

DELETE

SoftwarePool

X

X

X

X


27.2.2.3 API Examples

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

  • GET on SoftwarePools to get pool details

  • GET on SoftwarePools to get Database/Schema/Pluggable pool details

  • Create Database pool

  • Update Database pool

  • Create Schema pool

  • Update Schema pool

  • Create Pluggable database pool

  • Update Pluggable database pool

  • Delete Database/Schema/Pluggable Database pool

27.2.2.4 SoftwarePools Resource

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/ cloudservices/admin/cfw/v1/softwarepools

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

  • Method

    GET

This is the resource returned as the complete SoftwarePools resource:

Status 200 OK 
Content-Type: application/json 
{
name: "Software Pools"
type: "Software Pool"
hasMore: false
count: 2
items: [2]
0:  {
name: "IT_MW_Pool_2"
type: "mwaas_zone"
id: "E284FAAA7FBA6A06F7090115A3E07299"
zoneName: "IT_MW_Zone1"
canonicalLink: 
"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E284FAAA7FBA6A06F7090115A3E07299"
description: "Middleware Pool of Oracle Homes of Version 10.3.5.0"
}-
1:  {
name: "IT_MW_Pool1"
type: "mwaas_zone"
id: "DD73A46E9E3C9866E040F00AE5235A7F"
zoneName: "IT_MW_Zone1"
canonicalLink:
"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/DD73A46E9E3C9866E040F00AE5235A7F"
description: "Middleware Pool of Oracle Homes"
}-
-
totalCount: 2
canonicalLink: 
"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/"
selfLink: 
"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/"
}
27.2.2.4.1 GET on SoftwarePool Resource

The GET request on the SoftwarePool URI can be issued to retrieve its details.

The following shows the configuration for HET on SoftwarePool:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E284FAAA7FBA6A06F7090115A3E07299

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

  • Method

    GET

The following is the response from the above interaction:

{
        "name":"DB_POOL",
        "description":"Database Pool of Oracle Homes",
        "type":"Database Zone",
        "id":"E827809080C16F75E040F20A60511EA2",
        "zoneName":"SLC01MDR_ZONE",
        "members":{
                "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/members",
                "numberOfPoolMembers":"1"
        },
        "constraints":{
                "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/constraints",
                "numberOfConstraints":"1"
        },
        "filters":{
                "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/filters",
                "numberOfFilters":"3"
        },
        "properties":{
          "canonicalLink":https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/properties",
          "numberOfPropertiess":"0"
        },
        "createdOn":"2013-10-07 06:27:17",
        "createdBy":null,
        "modifiedOn":null,
        "modifiedBy":null,
        "owner":"SYSMAN",
        "etag":null,
        "lastModified":null,
        "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2",
        "selfLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2"
}
27.2.2.4.2 Create Database Pool

A POST operation is issued on Software Pools Collection resource to create a Database Pool.

The following shows the configuration for POST to SoftwarePools:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

    Content-Type: application/json

  • Body

    { 
            "name": "DB_POOL", 
            "poolTargetType": "oracle_cloud_zone",
            "description": "Database Pool of Oracle Homes",
            "paasZone": "SLC01MDR_ZONE",
            "members": ["OraDb11g_home1_2_slc01mdr"],
            "serviceFamily":"DBAAS",
            "serviceType":"DBAAS",
            "constraints": 
                                    {"items": [{"name": "MAX_INSTANCES", "value": "10"}]},
            "filters": 
                             {"items": [{"name": "CONFIGURATION","value": "oracle_database"},{"name": "VERSION","value": "11.2.0.2.0"},
                             {"name": "PLATFORM","value": "226"}]} 
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
            "name":"DB_POOL",
            "description":"Database Pool of Oracle Homes",
            "type":"Database Zone",
            "id":"E827809080C16F75E040F20A60511EA2",
            "zoneName":"SLC01MDR_ZONE",
            "members":{
                    "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/members",
                    "numberOfPoolMembers":"1"
            },
            "constraints":{
                    "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/constraints",
                    "numberOfConstraints":"1"
            },
            "filters":{
                    "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/filters",
                    "numberOfFilters":"3"
            },
            "properties":{
              "canonicalLink":https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2/properties",
              "numberOfPropertiess":"0"
            },
            "createdOn":"2013-10-07 06:27:17",
            "createdBy":null,
            "modifiedOn":null,
            "modifiedBy":null,
            "owner":"SYSMAN",
            "etag":null,
            "lastModified":null,
            "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2",
            "selfLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2"
    }
    
27.2.2.4.3 Update Database Pool

A PUT operation is issued on Software Pools Collection resource to update a Database Pool.

The following shows the configuration for PUT to SoftwarePools:

  • URL https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    { 
            "name": "DB_POOL", 
            "poolTargetType": "oracle_cloud_zone",
            "description": "Database Pool of Oracle Homes",
            "membersToAdd": [
                    "OraDb11g_home1_2_slc01mdr"],
            "membersToRemove": [
                    "OraDb11g_home1_2_slc01mdr"],
            "constraints": 
                                    {"items": [{"name": "MAX_INSTANCES", "value": "8"}]},
            }
    
  • Method

    PUT

    The following is the response from the above interaction:

    Status 200 OK 
    Content-Type: application/json 
    {
    message: "Software Pool  " DB_POOL" updated successfully."
    }
    
27.2.2.4.4 Create Schema Pool

A POST operation is issued on Software Pools Collection resource to create a Software Pool.

The following shows the configuration for POST to SoftwarePools:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    { 
            "name": "SCHEMA_POOL", 
            "poolTargetType": "schaas_pool",
            "description": "Schema Service Pool",
            "paasZone": "SLC01MDR_ZONE",
            "members": ["simple.us.oracle.com"],
            "serviceFamily":"DBAAS",
            "serviceType":"SCHEMA",
            "constraints": 
                    {
                    "items": [
                            {"name": "MAX_SERVICES", "value": "20"},
                            {"name": "USE_WORKLOAD", "value": "true"},
                            {"name": "MAX_CPU_USAGE", "value": "90"},                                           
                            {"name": "MAX_MEMORY_USAGE", "value": "90"},
                            {"name": "ENFORCE_CPU", "value": "true"}                           
                            ]
                                    },
            "filters": 
                    {
                    "items": [
                    {"name": "TARGET_TYPE","value": "oracle_database"},
                    {"name": "VERSION","value": "11.2.0.2.0"},
                    {"name": "PLATFORM","value": "226"}
                    ]
                    } 
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    Status 201 Created 
    Content-Type: application/json
    {
            "name":"SCHEMA_POOL",
            "description":"Schema Service Pool",
            "type":"Schema Pool",
            "id":"2CFF36A9E92AAD533253871374857D8C",
            "zoneName":"SLC01MDR_ZONE",
            "members":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/2CFF36A9E92AAD533253871374857D8C/members",
             "numberOfPoolMembers":"1"},
            "constraints":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/2CFF36A9E92AAD533253871374857D8C/constraints",
             "numberOfConstraints":"5"},
            "filters":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/2CFF36A9E92AAD533253871374857D8C/filters",
             "numberOfFilters":"3"},
            "properties":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/2CFF36A9E92AAD533253871374857D8C/properties",
             "numberOfPropertiess":"0"},
            "createdOn":"2013-10-07 08:13:48",
            "createdBy":null,
            "modifiedOn":null,
            "modifiedBy":null,
            "owner":"SYSMAN",
            "etag":null,
            "lastModified":null,
            "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/2CFF36A9E92AAD533253871374857D8C",
            "selfLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/2CFF36A9E92AAD533253871374857D8C"
    }
    
27.2.2.4.5 Update Schema Pool

A PUT operation is issued on Software Pools Collection resource to update a Software Pool.

The following shows the configuration for PUT to SoftwarePools:

  • URL

    https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    { 
            "name": "SCHEMA_POOL", 
            "poolTargetType": "schaas_pool",
            "description": "Schema Service Pool",
            "membersToAdd": [
                    "simple.us.oracle.com"],
            "membersToRemove": [
                    "simple.us.oracle.com"],
            "constraints": 
                    {
                    "items": [
                    {"name": "MAX_SERVICES", "value": "10"},
                    {"name": "USE_WORKLOAD", "value": "false"},
                    {"name": "MAX_CPU_USAGE", "value": "90"},                                           
                    {"name": "MAX_MEMORY_USAGE", "value": "90"},
                    {"name": "ENFORCE_CPU", "value": "false"}                          
                    ]
                    },
            }
    
  • Method

    PUT

    The following is the response from the above interaction:

    Status 200 OK 
    Content-Type: application/json 
    {
    message: "Software Pool  "SCHEMA_POOL" updated successfully.
    
27.2.2.4.6 Create Pluggable Database Pool

A POST operation is issued on Software Pools Collection resource to create a Software Pool.The following shows the configuration for POST to SoftwarePools:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    { 
            "name": "PDB_POOL", 
            "poolTargetType": "pdbaas_pool",
            "description": "Pluggable Database Pool",
            "paasZone": "PDB_ZONE",
            "members": ["database"],
            "serviceFamily":"DBAAS",
            "serviceType":"PDB",
            "constraints": 
                    {
                    "items": [
                    {"name": "MAX_PDB_SERVICES", "value": "20"},
                    {"name": "PDBS_USE_WORKLOAD", "value": "true"},
                    {"name": "MAX_CPU_USAGE_BY_PDBS", "value": "90"},                                             
                    {"name": "MAX_MEMORY_USAGE_BY_PDBS", "value": "90"},
                    {"name": "PDBS_ENFORCE_CPU", "value": "true"}                               
                    ]
            },
            "filters": 
                    {
                    "items": [
                            {"name": "TARGET_TYPE_CDB","value": "oracle_database"},
                            {"name": "VERSION_CDB","value": "12.1.0.1.0"},
                            {"name": "PLATFORM_CDB","value": "226"}
                            ]
                    } 
            }
    
  • Method

    POST

    The following is the response from the above interaction:

    Status 201 Created 
    Content-Type: application/json
    {
            "name":"PDB_POOL",
            "description":"Pluggable Database Pool",
            "type":"Pdb Pool",
            "id":"E82952BD4C94D443E040F20A605114E6",
            "zoneName":"PDB_ZONE",
            "members":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E82952BD4C94D443E040F20A605114E6/members",
             "numberOfPoolMembers":"1"
            },
            "constraints":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E82952BD4C94D443E040F20A605114E6/constraints",
             "numberOfConstraints":"5"
            },
            "filters":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E82952BD4C94D443E040F20A605114E6/filters",
             "numberOfFilters":"3"
             },
            "properties":{
             "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E82952BD4C94D443E040F20A605114E6/properties",
             "numberOfPropertiess":"0"},
            "createdOn":"2013-10-07 08:29:51",
            "createdBy":null,
            "modifiedOn":null,
            "modifiedBy":null,
            "owner":"SYSMAN",
            "etag":null,
            "lastModified":null,
            "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E82952BD4C94D443E040F20A605114E6",
            "selfLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E82952BD4C94D443E040F20A605114E6"
    }
    
27.2.2.4.7 Update Pluggable Database Pool

A PUT operation is issued on Software Pools Collection resource to update a Software Pool.

The following shows the configuration for PUT to SoftwarePools:

  • URL

    https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    { 
            "name": "PDB_POOL", 
            "poolTargetType": "pdbaas_pool",
            "description": "Pluggable Database Pool",
            "membersToAdd": [
                    "simple.us.oracle.com"],
            "membersToRemove": [
                    "simple1.us.oracle.com"],
            "constraints": 
                    {
                    "items": [
                    {"name": "MAX_PDB_SERVICES", "value": "10"},
                    {"name": "PDBS_USE_WORKLOAD", "value": "false"},
                    {"name": "MAX_CPU_USAGE_BY_PDBS", "value": "90"},                                             
                    {"name": "MAX_MEMORY_USAGE_BY_PDBS", "value": "90"},
                    {"name": "PDBS_ENFORCE_CPU", "value": "false"}                              
                    ]
            },
            }
    
  • Method

    PUT

    The following is the response from the above interaction:

    Status 200 OK 
    Content-Type: application/json 
    {
    message: "Software Pool  "PDB_POOL" updated successfully."
    }
    
27.2.2.4.8 Delete Database / Schema / Pluggable Database Pool

The DELETE request on the URI of the Database pool can be issued to delete a SoftwarePool Instance.The following shows the configuration for deleting a SoftwarePool:

  • URL

    https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/softwarepools/E827809080C16F75E040F20A60511EA2

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    DELETE

    The following is the response from the above interaction:

    Status 200 OK 
    Content-Type: application/json 
    {
    message: "Software Pool " E827809080C16F75E040F20A60511EA2" deleted successfully."
    }
    

27.2.3 Database Quota APIs

Note:

Quota APIs are only supported by the Oracle Cloud Application plug-in version 12.1.0.7.0 and higher.

This section describes the REST request/response interactions for setting up Quota. The topics covered in this section are:

  • Resource Model for Database Quota

  • Operations supported on resources

  • API Examples

27.2.3.1 Resource Model for Database Quota

Cloud resources are organized by common service entities, and specific services (for example, Database Quota) provide resources by extending these common service entities. The Database Quota is a CloudResource for which instance does not exist.

The following sections describe the resources that are supported by the Database Quota APIs and provide examples of supported operations. The DbaasQuota resource models is described.

27.2.3.1.1 DbaasQuota

The DbaasQuota extends the CloudResource. It describes the quota settings for all roles. DbaasQuota has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.DbaasQuota+json

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/quota

The following table describes the DbaasQuota data model.

Field Type Occurs Description
uri URI 1 A GET against this URI refreshes the client representation of the resources accessible to this user.
name String 1 A human readable name given to the template.
description String 1 A brief description given to the template
resource_state String 1 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.
media_type String 1 The media type of the service template that. this type represents
service_family_type String 1 Dbaas
canonicalLink URI 1 Can be used to perform cloud interactions like GET and POST.
databases String 1 The databases usage report.
schema_services String 1 The schema services usage report.
pluggable_databases String 1 The pluggable databases usage report.
memory String 1 The memory usage report.
storage String 1 The storage usage report.
Quota String 1 The Quota setup details for a role.

27.2.3.1.2 Supported Operations

The following table lists all the operations that are supported on the database quota resources.

Table 27-19 Supported Operations

Resource Operations
 

GET

POST

PUT

DELETE

DbaasQuota

X

X

X

X


27.2.3.2 API Examples

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

  • GET on DbaasQuota to get details on quota usage & role quota setup

  • Create Quota for Role

  • Update Quota for a Role already setup

  • Delete quota setup for Role

27.2.3.2.1

DbaasQuota Resource

  • URL

    https://example.mycompany.com/em/cloud/dbaas/quota

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

This is the resource returned as the complete DbaasQuota resource:

{
  "uri" : "/em/cloud/dbaas/quota" ,
  "name" : "Dbaas User Quota" ,
  "description" : "User Quota for the user" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "media_type" : "application/oracle.com.cloud.common.DbaasQuota+json" ,
  "service_family_type" : "dbaas" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/quota" ,
  "databases" :     {
      "quota" : "Unlimited" ,
      "used" : "1" ,
      "unit" : "Instance"
    } ,
  "schema_services" :     {
      "quota" : "Unlimited" ,
      "used" : "1" ,
      "unit" : "Instance"
    } ,
  "pluggable_databases" :     {
      "quota" : "Unlimited" ,
      "used" : "1" ,
      "unit" : "Instance"
    } ,
  "memory" :     {
      "quota" : "Unlimited" ,
      "used" : "0.79" ,
      "unit" : "GB"
    } ,
  "storage" :     {
      "quota" : "Unlimited" ,
      "used" : "3.38" ,
      "unit" : "GB"
    } ,
  "Quotas" : 
  [
      {
        "Role Name" : "DBAAS_ROLE" ,
        "Memory(GB)" : "99" ,
        "Storage(GB)" : "99" ,
        "Number of Database Requests" : "99" ,
        "Number of Schema Service Requests" : "99" ,
        "Number of Pluggable database Service Requests" : "99"
      }
  ]
}
27.2.3.2.2 Create Quota for Role

This section describes how to create/setup a quota for a role using the Cloud resources.

The following shows the configuration for POST to DbaasQuota:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/quota

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/oracle.com.cloud.common.DbaasQuota+jsonAccept: application/oracle.com.cloud.common.DbaasQuota+json

  • Body

      {
            "role_name" : "DBAAS_ROLE",       
            "databases" : "10",
            "schema_services" : "21",
            "pluggable_databases" : "22",
            "storage" : "99",
            "memory" : "99"
            }
    
  • Method

    POST

The following is the response from the above interaction:

{
  "uri" : "/em/cloud/dbaas/quota" ,
  "name" : "Dbaas User Quota" ,
  "description" : "User Quota for the user" ,
  "resource_state" :     {
      "state" : "READY" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T08:58:48+0000" ,
            "text" : "Quota for Role DBAAS_ROLE setup successfully."
          }
      ]
    } ,
  "media_type" : "application/oracle.com.cloud.common.DbaasQuota+json" ,
  "service_family_type" : "dbaas" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/quota"
}
27.2.3.2.3 Update Quota for Role

This section describes how update the quota already setup for a role using the Cloud resources.The following shows the configuration for PUT to DbaasQuota:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/quota

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/oracle.com.cloud.common.DbaasQuota+jsonAccept: application/oracle.com.cloud.common.DbaasQuota+json

  • Body

    {
            "role_name" : "DBAAS_ROLE",       
            "databases" : "10",
            "schema_services" : "21",
            "pluggable_databases" : "22",
            "storage" : "99",
            "memory" : "99"
             
    
  • Method

    PUT

    The following is the response from the above

    {
      "uri" : "/em/cloud/dbaas/quota" ,
      "name" : "Dbaas User Quota" ,
      "description" : "User Quota for the user" ,
      "resource_state" :     {
          "state" : "READY" ,
          "messages" : 
          [
              {
                "date" : "2013-08-27T09:01:56+0000" ,
                "text" : "Quota for Role DBAAS_ROLE updated successfully."
              }
          ]
        } ,
      "media_type" : "application/oracle.com.cloud.common.DbaasQuota+json" ,
      "service_family_type" : "dbaas" ,
      "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/quota"
    }
    
27.2.3.2.4 Delete Quota for Role

This section describes how delete the quota setup for a role using the Cloud resources.The following shows the configuration for deleting in DbaasQuota:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/quota

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/oracle.com.cloud.common.DbaasQuota+jsonAccept: application/oracle.com.cloud.common.DbaasQuota+json

  • Body

    {
            "role_name" : "DBAAS_ROLE",       
             
    
  • Method

    DELETE

    The following is the response from the above

    {  "uri" : "/em/cloud/dbaas/quota" ,  "name" : "Dbaas User Quota" ,  "description" : "User Quota for the user" ,  "resource_state" :     {      "state" : "READY" ,      "messages" :       [          {            "date" : "2013-08-27T08:58:32+0000" ,            "text" : "Quota for Role DBAAS_ROLE deleted successfully."          }      ]    } ,  "media_type" : "application/oracle.com.cloud.common.DbaasQuota+json" ,  "service_family_type" : "dbaas" ,  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/quota"}
    

27.2.4 Database Request Settings APIs

Note:

Request Settings APIs are only supported by the Oracle Cloud Application plug-in version 12.1.0.7.0 and higher.

This section describes the REST request/response interactions for Database Request Settings. The topics covered in this section are:

  • Resource Model for Database Request Settings

  • Operations supported on resources

  • API Examples

27.2.4.1 Resource Model for Database Request Settings

Cloud resources are organized by common service entities, and specific services (for example, Database Request Settings) provide resources by extending these common service entities. The Database Request Settings is a CloudResource for which instance does not exist.The following sections describe the resources that are supported by the Database Request Settings APIs and provide examples of supported operations. The DbaasRequestSettings resource model is described.

27.2.4.1.1 DbaasRequestSettings

The DbaasRequestSettings extends the CloudResource. It describes the database request settings related to service instances. DbaasRequestSettings has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.DbaasRequestSettings+json

  • Supported Payload: json

  • URI Format: /em/cloud/dbaas/requestsettings

The following table describes the DbaasRequestSettings data model.

Table 27-20 DBaaSRequestSettings Data Model

Field Type Occurs Description

uri

URI

1

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

name

String

1

A human readable name given to the template.

description

String

1

A brief description given to the template

resource_state

ResourceState

1

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.

media_type

String

1

The media type of the service template.

service_family_type

String

1

Dbaas

canonicalLink

URI

1

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

RequestSettings

String

1

The current database request settings.


27.2.4.1.2 Supported Operations

The following table lists all the operations that are supported on the database quota service resources.

Table 27-21 Supported Operations

Resource Operations
 

GET

POST

PUT

DELETE

DbaasRequestSettings

X

X

X

X


27.2.4.2 API Examples

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

  • GET on DbaasRequestSettings to get details current database request settings

  • Update the database request settings

27.2.4.2.1 DbaasRequestSettings Resource
  • URL

    https://example.mycompany.com/em/cloud/dbaas/requestsettings

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    GET

This is the resource returned as the complete DbaasRequestSettings resource:

{
  "uri" : "/em/cloud/dbaas/requestsettings" ,
  "name" : "Dbaas Request Settings" ,
  "description" : "Dbaas Request settings" ,
  "resource_state" :     {
      "state" : "READY"
    } ,
  "media_type" : "application/oracle.com.cloud.common.DbaasRequestSettings+json" ,
  "service_family_type" : "dbaas" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/requestsettings" ,
  "Request Settings" :     {
      "futureReservationLength" : "No Reservation" ,
      "defaultRetirementPeriod" : "No Reservation" ,
      "maximumArchiveDuration" : "No Reservation"
    }
}
27.2.4.2.2 Update Database Request Settings

This section describes how to update the request settings using the Cloud resources.

The following shows the configuration for POST to DbaasRequestSettings:

  • URL

    https://example.mycompany.com/em/cloud/dbaas/requestsettings

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

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

  • Body

    {
            "future_reservation_length" : "2 Months", 
            "maximum_archive_duration" : "10 Weeks",
            "default_retirement_period" : "No Reservation"
            }
    
  • Method

    POST

The following is the response from the above interaction:

{
  "uri" : "/em/cloud/dbaas/requestsettings" ,
  "name" : "Dbaas Request Settings" ,
  "description" : "Dbaas Request settings" ,
  "resource_state" :     {
      "state" : "READY" ,
      "messages" : 
      [
          {
            "date" : "2013-08-27T09:13:03+0000" ,
            "text" : "Request settings have been updated."
          }
      ]
    } ,
  "media_type" : "application/oracle.com.cloud.common.DbaasRequestSettings+json" ,
  "service_family_type" : "dbaas" ,
  "canonicalLink" : "/em/websvcs/restful/extws/cloudservices/service/v0/ssa/em/cloud/dbaas/requestsettings"
}

27.2.5 Service Template APIs

This section covers the following:

27.2.5.1 Service Templates

Service Templates is a collection resource representing a Cloud Administrator's view of all the accessible service template resources. ServiceTemplates has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.ServiceTemplates+json

  • Support Payload: json

  • URI Format: em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/

The following table describes the ServiceTemplates data model.

Table 27-22 ServiceTemplates Data Model

Field Name Occurs

Name

String

1

Displays name of this collection resource.

Type

String

1

Type of this collection resource.

hasMore

Boolean

1

Indicates whether there are more elements in the collection.

Count

Integer

1

Number of elements returned.

Items

Collection <ServiceTemplate>

1

The elements of this collection.

totalCount

Integer

1

Total number of PaaSZone resources.

canonicalLink

URI

1

A GET against this URI refreshes the client representation of this resource.

selfLink

URI

1

Refers to the resource equivalent to the containing elements.


27.2.5.1.1 Supported Operations

The following table lists all the operations that are supported on the ServiceTemplate resources.

Table 27-23 Supported Operations

Resource Operations
 

GET

POST

PUT

DELETE

ServiceTemplates

X

X

X

X


27.2.5.2 ServiceTemplate

A service template is a standardized service definition that can be used by self service users to provision a service instance. ServiceTemplate has the following media type and payload:

  • Media Type: application/oracle.com.cloud.common.ServiceTemplate+json

  • Supported Payload: json

  • URI Format: em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/{templateId}

The following table describes the ServiceTemplate data model.

Table 27-24 ServiceTemplate Data Model

Field Name Occurs

Name

String

1

A human readable name given to the ServiceTemplate.

ID

String

1

Service Template ID that uniquely identifies the resource.

Description

String

0..1

As brief description given to the zone.

canonicalLink

URI

1

A GET against this URI refreshes the client representation of this resource.

serviceFamily

String

1

Service family

serviceType

String

1

Service type.

Roles

Collection <Role>

0..1

SSA roles that can access this service template.

poolIds

Collection <String>

1

Software Pool Ids associated with this service template.

createdOn

String(Date/Time)

0..1

Time when the resource was created.

createdBy

String

1

The user who created the resource.

modifiedOn

String(Date/Time)

0..1

Time when the resource was last modified.

rolesToRemove

Collection <String>

0..1

SSA roles to be deleted while editing a PaaS Zone.


27.2.5.2.1 Supported Operations

The following table lists all the operations that are supported on the ServiceTemplate resources.

Table 27-25 ServiceTemplate

Resource Operations
 

GET

POST

PUT

DELETE

ServiceTemplates

X

X

X

X


27.2.5.3 API Examples

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

  • GET on ServiceTemplates to get service template list

  • GET on ServiceTemplates to get Database/Schema/Pluggable template details

  • Create Database Service Template

  • Create Schema Service Template

  • Create Pluggable database Service Template

  • Delete Database/Schema/Pluggable Database Service Template

27.2.5.3.1 ServiceTemplates Resource
  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/ cloudservices/admin/cfw/v1/servicetemplates

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Method

    GET

This is the resource returned as the complete ServiceTemplates resource:

{
    "name":"Service Templates",
    "type":"Service Template",
    "hasMore":false,
    "items":[
        {
            "id":"E821074692058B5DE040F00AA37D75AB",
            "name":"ST_DB_SCH_01",
            "serviceFamily":"DBAAS",
            "description":"Database Schema Service Template",
            "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E821074692058B5DE040F00AA37D75AB"
        }
    ],
    "totalCount":1,
    "canonicalLink":"https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates"
} 
27.2.5.3.2 GET on ServiceTemplate Resource

The GET request on the ServiceTemplate URI can be issued to retrieve its details.The following shows the configuration for GET to ServiceTemplate:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E821074692058B5DE040F00AA37D75AB

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Method

    GET

The following is the response from the above interaction:

{
  "name" : "ST_DB_SCH_01",
  "serviceFamily" : "DBAAS",
  "serviceType" : "SCHEMA",
  "type" : "Service Template",
  "description" : "Database Schema Service Template",
  "id" : "E821074692058B5DE040F00AA37D75AB",
  "pools" : [ {
    "name" : "SP_DB_SCH_01",
    "id" : "EBECE6B8F0144BEFAB2F1991B4AFCC65",
    "type" : "schaas_pool",
    "zone" : {
      "id" : "E82022FF954B98CFE040F00AA37D447B",
      "name" : "PZ01"
    }
  } ],
  "serviceExecutableMeta" : {
    "type" : "CDP",
    "configurations" : [ {
      "id" : "targets",
      "name" : "targets",
      "value" : ""
    }, {
      "id" : "ssaRequestId",
      "name" : "ssaRequestId",
      "value" : ""
    }, {
      "id" : "ssaUser",
      "name" : "ssaUser",
      "value" : ""
    }, {
      "id" : "ssaTargetName",
      "name" : "ssaTargetName",
      "value" : ""
    }, {
      "id" : "ssaTargetType",
      "name" : "ssaTargetType",
      "value" : ""
    }, {
      "id" : "zoneTargetName",
      "name" : "zoneTargetName",
      "value" : ""
    }, {
      "id" : "zoneTargetType",
      "name" : "zoneTargetType",
      "value" : ""
    }, {
      "id" : "REQUEST_NAME",
      "name" : "REQUEST_NAME",
      "value" : ""
    }, {
      "id" : "SERV_TEMPLATE_GUID",
      "name" : "SERV_TEMPLATE_GUID",
      "value" : ""
    }, {
      "id" : "CREATE_SCHEMA_OPTION",
      "name" : "Option for creating user schemas",
      "value" : "EMPTY_SCHEMAS"
    }, {
      "id" : "MAX_NUMBER_OF_SCHEMAS",
      "name" : "Maximum number of schemas permissible",
     "value" : "4"
    }, {
      "id" : "DB_PROFILE_URN",
      "name" : "Database Profile Component's URN",
      "value" : ""
    }, {
      "id" : "REMAP_SCHEMA_LIST",
      "name" : "Schema list.",
      "value" : "",
      "values" : [ ]
    }, {
      "id" : "MASTER_ACCOUNT",
      "name" : "Master Account",
      "value" : ""
    }, {
      "id" : "ROLE_NAME",
      "name" : "Database Role Name",
      "value" : "ST_DB_SCH_01_Oct_06_2013_22"
    }, {
      "id" : "SCHEMA_PRIVILEGES",
      "name" : "Schema Privileges",
      "value" : "",
      "values" : [ "CREATE TABLE", "CREATE SEQUENCE", "CREATE OPERATOR", "CREATE DIMENSION", "CREATE VIEW", "CREATE INDEXTYPE", "CREATE TYPE", "CREATE TRIGGER", "CREATE SESSION", "CREATE SYNONYM", "CREATE PROCEDURE" ]
    }, {
      "id" : "ENFORCE_STORAGE_CONSTRAINT",
      "name" : "Enforces Storage Constraint",
      "value" : "false"
    }, {
      "id" : "INITIAL_BLOCK_SIZE",
      "name" : "Initial Storage Size",
      "value" : ""
    }, {
      "id" : "AUTO_EXTEND_BLOCK_SIZE",
      "name" : "Auto extend block size",
      "value" : ""
    }, {
      "id" : "TABLESPACE_ENCRYPTION_ALGORITHM",
      "name" : "Tablespace Encryption",
      "value" : ""
    }, {
      "id" : "SHARED_STAGE_LOCATION",
      "name" : "Staging Location",
      "value" : ""
    }, {
      "id" : "WORKING_DIRECTORY",
      "name" : "Working Directory",
      "value" : ""
    }, {
      "id" : "SCHAAS_CUSTOM_PRE_SCRIPTS_URN",
      "name" : "Pre-script",
      "value" : ""
    }, {
      "id" : "SCHAAS_CUSTOM_POST_SCRIPTS_URN",
      "name" : "Post-script",
      "value" : ""
    }, {
      "id" : "SCHEMA_PASSWORD_LIST",
      "name" : "Schema password list",
      "value" : "",
      "values" : [ ]
    }, {
      "id" : "CUSTOM_USER_SELECTED_SCRIPT_URN",
      "name" : "Custom Script URN",
      "value" : "",
      "values" : [ ]
    }, {
      "id" : "DBSERVICE_NAME",
      "name" : "Database Service Name",
      "value" : ""
    } ]
  },
  "createdOn" : null,
  "createdBy" : null,
  "modifiedOn" : null,
  "modifiedBy" : null,
  "owner" : "SYSMAN",
  "etag" : null,
  "lastModified" : null,
  "canonicalLink" : "https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E821074692058B5DE040F00AA37D75AB",
  "selfLink" : "https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E821074692058B5DE040F00AA37D75AB"
}
27.2.5.3.3

Create Database Service Template

A POST operation is issued on ServiceTemplates Collection resource to create a Database Service Template.The following shows the configuration for POST to ServiceTemplates:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    {
        "name":"TestDbTemplate1",
        "serviceType":"DB",
        "serviceFamily":"DBAAS",
        "description":"This is a test database dbca service template 1",
        "poolIds":[ "F66D9FD94B4651A007D48A5732F3284F" ],
        "roles":[
            { "name":"SSA_USER_ROLE1" }
        ],
       "serviceExecutableMeta":{
            "type":"CDP",
                    "configurations":[
             { "name":"PROFILE_COMPONENT_URN", "value":"oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbCreateTemplate:E87A7B5AA40CC345E040F20A605121D6:0.1" },
             { "name":"DATABASE_TYPE","value":"oracle_database" },
             { "name":"COMMON_DB_SYSTEM_PASSWORD", "value":"welcome" },
             { "name":"COMMON_DB_DBSNMP_PASSWORD", "value":"welcome" },
             { "name":"COMMON_DB_SYS_PASSWORD","value":"welcome" },
             { "name":"COMMON_DB_SID","value":"mydb1" },
             { "name":"COMMON_DOMAIN_NAME","value":"us.oracle.com" },
             { "name":"LISTENER_PORT", "value":"1521"},
             { "name":"STAGE_LOCATION", "value":"/scratch" },
             { "name":"REF_ZONE", "value":"SLC01MDR_ZONE" },
             { "name":"REF_POOL",   "value":"DBPOOL" },
             { "name":"REF_HOST", "value":"slc01mdr.us.oracle.com" },
             { "name":"REF_TGT","value":"slc01mdr.us.oracle.com" },
             { "name":"DBCA_TEMPLATE:DB_STORAGE_TYPE",  "value":"FS" },
             { "name":"DBCA_TEMPLATE:DATA_FILE_LOCATION","value":"{ORACLE_BASE}/mydir/oradata" },
             { "name":"DBCA_TEMPLATE:REC_STORAGE_TYPE_SAME_AS_DB_FILES", "value":"Y" },
             { "name":"DBCA_TEMPLATE:ARCHIVE_LOG_MODE", "value":"N" },
             { "name":"DBCA_TEMPLATE:FLASH_RECOVERY_AREA_SIZE", "value":"2048" },
             { "name":"DBCA_TEMPLATE:RECOVERY_FILE_LOCATION","value":"{ORACLE_BASE}/mydir/fra" },
             { "name":"DBCA_TEMPLATE:REDO_FILE_LOCATION", "value":"{ORACLE_BASE}/mydir/fra"  },
             {
                "name":"INIT_PARAMS",
                "subconfigurations":[
                   { "name":"INIT_PARAMS:1", "value":"sga_target=1073741824" },
                   { "name":"INIT_PARAMS:2", "value":"pga_aggregate_target=1073741824"  }
                ]
             }
          ],
          "payloads":[
             {
                "id":"4",
                "name":"oracle:defaultService:em:provisioning:1:cmp:COMP_Directives:none:E482D893171AC51BE040F00A87254669:0.1"
             },
             {
                "id":"3",
                "name":"oracle:defaultService:em:provisioning:1:cmp:COMP_Directives:none:E482D893171AC51BE040F00A87254669:0.1"
             }
          ]  
        }
    }
    
  • Method

    POST

The following is the response from the above interaction:

{  "name":"TestDbTemplate1",       "serviceFamily":"DBAAS",        "serviceType":"DB",     "type":"Service Template",      "description":"This is a test database dbca service template 1",        "id":"E88690EB9B2DB218E040F20A605108AF",        "pools":[                {                "name":"DB_POOL",                "id":"F66D9FD94B4651A007D48A5732F3284F",                "type":"oracle_cloud_zone",               "zone": { "id":"2F1E72A95EC21F8F666451B5413FF99A", "name":"SLC01MDR_ZONE"                 }                }                ],       "roles":[                {        "name":"SSA_USER_ROLE1","description":null }       ],       "serviceExecutableMeta":{                "type":"CDP",           "configurations":[                       {                        "id":"INIT_PARAMS",                      "name":"Initialization parameter values",                       "value":"",                     "values":["pga_aggregate_target=1073741824","sga_target=1073741824"]                   },                       {                        "id":"PROFILE_COMPONENT_URN",                     "name":"URN of the Profile Component to be used for Database Creation",                                 "value":"oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbCreateTemplate:E87A7B5AA40CC345E040F20A605121D6:0.1"                    },                       {                        "id":"DATABASE_TYPE",                    "name":"Database Type",                 "value":"oracle_database"                        },                       {                        "id":"DBAAS_SSA_CUSTOM_PRE_SCRIPTS_URN",                     "name":"Pre-script",                    "value":""                      },                       {                        "id":"DBAAS_SSA_CUSTOM_POST_SCRIPTS_URN",                    "name":"Post-script",                   "value":""                      },                       {                        "id":"USER_NAME",                        "name":"User Name (cannot be any of Oracle default accounts)",                  "value":""                      },                       {                        id":"USER_PASSWORD",                     "name":"User Password"                  },                       {                        "id":"INSTANCE_COUNT",                   "name":"Number of RAC Database Instances",                      "value":"2"                     },                       {                        "id":"COMMON_DB_SYSTEM_PASSWORD",                  "name":"SYSTEM Account password",                       "value":"welcome"                       },                       {                        "id":"COMMON_DB_DBSNMP_PASSWORD",                  "name":"DBSNMP Account password",                       "value":"welcome"                       },                       {                        "id":"COMMON_DB_SYS_PASSWORD",                     "name":"SYS Account password",                  "value":"welcome"                       },                       {                        "id":"DB_ADMIN_PASSWORD_SAME",                     "name":"Use the same passwords for SYS, SYSTEM and DBSNMP account",                     "value":"true"                  },                       {                        "id":"COMMON_DB_SID",                     "name":"Database SID Prefix",                   "value":"mydb1"                 },                       {                        "id":"COMMON_DOMAIN_NAME",                        "name":"Database Domain Name",                  "value":"us.oracle.com"                 },                       {                        "id":"LISTENER_PORT",                    "name":"Listener Port",                 "value":"1521"                  },                       {                        "id":"ALLOW_BACKUPS",                    "name":"Enable Backups for the Database",                       "value":""                      },                       {                        "id":"MAX_BACKUPS_ALLOWED",                       "name":"Number of Backups allowed for the Database",                    "value":""                      },                       {                        "id":"NONADMIN_SSA_ACC_DB_USER_NAMES",                       "name":"Non Admin SSA Accessible users",                        "value":""                      },                       {                        "id":"DB_USER_NAMES",                     "name":"Database Users from source",                    "value":""                      },                       {                        "id":"DB_USER_PASSWORDS",                 "name":"Passwords for Database"                 }                ]        },       "createdOn":null,       "createdBy":null,       "modifiedOn":null,      "modifiedBy":null,      "owner":"SYSMAN",       "etag":null,    "lastModified":null,    "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E88690EB9B2DB218E040F20A605108AF",   "selfLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E88690EB9B2DB218E040F20A605108AF"}
27.2.5.3.4

Create Schema Service Template

A POST operation is issued on Service Templates Collection resource to create a Schema Service Template.The following shows the configuration for POST to ServiceTemplates:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    {
                    "name":"TestSchaasTemplate3",
                    "serviceType":"SCHEMA",
                    "serviceFamily":"DBAAS",
                    "description":"This is a test schaas service template 1",
                    "poolIds":[ "9D3187DE6B1115791D71D2827FB98558" ],
                    "roles":[
                            { "name":"SSA_USER_ROLE1" }
                    ],
               "serviceExecutableMeta":{
                    "type":"CDP",
                    "configurations":[
                    { "name":"ROLE_NAME", "value":"SampleRole" },
                    { "name":"MAX_NUMBER_OF_SCHEMAS","value":"2" },
                    { "name":"ENFORCE_STORAGE_CONSTRAINT","value":"NO_LIMIT" },
                    { "name":"AUTO_EXTEND_BLOCK_SIZE","value":"1024" },
                    { "name":"REF_ZONE","value":"SLC01MDR_ZONE" },
                    { "name":"REF_POOL","value":"SCH_POOL" },
                    { "name":"REF_HOST","value":"slc03rdr.us.oracle.com" },
                    { "name":"REF_DB","value":"simple.us.oracle.com" },
                    { "name":"CREATE_SCHEMA_OPTION","value":"EMPTY_SCHEMAS" },
                                    {
                    "name":"WORKLOADS",
                    "subconfigurations":[                    
                    {
                    "name":"WORK_LOADS:1",
                    "subconfigurations":[
                    { "name":"name",  "value":"large "  },
                    { "name":"description", "value":"large workload" },
                    {   "name":"default",    "value":"Y" },
                    {   "name":"CPU",  "value":"6" },
                    {   "name":"Memory", "value":"4048"    },
                    {   "name":"Storage", "value":"2024"   }
                    ]
            }
            ]
            }
            ]
            }
            }
    
  • Method

    POST

The following is the response from the above interaction:

{
  "name": "TestSchaasTemplate3",
  "serviceFamily": "DBAAS",
  "serviceType": "SCHEMA",
  "type": "Service Template",
  "description": "This is a test schaas service template 1",
  "id": "E87A364660A25B39E040F20A60510FDD",
  "pools": [
    {
      "name": "SCH_POOL",
      "id": "9D3187DE6B1115791D71D2827FB98558",
      "type": "schaas_pool",
      "zone": {
        "id": "2F1E72A95EC21F8F666451B5413FF99A",
        "name": "SLC01MDR_ZONE"
      }
    }
  ],
  "roles": [
    {
      "name": "SSA_USER_ROLE1",
      "description": null
    }
  ],
  "serviceExecutableMeta": {
    "type": "CDP",
    "configurations": [
      {
        "id": "targets",
        "name": "targets",
        "value": ""
      },
      {
        "id": "ssaRequestId",
        "name": "ssaRequestId",
        "value": ""
      },
      {
        "id": "ssaUser",
        "name": "ssaUser",
        "value": ""
      },
      {
        "id": "ssaTargetName",
        "name": "ssaTargetName",
        "value": ""
      },
      {
        "id": "ssaTargetType",
        "name": "ssaTargetType",
        "value": ""
      },
      {
        "id": "zoneTargetName",
        "name": "zoneTargetName",
        "value": ""
      },
      {
        "id": "zoneTargetType",
        "name": "zoneTargetType",
        "value": ""
      },
      {
        "id": "REQUEST_NAME",
        "name": "REQUEST_NAME",
        "value": ""
      },
      {
        "id": "SERV_TEMPLATE_GUID",
        "name": "SERV_TEMPLATE_GUID",
        "value": ""
      },
      {
        "id": "CREATE_SCHEMA_OPTION",
        "name": "Option for creating user schemas",
        "value": "EMPTY_SCHEMAS"
      },
      {
        "id": "MAX_NUMBER_OF_SCHEMAS",
        "name": "Maximum number of schemas permissible",
        "value": "2"
      },
      {
        "id": "DB_PROFILE_URN",
        "name": "Database Profile Component's URN",
        "value": ""
      },
      {
        "id": "REMAP_SCHEMA_LIST",
        "name": "Schema list",
        "value": "",
        "values": []
      },
      {
        "id": "MASTER_ACCOUNT",
        "name": "Master Account",
        "value": ""
      },
      {
        "id": "ROLE_NAME",
        "name": "Database Role Name",
        "value": "TestSchaasTemplate3_Oct_11_"
      },
      {
        "id": "SCHEMA_PRIVILEGES",
        "name": "Schema Privileges",
        "value": "",
        "values": [
          "CREATE TYPE",
          "CREATE SEQUENCE",
          "CREATE DIMENSION",
          "CREATE INDEXTYPE",
          "CREATE SESSION",
          "CREATE SYNONYM",
          "CREATE OPERATOR",
          "CREATE VIEW",
          "CREATE TABLE",
          "CREATE TRIGGER",
          "CREATE PROCEDURE"
        ]
      },
      {
        "id": "ENFORCE_STORAGE_CONSTRAINT",
        "name": "Enforces Storage Constraint",
        "value": "false"
      },
      {
        "id": "INITIAL_BLOCK_SIZE",
        "name": "Initial Storage Size",
        "value": ""
      },
      {
        "id": "AUTO_EXTEND_BLOCK_SIZE",
        "name": "Auto extend block size",
        "value": ""
      },
      {
        "id": "TABLESPACE_ENCRYPTION_ALGORITHM",
        "name": "Tablespace Encryption",
        "value": ""
      },
      {
        "id": "SHARED_STAGE_LOCATION",
        "name": "Staging Location",
        "value": ""
      },
      {
        "id": "WORKING_DIRECTORY",
        "name": "Working Directory",
        "value": ""
      },
      {
        "id": "SCHAAS_CUSTOM_PRE_SCRIPTS_URN",
        "name": "Pre-script",
        "value": ""
      },
      {
        "id": "SCHAAS_CUSTOM_POST_SCRIPTS_URN",
        "name": "Post-script",
        "value": ""
      },
      {
        "id": "SCHEMA_PASSWORD_LIST",
        "name": "Schema password list",
        "value": "",
        "values": []
      },
      {
        "id": "CUSTOM_USER_SELECTED_SCRIPT_URN",
        "name": "Custom Script URN",
        "value": "",
        "values": []
      },
      {
        "id": "DBSERVICE_NAME",
        "name": "Database Service Name",
        "value": ""
      }
    ]
  },
  "createdOn": null,
  "createdBy": null,
  "modifiedOn": null,
  "modifiedBy": null,
  "owner": "SYSMAN",
  "etag": null,
  "lastModified": null,
  "canonicalLink": "https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E87A364660A25B39E040F20A60510FDD",
  "selfLink": "https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E87A364660A25B39E040F20A60510FDD"
}
27.2.5.3.5 Create Pluggable Database Service Template

A POST operation is issued on ServiceTemplates Collection resource to create a Pluggable Database ServiceTemplate.The following shows the configuration for POST to ServiceTemplates:

  • URL

    https:// cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=Content-Type: application/json

  • Body

    {
        "name":"TestPDbTemplate1",
        "serviceType":"PDB",
        "serviceFamily":"DBAAS",
        "description":"This is a test pluggable database service template 1",
        "poolIds":[ "FF394120842D8C71CC92BE6A4D5A488E" ],     
        "roles":[
            { "name":"SSA_USER_ROLE1" }
        ],
       "serviceExecutableMeta":{
            "type":"CDP",
            "configurations":[
             {
                "name":"TABLESPACE_ENCRYPTION_ALGORITHM",
                "subconfigurations":[
                   {  "name":"name", "value":"NONE" }
                ]
             },
             {  "name":"MAX_TABLESPACE_ALLOWED", "value":"2" },
             {  "name":"PDB_SID_PREFIX", "value":"mypdb" },
             {  "name":"ENFORCE_STORAGE_CONSTRAINT", "value":"NO_LIMIT" },
             {  "name":"AUTO_EXTEND_BLOCK_SIZE","value":"1024" },
             {  "name":"REF_DATA_ZONE", "value":"PDB_Zone" },             
             {  "name":"REF_DATA_TARGET", "value":"database" },          
             {  "name":"REF_DATA_TARGET_TYPE", "value":"oracle_database" },                
             {  "name":"REF_DATA_POOL","value":"PDB_POOL" },
             {  "name":"REF_DATA_HOST", "value":"slc03rdr.us.oracle.com" },
             {  "name":"CREATE_PDB_OPTION", "value":"EMPTY_PDB" },
             {  "name":"ROLE_OPTION","value":"CUSTOM_NEW_ROLE" },
             {
                "name":"INIT_PARAMS",
                "subconfigurations":[
                   { "name":"INIT_PARAMS:1", "value":"*.cursor_sharing=EXACT" },
                   { "name":"INIT_PARAMS:2", "value":"*.open_cursors=200"  }
                ]
             },
                     {
                "name":"WORKLOADS",
                "subconfigurations":[
                   {
                      "name":"WORK_LOADS:1",
                      "subconfigurations":[
                         { "name":"name", "value":"SmallPdb" },
                         { "name":"description", "value":"small workload" },
                         {  "name":"default", "value":"N" },
                         {  "name":"CPU", "value":"2" },
                         {  "name":"Memory", "value":"2048" },
                         {  "name":"Storage", "value":"1024" },
                         {  "name":"Sessions", "value":"100" }
                      ]
                   }
                ]
             }
          ]
       }
    }
    
  • Method

    POST

    The following is the response from the above interaction:

    {
    "name":"TestPDbTemplate1",
    "serviceFamily":"DBAAS",
    "serviceType":"PDB",
    "type":"Service Template",
    "description":"This is a test pluggable database service template 1",
    "id":"E8887DEEE424BEAEE040F20A605118CE",
    "pools":[
            {
            "name":"PDB_POOL",
            "id":"FF394120842D8C71CC92BE6A4D5A488E",
            "type":"pdbaas_pool",
            "zone":{"id":"B60C4DA1398F41BEBC862D5A10A0C713", 
                    "name":"PDB_Zone"}
            }
    ],
    "roles":[
            {"name":"SSA_USER_ROLE1","description":null}
            ],
    "serviceExecutableMeta":{
            "type":"CDP",
            "configurations":[
            {"id":"CREATE_PDB_OPTION","name":"Option for creating Pluggable Database","value":"EMPTY_PDB"},
            {"id":"PROFILE_URN","name":"Profile Component's URN","value":""},
            {"id":"MAX_TABLESPACE_ALLOWED","name":"Maximum number of Tablespaces","value":"2"},
    {"id":"ENFORCE_STORAGE_CONSTRAINT","name":"Enforce Storage Constraint","value":"false"},
            {"id":"TABLESPACE_ENCRYPTION_ALGORITHM","name":"Tablespace Encryption","value":"","values":["NONE"]},
            {"id":"TABLESPACE_SIZE","name":"Tablespace Size","value":"","values":[]},
            {"id":"SHARED_STAGE_LOCATION","name":"Staging Location","value":""},
            {"id":"WORKING_DIRECTORY","name":"Working Directory","value":""},
            {"id":"PDBAAS_CUSTOM_PRE_SCRIPTS_URN","name":"URN of the pre sql custom script","value":""},
            {"id":"PDBAAS_CUSTOM_POST_SCRIPTS_URN","name":"URN of the post sql custom script","value":""},
            {"id":"PDB_SID_PREFIX","name":"Pluggable Database SID Prefix","value":"mypdb"},
            {"id":"PDB_ADMIN_USER_NAME","name":"Pluggable Database Administrator","value":""},
            {"id":"PDB_ADMIN_PASSWORD","name":"Pluggable Administrator Password"},
            {"id":"PDB_SERVICE_NAME_PREFIX","name":"Pluggable Database Service Name Prefix","value":""},
            {"id":"PDBSERVICE_NAME","name":"Pluggable Database Service Name","value":""},
            {"id":"ROLE_OPTION","name":"Role Option Custom New Role/ Existing Roles","value":"CUSTOM_NEW_ROLE"},
            {"id":"INIT_PARAMS","name":"Initialization parameter values passed as list","value":"","values":["*.open_cursors=200","*.cursor_sharing=EXACT"]},
            {"id":"CUSTOM_ROLE_NAME","name":"Database Role Name","value":"PDBAAS_OCT_12_2013_02_13_AM"},
            {"id":"CUSTOM_ROLE_DESC","name":"Database Role Description","value":"New db role to be assigned to pluggable database administrator."},
            {"id":"PRIVILEGES","name":"Custom Role Privileges","value":"","values":["CREATE ANY SYNONYM","CREATE ANY OPERATOR","CREATE SESSION","CREATE JOB","CREATE ANY TYPE","CREATE INDEXTYPE","SELECT ANY DICTIONARY","CREATE ANY SEQUENCE","CREATE DIMENSION","CREATE ANY DIRECTORY","CREATE ANY INDEX","CREATE ANY TABLE","CREATE ANY PROCEDURE","ALTER SESSION","CREATE ANY MATERIALIZED VIEW","CREATE ANY TRIGGER","CREATE ANY VIEW"]},
            {"id":"ROLES","name":"List of roles selected from reference database","value":"","values":[]}
                    ]
            },
    "createdOn":null,
    "createdBy":null,
    "modifiedOn":null,
    "modifiedBy":null,
    "owner":"SYSMAN",
    "etag":null,
    "lastModified":null,
    "canonicalLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E8887DEEE424BEAEE040F20A605118CE",
    "selfLink":"https://slc03rdr.us.oracle.com:11180/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/E8887DEEE424BEAEE040F20A605118CE"
    }
    
27.2.5.3.6

Delete Database/Schema/Pluggable Database Service Template

The DELETE request on the URI of the Service Template can be issued to delete a ServiceTemplate Instance. The following shows the configuration for deleting in ServiceTemplate:

  • URL

    https://cloudcompany.com/em/websvcs/restful/extws/cloudservices/admin/cfw/v1/servicetemplates/ E87A364660A25B39E040F20A60510FDD

  • Headers

    Authorization: basic ZGVtb3VzZXI6ZGVtb3VzZXI=

  • Method

    DELETE

The following is the response from the above interaction:

{
  "message": "Service Template \"E87A364660A25B39E040F20A60510FDD\" deleted successfully."
}

27.3 EMCLI For Administrator Flows

The Enterprise Manager Command Line Interface (EMCLI) enables you to access Enterprise Manager Cloud Control functionality from text-based consoles (shells and command windows) for a variety of operating systems. You can call Enterprise Manager Functionality using custom scripts, such as SQL*Plus, OS shell, Perl, or Tcl, thus easily integrating Enterprise Manager Functionality with a company's business process.

This section provides details on the EMCLI verbs for Enterprise Manager Self Service Applications Admin users.

EMCLI verbs will be supported for the following operations in Enterprise Manager Release 12.1.0.5:

  • PaaS Infrastructure Zones and Software Pools - Create, Edit, List, Delete

  • PaaS Infrastructure Zones and Software Pools - Add and Remove members

  • Dbaas Quota - Create, Edit, List, Delete

  • Dbaas Request settings -Edit, List

  • Dbaas Service Template - Create, Edit, List, Delete

All PaaS Infrastructure Zone EMCLI operations are available only to users with a EM_CLOUD_ADMINISTRATOR role and Software Pool operations can be performed only by users with a EM_SSA_ADMINISTRATOR role. EMCLI verbs will obtain user information from the security context and verify only those users authorized to perform these operations.

27.3.1 PaaSZone APIs

The following table provides details of the supported verbs.

Table 27-26 PaasZone API

Verb Description Format

create_paas_zone

Creates a PaaS Infrastructure Zone

  • name - Name of the PaaS Infrastructure Zone to be created

  • credential - Global Named Credentials to be used for provisioning in this PaaS Infrastructure Zone.

  • hosts - Comma separated list of the Host targets to be added as members of this Paas Infrastructure Zone. PaaS Infrastructure Zone can contain either hosts or Oracle VM Zones as members. "ovm_zones - Comma separated list of the Oracle VM Zone targets to be added as members of this Paas Infrastructure Zone.

  • roles - Comma separated list of SSA roles that can access this PaaS Infrastructure Zone.

  • description - Description of the PaaS Infrastructure Zone.

  • cpu_utilization - Placement Policy Constraints allow the cloud administrator to set maximum thresholds for any host. Value entered must be between 1 and 100. If not provided, default value is taken to be 80 percent. Parameter is not needed if Oracle VM Zone targets are added as members.

  • memory_utilization - Another Placement Policy Constraint for PaaS Infrastructure Zone. Value entered must be between 1 and 100. If not provided, default value is taken to be 80 percent. Parameter is not needed if Oracle VM Zone targets are added as members.

Example:

emcli create_paas_zone 
   -name=MyPaaSZone 
   -credential=AIME__N 
   -hosts=slc13rdr.us.oracle.com 
   -roles="SSA_USER_ROLE1" 
   -description="Test PaaS zone" 
   -cpu_utilization=90 
   -memory_utilization=90

Sample Output:

PaaS Infrastructure Zone "MyPaaSZone" created successfully.

emcli create_paas_zone-name=<Name of PaaS Zone>

-credential=<Global Named Credential>

[-hosts=<Host1,Host2,Host3...>]

[-ovm_zones=<OVMZone1,OVMZone2,OVMZone3...>]

[-roles=<SsaRole1,SsaRole2,..>]

[-description=<Description of PaaS Zone>]

[-cpu_utilization=<Value between 1 and 100>]

[-memory_utilization=<Value between 1 and 100>]

update_paas_zone

Updates a PaaS Infrastructure Zone.

  • name - Name of the existing PaaS Infrastructure Zone.

  • credential - Global Named Credentials to be updated.

  • add_hosts - Comma separated list of the Host targets to be added as members of this Paas Infrastructure Zone. The hosts to be added must not be already added to other existing PaaS Zones.

  • remove_hosts - Comma separated list of the Host targets to be removed as members from this Paas Infrastructure Zone.

  • add_ovm_zones - Comma separated list of the Oracle VM Zone targets to be added as members of this Paas Infrastructure Zone. The Oracle VM Zones to be added must not be already added to other existing PaaS Zones.

  • remove_ovm_zones - Comma separated list of the Oracle VM Zone targets to be removed as members from this Paas Infrastructure Zone.

  • add_roles - Comma separated list of SSA roles to be added that can access this PaaS Infrastructure Zone.

  • remove_roles - Comma separated list of SSA roles to be removed from: this PaaS Infrastructure Zone.

  • description - Updated description of the PaaS Infrastructure Zone.

  • cpu_utilization - Placement Policy Constraints allow the cloud administrator to set maximum thresholds for any host. Value entered must be between 1 and 100.

  • memory_utilization - Another Placement Policy Constraint for PaaS Infrastructure Zone. Value entered must be between 1 and 100.

Example:

emcli update_paas_zone 
    -name=MyPaaSZone 
    -credential=AIME_N 
    -add_hosts=slc13rdr.us.oracle.com  
    -remove_hosts=slc13a.us.oracle.com 
    -add_roles="SSA_USER_ROLE1"  
    -remove_roles="SSA_USER_ROLE2" 
    -description="Test PaaS zone" 
    -cpu_utilization=90 
    -memory_utilization=90 

Sample Output:

PaaS Infrastructure Zone "MyPaaSZone" updated successfully. 

emcli update_paas_zone-name=<Name of PaaS Zone>

[-description=<Description of PaaS Zone>]

[-credential=<Global Named Credential>]

[-add_hosts=<Host1,Host2,Host3...>]

[-remove_hosts=<Host4,Host5...>]

[-add_ovm_zones=<OVMZone1,OVMZone2,OVMZone3...>]

[-remove_ovm_zones=<OVMZone4,OVMZone5...>]

[-add_roles=<SsaRole1,SsaRole2,..>]

[-remove_roles=<SsaRole3,SsaRole4,..>]

[-cpu_utilization=<Value between 1 and 100>]

[-memory_utilization=<Value between 1 and 100>]

delete_paas_zone

Deletes a PaaS Infrastructure Zone. PaaS Infrastructure Zone cannot be deleted if there is an existing Software Pool associated with it.

name - Name of the existing PaaS Infrastructure Zone to be deleted.

Example:

emcli delete_paas_zone 
       -name=MyPaaSZone 

Sample Output:

PaaS Infrastructure Zone "MyPaaSZone" deleted successfully

emcli delete_paas_zone -name=<Name of PaaS Zone>

get_paas_zone_detail

Retrieves the PaaS Infrastructure Zone details.

name - Details of the existing PaaS Infrastructure Zone, such as Name, Description, Named Credentials, Number of Hosts, Roles, Maximum Memory Allocation (%), and Maximum CPU Utilization (%).

Example:

emcli  get_paas_zone_detail 
    -name=MyPaaSZone

Sample Output:

Name               MyPaaSZone                                                         
  Description        TEST zone                                                         
  Named Credentials  AIME_N                                                       
  Number of Hosts    1                                                                
  Roles              SSA_USER_ROLE1                                                   
  Maximum Memory Allocation (%)   90                                                               
  Maximum CPU Utilization (%)     90  

emcli get_paas_zone_detail -name=<Name of PaaS Zone>


See REST API equivalent for the same at PaaSZone APIs.

27.3.2 Pool APIs

The following table provides details of the supported verbs.

Table 27-27 Pool APIs

Verb Description Format

create_pool

Creates a Database Pool.

  • name - Name of the Database Pool to be created

  • target_type - Target type of the Software Pool to be created

  • paas_zone - Name of PaaS Infrastructure Zone in which the Software Pool is to be created.

  • members - Comma separated list of targets to be added as members of the Software Pool.

  • description - Description of the Software Pool.

  • placement_constraints - Comma separated key value pairs of the placement constraints that allow the self service administrator to set maximum ceilings for resource utilization. This provides protection for the members of the Software Pool in terms of resource consumption. Refer to the get_pool_allowed_placement_constraints verb to get the available placement constraints for a pool target type.

  • member_constraints - Comma separated key value pairs that restricts the addition of member targets to a Software Pool with a set criteria. Refer to the get_pool_allowed_member_constraints verb to get the available member constraints and their possible values for a pool target type.

  • properties - Comma separated key value pairs for additional properties that need to be specified based on the Software Pool target type.

Example:

emcli  create_pool
    -name=MyDbPool
    -target_type=oracle_cloud_zone
    -paas_zone=MyPaaSZone
    -members=OraDb11g_home1_1_slc03qtn
    -description="Test Database Pool"
    -member_constraints= 
      "CONFIGURATION=oracle_database, 
       VERSION=11.2.0.2.0, 
       PLATFORM=226"
    -placement_constraints= 
       "MAX_INSTANCES=7"
    -properties= 
"host_credential_guid=DBA449B8967AAF77E040F00A73B11F55,
root_credential_guid=DBA449B8967AAF77E040F00A73B11F55"

Sample Output:

Software Pool "MyDbPool" created successfully.

emcli create_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

-paas_zone=<Paas Infrastructure Zone of Software Pool>

-members=<Member1, Member2...>

[-description=<Description of Software Pool>]

[-placement_constraints=<constraint1=value1, constraint2=value2...>]

[-member_constraints=<constraint1=value1, constraint2=value2>]

[-properties=<property1=value1, property2=value2>]

update_pool

Updates a a Database Pool.

  • "name - Name of the existing Software Pool.

  • "target_type - Target type of the existing Software Pool. For example: "mwaas_zone" for Middleware Pool, "oracle_cloud_zone" for Database Pool, and "schaas_pool" for Schema Pool.

  • "description - Description of the Software Pool.

  • "add_members - Comma separated list of targets to be added as members of the Software Pool. The targets to be added must satisfy the member constraints of the Software Pool.

  • "remove_members - Member targets to be removed from the Software Pool.

  • "placement_constraints - Comma separated key value pairs of the placement constraints that allow the self service administrator to set maximum ceilings for resource utilization. This provides protection for the members of the Software Pool in terms of resource consumption.

  • "properties - Comma separated key value pairs for properties that need to be updated based on the Software Pool target type

Example:

emcli update_pool
    -name=MyDbPool
    -target_type=oracle_cloud_zone
    -paas_zone=MyPaaSZone
    -add_members=
          OraDb11g_home1_1_slc03qtn
    -remove_members= 
          OraDb11g_home1_2_slc01mdr
    -description="Test Database Pool"
    -placement_constraints= 
       "MAX_INSTANCES=7"
    -properties= 
"host_credential_guid=DBA449B8967AAF77E040F00A73B11F55,
root_credential_guid=DBA449B8967AAF77E040F00A73B11F55"

Sample Output:

Software Pool "MyDbPool" updated successfully. 

emcli update_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

[-description=<Description of Software Pool>]

[-add_members=<Member1, Member2...>]

[-remove_members=<Member4, Member5...>]

[-placement_constraints=<constraint1=value1,constraint2=value2...>]

[-properties=<property1=value1, property2=value2>]

delete_pool

Deletes a Database Pool. Software Pool cannot be deleted if there is an existing Service Template associated with it.

  • name - Name of an existing Software Pool.

  • target - Target type of the Software Pool.

Example:

emcli delete_pool
   -name=MyDbPool
    -target_type=oracle_cloud_zone       

Sample Output:

Software Pool "MyDbPool" deleted successfully.

emcli delete_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

get_pool_detail

Retrieves the Database Pool details, such as name, target type, description, PaaS Infrastructure Zone, number of members, placement constraints, and member constraints.

  • name - Name of the Software Pool.

  • target - Target type of the Software Pool

Example:

emcli get_pool_detail
    -name=MyDbPool
    -target_type=oracle_cloud_zone

Sample Output:

Name              MyDbPool                                                  Target Type       oracle_cloud_zone                                                Description       Test Database Pool                                                 Paas Infrastructure Zone SLC01MDR_ZONE                                                      Number of Members               1                                                                Placement Constraints MAX_INSTANCES : 10                                                 Member Constraints CONFIGURATION : Database Instance ,  VERSION : 11.2.0.2.0 , PLATFORM : Linux x86-64

emcli get_pool_detail -name=<Name of Software Pool>

-target_type=mwaas_zone

create_pool

Creates a Schema Pool.

  • name - Name of the Pool to be created

  • target_type - Target type of the Software Pool to be created

  • paas_zone - Name of PaaS Infrastructure Zone in which the Software Pool is to be created.

  • members - Comma separated list of targets to be added as members of the Software Pool.

  • description - Description of the Software Pool.

  • placement_constraints - Comma separated key value pairs of the placement constraints that allow the self service administrator to set maximum ceilings for resource utilization. This provides protection for the members of the Software Pool in terms of resource consumption. Refer to the get_pool_allowed_placement_constraints verb to get the available placement constraints for a pool target type.

  • member_constraints - Comma separated key value pairs that restricts the addition of member targets to a Software Pool with a set criteria. Refer to the get_pool_allowed_member_constraints verb to get the available member constraints and their possible values for a pool target type.

  • properties - Comma separated key value pairs for additional properties that need to be specified based on the Software Pool target type.

Example:

emcli  create_pool
    -name= MySchemaPool
    -target_type= schaas_pool
    -paas_zone=MyPaaSZone
    -members= simple.us.oracle.com
    -description="Test Schema Pool"
    -member_constraints= 
      " TARGET_TYPE=oracle_database, 
       VERSION=11.2.0.2.0, 
       PLATFORM=226"
    -placement_constraints= 
       "MAX_SERVICES=7,
        USE_WORKLOAD=true,  
        MAX_CPU_USAGE=90, 
        MAX_MEMORY_USAGE=90, 
        ENFORCE_CPU=true"
    -properties= 
"host_credential_guid=DBA449B8967AAF77E040F00A73B11F55,
database_credential_guid =DBA449B8967AAF77E040F00A73B11F55"

Sample Output:

Software Pool "MySchemaPool" created successfully.

emcli create_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

-paas_zone=<Paas Infrastructure Zone of Software Pool>

-members=<Member1, Member2...>

[-description=<Description of Software Pool>]

[-placement_constraints=<constraint1=value1, constraint2=value2...>]

[-member_constraints=<constraint1=value1, constraint2=value2>]

[-properties=<property1=value1, property2=value2>]

update_pool

Updates a a Schema Pool.

  • name - Name of the existing Software Pool.

  • target_type - Target type of the existing Software Pool. For example: "mwaas_zone" for Middleware Pool, "oracle_cloud_zone" for Database Pool, and "schaas_pool" for Schema Pool.

  • description - Description of the Software Pool.

  • add_members - Comma separated list of targets to be added as members of the Software Pool. The targets to be added must satisfy the member constraints of the Software Pool.

  • remove_members - Member targets to be removed from the Software Pool.

  • placement_constraints - Comma separated key value pairs of the placement constraints that allow the self service administrator to set maximum ceilings for resource utilization. This provides protection for the members of the Software Pool in terms of resource consumption.

  • properties - Comma separated key value pairs for properties that need to be updated based on the Software Pool target type

Example:

emcli update_pool
    -name= MySchemaPool
    -target_type= schaas_pool
    -add_members=
          simple.us.oracle.com
    -remove_members= 
          Simple1.us.oracle.com
    -description="Test Database Pool"
    -placement_constraints= 
       "MAX_SERVICES=17,
        USE_WORKLOAD=false,  
        MAX_CPU_USAGE=90,  
        MAX_MEMORY_USAGE=90, 
        ENFORCE_CPU=false"    

Sample Output:

Software Pool "MySchemaPool" updated successfully.y. 

emcli update_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

[-description=<Description of Software Pool>]

[-add_members=<Member1, Member2...>]

[-remove_members=<Member4, Member5...>]

[-placement_constraints=<constraint1=value1,constraint2=value2...>]

[-properties=<property1=value1, property2=value2>]

delete_pool

Deletes a Schema Pool. Software Pool cannot be deleted if there is an existing Service Template associated with it.

  • name - Name of an existing Software Pool.

  • target - Target type of the Software Pool.

Example:

emcli delete_pool
    -name=MySchemaPool
    -target_type= schaas_pool

Sample Output:

Software Pool "MySchemaPool" deleted successfully.

emcli delete_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

get_pool_detail

Retrieves the Schema Pool details, such as name, target type, description, PaaS Infrastructure Zone, number of members, placement constraints, and member constraints.

  • name - Name of the Software Pool.

  • target - Target type of the Software Pool

Example:

emcli get_pool_detail
    -name=MySchemaPool
    -target_type= schaas_pool

Sample Output:

Name                MySchemaPool
Target Type         schaas_pool                                                       Description         Test Schema Pool                                                 Paas Infrastructure Zone SLC01MDR_ZONE                                                    Number of Members   1                                                                Placement Constraints           MAX_CPU_USAGE : 90 , ENFORCE_CPU : false , MAX_MEMORY_USAGE : 90 , MAX_SERVICES : 17 , USE_WORKLOAD : false                       
Member Constraints              VERSION : 11.2.0.2.0 , PLATFORM : Linux x86-64 , TARGET_TYPE : Database Instance

emcli get_pool_detail -name=<Name of Software Pool>

-target_type=mwaas_zone

create_pool

Creates a Pluggable Database Pool.

  • name - Name of the Database Pool to be created

  • target_type - Target type of the Software Pool to be created

  • paas_zone - Name of PaaS Infrastructure Zone in which the Software Pool is to be created.

  • members - Comma separated list of targets to be added as members of the Software Pool.

  • description - Description of the Software Pool.

  • placement_constraints - Comma separated key value pairs of the placement constraints that allow the self service administrator to set maximum ceilings for resource utilization. This provides protection for the members of the Software Pool in terms of resource consumption. Refer to the get_pool_allowed_placement_constraints verb to get the available placement constraints for a pool target type.

  • member_constraints - Comma separated key value pairs that restricts the addition of member targets to a Software Pool with a set criteria. Refer to the get_pool_allowed_member_constraints verb to get the available member constraints and their possible values for a pool target type.

  • properties - Comma separated key value pairs for additional properties that need to be specified based on the Software Pool target type.

Example:

emcli  create_pool
    -name= MyPdbPool
    -target_type= pdbaas_pool
    -paas_zone=MyPaaSZone
    -members= database
    -description="Test PDB Pool"
    -member_constraints= 
      TARGET_TYPE_CDB=oracle_database, 
      VERSION_CDB=12.1.0.1.0, 
      PLATFORM_CDB=226"
    -placement_constraints= 
        "MAX_PDB_SERVICES=7, 
        PDBS_USE_WORKLOAD=true, 
        MAX_CPU_USAGE_BY_PDBS=90,  
        MAX_MEMORY_USAGE_BY_PDBS=90, 
        PDBS_ENFORCE_CPU=true"
    -properties= 
"host_credential_guid=DBA449B8967AAF77E040F00A73B11F55, gi_credential_guid=DBA449B8967AAF77E040F00A73B11F55,
cdb_credential_guid =DBA449B8967AAF77E040F00A73B11F55"

Sample Output:

Software Pool "MySchemaPool" created successfully.

Note: This verb is for DB Pool. The target_type for Schema Pool is schaas_pool. Though the properties are not mandated by the verb (because SSA framework owns it), they are needed and without them the pools will not work. "Valid property names for Schema Pool are host_credential_guid, database_credential_guid, and gi_credential_guid.

emcli create_pool -name=<Name of Software Pool>-target_type=<Target type of Software Pool>-paas_zone=<Paas Infrastructure Zone of Software Pool>-members=<Member1, Member2...>[-description=<Description of Software Pool>][-placement_constraints=<constraint1=value1, constraint2=value2...>][-member_constraints=<constraint1=value1, constraint2=value2>][-properties=<property1=value1, property2=value2>]

update_pool

Updates a Pluggable Database Pool.

  • name - Name of the existing Software Pool.

  • target_type - Target type of the existing Software Pool. For example: "mwaas_zone" for Middleware Pool, "oracle_cloud_zone" for Database Pool, and "schaas_pool" for Schema Pool.

  • description - Description of the Software Pool.

  • add_members - Comma separated list of targets to be added as members of the Software Pool. The targets to be added must satisfy the member constraints of the Software Pool.

  • remove_members - Member targets to be removed from the Software Pool.

  • placement_constraints - Comma separated key value pairs of the placement constraints that allow the self service administrator to set maximum ceilings for resource utilization. This provides protection for the members of the Software Pool in terms of resource consumption.

  • properties - Comma separated key value pairs for properties that need to be updated based on the Software Pool target type

Example:

emcli update_pool
    -name= MyPdbPool
    -target_type= pdbaas_pool
    -paas_zone=MyPaaSZone
    -add_members=database
    -remove_members=database    
    -description="Test PDB Pool"
    -placement_constraints= 
        "MAX_PDB_SERVICES=7, 
        PDBS_USE_WORKLOAD=true, 
        MAX_CPU_USAGE_BY_PDBS=90,  
        MAX_MEMORY_USAGE_BY_PDBS=90, 
        PDBS_ENFORCE_CPU=true"
    -properties= 
"host_credential_guid=DBA449B8967AAF77E040F00A73B11F55, gi_credential_guid=DBA449B8967AAF77E040F00A73B11F55,
cdb_credential_guid =DBA449B8967AAF77E040F00A73B11F55"

Sample Output:

Software Pool "MyPdbPool" updated successfully. 

emcli update_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

[-description=<Description of Software Pool>]

[-add_members=<Member1, Member2...>]

[-remove_members=<Member4, Member5...>]

[-placement_constraints=<constraint1=value1,constraint2=value2...>]

[-properties=<property1=value1, property2=value2>]

delete_pool

Deletes a Pluggable Database Pool. Software Pool cannot be deleted if there is an existing Service Template associated with it.

  • name - Name of an existing Software Pool.

  • target - Target type of the Software Pool.

Example:

emcli delete_pool
    -name= MyPdbPool
    -target_type= pdbaas_pool

Sample Output:

Software Pool "MyPdbPool" deleted successfully.

emcli delete_pool -name=<Name of Software Pool>

-target_type=<Target type of Software Pool>

get_pool_detail

Retrieves the Pluggable Database Pool details, such as name, target type, description, PaaS Infrastructure Zone, number of members, placement constraints, and member constraints.

  • name - Name of the Software Pool.

  • target - Target type of the Software Pool

Example:

emcli get_pool_detail
    -name= MyPdbPool
    -target_type= pdbaas_pool 

Sample Output:

Name                 MyPdbPool                                                        Target Type          pdbaas_pool                                                      Description          Test PDB Pool                                                    Paas Infrastructure Zone  PDB_ZONE                                                         Number of Members     1                                                                Placement Constraints           
   MAX_MEMORY_USAGE_BY_PDBS : 90 ,     
   MAX_CPU_USAGE_BY_PDBS : 90 , 
    MAX_PDB_SERVICES : 7 ,  
    PDBS_ENFORCE_CPU : false , 
    PDBS_USE_WORKLOAD :false                                                           
Member Constraints              
  PLATFORM_CDB : Linux x86-64 ,  
  TARGET_TYPE_CDB : Database Instance,
  VERSION_CDB : 12.1.0.1.0

emcli get_pool_detail -name=<Name of Software Pool>

-target_type=mwaas_zone


See REST API equivalent for the same at Pool APIs

27.3.3 Database Quota APIs

The following table provides details of the supported verbs.

Table 27-28 Database Quota API

Verb Description Format

create_dbaas_quota

Creates Database Quota for a SSA User Role.

  • "role_name - Name of SSA User Role for which Quota is to be created.

  • "databases - Number of Database Service Requests allowed.

  • "schema_services - Number of Schema Service Requests allowed.

  • "pluggable_databases - Number of Pluggable Database Service Requests allowed.

  • "memory - Amount of Memory Usage Allowed.

  • "storage - Amount of Storage Usage Allowed.

Example:

emcli create_dbaas_quota
           -role_name="My Role"
           -databases="10"
           -schema_services="10"
           -pluggable_databases="10"
           -memory="99"
           -storage="99"

Sample Output:

Quota for "My Role" setup successfully

emcli create_dbaas_quota

-role_name="<Name of SSA User Role>"

-databases="<Number of Database Requests>"

-schema_services="<Number of Schema Service Requests>"

-pluggable_databases="<Number of Pluggable Database Service Requests>"

-memory="<Memory(GB)>"

-storage="<Storage(GB)>"

update_dbaas_quota

Updates the Database Quota for a SSA User Role.

  • "role_name - Name of SSA User Role for which Quota is to be updated.

  • "databases - Number of Database Service Requests allowed.

  • "schema_services - Number of Schema Service Requests allowed.

  • "pluggable_databases - Number of Pluggable Database Service Requests allowed.

  • "memory - Amount of Memory Usage Allowed.

  • "storage - Amount of Storage Usage Allowed

Example:

emcli update_dbaas_quota
           -role_name="My Role"
           -databases="10"
           -schema_services="10"
           -pluggable_databases="10"
           -memory="99"
           -storage="99"       

Sample Output:

Quota for "My Role" updated successfully. 

emcli update_dbaas_quota

-role_name="<Name of SSA User Role>"

-databases="<Number of Database Requests>"

-schema_services="<Number of Schema Service Requests>"

-pluggable_databases="<Number of Pluggable Database Service Requests>"

-memory="<Memory(GB)>"

-storage="<Storage(GB)>"

delete_dbaas_quota

Deletes the Database Quota for a SSA User Role.

role_name - Name of SSA User Role for which Quota is to be deleted.

Example:

emcli delete_dbaas_quota
           -role_name="My Role"

Sample Output:

Quota for "My Role" deleted successfully.

emcli delete_dbaas_quota -role_name="<Name of SSA User Role>"

get_dbaas_quota

Lists the Database Quotas setup for SSA User Roles.

Example:

emcli get_dbaas_quota       

Sample Output:

ROLE_NAME : SSA_USER_ROLE1
 NUMBER_OF_SCHEMA_SERVICES : 99
 MEMORY : 99
 STORAGE : 99
 NUMBER_OF_PLUGGABLE_DATABASES : 99
 NUMBER_OF_DB_INSTANCES : 99
Quotas for Roles retrieved successfully.

emcli get_dbaas_quota


See REST API equivalent for the same at Database Quota APIs

27.3.4 Database Request Settings APIs

The following table provides details of the supported verbs

Table 27-29 Database Request Settings API

Verb Description Format

update_dbaas_request_settings

Updates the Database Request Settings

"future_reservation_length - Amount of time in advance a Self Service user can Schedule a request.

"maximum_archive_duration - Amount of time after which the ''Completed'', Self Service Create Requests will be purged from the Repository.

"default_retirement_period - The maximum amount of time for which Self Service user can retain a service instance.

Example:

emcli update_dbaas_request_settings
  -future_reservation_length="2 Months"
  -maximum_archive_duration="10 Weeks"
  -default_retirement_period="No Reservation"

Sample Output:

Request settings updated successfully

emcli update_dbaas_request_settings

-future_reservation_length="<Future Request Scheduling Period>"

-maximum_archive_duration="<Request Purging Duration>"

-default_retirement_period="<Default Retention Duration>"

get_dbaas_request_settings

Retrieves the PaaS Infrastructure Zone details.

Example:

emcli get_dbaas_request_settings

Sample Output:

Future Reservation Length  : 2 Months
 Maximum Archive Duration : 10 Weeks
 Default Retirement Period : 1 Years
Request Settings retrieved successfully.

emcli get_dbaas_request_settings


See REST API equivalent for the same at Database Request Settings APIs

27.3.5 Service Template APIs

Table 27-30 Service Template API

Verb Description Format

create_service_template

Creates a Database Service Template

The input_file shall be a json based metadata file which shall have the necessary configuration for the specific service template creation.

A Sample JSON service executable metadata file for DBCA based database service template is attached at the end.

Example:

emcli create_service_template
  -name="Database service template"
  -service_family="DBAAS"
  -service_type="DB"
  -pool_target_type=  
           "oracle_cloud_zone"
   -software_pools="MyPoolOH"
   -roles="SSA_USER_ROLE"
   -description="Database small instance service template."
        -input_file="data:executable.json"

Sample Output:

Service Template "My Service Template" created successfully

emcli create_service_template

-name="<Name of Service Template>"

-service_family="<Service family for which the Service Template is being created>"

-service_type="<Service type for which the Service Template is being created>"]

-pool_target_type="Target type of Software Pools to be associated with the Service Template"

-software_pools="<SwPool1,SwPool2,SwPool3,...>"

[-roles="<SsaRole1,SsaRole2,..>"]

[-description="<Description of Service Template>"]

[-input_file="data:<Name of Service executable MetaData File>"]

create_service_template

Creates a Pluggable Database Service Template

The input_file shall be a json based metadata file which shall have the necessary configuration for the specific service template creation.

A Sample JSON service executable metadata file for PDB service template is attached at the end.

Example:

emcli create_service_template
  -name="PDB service template"
  -service_family="DBAAS"
  -service_type="PDB"
  -pool_target_type=  
           "pdbaas_pool"
   -software_pools="MyPDBPool"
   -roles="SSA_USER_ROLE"
   -description="PDB small instance service template."
        -input_file="data:executable.json"

Sample Output:

Service Template "My PDB Service Template" created successfully. 

emcli create_service_template

-name="<Name of Service Template>"

-service_family="<Service family for which the Service Template is being created>"

-service_type="<Service type for which the Service Template is being created>"]

-pool_target_type="Target type of Software Pools to be associated with the Service Template"

-software_pools="<SwPool1,SwPool2,SwPool3,...>"

[-roles="<SsaRole1,SsaRole2,..>"]

[-description="<Description of Service Template>"]

[-input_file="data:<Name of Service executable MetaData File>"]

create_service_template

Creates a Schema Service Template

The input_file shall be a json based metadata file which shall have the necessary configuration for the specific service template creation.

A Sample JSON service executable metadata file for schme service template

Example:

emcli create_service_template
  -name="Schema service template"
  -service_family="DBAAS"
  -service_type="SCHEMA"
  -pool_target_type=  
           "schaas_pool"
   -software_pools="MySCHPool"
   -roles="SSA_USER_ROLE"
   -description="Schema small instance service template."
        -input_file="data:executable.json

Sample Output:

Service Template "My Schema Service Template" created successfully

emcli create_service_template

-name="<Name of Service Template>"

-service_family="<Service family for which the Service Template is being created>"

-service_type="<Service type for which the Service Template is being created>"]

-pool_target_type="Target type of Software Pools to be associated with the Service Template"

-software_pools="<SwPool1,SwPool2,SwPool3,...>"

[-roles="<SsaRole1,SsaRole2,..>"]

[-description="<Description of Service Template>"]

[-input_file="data:<Name of Service executable MetaData File>"]

get_service_templates

Retrieves the list of available service templates based on the service family passed.

Example:

emcli get_service_templates 
     -service_family="DBAAS"

Sample Output:

Name Service Family                      Description                                       
ServiceTemplate1                         DBAAS ServiceTemplate1Description                                                           

emcli get_service_templates[-service_family="<Service family filter used for filtering the service templates>"]emcli create_service_template

-

delete_service_template

Deletes the Service Template

Example:

emcli delete_service_template
     -name="Database service template"
     -service_family="DBAAS"

Sample Output:

Service Template with name " Database service template " and service family " DBAAS " deleted successfully.

emcli delete_service_template

-name="<Name of Service Template>"]

-service_family="<Service family to which the Service Template belongs>"]


Sample Service executable metadata file(s):

  • DBCA based database service template

    {
            "type":"CDP",
            "configurations":[
             { "name":"PROFILE_COMPONENT_URN", "value":"oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_DbCreateTemplate:E87A7B5AA40CC345E040F20A605121D6:0.1" },
             { "name":"DATABASE_TYPE","value":"oracle_database" },
             { "name":"COMMON_DB_SYSTEM_PASSWORD", "value":"welcome" },
             { "name":"COMMON_DB_DBSNMP_PASSWORD", "value":"welcome" },
             { "name":"COMMON_DB_SYS_PASSWORD","value":"welcome" },
             { "name":"COMMON_DB_SID","value":"mydb1" },
             { "name":"COMMON_DOMAIN_NAME","value":"us.oracle.com" },
             { "name":"LISTENER_PORT", "value":"1521"},
             { "name":"STAGE_LOCATION", "value":"/scratch" },
             { "name":"REF_ZONE", "value":"SLC01MDR_ZONE" },
             { "name":"REF_POOL",   "value":"DB_POOL" },
             { "name":"REF_HOST", "value":"slc01mdr.us.oracle.com" },
             { "name":"REF_TGT","value":"slc01mdr.us.oracle.com" },
             { "name":"DBCA_TEMPLATE:DB_STORAGE_TYPE",  "value":"FS" },
             { "name":"DBCA_TEMPLATE:DATA_FILE_LOCATION","value":"{ORACLE_BASE}/mydir/oradata" },
             { "name":"DBCA_TEMPLATE:REC_STORAGE_TYPE_SAME_AS_DB_FILES", "value":"Y" },
             { "name":"DBCA_TEMPLATE:ARCHIVE_LOG_MODE", "value":"N" },
             { "name":"DBCA_TEMPLATE:FLASH_RECOVERY_AREA_SIZE", "value":"2048" },
             { "name":"DBCA_TEMPLATE:RECOVERY_FILE_LOCATION","value":"{ORACLE_BASE}/mydir/fra" },
             { "name":"DBCA_TEMPLATE:REDO_FILE_LOCATION", "value":"{ORACLE_BASE}/mydir/fra"  },
             {
                    "name":"INIT_PARAMS",
                    "subconfigurations":[
                       { "name":"INIT_PARAMS:1", "value":"sga_target=1073741824" },
               { "name":"INIT_PARAMS:2", "value":"pga_aggregate_target=1073741824"  }
                    ]
             }
              ],
              "payloads":[
             {
            "id":"4",
                                    "name":"oracle:defaultService:em:provisioning:1:cmp:COMP_Directives:none:E482D893171AC51BE040F00A87254669:0.1"
             },
             {
            "id":"3",
            "name":"oracle:defaultService:em:provisioning:1:cmp:COMP_Directives:none:E482D893171AC51BE040F00A87254669:0.1"
             }
              ]      
        }
    
  • Empty PDB based service template creation

    {
            "type":"CDP",
            "configurations":[
             {
                    "name":"TABLESPACE_ENCRYPTION_ALGORITHM",
                    "subconfigurations":[
                       {  "name":"name", "value":"NONE" }
                    ]
             },
             {  "name":"MAX_TABLESPACE_ALLOWED", "value":"2" },
             {  "name":"PDB_SID_PREFIX", "value":"mypdb" },
             {  "name":"ENFORCE_STORAGE_CONSTRAINT", "value":"NO_LIMIT" },
             {  "name":"AUTO_EXTEND_BLOCK_SIZE","value":"1024" },
             {  "name":"REF_DATA_ZONE", "value":"PDB_Zone" },             
             {  "name":"REF_DATA_TARGET", "value":"database" },          
             {  "name":"REF_DATA_TARGET_TYPE", "value":"oracle_database" },       
             {  "name":"REF_DATA_POOL","value":"PDB_POOL" },
             {  "name":"REF_DATA_HOST", "value":"slc03rdr.us.oracle.com" },
             {  "name":"CREATE_PDB_OPTION", "value":"EMPTY_PDB" },
             {  "name":"ROLE_OPTION","value":"CUSTOM_NEW_ROLE" },
             {
                    "name":"INIT_PARAMS",
                    "subconfigurations":[
                       { "name":"INIT_PARAMS:1", "value":"*.cursor_sharing=EXACT" },
                       { "name":"INIT_PARAMS:2", "value":"*.open_cursors=200"  }
                      ]
             },
             {
                    "name":"WORKLOADS",
                    "subconfigurations":[
                       {
                              "name":"WORK_LOADS:1",
                              "subconfigurations":[
                             { "name":"name", "value":"SmallPdb" },
                             { "name":"description", "value":"small workload" },
                             {  "name":"default", "value":"N" },
                             {  "name":"CPU", "value":"2" },
                             {  "name":"Memory", "value":"2048" },
                             {  "name":"Storage", "value":"1024" },
                             {  "name":"Sessions", "value":"100" }
                      ]
               }
            ]
          }
        ]
    }
    
  • Schema based service template creation

    {
            "type":"CDP",
            "configurations":[
                    { "name":"ROLE_NAME", "value":"SampleRole" },
                    { "name":"MAX_NUMBER_OF_SCHEMAS","value":"2" },
                    { "name":"ENFORCE_STORAGE_CONSTRAINT","value":"NO_LIMIT" },
                    { "name":"AUTO_EXTEND_BLOCK_SIZE","value":"1024" },
                    { "name":"REF_ZONE","value":"SLC01MDR_ZONE" },
                    { "name":"REF_POOL","value":"SCH_POOL" },
                    { "name":"REF_HOST","value":"slc03rdr.us.oracle.com" },
                    { "name":"REF_DB","value":"simple.us.oracle.com" },
                    { "name":"CREATE_SCHEMA_OPTION","value":"EMPTY_SCHEMAS" },
                    {
                    "name":"WORKLOADS",
                    "subconfigurations":[                    
                    {
                            "name":"WORK_LOADS:1",
                            "subconfigurations":[
                            { "name":"name",  "value":"large "  },
                            { "name":"description", "value":"large workload" },
                            {   "name":"default",    "value":"Y" },
                            {   "name":"CPU",  "value":"6" },
                            {   "name":"Memory", "value":"4048"    },
                            {   "name":"Storage", "value":"2024"   }
                    ]
                    }
            ]
         }
      ]
    }
    

See REST API equivalent for the same at Service Template APIs

27.3.6 Using EMCLI to Create Database Profiles

This section explains the different Database Provisioning Profiles used in Database as a Service and Schema as a Service. It also explains how these profiles can be created using the EMCLI verbs exposed in the 12.1.0.3 database plug-in. The following topics are covered:

27.3.6.1 About Database Provisioning Profile T ypes

The following are the four types of Database provisioning profiles used in Database as a Service and Schema as a Service:

DBCA Template

The DBCA template supports both structure plus data and structure only types. This database provisioning profile is created from the production or source database registered with Enterprise Manager.

Note:

Structure and data requires a shutdown of the database. It should be used for very small databases (< 50GB).

RMAN

This data content of this database provisioning profile comprises the RMAN Backup pieces. Any of the following methods can be used to create the RMAN profile:

  • Hot RMAN Backup

    This option is enabled only when the archive log mode on the source database is turned ON.

  • Cold RMAN Backup

    In this case, the source database is brought down to take the RMAN backup

  • Existing Backup

    This option can be used when the RMAN backup is already taken on the source and you want to use one of the existing RMAN backups to create a profile.

  • Existing Backup pieces when there is no access to the source database

    Create profile source database using existing backup pieces when there is no access to the source database. This option can be used when the RMAN backup is already taken on the source and kept in a known location. This option is only supported using EMCLI.

Snapclone

The data content of this database provisioning profile is derived from Snapshot information on the Filer (NetApp or SunZFS filer) of all the volumes where the datafiles for the source database are kept.

Schema

The data content of this database provisioning profile is compiled from an export dump created using the Data Pump tool. You can choose to export Schema objects (structure only) or the Schema with data (structure + data).

Note that you cannot export empty schemas or include Oracle schemas (these schemas are not available for selection). Schemas that are filtered out are listed below:

Table 27-31 Filtered Out Schema

ANONYMOUS

DMSYS

OASPUBLIC

OWBSYS

TSMSYS

APEX_030200

EXFSYS

ODM

OWBSYS_AUDIT

WEBSYS

APEX_PUBLIC_USER

FLOWS_

ODM_MTR

SCOTT

WK_PROXY

APPQOSSYS

FLOWS_03000

OLAPSYS

SI_INFORMTN_SCHEMA

WK_TEST

AURORA$JIS$UTILITY$

FLOWS_FILES

ORACLE_OCM

SPATIAL_CSW_ADMIN_USR

WKPROXY

AURORA$ORB$UNAUTHENTICATED

LBACSYS

ORDDATA

SPATIAL_WFS_ADMIN_USR

WKSYS

BI

MDDATA

ORDPLUGINS

SYS

WMSYS

CTXSYS

MDSYS

ORDSYS

SYSMAN

XDB

DBSNMP

MGMT_VIEW

OSE$HTTP$ADMIN

SYSTEM

XS$NULL

DIP

MTSSYS

OUTLN

TRACESRV

 

27.3.6.2 Creating Provisioning Profiles using EMCLI

This method allows the administrators or cloud provisioning operators to create the database provisioning profile using EMCLI verbs. The following is the syntax of the verb introduced in the 12.1.0.3 database plug-in:

emcli create_dbprofile -input_file=data:<Prop file name>

This command takes in a property file that completely describes the type of profile that will be created and the options used.

27.3.6.3 Sample EMCLI Property Files

The following sections provide sample EMCLI property files for the database provisioning profiles:

DBCA Template

Table 27-32 EMCLI Property Files for DBCA Template

Name Required Description Variable

Reference Database

true

The source database from which the profile will be created

REFERENCE_DATABASE=

Type of the reference database

true

The target type of the source database (oracle_database or rac_database)

REFERENCE_DATABASE_TYPE=

Reference Node

false

The reference node from which the profile will be created. Applicable only for RAC and Cluster targets

REF_NODE_SELECTED=

Backup mechanism for data

false

Variable to identify what mode needs to be used for creating backup data. Possible values are EXPORT, DBCA_TEMPLATE, RMAN, THIN_PROVISIONING

DATA_CONTENT_MODE=DBCA_TEMPLATE

The content that will be included in the backup

false

The data content that gets included in the backup can metadata or data. Possible values are METADATA_ONLY and METADATA_AND_DATA.

DATA_CONTENT=METADATA_AND_DATA

Reference Host Credentials

true

The credentials that will be used for OS authentication. Format is <Cred Name:Owner>. If this is not provided,preferred credentials will be checked against NormalHostCreds.

REF_HOST_CREDENTIALS=

Database Credentials

false

The credentials that will be used for performing database authentication. Format is <Cred Name:Owner>. If this is not provided, preferred credentials will be checked against SysDbaCreds

REF_DB_CREDENTIALS=

Convert to OFA format

false

Converts to the OFA format

CONVERT_TO_OFA=

Profile Name

true

Name of the profile

PROFILE_NAME=

Profile Description

false

Name with which the profile should be created.

PROFILE_DESC=

Profile location

true

Location of the profile in software library

PROFILE_LOCATION=

Profile Version

false

Version of the profile. If none is specified, the Database version shall be used.

PROFILE_VERSION=

Profile Vendor

false

Vendor of the profile. Default is Oracle.

PROFILE_VENDOR=

Profile notes

false

Notes for the profile.

PROFILE_NOTES=

Working Directory

false

Working directory is the location where the files are staged.

WORKING_DIRECTORY=

Is the profile initiated by end user

true

Is the profile initiated by end user as part of backup process or the database.

USER_INITIATED=false


New RMAN Backup from the Source Database

Table 27-33 EMCLI Property Files for a New RMAN Backup

Name Required Description Variable

Reference Database

true

The source database from which the profile will be created

REFERENCE_DATABASE=

Type of the reference database

true

The target type of the source database (oracle_database or rac_database)

REFERENCE_DATABASE_TYPE=

Reference Node

false

The reference node from which the profile will be created. Applicable only for RAC and Cluster targets

REF_NODE_SELECTED=

Backup mechanism for data

false

Variable to identify what mode needs to be used for creating backup data. Possible values are EXPORT, DBCA_TEMPLATE, RMAN, and THIN_PROVISIONING

DATA_CONTENT_MODE=RMAN

The content that will be included in the backup

false

The data content that gets included in the backup can metadata or data. Possible values are METADATA_ONLY and METADATA_AND_DATA.

DATA_CONTENT=METADATA_AND_DATA

Reference Host Credentials

true

The credentials that will be used for OS authentication. Format is <Cred Name:Owner>. If this is not provided,preferred credentials will be checked against NormalHostCreds.

REF_HOST_CREDENTIALS=

Database Credentials

false

The credentials that will be used for performing database authentication. Format is <Cred Name:Owner>. If this is not provided, preferred credentials will be checked against SysDbaCreds

REF_DB_CREDENTIALS=

Profile Name

true

Name of the profile

PROFILE_NAME=

Profile Description

false

Name with which the profile should be created.

PROFILE_DESC=

Profile location

true

Location of the profile in software library

PROFILE_LOCATION=

Profile Version

false

Version of the profile. If none is specified, the Database version shall be used.

PROFILE_VERSION=

Profile Vendor

false

Vendor of the profile. Default is Oracle.

PROFILE_VENDOR=

Profile notes

false

Notes for the profile.

PROFILE_NOTES=

Working Directory

false

Working directory is the location where the files are staged.

WORKING_DIRECTORY=

Is the profile initiated by end user

true

Is the profile initiated by end user as part of backup process or the database.

USER_INITIATED=false

Is Database target available

false

Is Database target available. Must be set to 'true' for this use case.

DB_TARGET_AVAILABLE=true

Backup Type

false

Backup type.

RMAN.BACKUP_TYPE=

Number of RMAN Channels to use(Default No of Channels : 2

false

Number of Channels to be used. Possible Values: like 1, 2 or 3.

RMAN.RMAN_CHANNELS=

Retain backup until

false

Retain backup until. Format: mm/dd/yyyy.

RMAN.RETAIN_UNTIL=

Encryption Type

false

Encryption Type. Possible Values: ON, OFF.

RMAN.ENCRYPTION_TYPE=

Encryption Password/Key

false

Encryption key which was used to encrypt the backup.

RMAN.ENCRYPTION_PASSWORD=

Compression Type

false

Compression type. Possible Values: HIGH, MEDIUM, LOW.

RMAN.COMPRESSION_TYPE=

RMAN Backup Location

true

Location of the RMAN Backups.

RMAN.RMAN_BACKUP_LOCATION=

Backup file format

false

Backup file format.

RMAN.BACKUP_FILE_FORMAT=

Backup file tag

false

Backup file tag.

RMAN.BACKUP_FILE_TAG=

Source: Control File Location

false

Location of the Control File.

RMAN.CONTROL_FILE_NAME=

Control File Tag

false

Control File Tag.

RMAN.CONTROL_FILE_TAG=

Source: Database SID

false

Database SID of the source database.

RMAN.ORACLE_DB_SID=

Initialize File Name

false

Initialize file name.

RMAN.INIT_FILE_NAME=

User List File Name

false

Name of the users list file. this file should be kept in location specified for RMAN_BACKUP_LOCATION.

RMAN.USERLIST_FILE_NAME=

GDB Name of source Db

false

GDB Name of source Db.

RMAN.DATABASE_NAME=

use existing RMAN Backup

true

use existing RMAN Backup. This should be set to 'NO' for this use case.

RMAN.USE_EXISTING_BACKUP=NO


Existing RMAN Backup from the Source Database

Table 27-34 EMCLI Property Files for a Existing RMAN Backup

Name Required Description Variable

Reference Database

true

The source database from which the profile will be created

REFERENCE_DATABASE=

Type of the reference database

true

The target type of the source database (oracle_database or rac_database)

REFERENCE_DATABASE_TYPE=

Reference Node

false

The reference node from which the profile will be created. Applicable only for RAC and Cluster targets

REF_NODE_SELECTED=

Backup mechanism for data

false

Variable to identify what mode needs to be used for creating backup data. Possible values are EXPORT, DBCA_TEMPLATE, RMAN, and THIN_PROVISIONING

DATA_CONTENT_MODE=RMAN

The content that will be included in the backup

false

The data content that gets included in the backup can metadata or data. Possible values are METADATA_ONLY and METADATA_AND_DATA.

DATA_CONTENT=METADATA_AND_DATA

Reference Host Credentials

true

The credentials that will be used for OS authentication. Format is <Cred Name:Owner>. If this is not provided,preferred credentials will be checked against NormalHostCreds.

REF_HOST_CREDENTIALS=

Database Credentials

false

The credentials that will be used for performing database authentication. Format is <Cred Name:Owner>. If this is not provided, preferred credentials will be checked against SysDbaCreds

REF_DB_CREDENTIALS=

Profile Name

true

Name of the profile

PROFILE_NAME=

Profile Description

false

Name with which the profile should be created.

PROFILE_DESC=

Profile location

true

Location of the profile in software library.

PROFILE_LOCATION=

Profile Version

false

Version of the profile. If none is specified, the Database version shall be used.

PROFILE_VERSION=

Profile Vendor

false

Vendor of the profile. Default is Oracle.

PROFILE_VENDOR=

Profile notes

false

Notes for the profile.

PROFILE_NOTES=

Working Directory

false

Working directory is the location where the files are staged.

WORKING_DIRECTORY=

Is the profile initiated by end user

true

Is the profile initiated by end user as part of backup process or the database.

USER_INITIATED=false

Is Database target available

false

Is Database target available. Must be set to 'true' for this use case.

DB_TARGET_AVAILABLE=true

Platform Name of Source Database

false

Platform Name of Source Database. For example, Linux x86-64 or Oracle Solaris on x86-64 (64-bit).

SOURCE_DB_PLATFORM_NAME=

Backup Type

false

Backup type.

RMAN.BACKUP_TYPE=

Number of RMAN Channels to use(Default No of Channels : 2

false

Number of Channels to be used. Possible Values: like 1, 2 or 3.

RMAN.RMAN_CHANNELS=

Retain backup until

false

Retain backup until. Format: mm/dd/yyyy.

RMAN.RETAIN_UNTIL=

Encryption Type

false

Encryption Type. Possible Values: ON, OFF.

RMAN.ENCRYPTION_TYPE=

Source:Encryption Password/Key

false

Encryption key which was used to encrypt the backup.

RMAN.ENCRYPTION_PASSWORD=

Compression Type

false

Compression type. Possible Values: HIGH, MEDIUM, LOW.

RMAN.COMPRESSION_TYPE=

RMAN Backup Location

true

Location of the RMAN Backups.

RMAN.RMAN_BACKUP_LOCATION=

Backup file format

false

Backup file format.

RMAN.BACKUP_FILE_FORMAT=

Backup file tag

false

Backup file tag.

RMAN.BACKUP_FILE_TAG=

Source: Control File Location

false

Location of the Control File.

RMAN.CONTROL_FILE_NAME=

Control File Tag

false

Control File Tag.

RMAN.CONTROL_FILE_TAG=

Source: Database SID

false

Database SID of the source database.

RMAN.ORACLE_DB_SID=

Initialize File Name

false

Initialize file name.

RMAN.INIT_FILE_NAME=

User List File Name

false

Name of the users list file. this file should be kept in location specified for RMAN_BACKUP_LOCATION.

RMAN.USERLIST_FILE_NAME=

GDB Name of source Db

false

GDB Name of source Db.

RMAN.DATABASE_NAME=

use existing RMAN Backup

true

use existing RMAN Backup. This should be set to 'YES' for this use case.

RMAN.USE_EXISTING_BACKUP=YES


Existing RMAN Backup on the Stage Location

Table 27-35 EMCLI Property Files for a Existing RMAN Backup on the Stage Location

Name Required Description Variable

Reference Database

true

The source database from which the profile will be created

REFERENCE_DATABASE=

Type of the reference database

true

The target type of the source database (oracle_database or rac_database)

REFERENCE_DATABASE_TYPE=

Reference Node

false

The reference node from which the profile will be created. Applicable only for RAC and Cluster targets

REF_NODE_SELECTED=

Backup mechanism for data

false

Variable to identify what mode needs to be used for creating backup data. Possible values are EXPORT, DBCA_TEMPLATE, RMAN, and THIN_PROVISIONING

DATA_CONTENT_MODE=RMAN

The content that will be included in the backup

false

The data content that gets included in the backup can metadata or data. Possible values are METADATA_ONLY and METADATA_AND_DATA.

DATA_CONTENT=METADATA_AND_DATA

Reference Host Credentials

true

The credentials that will be used for OS authentication. Format is <Cred Name:Owner>. If this is not provided,preferred credentials will be checked against NormalHostCreds.

REF_HOST_CREDENTIALS=

Database Credentials

false

The credentials that will be used for performing database authentication. Format is <Cred Name:Owner>. If this is not provided, preferred credentials will be checked against SysDbaCreds

REF_DB_CREDENTIALS=

Profile Name

true

Name of the profile

PROFILE_NAME=

Profile Description

false

Name with which the profile should be created.

PROFILE_DESC=

Profile location

true

Location of the profile in software library.

PROFILE_LOCATION=

Profile Version

false

Version of the profile. If none is specified, the Database version shall be used.

PROFILE_VERSION=

Profile Vendor

false

Vendor of the profile. Default is Oracle.

PROFILE_VENDOR=

Profile notes

false

Notes for the profile.

PROFILE_NOTES=

Working Directory

false

Working directory is the location where the files are staged.

WORKING_DIRECTORY=

Is the profile initiated by end user

true

Is the profile initiated by end user as part of backup process or the database.

USER_INITIATED=false

Is Database target available

false

Is Database target available. Must be set to 'false' for this use case.

DB_TARGET_AVAILABLE=false

Platform Name of Source Database

false

Platform Name of Source Database. For example, Linux x86-64 or Oracle Solaris on x86-64 (64-bit).

SOURCE_DB_PLATFORM_NAME=

Backup Type

false

Backup type.

RMAN.BACKUP_TYPE=

Number of RMAN Channels to use(Default No of Channels : 2

false

Number of Channels to be used. Possible Values: like 1, 2 or 3.

RMAN.RMAN_CHANNELS=

Retain backup until

false

Retain backup until. Format: mm/dd/yyyy.

RMAN.RETAIN_UNTIL=

Encryption Type

false

Encryption Type. Possible Values: ON, OFF.

RMAN.ENCRYPTION_TYPE=

Source:Encryption Password/Key

false

Encryption key which was used to encrypt the backup.

RMAN.ENCRYPTION_PASSWORD=

Compression Type

false

Compression type. Possible Values: HIGH, MEDIUM, LOW.

RMAN.COMPRESSION_TYPE=

RMAN Backup Location

true

Location of the RMAN Backups.

RMAN.RMAN_BACKUP_LOCATION=

Backup file format

false

Backup file format. Possible Values: %U

RMAN.BACKUP_FILE_FORMAT=

Source: Control File Location

false

Location of the Control File.

RMAN.CONTROL_FILE_NAME=

Control File Tag

false

Control File Tag. Default: control01.ctl

RMAN.CONTROL_FILE_TAG=

Source: Database SID

false

Database SID of the source database.

RMAN.ORACLE_DB_SID=

Initialize File Name

false

Initialize file name.

RMAN.INIT_FILE_NAME=

User List File Name

false

Name of the users list file. this file should be kept in location specified for RMAN_BACKUP_LOCATION.

RMAN.USERLIST_FILE_NAME=

GDB Name of source Db

false

GDB Name of source Db.

RMAN.DATABASE_NAME=

RMDB Version

false

RMDBS version

RMAN.DATABASE_VERSION=


Snapclone Database

Table 27-36 EMCLI Property Files for Snapclone Database

Name Required Description Variable

Reference Database

true

The source database from which the profile will be created

REFERENCE_DATABASE=

Type of the reference database

true

The target type of the source database (oracle_database or rac_database)

REFERENCE_DATABASE_TYPE=

Reference Node

false

The reference node from which the profile will be created. Applicable only for RAC and Cluster targets

REF_NODE_SELECTED=

Backup mechanism for data

false

Variable to identify what mode needs to be used for creating backup data. Possible values are EXPORT, DBCA_TEMPLATE, RMAN, and THIN_PROVISIONING

DATA_CONTENT_MODE=THIN_PROVISIONING

The content that will be included in the backup

false

The data content that gets included in the backup can metadata or data. Possible values are METADATA_ONLY and METADATA_AND_DATA.

DATA_CONTENT=METADATA_AND_DATA

Reference Host Credentials

true

The credentials that will be used for OS authentication. Format is <Cred Name:Owner>. If this is not provided,preferred credentials will be checked against NormalHostCreds.

REF_HOST_CREDENTIALS=

Database Credentials

false

The credentials that will be used for performing database authentication. Format is <Cred Name:Owner>. If this is not provided, preferred credentials will be checked against SysDbaCreds

REF_DB_CREDENTIALS=

Profile Name

true

Name of the profile

PROFILE_NAME=

Profile Description

false

Name with which the profile should be created.

PROFILE_DESC=

Profile location

true

Location of the profile in software library.

PROFILE_LOCATION=

Profile Version

false

Version of the profile. If none is specified, the Database version shall be used.

PROFILE_VERSION=

Profile Vendor

false

Vendor of the profile. Default is Oracle.

PROFILE_VENDOR=

Profile notes

false

Notes for the profile.

PROFILE_NOTES=

Working Directory

false

Working directory is the location where the files are staged.

WORKING_DIRECTORY=

Is the profile initiated by end user

true

Is the profile initiated by end user as part of backup process or the database.

USER_INITIATED=false


Schema Database

Table 27-37 EMCLI Property Files for Schema Database

Name Required Description Variable

Reference Database

true

The source database from which the profile will be created

REFERENCE_DATABASE=

Type of the reference database

true

The target type of the source database (oracle_database or rac_database)

REFERENCE_DATABASE_TYPE=

Reference Node

false

The reference node from which the profile will be created. Applicable only for RAC and Cluster targets

REF_NODE_SELECTED=

Backup mechanism for data

false

Variable to identify what mode needs to be used for creating backup data. Possible values are EXPORT, DBCA_TEMPLATE, RMAN, and THIN_PROVISIONING

DATA_CONTENT_MODE=EXPORT

The content that will be included in the backup

false

The data content that gets included in the backup can metadata or data. Possible values are METADATA_ONLY and METADATA_AND_DATA.

DATA_CONTENT=METADATA_AND_DATA

Reference Host Credentials

true

The credentials that will be used for OS authentication. Format is <Cred Name:Owner>. If this is not provided,preferred credentials will be checked against NormalHostCreds.

REF_HOST_CREDENTIALS=

Database Credentials

false

The credentials that will be used for performing database authentication. Format is <Cred Name:Owner>. If this is not provided, preferred credentials will be checked against SysDbaCreds

REF_DB_CREDENTIALS=

Profile Name

true

Name of the profile

PROFILE_NAME=

Profile Description

false

Name with which the profile should be created.

PROFILE_DESC=

Profile location

true

Location of the profile in software library.

PROFILE_LOCATION=

Profile Version

false

Version of the profile. If none is specified, the Database version shall be used.

PROFILE_VERSION=

Profile Vendor

false

Vendor of the profile. Default is Oracle.

PROFILE_VENDOR=

Profile notes

false

Notes for the profile.

PROFILE_NOTES=

Data gold image name

true

Entity name of the data gold image

DATA_GOLD_IMAGE_ENTITY_NAME=

Working Directory

false

Working directory is the location where the files are staged.

WORKING_DIRECTORY=

Schemas to be exported

true

List of schemas that needs to be included as part of the export.

EXPORT.SCHEMA_INCLUDE_LIST.0=

Dump Directories

false

List of directory objects that needs to be used for storing export. Format: directory=dir1,file_name=file1%U.dmp[,max_size=1MB].

EXPORT.DUMP_DIRECTORY_LIST.0=

Log Directory

false

Log directory location where the log file generated during export.

PORT.LOG_FILE_DIRECTORY=

Degree of Parallelism

false

Degree of Parallelism indicates the number of threads. For example, 1 or 2 or 3...

EXPORT.DEGREE_OF_PARALLELISM=