Creating an Archive Rule for the Specified Analyzer
Function
This API is used to create an archive rule for the specified analyzer. The archive rule will automatically archive new findings that meet the criteria you define when you create the rule.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| AccessAnalyzer:archiveRule:create | Write | archiveRule * | - | - | - |
URI
POST /v5/analyzers/{analyzer_id}/archive-rules
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| analyzer_id | Yes | String | Definition: Unique identifier of an analyzer. You can call the ListAnalyzers API to obtain the analyzer ID. The response parameters of this API return an analyzer list. The id field of each analyzer object is the analyzer ID. Range: 1 to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| filters | Yes | Array of FindingFilter objects | Definition: A filter to match the returned findings. Constraints: N/A Range: The array length ranges from 1 to 10. Default Value: N/A |
| name | Yes | String | Definition: Name of the archive rule. Constraints: Must start with a letter. Range: 1 to 255 characters. Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed. Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| criterion | Yes | Criterion object | Definition: Criteria in the filter. Constraints: Only one operator is allowed. Range: N/A Default Value: N/A |
| key | Yes | String | Definition: Filter key. Constraints: N/A Range: Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| contains | No | Array of strings | Definition: Matching the "contains" operator in the filter. Constraints: N/A Range: Array length: 1 to 20. Default Value: N/A |
| eq | No | Array of strings | Definition: Matching the "eq" operator in the filter. Constraints: N/A Range: Array length: 1 to 20. Default Value: N/A |
| exists | No | Boolean | Definition: Matching the "exists" operator in the filter Constraints: N/A Range: N/A Default Value: N/A |
| neq | No | Array of strings | Definition: Matching the "neq" operator in the filter. Constraints: N/A Range: Array length: 1 to 20. Default Value: N/A |
Response Parameters
Status code: 201
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition: Unique identifier of an archive rule. Range: 1 to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
| urn | String | Definition: Unique resource identifier of an archive rule. Range: The value can contain up to 1,500 characters. |
Example Requests
Creating an archive rule for a specified analyzer. The archive rule automatically archives new findings that meet the criteria you define when you create the rule.
POST https://{hostname}/v5/analyzers/{analyzer_id}/archive-rules
{
"filters" : [ {
"criterion" : {
"eq" : [ "iam:agency" ]
},
"key" : "resource_type"
} ],
"name" : "my-archive-rules"
} Example Responses
Status code: 201
Created
{
"id" : "{archive_rule_id}",
"urn" : "AccessAnalyzer:{region_id}:{domain_id}:archiveRule:{analyzer_id}/{archive_rule_id}"
} Status Codes
| Status Code | Description |
|---|---|
| 201 | Created |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot