The following example shows how to view detailed information about a Database Cloud Service instance by submitting a GET request on the REST endpoint using cURL.

To know basic about RESTAPI

In the last post, we created an access rule with RestApi. Now, in this post, we will see how to get the information about that instance.

The following example shows how to view the rules for a Database Cloud Service instance by submitting a GET request on the REST endpoint using cURL.

In this example, the identity domain is “idcs-bac676f0a2c643a281868616b45986da”, the service instance is Skant and the Oracle Cloud username and password are “clouduser” and “Pa$$word“.

cURL Command

[oracle@edvmr1p0 Solution_files]$ curl -X GET -i -H "X-ID-TENANT-NAME: idcs-bac676f0a2c643a281868616b45986da" -u "clouduser:Pa$$word" "https://dbaas.oraclecloud.com/paas/api/v1.1/instancemgmt/idcs-bac676f0a2c643a281868616b45986da/services/dbaas/instances/Skant/accessrules"

HTTP Status Code and Response Headers

HTTP/1.0 200 Connection established
X-RBT-SCAR: 10.135.5.84:898273039:1000

HTTP/1.1 200 OK
Server: Oracle-Application-Server-11g
Strict-Transport-Security: max-age=31536000;includeSubDomains
Content-Language: en
Access-Control-Allow-Headers: Content-Type, api_key, Authorization, X-ID-TENANT-NAME, X-USER-IDENTITY-DOMAIN-NAME
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
X-ORACLE-DMS-ECID: 005PwbHRwry6uHFpR05Eid0007FJ0004SX
X-ORACLE-DMS-ECID: 005PwbHRwry6uHFpR05Eid0007FJ0004SX
Access-Control-Allow-Origin: *
X-Frame-Options: DENY
Content-Type: application/json
Vary: user-agent
Date: Mon, 19 Mar 2018 20:29:47 GMT
Content-Length: 1704
Connection: keep-alive

Response Body

{
"accessRules": [
{
"ruleName": "ora_p2_ssh",
"description": "",
"status": "enabled",
"source": "PUBLIC-INTERNET",
"destination": "DB_1",
"ports": "22",
"protocol": "tcp",
"ruleType": "DEFAULT"
},
{
"ruleName": "ora_p2_http",
"description": "",
"status": "disabled",
"source": "PUBLIC-INTERNET",
"destination": "DB_1",
"ports": "80",
"protocol": "tcp",
"ruleType": "DEFAULT"
},
{
"ruleName": "ora_p2_httpssl",
"description": "",
"status": "disabled",
"source": "PUBLIC-INTERNET",
"destination": "DB_1",
"ports": "443",
"protocol": "tcp",
"ruleType": "DEFAULT"
},
{
"ruleName": "ora_p2_dbconsole",
"description": "",
"status": "disabled",
"source": "PUBLIC-INTERNET",
"destination": "DB_1",
"ports": "1158",
"protocol": "tcp",
"ruleType": "DEFAULT"
},
{
"ruleName": "ora_p2_dbexpress",
"description": "",
"status": "disabled",
"source": "PUBLIC-INTERNET",
"destination": "DB_1",
"ports": "5500",
"protocol": "tcp",
"ruleType": "DEFAULT"
},
{
"ruleName": "ora_p2_dblistener",
"description": "",
"status": "disabled",
"source": "PUBLIC-INTERNET",
"destination": "DB_1",
"ports": "1521",
"protocol": "tcp",
"ruleType": "DEFAULT"
},
{
"ruleName": "sys_infra2db_ssh",
"description": "DO NOT MODIFY: Permit PSM to ssh to database",
"status": "enabled",
"source": "PAAS-INFRA",
"destination": "DB_1",
"ports": "22",
"protocol": "tcp",
"ruleType": "SYSTEM"
},
{
"ruleName": "ora_trusted_hosts_dblistener",
"description": "DO NOT MODIFY: A secrule to allow specific IPs to connect to this db",
"status": "enabled",
"source": "127.0.0.1/32",
"destination": "DB_1",
"ports": "1521",
"protocol": "tcp",
"ruleType": "SYSTEM"
},
{
"ruleName": "allow-1525-connection",
"description": "Open port for developers during deployment time",
"status": "enabled",
"source": "PUBLIC-INTERNET",
"destination": "DB_1",
"ports": "1525",
"protocol": "tcp",
"ruleType": "USER"
}
],
"activities": []
}

Stay tuned for More articles on Oracle Cloud and RESTapi

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel : https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.