Skip to content

create_profiling_group async

create_profiling_group(
    profiling_group_name: ProfilingGroupName,
    client_token: ClientToken,
    *,
    config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
    compute_platform: Optional[ComputePlatform] = None,
    agent_orchestration_config: Optional[AgentOrchestrationConfig] = None,
    tags: Optional[TagsMap] = None,
) -> CreateProfilingGroupResponse

Creates a profiling group.

Parameters:

  • profiling_group_name (ProfilingGroupName) –

    The name of the profiling group to create.

  • compute_platform (Optional[ComputePlatform], default: None ) –

    The compute platform of the profiling group. Use AWSLambda if your application runs on AWS Lambda. Use Default if your application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. If not specified, Default is used.

  • client_token (ClientToken) –

    Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental creation of duplicate profiling groups if there are failures and retries.

  • agent_orchestration_config (Optional[AgentOrchestrationConfig], default: None ) –

    Specifies whether profiling is enabled or disabled for the created profiling group.

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

    A list of tags to add to the created profiling group.

Raises:

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

  • InternalServerException –

    The server encountered an internal error and is unable to complete the request.

  • ServiceQuotaExceededException –

    You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use Service Quotas to request a service quota increase.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The parameter is not valid.

  • UnknownServiceError –

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

Source code in docs_src/capo_codeguruprofiler/_services/async_code_guru_profiler.py
async def create_profiling_group(
    self,
    profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
    client_token: "capo_codeguruprofiler.types.client_token.ClientToken",
    *,
    config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
    compute_platform: Optional[
        "capo_codeguruprofiler.types.compute_platform.ComputePlatform"
    ] = None,
    agent_orchestration_config: Optional[
        "capo_codeguruprofiler.types.agent_orchestration_config.AgentOrchestrationConfig"
    ] = None,
    tags: Optional["capo_codeguruprofiler.types.tags_map.TagsMap"] = None,
) -> "capo_codeguruprofiler.types.create_profiling_group_response.CreateProfilingGroupResponse":
    """<p>Creates a profiling group.</p>

    Args:
        profiling_group_name: <p>The name of the profiling group to create.</p>
        compute_platform: <p> The compute platform of the profiling group. Use <code>AWSLambda</code> if your application runs on AWS Lambda. Use <code>Default</code> if your application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. If not specified, <code>Default</code> is used. </p>
        client_token: <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental creation of duplicate profiling groups if there are failures and retries. </p>
        agent_orchestration_config: <p> Specifies whether profiling is enabled or disabled for the created profiling group. </p>
        tags: <p> A list of tags to add to the created profiling group. </p>

    Raises:
        capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
        capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_codeguruprofiler.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html">Service Quotas</a> to request a service quota increase. </p>
        capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
        capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeguruprofiler.types.create_profiling_group_request.CreateProfilingGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguruprofiler.types.create_profiling_group_response.CreateProfilingGroupResponse"
    ]:
        import capo_codeguruprofiler._operations.code_guru_profiler.create_profiling_group

        (
            output,
            http_response,
        ) = await capo_codeguruprofiler._operations.code_guru_profiler.create_profiling_group.async_create_profiling_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateProfilingGroup")
    )
    input_: capo_codeguruprofiler.types.create_profiling_group_request.CreateProfilingGroupRequest = {
        "profiling_group_name": profiling_group_name,
        "client_token": client_token,
    }
    if compute_platform is not None:
        input_["compute_platform"] = compute_platform
    if agent_orchestration_config is not None:
        input_["agent_orchestration_config"] = agent_orchestration_config
    if tags is not None:
        input_["tags"] = tags

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