Skip to content

delete_cache_parameter_group async

delete_cache_parameter_group(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    cache_parameter_group_name: Optional[String] = None,
) -> None

Deletes the specified cache parameter group. You cannot delete a cache parameter group if it is associated with any cache clusters. You cannot delete the default cache parameter groups in your account.

Parameters:

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

    The name of the cache parameter group to delete.

    The specified cache security group must not be associated with any clusters.

Raises:

Examples:

DeleteCacheParameterGroup Deletes the Amazon ElastiCache parameter group custom-mem1-4.

>>> await client.delete_cache_parameter_group(cache_parameter_group_name='custom-mem1-4')
Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def delete_cache_parameter_group(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    cache_parameter_group_name: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
) -> None:
    """<p>Deletes the specified cache parameter group. You cannot delete a cache parameter group if it is associated with any cache clusters. You cannot delete the default cache parameter groups in your account.</p>

    Args:
        cache_parameter_group_name: <p>The name of the cache parameter group to delete.</p> <note> <p>The specified cache security group must not be associated with any clusters.</p> </note>

    Raises:
        capo_elasticache.errors.cache_parameter_group_not_found_fault.CacheParameterGroupNotFoundFault: <p>The requested cache parameter group name does not refer to an existing cache parameter group.</p>
        capo_elasticache.errors.invalid_cache_parameter_group_state_fault.InvalidCacheParameterGroupStateFault: <p>The current state of the cache parameter group does not allow the requested operation to occur.</p>
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        DeleteCacheParameterGroup
        Deletes the Amazon ElastiCache parameter group custom-mem1-4.

        >>> await client.delete_cache_parameter_group(cache_parameter_group_name='custom-mem1-4')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.delete_cache_parameter_group_message.DeleteCacheParameterGroupMessage]",
    ) -> AsyncOperationResponse[None]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.delete_cache_parameter_group

        (
            output,
            http_response,
        ) = await capo_elasticache._operations.amazon_elasti_cache_v9.delete_cache_parameter_group.async_delete_cache_parameter_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteCacheParameterGroup")
    )
    input_: capo_elasticache.types.delete_cache_parameter_group_message.DeleteCacheParameterGroupMessage = {}
    if cache_parameter_group_name is not None:
        input_["cache_parameter_group_name"] = cache_parameter_group_name

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