Help Center> CodeArts Pipeline> API Reference> API> Tenant-level open source governance policy management> Changing the Enabling Status of a Tenant-Level Open Source Governance Policy
Updated on 2023-11-28 GMT+08:00

Changing the Enabling Status of a Tenant-Level Open Source Governance Policy

Function

Changing the Enabling Status of a Tenant-Level Open Source Governance Policy

URI

PUT /v2/{domain_id}/tenant/open-source/rule-sets/{rule_set_id}/switch

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Indicates the tenant ID.

rule_set_id

Yes

String

Policy 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

is_valid

Yes

Boolean

Rule Template Instance Status

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

status

Boolean

Status

rule_set_id

String

Rule Set ID

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Error Message

error_code

String

Error code.

Example Requests

POST https://{endpoint}/v2/ce8df55870164338a72d7e828a966a2a/tenant/open-source/rule-sets/da4703a10ca543268e6e487540ea9e0f/switch

{
  "is_valid" : false
}

Example Responses

Status code: 200

OK

{
  "status" : true,
  "rule_set_id" : "da4703a10ca543268e6e487540ea9e0f"
}

Status Codes

Status Code

Description

200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.