Tuesday, June 7, 2016

Create DBCS Instance using REST API

Since my previous post, REST API changed !
The following shows how to create an Oracle Database Cloud Service instance 12g using the REST API:

Documentation:

https://docs.oracle.com/cloud/latest/dbcs_dbaas/CSDBR/op-paas-service-dbcs-api-v1.1-instances-%7BidentityDomainId%7D-post.html#examples

Command:

curl --include --request POST --cacert "D:\Distribs\cacert.pem" --user "user:my_password" --header "X-ID-TENANT-NAME:my_identity_domain" --header "Content-Type:application/json" --data "@D:\OPC_Demo\createMyDB.json" https://dbcs.emea.oraclecloud.com/paas/service/dbcs/api/v1.1/instances/my_identity_domain

Result




createMyDB.json file :

 {
  "serviceName": "DB12RESTDemo",
  "version": "12.1.0.2",
  "level": "PAAS",
  "edition": "EE",
  "subscriptionType": "MONTHLY",
  "description": "VM Created using REST API",
  "shape": "oc3",
  "vmPublicKeyText": "ssh-rsa AAAAB3NzaKvGXmw== rsa-key-20150105",
  "parameters": [
    {
      "type": "db",
      "usableStorage": "15",
      "adminPassword": "Manager12#",
      "sid": "ORCL",
      "pdb": "PDB1",
      "failoverDatabase": "no",
      "backupDestination": "NONE"
    }
  ]
  }
}}