Skip to content

describe_ipam_pool_allocations

describe_ipam_pool_allocations(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_pool_allocation_ids: Optional[ValueStringList] = None,
    filters: Optional[FilterList] = None,
    max_results: Optional[DescribeIpamPoolAllocationsMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeIpamPoolAllocationsResult

Describes IPAM pool allocations. You can describe all allocations owned by you across all pools, or you can describe specific allocations by ID.

If you specify IpamPoolAllocationIds, the results include only the specified allocations. If you do not specify IpamPoolAllocationIds, the results include all allocations owned by you. You can use Filters to narrow the results.

This action returns only allocations directly owned by you. To view all allocations in a pool you own or that has been shared with you, including allocations owned by other accounts, use GetIpamPoolAllocations.

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_allocation_ids (Optional[ValueStringList], default: None ) –

    The IDs of the IPAM pool allocations you want to describe.

  • filters (Optional[FilterList], default: None ) –

    One or more filters for the request. For more information about filtering, see Filtering CLI output.

  • max_results (Optional[DescribeIpamPoolAllocationsMaxResults], default: None ) –

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

  • next_token (Optional[NextToken], default: None ) –

    The token for the next page of results.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def describe_ipam_pool_allocations(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    ipam_pool_allocation_ids: Optional[
        "capo_ec2.types.value_string_list.ValueStringList"
    ] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_ipam_pool_allocations_max_results.DescribeIpamPoolAllocationsMaxResults"
    ] = None,
    next_token: Optional["capo_ec2.types.next_token.NextToken"] = None,
) -> "capo_ec2.types.describe_ipam_pool_allocations_result.DescribeIpamPoolAllocationsResult":
    """<p>Describes IPAM pool allocations. You can describe all allocations owned by you across all pools, or you can describe specific allocations by ID.</p> <p>If you specify <code>IpamPoolAllocationIds</code>, the results include only the specified allocations. If you do not specify <code>IpamPoolAllocationIds</code>, the results include all allocations owned by you. You can use <code>Filters</code> to narrow the results.</p> <note> <p>This action returns only allocations directly owned by you. To view all allocations in a pool you own or that has been shared with you, including allocations owned by other accounts, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetIpamPoolAllocations.html">GetIpamPoolAllocations</a>.</p> </note>

    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_allocation_ids: <p>The IDs of the IPAM pool allocations you want to describe.</p>
        filters: <p>One or more filters for the request. For more information about filtering, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">Filtering CLI output</a>.</p>
        max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
        next_token: <p>The token for the next page of results.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_ipam_pool_allocations_request.DescribeIpamPoolAllocationsRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_ipam_pool_allocations_result.DescribeIpamPoolAllocationsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_ipam_pool_allocations

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_ipam_pool_allocations.describe_ipam_pool_allocations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeIpamPoolAllocations")
    )
    input_: capo_ec2.types.describe_ipam_pool_allocations_request.DescribeIpamPoolAllocationsRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if ipam_pool_allocation_ids is not None:
        input_["ipam_pool_allocation_ids"] = ipam_pool_allocation_ids
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output