Add an Access Rule

post

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

Adds (inserts) a new access rule to a MySQL Cloud Service instance.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
The request body defines the details of the access rule to add.
Root Schema : access-rules-add-post-request
Type: object
Show Source

Response

Supported Media Types

202 Response

Accepted. See Status Codes for information about other HTTP status codes.

Examples

The following example shows how to create an access rule by submitting a POST 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 creates a new access rule named my_test_rule.

curl -i -X POST \
  -u "username:password" \
  -H "X-ID-TENANT-NAME: ExampleIdentityDomain" \
  -d '{"ruleName":"my_test_rule","ruleType":"USER","description":"","source":"PUBLIC-INTERNET","destination":"mysql_MASTER","ports":"3308","protocol":"tcp","status":"disabled"}' \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/MyTestInstance/accessrules 

The request body passed into curl's -d parameter is:

{
   "ruleName":"my_test_rule",
   "ruleType":"USER",
   "description":"",
   "source":"PUBLIC-INTERNET",
   "destination":"mysql_MASTER",
   "ports":"3308",
   "protocol":"tcp",
   "status":"disabled"
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 202 Accepted
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: P0rRGFC00d5906Ez0iWspH505000Iu90^d
X-ORACLE-DMS-ECID: P0rRGFC00d5906Ez0iWspH505000Iu90^d
Access-Control-Allow-Origin: *
X-Frame-Options: DENY
Content-Type: application/json
Vary: user-agent
Date: Thu, 24 Nov 2016 03:01:17 GMT
Connection: close
    

Example of Response Body

The following shows an example of the response body.

null