Create Rule Set
Use this API to create a new SQL rule set by copying an existing rule set. This lets you reuse an existing rule baseline and save it with a new name and description.
Request URL: /openapi/v1/ruleSet/create
Request Method: POST
Before You Begin
- Call List Rule Sets to obtain the
parentIdto copy from. - Use a clear name and description for the new rule set so it is easy to find, bind, and maintain later.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| name | String | Yes | Rule set name. | Production SQL Rule Set |
| parentId | String | Yes | ID of the source rule set to copy from. | rs-default-dev |
| description | String | Yes | Rule set description. | For production SQL development workflows |
How to Use the Returned Value
After the call succeeds, data in the response is the new rule set ID. Use this value as id when calling Delete Rule Set or Bind or Unbind Rule Set Resources.
Request Example
{
"name": "Production SQL Rule Set",
"parentId": "rs-default-dev",
"description": "For production SQL development workflows"
}
Response Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | Whether the request is successful. | true |
| requestId | String | Request ID for troubleshooting and tracing. | Ew4t6KMF-HNNOpCMnNKPn0RHdIOh4TLN |
| data | String | ID of the new rule set. | rs-dii9zwptapl1 |
| errorCode | String | Error code returned when the call fails. | None |
| message | String | Error message returned when the call fails. | None |
Successful Invocation Example
{
"success": true,
"requestId": "Ew4t6KMF-HNNOpCMnNKPn0RHdIOh4TLN",
"data": "rs-dii9zwptapl1"
}
Result
A successful response returns the new rule set ID in data. Store this value if you plan to bind the rule set to environments, data sources, or database groups.