Skip to main content

ListStackOperationRisks

Description

call the ListStackOperationRisks interface to detect the high-risk resources that may be involved in the operation of deleting the resource stack, and return the risk reason corresponding to each resource.

Request Method

POST

Request Path

/apsara/route/ROS/ListStackOperationRisks

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
RamRoleNameBODYstringNotest-roleRAM role name. if a RAM role is specified, ROS will create a resource stack according to the permissions of the RAM role and use the credentials of the role to make interface calls on behalf of the user. If you do not specify a RAM role, ROS will use the relevant permissions of the current account to create a resource stack. The maximum length of the RAM role name is 64 bytes.
regionIdBODYstringYesNo sample value for this parameter.region id
RetainAllResourcesBODYbooleanNofalsewhether to keep all resources under the resource stack. Value: true: reserved. false (default): not reserved. Description This parameter is valid when the OperationType value is DeleteStack.
OperationTypeBODYstringYesDeleteStackthe type of operation to be detected. The value is DeleteStack, which indicates that the high-risk resources involved in the operation of deleting the resource stack are detected.
RegionIdBODYstringYescn-hangzhouthe region ID to which the resource stack belongs.
ClientTokenBODYstringNo123e4567-e89b-12d3-a456-42665544****guarantees the idempotence of the request. This value is generated by the client and must be globally unique. is no more than 64 characters in length and can contain English letters, numbers, dashes (-) and underscores (_).
RetainResources.NBODYrepeatlistNoWebServerthe list of resources that need to be kept. Description This parameter is valid when the OperationType value is DeleteStack.
versionBODYstringNo2016-01-01version of api
StackIdBODYstringYes4a6c9851-3b0f-4f5f-b4ca-a14bf691****resource stack ID.

Return data

NameTypeSample valueDescription
LogicalResourceIdstringMySGresource logical ID, that is, the resource name defined by the template.
RequestIdstringDF4296CF-F45F-4845-A72B-BE617601DB25the request ID when the risk detection of the resource fails. this parameter is not returned when the risk detection is normal.
RiskResourcesarray of resourceNo sample value for this parameter.risk information.
MessagestringYou are not authorized to complete this action.error information when the risk detection of resources fails. this parameter is not returned when the risk detection is normal.
PhysicalResourceIdstringsg-bp1dpioafqphedg9****resource physical ID, that is, the actual resource ID.
ResourceTypestringALIYUN::ECS::SecurityGroupresource type.
CodestringNoPermissionthe error code when the risk detection of resources fails. this parameter is not returned when the risk detection is normal.
ReasonstringThere are some ECS instances (i-bp18el96s4wq635e****) depending on the security group.Risk cause.
RiskTypestringReferencedrisk type, value: Referenced: the current resource is referenced by other resources. MaybeReferenced: the current resource may be referenced by other resources. AdditionalRiskCheckRequired: nested resource stacks require additional risk detection.

Example

Successful Response example

{
"LogicalResourceId":"MySG",
"RequestId":"DF4296CF-F45F-4845-A72B-BE617601DB25",
"RiskResources":"",
"Message":"You are not authorized to complete this action.",
"PhysicalResourceId":"sg-bp1dpioafqphedg9****",
"ResourceType":"ALIYUN::ECS::SecurityGroup",
"Code":"NoPermission",
"Reason":"There are some ECS instances (i-bp18el96s4wq635e****) depending on the security group.",
"RiskType":"Referenced"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}