Skip to content

get_change_token async

get_change_token(
    *, config_overrides: Optional[AsyncWAFRegionalClientConfig] = None
) -> GetChangeTokenResponse

This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.

For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

When you want to create, update, or delete AWS WAF objects, get a change token and include the change token in the create, update, or delete request. Change tokens ensure that your application doesn't submit conflicting requests to AWS WAF.

Each create, update, or delete request must use a unique change token. If your application submits a GetChangeToken request and then submits a second GetChangeToken request before submitting a create, update, or delete request, the second GetChangeToken request returns the same value as the first GetChangeToken request.

When you use a change token in a create, update, or delete request, the status of the change token changes to PENDING, which indicates that AWS WAF is propagating the change to all AWS WAF servers. Use GetChangeTokenStatus to determine the status of your change token.

Raises:

  • WAFInternalErrorException –

    The operation failed because of a system problem, even though the request was valid. Retry your request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To get a change token The following example returns a change token to use for a create, update or delete operation.

>>> await client.get_change_token()
Source code in docs_src/capo_waf_regional/_services/async_waf_regional.py
async def get_change_token(
    self, *, config_overrides: Optional[AsyncWAFRegionalClientConfig] = None
) -> "capo_waf_regional.types.get_change_token_response.GetChangeTokenResponse":
    """<note> <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p> <p> <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use. </p> </note> <p>When you want to create, update, or delete AWS WAF objects, get a change token and include the change token in the create, update, or delete request. Change tokens ensure that your application doesn't submit conflicting requests to AWS WAF.</p> <p>Each create, update, or delete request must use a unique change token. If your application submits a <code>GetChangeToken</code> request and then submits a second <code>GetChangeToken</code> request before submitting a create, update, or delete request, the second <code>GetChangeToken</code> request returns the same value as the first <code>GetChangeToken</code> request.</p> <p>When you use a change token in a create, update, or delete request, the status of the change token changes to <code>PENDING</code>, which indicates that AWS WAF is propagating the change to all AWS WAF servers. Use <code>GetChangeTokenStatus</code> to determine the status of your change token.</p>

    Raises:
        capo_waf_regional.errors.waf_internal_error_exception.WAFInternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
        capo_waf_regional.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To get a change token
        The following example returns a change token to use for a create, update or delete operation.

        >>> await client.get_change_token()
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_waf_regional.types.get_change_token_request.GetChangeTokenRequest]",
    ) -> AsyncOperationResponse[
        "capo_waf_regional.types.get_change_token_response.GetChangeTokenResponse"
    ]:
        import capo_waf_regional._operations.awswaf_regional_20161128.get_change_token

        (
            output,
            http_response,
        ) = await capo_waf_regional._operations.awswaf_regional_20161128.get_change_token.async_get_change_token(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetChangeToken")
    )
    input_: capo_waf_regional.types.get_change_token_request.GetChangeTokenRequest = {}

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