Skip to content

put_default_application_setting async

put_default_application_setting(
    application_arn: ARN,
    set_as_default: Boolean,
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
) -> PutDefaultApplicationSettingResponse

Sets the default application to the application with the specified ARN.

To remove the default application, use the GetDefaultApplicationSetting operation to get the current default and then call the PutDefaultApplicationSetting with the current applications ARN and the setAsDefault parameter set to false.

Parameters:

  • set_as_default (Boolean) –

    Set to true to set the specified ARN as the default application. Set to false to clear the default application.

Raises:

Source code in docs_src/capo_opensearch/_services/async_open_search.py
async def put_default_application_setting(
    self,
    application_arn: "capo_opensearch.types.arn.ARN",
    set_as_default: "capo_opensearch.types.boolean.Boolean",
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
) -> "capo_opensearch.types.put_default_application_setting_response.PutDefaultApplicationSettingResponse":
    """<p>Sets the default application to the application with the specified ARN.</p> <p> To remove the default application, use the <code>GetDefaultApplicationSetting</code> operation to get the current default and then call the <code>PutDefaultApplicationSetting</code> with the current applications ARN and the <code>setAsDefault</code> parameter set to <code>false</code>.</p>

    Args:
        set_as_default: <p>Set to true to set the specified ARN as the default application. Set to false to clear the default application.</p>

    Raises:
        capo_opensearch.errors.access_denied_exception.AccessDeniedException: <p>An error occurred because you don't have permissions to access the resource.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_opensearch.types.put_default_application_setting_request.PutDefaultApplicationSettingRequest]",
    ) -> AsyncOperationResponse[
        "capo_opensearch.types.put_default_application_setting_response.PutDefaultApplicationSettingResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.put_default_application_setting

        (
            output,
            http_response,
        ) = await capo_opensearch._operations.amazon_open_search_service.put_default_application_setting.async_put_default_application_setting(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutDefaultApplicationSetting")
    )
    input_: capo_opensearch.types.put_default_application_setting_request.PutDefaultApplicationSettingRequest = {
        "application_arn": application_arn,
        "set_as_default": set_as_default,
    }

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