Create a Rule
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/dbaas/instances/{serviceId}/accessrules
Request
- application/json
-
identityDomainId: string
Identity domain ID for the Database Classic Cloud Service account:
For a Cloud account with Identity Cloud Service: the identity service ID, which has the form
idcs-letters-and-numbers
. You can find this ID in the Identity Service Id field on the Overview tab of the Service Details page for Database Classic Cloud Service in My Services.For a traditional cloud account: the name of the identity domain.
-
serviceId: string
Name of the Database Classic Cloud Service instance.
-
Authorization: string
Base64 encoding of the user name and password of the user making the request. For more information, see Security, Authentication and Authorization.
-
X-ID-TENANT-NAME: string
Identity domain ID for the Database Classic Cloud Service account:
For a Cloud account with Identity Cloud Service: the identity service ID, which has the form
idcs-letters-and-numbers
. You can find this ID in the Identity Service Id field on the Overview tab of the Service Details page for Database Classic Cloud Service in My Services.For a traditional cloud account: the name of the identity domain.
object
Request Body
-
description:
string
The description of the rule.
-
destination:
string
The destination to which traffic is allowed. Specify the value
"DB_1"
. -
ports:
string
The network port or ports to allow traffic on. Specify a single port or a port range. For example,
8989
or7000-8000
. -
ruleName:
string
The name of the rule.
-
source:
string
The IP addresses and subnets from which traffic is allowed. Valid values include:
DB_1
for any other cloud service instance in the Database Classic Cloud Service instance's ora_db security list.PUBLIC-INTERNET
for any host on the Internet- A single IP address or a comma-separated list of subnets (in CIDR format) or IPv4 addresses
-
status:
string
Status of the rule. Specify whether the status should be enabled or disabled. Specify either
disabled
orenabled
.
Response
202 Response
-
Location: string
A REST URI you can use to check the progress and completion of the rule creation operation.
Examples
The following example shows how to create a rule by submitting a POST request on the REST endpoint using cURL.
This example uses a traditional cloud account, so the {identityDomainId}
path parameter and the X-ID-TENANT-NAME
header parameter are set to the account's domain name, which is usexample
. The Oracle Cloud user name of the user making the call is dbcsadmin
. The example-https
rule is being created for the service instance db12c-xp-si
.
cURL Command
$ curl --include --request POST \
--user dbcsadmin:password \
--header "X-ID-TENANT-NAME:usexample" \
--header "Content-Type: application/json" \
--data '{"ruleName":"example-https","description":"","source":"192.0.2.0/24","destination":"DB_1","ports":"443","status":"enabled"}' \
https://dbaas.oraclecloud.com/paas/api/v1.1/instancemgmt/usexample/services/dbaas/instances/db12c-xp-si/accessrules
HTTP Status Code and Response Headers
HTTP/1.1 202 Accepted Date: date-and-time-stamp Server: Oracle-Application-Server-11g Content-Length: 0 X-ORACLE-DMS-ECID: id-string X-ORACLE-DMS-ECID: id-string X-Frame-Options: DENY Vary: Accept-Encoding,User-Agent Content-Language: en Content-Type: application/json