Help Center/ Config/ API Reference/ APIs/ Compliance/ Collect Remediation Results
Updated on 2024-08-13 GMT+08:00

Collect Remediation Results

Function

This API is used to collect remediation results.

Calling Method

For details, see Calling APIs.

URI

POST /v1/resource-manager/domains/{domain_id}/policy-assignments/{policy_assignment_id}/remediation-execution-statuses/summary

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Specifies tags.

Maximum: 36

policy_assignment_id

Yes

String

Specifies the rule ID.

Maximum: 36

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Specifies the maximum number of records to return.

Minimum: 1

Maximum: 200

Default: 200

marker

No

String

Specifies the pagination parameter.

Minimum: 4

Maximum: 400

Request Parameters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

resource_keys

Yes

Array of RemediationResourceKey objects

A list of query criteria required to collect remediation results.

Array Length: 0 - 100

Table 4 RemediationResourceKey

Parameter

Mandatory

Type

Description

resource_id

Yes

String

Resource ID.

Minimum: 1

Maximum: 512

resource_provider

Yes

String

Cloud service name, to be compatible with some policyState where the cloud service name is empty in the compliance result, the value can be an empty string.

Minimum: 0

Maximum: 128

resource_type

Yes

String

Resource type, to be compatible with some policyState where the resource type is empty in the compliance result, the value can be an empty string.

Minimum: 0

Maximum: 128

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

value

Array of RemediationExecutionStatus objects

Detailed correction result list.

page_info

PageInfo object

Specifies the pagination object.

Table 6 RemediationExecutionStatus

Parameter

Type

Description

resource_key

RemediationResourceKey object

Details about the query criteria for remediation results.

invocation_time

String

The start time of remediation.

state

String

Execution result of remediation.

message

String

Information of remediation execution.

Table 7 RemediationResourceKey

Parameter

Type

Description

resource_id

String

Resource ID.

Minimum: 1

Maximum: 512

resource_provider

String

Cloud service name, to be compatible with some policyState where the cloud service name is empty in the compliance result, the value can be an empty string.

Minimum: 0

Maximum: 128

resource_type

String

Resource type, to be compatible with some policyState where the resource type is empty in the compliance result, the value can be an empty string.

Minimum: 0

Maximum: 128

Table 8 PageInfo

Parameter

Type

Description

current_count

Integer

Specifies the resource quantity on the current page.

Minimum: 0

Maximum: 200

next_marker

String

Specifies the marker value of the next page.

Minimum: 4

Maximum: 400

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 403

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 404

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 500

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Example Requests

Collects remediation results for the specified resource.

POST https://{endpoint}/v1/resource-manager/domains/{domain_id}/policy-assignments/{policy_assignment_id}/remediation-execution-statuses/summary

{
  "resource_keys" : [ {
    "resource_id" : "resource_id_1",
    "resource_provider" : "resource_provider_1",
    "resource_type" : "resource_type_1"
  }, {
    "resource_id" : "resource_id_2",
    "resource_provider" : "resource_provider_2",
    "resource_type" : "resource_type_2"
  } ]
}

Example Responses

Status code: 200

Operation succeeded.

{
  "value" : [ {
    "resource_key" : {
      "resource_id" : "resource_id1",
      "resource_provider" : "resource_provider1",
      "resource_type" : "resource_type1"
    },
    "invocation_time" : "2024-01-17T09:39:19Z",
    "state" : "SUCCEEDED",
    "message" : "Execution success."
  }, {
    "resource_key" : {
      "resource_id" : "resource_id1",
      "resource_provider" : "resource_provider2",
      "resource_type" : "resource_type2"
    },
    "invocation_time" : "2024-01-17T09:41:20Z",
    "state" : "FAILED",
    "message" : "You do not have the permission to invoke functionGraph."
  } ],
  "page_info" : {
    "current_count" : 2,
    "next_marker" : null
  }
}

Status Codes

Status Code

Description

200

Operation succeeded.

400

Invalid parameters.

403

Forbidden

404

Resources not found.

500

Internal server error.

Error Codes

See Error Codes.