Enable, Disable, or Delete an Access Rule

put

/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances/{serviceId}/accessrules/{ruleName}

Disable, enable, or delete an access rule only. You cannot change the rule details.

Request

Supported Media Types
Path Parameters
  • Name of the identity domain for the MySQL Cloud Service account.
  • Name of the access rule to enable, disable, or delete. Must start with a letter, followed by letters, numbers, hyphens, or underscores. Must not exceed 50 characters, and is unique to the service.
  • The user-defined name of the Oracle MySQL Cloud Service instance.
Header Parameters
Body ()
The request body defines the details of the disable, enable, or delete request.
Root Schema : access-rules-update-put-request
Type: object
Show Source
  • Type of operation to perform on the access rule. Valid values are: update (to disable or enable a rule) and delete (to delete a rule).
  • State of the access rule to update to. This attribute is required only when you disable or enable a rule. Valid values are disabled or enabled.

Response

Supported Media Types

200 Response

OK (enable or disable rule). See Status Codes for information about other possible HTTP status codes.
Body ()
Root Schema : access-rules-details
Type: object
Show Source

202 Response

Accepted (delete rule). See Status Codes for information about other possible HTTP status codes.
Body ()
Root Schema : access-rules-details
Type: object
Show Source

Examples

The following example shows how to enable a rule by submitting a PUT request on the REST endpoint using cURL.

Note: The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the Oracle Public Cloud or Oracle Cloud Machine REST server to contact for your identity domain or tenant name. See Send Requests for the appropriate URL structure to use on Oracle Public Cloud or Oracle Cloud Machine.

cURL Command

The following example updates an access rule named ora_p2admin_mysql by enabling it.

curl -i -X PUT \
  -u "username:password" \
  -H "X-ID-TENANT-NAME: ExampleIdentityDomain" \
  -d '{"operation":"update","status":"enabled"}' \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/MyTestInstance/accessrules/ora_p2admin_mysql

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: Oracle-Application-Server-11g
Content-Language: en
Access-Control-Allow-Headers: Content-Type, api_key, Authorization
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
X-ORACLE-DMS-ECID: 1p2050uI5Gl0003i0HB00x4RW9Ep65Sd0F
X-ORACLE-DMS-ECID: 1p2050uI5Gl0003i0HB00x4RW9Ep65Sd0F
Access-Control-Allow-Origin: *
X-Frame-Options: DENY
Content-Type: application/json
Vary: user-agent
Date: Thu, 24 Nov 2016 02:35:54 GMT
Content-Length: 211
Connection: keep-alive

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "ruleName": "ora_p2admin_mysql",
    "description": "Permit public access to MySQL port",
    "status": "enabled",
    "source": "PUBLIC-INTERNET",
    "destination": "mysql_MASTER",
    "ports": "3306",
    "protocol": "tcp",
    "ruleType": "DEFAULT"
}