Enable, Disable or Delete a Rule
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/dbaas/instances/{serviceId}/accessrules/{ruleName}
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.
-
ruleName: string
Name of the rule to enable, disable or delete.
-
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.
objectRequest Body-
operation:
string
Type of operation to perform on the access rule. Valid values are:
update(to disable or enable a rule) anddelete(to delete a rule). -
status:
string
State of the access rule to update to. This attribute is required only when you disable or enable a rule. Valid value is
disabledorenabled.
Response
- application/json
200 Response
objectResponse Body, Status 200-
description(optional):
string
The Description of the rule.
-
destination(optional):
string
The value
DB_1. -
ports(optional):
string
The ports for the rule.
-
ruleName(optional):
string
The name of the rule.
-
ruleType(optional):
string
The type of the rule; one of:
DEFAULT,SYSTEMorUSER. -
source(optional):
string
IP addresses and subnets from which traffic is allowed.
-
status(optional):
string
The status of the rule; one of:
disabledorenabled.
202 Response
-
Location: string
A REST URI you can use to check the progress and completion of the rule deletion operation.
objectResponse Body, Status 202-
rule(optional):
object rule Object
Title:
rule Object
objectrule Object-
description(optional):
string
The Description of the rule.
-
destination(optional):
string
The value
DB_1. -
ports(optional):
string
The ports for the rule.
-
ruleName(optional):
string
The name of the rule.
-
ruleType(optional):
string
The type of the rule; one of:
DEFAULT,SYSTEMorUSER. -
source(optional):
string
IP addresses and subnets from which traffic is allowed.
-
status(optional):
string
The status of the rule; one of:
disabledorenabled.
Examples
The following example shows how to disable a rule by submitting a PUT 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 service instance is db12c-xp-si and the Oracle Cloud user name of the user making the call is dbcsadmin. The rule being disabled is example-https.
Note that the request body is included directly in the cURL command by using the --data option.
cURL Command
$ curl --include --request PUT \
--user dbcsadmin:password \
--header "X-ID-TENANT-NAME:usexample" \
--header "Content-Type: application/json" \
--data '{"operation":"update","status":"disabled"}' \
https://dbaas.oraclecloud.com/paas/api/v1.1/instancemgmt/usexample/services/dbaas/instances/db12c-xp-si/accessrules/example-https
HTTP Status Code and Response Headers
HTTP/1.1 200 OK Date: date-and-time-stamp Server: Oracle-Application-Server-11g Content-Length: 138 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
Response Body
{
"ruleName":"example-https",
"description":"",
"status":"disabled",
"source":"192.0.2.0/24",
"destination":"DB_1",
"ports":"443",
"ruleType":"USER"
}