View All Access Rules
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances/{serviceId}/accessrules
The access rules that control external access to the MySQL Server, and MySQL Enterprise Monitor are disabled by default. To gain access to the administration consoles, you are required to explicitly enable the access rules for them.
Request
-
identityDomainId: string
Name of the identity domain for the MySQL Cloud Service account.
-
serviceId: string
The user-defined name of the Oracle MySQL Cloud Service instance.
-
X-ID-TENANT-NAME: string
Name of the identity domain for the MySQL Cloud Service account.
Response
- application/json
200 Response
object
-
accessRules(optional):
array accessRules
Groups details about access rules.
-
activities(optional):
array activities
Groups details about ongoing and failed activity messages, if available.
array
object
-
description(optional):
string
Description of the rule.
-
destination(optional):
string
The service component to allow traffic to. For example,
mysql_MASTER
. -
ports(optional):
string
Ports for the rule. This can be a single port or a port range.
-
protocol(optional):
string
Communication protocol for the rule. For example,
tcp
. -
ruleName(optional):
string
Name of the rule.
-
ruleType(optional):
string
Type of rule. For example,
SYSTEM
,DEFAULT
, orUSER
. -
source(optional):
string
The hosts from which traffic is allowed. For example,
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(optional):
string
Status of the rule. Valid value:
disabled
orenabled
.
object
-
activity(optional):
array activity
Groups messages and errors for ongoing and failed activities.
array
object
-
errors(optional):
string
Error encountered for an ongoing or failed activity.
-
message(optional):
string
Message of an ongoing or failed activity.
Examples
The following example shows how to view all access rules for a MySQL Cloud Service instance by submitting a GET 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
curl -i -X GET \
-u "username:password" \
-H "X-ID-TENANT-NAME: ExampleIdentityDomain" \
-H "Accept: application/json" \
https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/MyTestInstance/accessrules
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK
Server: Oracle-Application-Server-11g
X-ORACLE-DMS-ECID: RU6F0Z005aviE10RHT050Zua0F000p7Id
X-ORACLE-DMS-ECID: RU6F0Z005aviE10RHT050Zua0F000p7Id
X-Frame-Options: DENY
Content-Language: en
Content-Type: application/json
Vary: user-agent
Date: Tue, 25 Oct 2016 23:45:51 GMT
Content-Length: 1145
Connection: keep-alive
Example of Response Body
The following shows an example of the response body in JSON format.
{ "accessRules": [ { "ruleName": "ora_p2admin_ssh", "description": "Permit public access to SSH port", "status": "enabled", "source": "PUBLIC-INTERNET", "destination": "mysql_MASTER", "ports": "22", "protocol": "tcp", "ruleType": "DEFAULT" }, { "ruleName": "ora_p2admin_mysql", "description": "Permit public access to MySQL port", "status": "disabled", "source": "PUBLIC-INTERNET", "destination": "mysql_MASTER", "ports": "3306", "protocol": "tcp", "ruleType": "DEFAULT" }, { "ruleName": "ora_trusted_hosts_mysql", "description": "DO NOT MODIFY: Permit specific IPs to access MySQL port ", "status": "enabled", "source": "127.0.0.1\/32", "destination": "mysql_MASTER", "ports": "3306", "protocol": "tcp", "ruleType": "SYSTEM" }, { "ruleName": "ora_p2admin_em", "description": "Permit public access to Enterprise Monitor https port", "status": "disabled", "source": "PUBLIC-INTERNET", "destination": "mysql_MASTER", "ports": "18443", "protocol": "tcp", "ruleType": "DEFAULT" }, { "ruleName": "sys_infra2mys_admin_ssh", "description": "DO NOT MODIFY: Permit PSM to ssh to admin host", "status": "enabled", "source": "PAAS-INFRA", "destination": "mysql_ADMIN_HOST", "ports": "22", "protocol": "tcp", "ruleType": "SYSTEM" } ], "activities": [ ] }