Deletes a prefix list and all entries in the prefix list.
Description
If a prefix list is associated with resources, you cannot delete the prefix list. You must disassociate the prefix list from the resources before you can delete the prefix list. You can call the DescribePrefixListAssociations operation to query resources that are associated with a specific prefix list.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | DeletePrefixList |
The operation that you want to perform. Set the value to DeletePrefixList. |
| RegionId | String | Yes | cn-chengdu |
The region ID of the prefix list. You can call the DescribeRegions operation to query the most recent region list. |
| PrefixListId | String | Yes | pl-x1j1k5ykzqlixdcy**** |
The ID of the prefix list. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| RequestId | String | 38793DB8-A4B2-4AEC-BFD3-111234E9188D |
The ID of the request. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=DeletePrefixList
&RegionId=cn-chengdu
&PrefixListId=pl-x1j1k5ykzqlixdcy****
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DeletePrefixListResponse>
<RequestId>38793DB8-A4B2-4AEC-BFD3-111234E9188D</RequestId>
</DeletePrefixListResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "38793DB8-A4B2-4AEC-BFD3-111234E9188D"
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | NotAllowed.AssociationExist | The specified prefix list has associated resources. | The error message returned because the prefix list is associated with resources. |
| 404 | InvalidPrefixListId.NotFound | The specified prefix list was not found. | The error message returned because the specified prefix list does not exist. |
For a list of error codes, visit the API Error Center.