Skip to content

create_component async

create_component(
    resource_group_name: ResourceGroupName,
    component_name: CustomComponentName,
    resource_list: ResourceList,
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
) -> CreateComponentResponse

Creates a custom component by grouping similar standalone instances to monitor.

Parameters:

Raises:

Source code in docs_src/capo_application_insights/_services/async_application_insights.py
async def create_component(
    self,
    resource_group_name: "capo_application_insights.types.resource_group_name.ResourceGroupName",
    component_name: "capo_application_insights.types.custom_component_name.CustomComponentName",
    resource_list: "capo_application_insights.types.resource_list.ResourceList",
    *,
    config_overrides: Optional[AsyncApplicationInsightsClientConfig] = None,
) -> "capo_application_insights.types.create_component_response.CreateComponentResponse":
    """<p>Creates a custom component by grouping similar standalone instances to monitor.</p>

    Args:
        resource_group_name: <p>The name of the resource group.</p>
        component_name: <p>The name of the component.</p>
        resource_list: <p>The list of resource ARNs that belong to the component.</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_in_use_exception.ResourceInUseException: <p>The resource is already created or in use.</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.create_component_request.CreateComponentRequest]",
    ) -> AsyncOperationResponse[
        "capo_application_insights.types.create_component_response.CreateComponentResponse"
    ]:
        import capo_application_insights._operations.ec2_windows_barley_service.create_component

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateComponent")
    )
    input_: capo_application_insights.types.create_component_request.CreateComponentRequest = {
        "resource_group_name": resource_group_name,
        "component_name": component_name,
        "resource_list": resource_list,
    }

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