psm dbcs create-access-rule

Create an access rule for an Oracle Database Cloud Service instance.

Syntax

In the following syntax, line breaks have been added for clarity. Do not include them when entering the command.

psm dbcs create-access-rule
  -s|--service-name instance-name
  -c|--config-payload json-file
  [-of|--output-format json|html|short]

Parameters

Parameter Description

-s|--service-name instance-name

Specifies the name of the Database Cloud Service instance for which you want to create an access rule.

-c|--config-payload json-file

Specifies the path to a JSON file containing the information necessary to create an access rule. The format of this file is the same as the request body you provide when adding an access rule by using the REST API. For information about this format, see the “Body” section of Create a Rule in REST API for Oracle Database Cloud Service.

-of|--output-format json|html|short

(Optional) Specifies the output format of the command’s response:

  • json—output is formatted as a JSON array.

  • html—output is formatted as HTML

  • short—output is formatted as a brief summary.

The default output format is the one you specified when using the psm setup command to configure the psm CLI.

Examples

The following example creates the access rule specified by information provided in the createaccessrule.json file for the db12c-xp-si2 Database Cloud Service instance.

$ psm dbcs create-access-rule --service-name db12c-xp-si2 --config-payload createaccessrule.json
"Accepted"

Listing of createaccessrule.json

{
  "ruleName":"example-https",
  "description":"",
  "source":"192.0.2.0/24",
  "destination":"DB",
  "ports":"443",
  "status":"enabled"
}