Skip to content

create_plugin async

create_plugin(
    application_id: ApplicationId,
    display_name: PluginName,
    type: PluginType,
    auth_configuration: PluginAuthConfiguration,
    *,
    config_overrides: Optional[AsyncQBusinessClientConfig] = None,
    server_url: Optional[Url] = None,
    custom_plugin_configuration: Optional[CustomPluginConfiguration] = None,
    tags: Optional[Tags] = None,
    client_token: Optional[ClientToken] = None,
) -> CreatePluginResponse

Creates an Amazon Q Business plugin.

Parameters:

  • application_id (ApplicationId) –

    The identifier of the application that will contain the plugin.

  • display_name (PluginName) –

    A the name for your plugin.

  • type (PluginType) –

    The type of plugin you want to create.

  • server_url (Optional[Url], default: None ) –

    The source URL used for plugin configuration.

  • custom_plugin_configuration (Optional[CustomPluginConfiguration], default: None ) –

    Contains configuration for a custom plugin.

  • tags (Optional[Tags], default: None ) –

    A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

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

    A token that you provide to identify the request to create your Amazon Q Business plugin.

Raises:

  • AccessDeniedException –

    You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.

  • ConflictException –

    You are trying to perform an action that conflicts with the current status of your resource. Fix any inconsistencies with your resources and try again.

  • InternalServerException –

    An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help.

  • ResourceNotFoundException –

    The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.

  • ServiceQuotaExceededException –

    You have exceeded the set limits for your Amazon Q Business service.

  • ThrottlingException –

    The request was denied due to throttling. Reduce the number of requests and try again.

  • ValidationException –

    The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_qbusiness/_services/async_q_business.py
async def create_plugin(
    self,
    application_id: "capo_qbusiness.types.application_id.ApplicationId",
    display_name: "capo_qbusiness.types.plugin_name.PluginName",
    type: "capo_qbusiness.types.plugin_type.PluginType",
    auth_configuration: "capo_qbusiness.types.plugin_auth_configuration.PluginAuthConfiguration",
    *,
    config_overrides: Optional[AsyncQBusinessClientConfig] = None,
    server_url: Optional["capo_qbusiness.types.url.Url"] = None,
    custom_plugin_configuration: Optional[
        "capo_qbusiness.types.custom_plugin_configuration.CustomPluginConfiguration"
    ] = None,
    tags: Optional["capo_qbusiness.types.tags.Tags"] = None,
    client_token: Optional["capo_qbusiness.types.client_token.ClientToken"] = None,
) -> "capo_qbusiness.types.create_plugin_response.CreatePluginResponse":
    """<p>Creates an Amazon Q Business plugin.</p>

    Args:
        application_id: <p>The identifier of the application that will contain the plugin.</p>
        display_name: <p>A the name for your plugin.</p>
        type: <p>The type of plugin you want to create.</p>
        server_url: <p>The source URL used for plugin configuration.</p>
        custom_plugin_configuration: <p>Contains configuration for a custom plugin.</p>
        tags: <p>A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
        client_token: <p>A token that you provide to identify the request to create your Amazon Q Business plugin.</p>

    Raises:
        capo_qbusiness.errors.access_denied_exception.AccessDeniedException: <p> You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.</p>
        capo_qbusiness.errors.conflict_exception.ConflictException: <p>You are trying to perform an action that conflicts with the current status of your resource. Fix any inconsistencies with your resources and try again.</p>
        capo_qbusiness.errors.internal_server_exception.InternalServerException: <p>An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact <a href="http://aws.amazon.com/contact-us/">Support</a> for help.</p>
        capo_qbusiness.errors.resource_not_found_exception.ResourceNotFoundException: <p>The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.</p>
        capo_qbusiness.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded the set limits for your Amazon Q Business service. </p>
        capo_qbusiness.errors.throttling_exception.ThrottlingException: <p>The request was denied due to throttling. Reduce the number of requests and try again.</p>
        capo_qbusiness.errors.validation_exception.ValidationException: <p>The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.</p>
        capo_qbusiness.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qbusiness.types.create_plugin_request.CreatePluginRequest]",
    ) -> AsyncOperationResponse[
        "capo_qbusiness.types.create_plugin_response.CreatePluginResponse"
    ]:
        import capo_qbusiness._operations.expert_q.create_plugin

        (
            output,
            http_response,
        ) = await capo_qbusiness._operations.expert_q.create_plugin.async_create_plugin(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_qbusiness.types.create_plugin_request.CreatePluginRequest",
    ) -> dict[str, Any]:
        import capo_qbusiness.types.create_plugin_request

        return capo_qbusiness.types.create_plugin_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreatePlugin", redact_input=_redact_input),
    )
    input_: capo_qbusiness.types.create_plugin_request.CreatePluginRequest = {
        "application_id": application_id,
        "display_name": display_name,
        "type": type,
        "auth_configuration": auth_configuration,
    }
    if server_url is not None:
        input_["server_url"] = server_url
    if custom_plugin_configuration is not None:
        input_["custom_plugin_configuration"] = custom_plugin_configuration
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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