Delete an IPAM pool.
You cannot delete an IPAM pool if there are allocations in it or CIDRs provisioned to it. To release allocations, see ReleaseIpamPoolAllocation. To deprovision pool CIDRs, see DeprovisionIpamPoolCidr.
For more information, see Delete a pool in the Amazon VPC IPAM User Guide.
Parameters:
-
dry_run
(Optional[Boolean], default:
None
)
–
A check for whether you have the required permissions for the action without actually making the request and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
-
ipam_pool_id
(Optional[IpamPoolId], default:
None
)
–
The ID of the pool to delete.
-
cascade
(Optional[Boolean], default:
None
)
–
Enables you to quickly delete an IPAM pool and all resources within that pool, including provisioned CIDRs, allocations, and other pools.
You can only use this option to delete pools in the private scope or pools in the public scope with a source resource. A source resource is a resource used to provision CIDRs to a resource planning pool.
Raises:
Source code in docs_src/capo_ec2/_services/ec2.py
| def delete_ipam_pool(
self,
*,
config_overrides: Optional[EC2ClientConfig] = None,
dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
ipam_pool_id: Optional["capo_ec2.types.ipam_pool_id.IpamPoolId"] = None,
cascade: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.delete_ipam_pool_result.DeleteIpamPoolResult":
"""<p>Delete an IPAM pool.</p> <note> <p>You cannot delete an IPAM pool if there are allocations in it or CIDRs provisioned to it. To release allocations, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ReleaseIpamPoolAllocation.html">ReleaseIpamPoolAllocation</a>. To deprovision pool CIDRs, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeprovisionIpamPoolCidr.html">DeprovisionIpamPoolCidr</a>.</p> </note> <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/delete-pool-ipam.html">Delete a pool</a> in the <i>Amazon VPC IPAM User Guide</i>. </p>
Args:
dry_run: <p>A check for whether you have the required permissions for the action without actually making the request and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
ipam_pool_id: <p>The ID of the pool to delete.</p>
cascade: <p>Enables you to quickly delete an IPAM pool and all resources within that pool, including provisioned CIDRs, allocations, and other pools.</p> <important> <p>You can only use this option to delete pools in the private scope or pools in the public scope with a source resource. A source resource is a resource used to provision CIDRs to a resource planning pool.</p> </important>
Raises:
capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ec2.types.delete_ipam_pool_request.DeleteIpamPoolRequest]",
) -> OperationResponse[
"capo_ec2.types.delete_ipam_pool_result.DeleteIpamPoolResult"
]:
import capo_ec2._operations.amazon_ec2.delete_ipam_pool
output, http_response = (
capo_ec2._operations.amazon_ec2.delete_ipam_pool.delete_ipam_pool(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteIpamPool")
)
input_: capo_ec2.types.delete_ipam_pool_request.DeleteIpamPoolRequest = {}
if dry_run is not None:
input_["dry_run"] = dry_run
if ipam_pool_id is not None:
input_["ipam_pool_id"] = ipam_pool_id
if cascade is not None:
input_["cascade"] = cascade
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|