Skip to content

get_subnet_cidr_reservations async

get_subnet_cidr_reservations(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filters: Optional[FilterList] = None,
    subnet_id: Optional[SubnetId] = None,
    dry_run: Optional[Boolean] = None,
    next_token: Optional[String] = None,
    max_results: Optional[GetSubnetCidrReservationsMaxResults] = None,
) -> GetSubnetCidrReservationsResult

Gets information about the subnet CIDR reservations.

Parameters:

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

    One or more filters.

    • reservationType - The type of reservation (prefix | explicit).

    • subnet-id - The ID of the subnet.

    • tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • subnet_id (Optional[SubnetId], default: None ) –

    The ID of the subnet.

  • dry_run (Optional[Boolean], default: None ) –

    Checks 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.

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

    The token for the next page of results.

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

    The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def get_subnet_cidr_reservations(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    subnet_id: Optional["capo_ec2.types.subnet_id.SubnetId"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    max_results: Optional[
        "capo_ec2.types.get_subnet_cidr_reservations_max_results.GetSubnetCidrReservationsMaxResults"
    ] = None,
) -> "capo_ec2.types.get_subnet_cidr_reservations_result.GetSubnetCidrReservationsResult":
    """<p>Gets information about the subnet CIDR reservations.</p>

    Args:
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>reservationType</code> - The type of reservation (<code>prefix</code> | <code>explicit</code>).</p> </li> <li> <p> <code>subnet-id</code> - The ID of the subnet.</p> </li> <li> <p> <code>tag</code>:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p> </li> <li> <p> <code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p> </li> </ul>
        subnet_id: <p>The ID of the subnet.</p>
        dry_run: <p>Checks 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>
        next_token: <p>The token for the next page of results.</p>
        max_results: <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.get_subnet_cidr_reservations_request.GetSubnetCidrReservationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.get_subnet_cidr_reservations_result.GetSubnetCidrReservationsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.get_subnet_cidr_reservations

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.get_subnet_cidr_reservations.async_get_subnet_cidr_reservations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetSubnetCidrReservations")
    )
    input_: capo_ec2.types.get_subnet_cidr_reservations_request.GetSubnetCidrReservationsRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if subnet_id is not None:
        input_["subnet_id"] = subnet_id
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output