Evaluate Custom Rules

Evaluate Custom Rules

Use this endpoint to evaluate domain specific language (DSL) custom rules against its resources. Custom rules are the rules defined by DSL specifications.

Request Endpoint

https://<tenant-URL>/api/v1/public_cloud/rule_evaluate

All parameters except resource_ids are required:

KeyValueDescription
cloud_providerazure | aws | googlecloudThe IaaS platform provider.
rule_codeURL-encoded stringThe rule definition written in DSL.
resource_idsURL-encoded stringThe list of resource IDs. There are these variations:
  • resource_ids: [] evaluates a given rule against all resources.
  • resource_ids:['a','b'] evaluates a given rule against ‘a' and 'b’ resources.
  • This is an optional parameter. If it’s an empty array, then the API evaluates a given rule against all resources.
instanceURL-encoded stringAWS: Account name.

Azure: AD application.

GCP: Service account.

Example Request and Response

POST 'https://<tenant-URL>/api/v1/public_cloud/rule_evaluate?token=f39866cb86ab84a0208e&cloud_provider="aws"&rule_code="RDSInstance should have MultiAZ eq true"&instance="API Test Instance"&resource_ids=["mariadb-1","mariadb-2"]'

{
"status": "success",
"message": {
"mariadb-1": true, // true =  resource passed the rule.
"mariadb-2": false // false = resource failed the rule.}}
Share this Doc

Evaluate Custom Rules

Or copy link

In this topic ...