Skip to content

change_cidr_collection async

change_cidr_collection(
    id: UUID,
    changes: CidrCollectionChanges,
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
    collection_version: Optional[CollectionVersion] = None,
) -> ChangeCidrCollectionResponse

Creates, changes, or deletes CIDR blocks within a collection. Contains authoritative IP information mapping blocks to one or multiple locations.

A change request can update multiple locations in a collection at a time, which is helpful if you want to move one or more CIDR blocks from one location to another in one transaction, without downtime.

Limits

The max number of CIDR blocks included in the request is 1000. As a result, big updates require multiple API calls.

PUT and DELETE_IF_EXISTS

Use ChangeCidrCollection to perform the following actions:

  • PUT: Create a CIDR block within the specified collection.

  • DELETE_IF_EXISTS: Delete an existing CIDR block from the collection.

Parameters:

  • id (UUID) –

    The UUID of the CIDR collection to update.

  • collection_version (Optional[CollectionVersion], default: None ) –

    A sequential counter that Amazon Route 53 sets to 1 when you create a collection and increments it by 1 each time you update the collection.

    We recommend that you use ListCidrCollection to get the current value of CollectionVersion for the collection that you want to update, and then include that value with the change request. This prevents Route 53 from overwriting an intervening update:

    • If the value in the request matches the value of CollectionVersion in the collection, Route 53 updates the collection.

    • If the value of CollectionVersion in the collection is greater than the value in the request, the collection was changed after you got the version number. Route 53 does not update the collection, and it returns a CidrCollectionVersionMismatch error.

  • changes (CidrCollectionChanges) –

    Information about changes to a CIDR collection.

Raises:

Source code in docs_src/capo_route_53/_services/async_route53.py
async def change_cidr_collection(
    self,
    id: "capo_route_53.types.uuid.UUID",
    changes: "capo_route_53.types.cidr_collection_changes.CidrCollectionChanges",
    *,
    config_overrides: Optional[AsyncRoute53ClientConfig] = None,
    collection_version: Optional[
        "capo_route_53.types.collection_version.CollectionVersion"
    ] = None,
) -> "capo_route_53.types.change_cidr_collection_response.ChangeCidrCollectionResponse":
    """<p>Creates, changes, or deletes CIDR blocks within a collection. Contains authoritative IP information mapping blocks to one or multiple locations.</p> <p>A change request can update multiple locations in a collection at a time, which is helpful if you want to move one or more CIDR blocks from one location to another in one transaction, without downtime. </p> <p> <b>Limits</b> </p> <p>The max number of CIDR blocks included in the request is 1000. As a result, big updates require multiple API calls.</p> <p> <b> PUT and DELETE_IF_EXISTS</b> </p> <p>Use <code>ChangeCidrCollection</code> to perform the following actions:</p> <ul> <li> <p> <code>PUT</code>: Create a CIDR block within the specified collection.</p> </li> <li> <p> <code> DELETE_IF_EXISTS</code>: Delete an existing CIDR block from the collection.</p> </li> </ul>

    Args:
        id: <p>The UUID of the CIDR collection to update.</p>
        collection_version: <p>A sequential counter that Amazon Route 53 sets to 1 when you create a collection and increments it by 1 each time you update the collection.</p> <p>We recommend that you use <code>ListCidrCollection</code> to get the current value of <code>CollectionVersion</code> for the collection that you want to update, and then include that value with the change request. This prevents Route 53 from overwriting an intervening update: </p> <ul> <li> <p>If the value in the request matches the value of <code>CollectionVersion</code> in the collection, Route 53 updates the collection.</p> </li> <li> <p>If the value of <code>CollectionVersion</code> in the collection is greater than the value in the request, the collection was changed after you got the version number. Route 53 does not update the collection, and it returns a <code>CidrCollectionVersionMismatch</code> error. </p> </li> </ul>
        changes: <p> Information about changes to a CIDR collection.</p>

    Raises:
        capo_route_53.errors.cidr_block_in_use_exception.CidrBlockInUseException: <p>This CIDR block is already in use.</p>
        capo_route_53.errors.cidr_collection_version_mismatch_exception.CidrCollectionVersionMismatchException: <p>The CIDR collection version you provided, doesn't match the one in the <code>ListCidrCollections</code> operation.</p>
        capo_route_53.errors.concurrent_modification.ConcurrentModification: <p>Another user submitted a request to create, update, or delete the object at the same time that you did. Retry the request. </p>
        capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
        capo_route_53.errors.limits_exceeded.LimitsExceeded: <p>This operation can't be completed because the current account has reached the limit on the resource you are trying to create. To request a higher limit, <a href="http://aws.amazon.com/route53-request">create a case</a> with the Amazon Web Services Support Center.</p>
        capo_route_53.errors.no_such_cidr_collection_exception.NoSuchCidrCollectionException: <p>The CIDR collection you specified, doesn't exist.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route_53.types.change_cidr_collection_request.ChangeCidrCollectionRequest]",
    ) -> AsyncOperationResponse[
        "capo_route_53.types.change_cidr_collection_response.ChangeCidrCollectionResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.change_cidr_collection

        (
            output,
            http_response,
        ) = await capo_route_53._operations.aws_dns_v20130401.change_cidr_collection.async_change_cidr_collection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ChangeCidrCollection")
    )
    input_: capo_route_53.types.change_cidr_collection_request.ChangeCidrCollectionRequest = {
        "id": id,
        "changes": changes,
    }
    if collection_version is not None:
        input_["collection_version"] = collection_version

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