Updated on 2023-12-08 GMT+08:00

Creating a Ruleset

Function

Creating a Ruleset

URI

POST /v2/{domain_id}/tenant/rule-sets/create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Indicates the tenant ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Can be obtained by calling the IAM API for obtaining the user token (the value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Rule Set Name

rules

Yes

Array of RequestRuleInstance objects

Rule Set

Table 4 RequestRuleInstance

Parameter

Mandatory

Type

Description

id

No

String

Rule Instance ID

is_valid

No

Boolean

Rule Instance Status

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

status

Boolean

Status

rule_set_id

String

Rule Set ID

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Error Message

error_code

String

Error code.

Example Requests

POST https://{endpoint}/v2/ce8df55870164338a72d7e828a966a2a/tenant/rule-sets/create

{
  "name" : "Creating a Policy - 20231020171008",
  "rules" : [ {
    "id" : "425eba0deaf04596a74cf7967d7fc04d",
    "is_valid" : true
  } ]
}

Example Responses

Status code: 200

OK

{
  "status" : true,
  "rule_set_id" : "9e0145159fdd49238aa1fcdd5b8239f9"
}

Status Codes

Status Code

Description

200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.