Skip to content

start_cache_revalidation

start_cache_revalidation(
    app_name: AppName,
    environment_name: EnvironmentName,
    deployment_id: DeploymentId,
    cache_tags: CacheTagList,
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    expiration_period_seconds: Optional[ExpirationPeriodSeconds] = None,
) -> StartCacheRevalidationOutput

Revalidates cached content for a deployment of an environment by cache tag.

Parameters:

  • app_name (AppName) –

    The name of the app.

  • environment_name (EnvironmentName) –

    The name of the environment.

  • deployment_id (DeploymentId) –

    The ID of the deployment.

  • cache_tags (CacheTagList) –

    The cache tags that identify the content to revalidate.

  • expiration_period_seconds (Optional[ExpirationPeriodSeconds], default: None ) –

    The period, in seconds, after which the revalidated content expires.

Raises:

Source code in docs_src/capo_amplifygen3/_services/amplify_gen3.py
def start_cache_revalidation(
    self,
    app_name: "capo_amplifygen3.types.app_name.AppName",
    environment_name: "capo_amplifygen3.types.environment_name.EnvironmentName",
    deployment_id: "capo_amplifygen3.types.deployment_id.DeploymentId",
    cache_tags: "capo_amplifygen3.types.cache_tag_list.CacheTagList",
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    expiration_period_seconds: Optional[
        "capo_amplifygen3.types.expiration_period_seconds.ExpirationPeriodSeconds"
    ] = None,
) -> "capo_amplifygen3.types.start_cache_revalidation_output.StartCacheRevalidationOutput":
    """<p>Revalidates cached content for a deployment of an environment by cache tag.</p>

    Args:
        app_name: <p>The name of the app.</p>
        environment_name: <p>The name of the environment.</p>
        deployment_id: <p>The ID of the deployment.</p>
        cache_tags: <p>The cache tags that identify the content to revalidate.</p>
        expiration_period_seconds: <p>The period, in seconds, after which the revalidated content expires.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifygen3.types.start_cache_revalidation_input.StartCacheRevalidationInput]",
    ) -> OperationResponse[
        "capo_amplifygen3.types.start_cache_revalidation_output.StartCacheRevalidationOutput"
    ]:
        import capo_amplifygen3._operations.omega.start_cache_revalidation

        output, http_response = (
            capo_amplifygen3._operations.omega.start_cache_revalidation.start_cache_revalidation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCacheRevalidation")
    )
    input_: capo_amplifygen3.types.start_cache_revalidation_input.StartCacheRevalidationInput = {
        "app_name": app_name,
        "environment_name": environment_name,
        "deployment_id": deployment_id,
        "cache_tags": cache_tags,
    }
    if expiration_period_seconds is not None:
        input_["expiration_period_seconds"] = expiration_period_seconds

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