Skip to content

update_application async

update_application(
    resource_group_name: ResourceGroupName,
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
    ops_center_enabled: Optional[OpsCenterEnabled] = None,
    cwe_monitor_enabled: Optional[CWEMonitorEnabled] = None,
    ops_item_sns_topic_arn: Optional[OpsItemSNSTopicArn] = None,
    sns_notification_arn: Optional[SNSNotificationArn] = None,
    remove_sns_topic: Optional[RemoveSNSTopic] = None,
    auto_config_enabled: Optional[AutoConfigEnabled] = None,
    attach_missing_permission: Optional[AttachMissingPermission] = None,
) -> UpdateApplicationResponse

Updates the application.

Parameters:

  • resource_group_name (ResourceGroupName) –

    The name of the resource group.

  • ops_center_enabled (Optional[OpsCenterEnabled], default: None ) –

    When set to true, creates opsItems for any problems detected on an application.

  • cwe_monitor_enabled (Optional[CWEMonitorEnabled], default: None ) –

    Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as instance terminated, failed deployment, and others.

  • ops_item_sns_topic_arn (Optional[OpsItemSNSTopicArn], default: None ) –

    The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.

  • sns_notification_arn (Optional[SNSNotificationArn], default: None ) –

    The SNS topic ARN. Allows you to receive SNS notifications for updates and issues with an application.

  • remove_sns_topic (Optional[RemoveSNSTopic], default: None ) –

    Disassociates the SNS topic from the opsItem created for detected problems.

  • auto_config_enabled (Optional[AutoConfigEnabled], default: None ) –

    Turns auto-configuration on or off.

  • attach_missing_permission (Optional[AttachMissingPermission], default: None ) –

    If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.

Raises:

Source code in docs_src/capo_application_insights/_services/async_application_insights.py
async def update_application(
    self,
    resource_group_name: "capo_application_insights.types.resource_group_name.ResourceGroupName",
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
    ops_center_enabled: Optional[
        "capo_application_insights.types.ops_center_enabled.OpsCenterEnabled"
    ] = None,
    cwe_monitor_enabled: Optional[
        "capo_application_insights.types.cwe_monitor_enabled.CWEMonitorEnabled"
    ] = None,
    ops_item_sns_topic_arn: Optional[
        "capo_application_insights.types.ops_item_sns_topic_arn.OpsItemSNSTopicArn"
    ] = None,
    sns_notification_arn: Optional[
        "capo_application_insights.types.sns_notification_arn.SNSNotificationArn"
    ] = None,
    remove_sns_topic: Optional[
        "capo_application_insights.types.remove_sns_topic.RemoveSNSTopic"
    ] = None,
    auto_config_enabled: Optional[
        "capo_application_insights.types.auto_config_enabled.AutoConfigEnabled"
    ] = None,
    attach_missing_permission: Optional[
        "capo_application_insights.types.attach_missing_permission.AttachMissingPermission"
    ] = None,
) -> "capo_application_insights.types.update_application_response.UpdateApplicationResponse":
    """<p>Updates the application.</p>

    Args:
        resource_group_name: <p>The name of the resource group.</p>
        ops_center_enabled: <p> When set to <code>true</code>, creates opsItems for any problems detected on an application. </p>
        cwe_monitor_enabled: <p> Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as <code>instance terminated</code>, <code>failed deployment</code>, and others. </p>
        ops_item_sns_topic_arn: <p> The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.</p>
        sns_notification_arn: <p> The SNS topic ARN. Allows you to receive SNS notifications for updates and issues with an application. </p>
        remove_sns_topic: <p> Disassociates the SNS topic from the opsItem created for detected problems.</p>
        auto_config_enabled: <p> Turns auto-configuration on or off. </p>
        attach_missing_permission: <p>If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.</p>

    Raises:
        capo_application_insights.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_application_insights.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource does not exist in the customer account.</p>
        capo_application_insights.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
        capo_application_insights.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_application_insights.types.update_application_request.UpdateApplicationRequest]",
    ) -> AsyncOperationResponse[
        "capo_application_insights.types.update_application_response.UpdateApplicationResponse"
    ]:
        import capo_application_insights._operations.ec2_windows_barley_service.update_application

        (
            output,
            http_response,
        ) = await capo_application_insights._operations.ec2_windows_barley_service.update_application.async_update_application(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateApplication")
    )
    input_: capo_application_insights.types.update_application_request.UpdateApplicationRequest = {
        "resource_group_name": resource_group_name
    }
    if ops_center_enabled is not None:
        input_["ops_center_enabled"] = ops_center_enabled
    if cwe_monitor_enabled is not None:
        input_["cwe_monitor_enabled"] = cwe_monitor_enabled
    if ops_item_sns_topic_arn is not None:
        input_["ops_item_sns_topic_arn"] = ops_item_sns_topic_arn
    if sns_notification_arn is not None:
        input_["sns_notification_arn"] = sns_notification_arn
    if remove_sns_topic is not None:
        input_["remove_sns_topic"] = remove_sns_topic
    if auto_config_enabled is not None:
        input_["auto_config_enabled"] = auto_config_enabled
    if attach_missing_permission is not None:
        input_["attach_missing_permission"] = attach_missing_permission

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