Skip to content

modify_application_status_check async

modify_application_status_check(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    application_status_check_id: Optional[ApplicationStatusCheckId] = None,
    aggregation: Optional[AggregationStatusEnum] = None,
    health_check_paths: Optional[HealthCheckPathRequestList] = None,
    protocol: Optional[NetworkProtocolEnum] = None,
    port: Optional[PortNumber] = None,
    path: Optional[String] = None,
    device_index: Optional[Integer] = None,
    ip_version: Optional[IpVersionEnum] = None,
    ip_scope: Optional[IpScopeEnum] = None,
    interval: Optional[Integer] = None,
    timeout: Optional[Integer] = None,
    failure_threshold: Optional[Integer] = None,
    success_threshold: Optional[Integer] = None,
    status_code_matcher: Optional[String] = None,
    initialization_grace_period_seconds: Optional[
        InitializationGracePeriodSeconds
    ] = None,
    client_token: Optional[String] = None,
    dry_run: Optional[Boolean] = None,
) -> ModifyApplicationStatusCheckResult

Modifies an existing application status check. You can update the protocol, port, path, thresholds, and other configuration settings. The following rules apply:

  • The application status check must exist and belong to your account.

  • Changes take effect on the next health check interval.

Parameters:

  • application_status_check_id (Optional[ApplicationStatusCheckId], default: None ) –

    The ID of the application status check to modify.

  • aggregation (Optional[AggregationStatusEnum], default: None ) –

    The aggregation setting for the application status check. When set to included, the result of this check contributes to the instance-level application status reported by DescribeApplicationStatus. When set to excluded, the check runs independently and does not affect the instance-level status. Valid values: included | excluded.

  • health_check_paths (Optional[HealthCheckPathRequestList], default: None ) –

    The health check paths to use for the application status check.

  • protocol (Optional[NetworkProtocolEnum], default: None ) –

    The protocol to use for the health check. Valid values: http | https.

  • port (Optional[PortNumber], default: None ) –

    The port to use for the health check. Valid values: 1 to 65535.

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

    The URL path to use for the health check HTTP request (for example, /health or /status).

  • device_index (Optional[Integer], default: None ) –

    The index of the network device to use for the health check. The value must be greater than or equal to 0.

  • ip_version (Optional[IpVersionEnum], default: None ) –

    The IP version to use for the health check. Valid values: ipv4 and ipv6.

  • ip_scope (Optional[IpScopeEnum], default: None ) –

    The IP scope to use for the health check. Valid value: private.

  • interval (Optional[Integer], default: None ) –

    The interval, in seconds, between health checks. Valid value: 60.

  • timeout (Optional[Integer], default: None ) –

    The amount of time, in seconds, to wait for a health check response before considering it failed. Valid values: 1 to 30. The value must be less than Interval.

  • failure_threshold (Optional[Integer], default: None ) –

    The number of consecutive failed health checks before the application status is considered impaired. The value must be greater than 0.

  • success_threshold (Optional[Integer], default: None ) –

    The number of consecutive successful health checks before the application status is considered healthy. The value must be greater than 0.

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

    The HTTP status codes that indicate a successful health check response. Specify a comma-separated list of individual status codes or ranges, for example, 200,202,300-399. For a range, the first value must be less than the second value. Maximum length: 64 characters.

  • initialization_grace_period_seconds (Optional[InitializationGracePeriodSeconds], default: None ) –

    The number of seconds to wait before starting health checks after an instance is launched. Valid values: 1 to 600.

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

    A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same token, the service ignores the request but does not return an error. For more information, see Ensuring idempotency.

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

    Checks whether you have the required permissions for the operation, 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.

Raises:

Examples:

To modify an application status check This example modifies the port and path of an existing application status check.

>>> await client.modify_application_status_check(application_status_check_id='asc-0123456789abcdef0', port=8080, path='/healthv2')
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_application_status_check(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    application_status_check_id: Optional[
        "capo_ec2.types.application_status_check_id.ApplicationStatusCheckId"
    ] = None,
    aggregation: Optional[
        "capo_ec2.types.aggregation_status_enum.AggregationStatusEnum"
    ] = None,
    health_check_paths: Optional[
        "capo_ec2.types.health_check_path_request_list.HealthCheckPathRequestList"
    ] = None,
    protocol: Optional[
        "capo_ec2.types.network_protocol_enum.NetworkProtocolEnum"
    ] = None,
    port: Optional["capo_ec2.types.port_number.PortNumber"] = None,
    path: Optional["capo_ec2.types.string.String"] = None,
    device_index: Optional["capo_ec2.types.integer.Integer"] = None,
    ip_version: Optional["capo_ec2.types.ip_version_enum.IpVersionEnum"] = None,
    ip_scope: Optional["capo_ec2.types.ip_scope_enum.IpScopeEnum"] = None,
    interval: Optional["capo_ec2.types.integer.Integer"] = None,
    timeout: Optional["capo_ec2.types.integer.Integer"] = None,
    failure_threshold: Optional["capo_ec2.types.integer.Integer"] = None,
    success_threshold: Optional["capo_ec2.types.integer.Integer"] = None,
    status_code_matcher: Optional["capo_ec2.types.string.String"] = None,
    initialization_grace_period_seconds: Optional[
        "capo_ec2.types.initialization_grace_period_seconds.InitializationGracePeriodSeconds"
    ] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.modify_application_status_check_result.ModifyApplicationStatusCheckResult":
    """<p>Modifies an existing application status check. You can update the protocol, port, path, thresholds, and other configuration settings. The following rules apply:</p> <ul> <li> <p>The application status check must exist and belong to your account.</p> </li> <li> <p>Changes take effect on the next health check interval.</p> </li> </ul>

    Args:
        application_status_check_id: <p>The ID of the application status check to modify.</p>
        aggregation: <p>The aggregation setting for the application status check. When set to <code>included</code>, the result of this check contributes to the instance-level application status reported by <code>DescribeApplicationStatus</code>. When set to <code>excluded</code>, the check runs independently and does not affect the instance-level status. Valid values: <code>included</code> | <code>excluded</code>.</p>
        health_check_paths: <p>The health check paths to use for the application status check.</p>
        protocol: <p>The protocol to use for the health check. Valid values: <code>http</code> | <code>https</code>.</p>
        port: <p>The port to use for the health check. Valid values: 1 to 65535.</p>
        path: <p>The URL path to use for the health check HTTP request (for example, <code>/health</code> or <code>/status</code>).</p>
        device_index: <p>The index of the network device to use for the health check. The value must be greater than or equal to 0.</p>
        ip_version: <p>The IP version to use for the health check. Valid values: <code>ipv4</code> and <code>ipv6</code>.</p>
        ip_scope: <p>The IP scope to use for the health check. Valid value: <code>private</code>.</p>
        interval: <p>The interval, in seconds, between health checks. Valid value: 60.</p>
        timeout: <p>The amount of time, in seconds, to wait for a health check response before considering it failed. Valid values: 1 to 30. The value must be less than <code>Interval</code>.</p>
        failure_threshold: <p>The number of consecutive failed health checks before the application status is considered impaired. The value must be greater than 0.</p>
        success_threshold: <p>The number of consecutive successful health checks before the application status is considered healthy. The value must be greater than 0.</p>
        status_code_matcher: <p>The HTTP status codes that indicate a successful health check response. Specify a comma-separated list of individual status codes or ranges, for example, <code>200,202,300-399</code>. For a range, the first value must be less than the second value. Maximum length: 64 characters.</p>
        initialization_grace_period_seconds: <p>The number of seconds to wait before starting health checks after an instance is launched. Valid values: 1 to 600.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same token, the service ignores the request but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
        dry_run: <p>Checks whether you have the required permissions for the operation, 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>

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

    Examples:
        To modify an application status check
        This example modifies the port and path of an existing application status check.

        >>> await client.modify_application_status_check(application_status_check_id='asc-0123456789abcdef0', port=8080, path='/healthv2')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.modify_application_status_check_request.ModifyApplicationStatusCheckRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_application_status_check_result.ModifyApplicationStatusCheckResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_application_status_check

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyApplicationStatusCheck")
    )
    input_: capo_ec2.types.modify_application_status_check_request.ModifyApplicationStatusCheckRequest = {}
    if application_status_check_id is not None:
        input_["application_status_check_id"] = application_status_check_id
    if aggregation is not None:
        input_["aggregation"] = aggregation
    if health_check_paths is not None:
        input_["health_check_paths"] = health_check_paths
    if protocol is not None:
        input_["protocol"] = protocol
    if port is not None:
        input_["port"] = port
    if path is not None:
        input_["path"] = path
    if device_index is not None:
        input_["device_index"] = device_index
    if ip_version is not None:
        input_["ip_version"] = ip_version
    if ip_scope is not None:
        input_["ip_scope"] = ip_scope
    if interval is not None:
        input_["interval"] = interval
    if timeout is not None:
        input_["timeout"] = timeout
    if failure_threshold is not None:
        input_["failure_threshold"] = failure_threshold
    if success_threshold is not None:
        input_["success_threshold"] = success_threshold
    if status_code_matcher is not None:
        input_["status_code_matcher"] = status_code_matcher
    if initialization_grace_period_seconds is not None:
        input_["initialization_grace_period_seconds"] = (
            initialization_grace_period_seconds
        )
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if dry_run is not None:
        input_["dry_run"] = dry_run

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