Skip to content

post_agent_profile async

post_agent_profile(
    profiling_group_name: ProfilingGroupName,
    agent_profile: AgentProfile,
    content_type: str,
    *,
    config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
    profile_token: Optional[ClientToken] = None,
) -> PostAgentProfileResponse

Submits profiling data to an aggregated profile of a profiling group. To get an aggregated profile that is created with this profiling data, use GetProfile .

Parameters:

  • profiling_group_name (ProfilingGroupName) –

    The name of the profiling group with the aggregated profile that receives the submitted profiling data.

  • agent_profile (AgentProfile) –

    The submitted profiling data.

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

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

  • content_type (str) –

    The format of the submitted profiling data. The format maps to the Accept and Content-Type headers of the HTTP request. You can specify one of the following: or the default .

    • application/json — standard JSON format

    • application/x-amzn-ion — the Amazon Ion data format. For more information, see Amazon Ion.

Raises:

Source code in docs_src/capo_codeguruprofiler/_services/async_code_guru_profiler.py
async def post_agent_profile(
    self,
    profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
    agent_profile: "capo_codeguruprofiler.types.agent_profile.AgentProfile",
    content_type: str,
    *,
    config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
    profile_token: Optional[
        "capo_codeguruprofiler.types.client_token.ClientToken"
    ] = None,
) -> "capo_codeguruprofiler.types.post_agent_profile_response.PostAgentProfileResponse":
    """<p> Submits profiling data to an aggregated profile of a profiling group. To get an aggregated profile that is created with this profiling data, use <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_GetProfile.html"> <code>GetProfile</code> </a>. </p>

    Args:
        profiling_group_name: <p> The name of the profiling group with the aggregated profile that receives the submitted profiling data. </p>
        agent_profile: <p> The submitted profiling data. </p>
        profile_token: <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental submission of duplicate profiling data if there are failures and retries. </p>
        content_type: <p> The format of the submitted profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <ul> <li> <p> <code>application/json</code> — standard JSON format </p> </li> <li> <p> <code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href="http://amzn.github.io/ion-docs/">Amazon Ion</a>. </p> </li> </ul>

    Raises:
        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.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</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.post_agent_profile_request.PostAgentProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_codeguruprofiler.types.post_agent_profile_response.PostAgentProfileResponse"
    ]:
        import capo_codeguruprofiler._operations.code_guru_profiler.post_agent_profile

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PostAgentProfile")
    )
    input_: capo_codeguruprofiler.types.post_agent_profile_request.PostAgentProfileRequest = {
        "profiling_group_name": profiling_group_name,
        "agent_profile": agent_profile,
        "content_type": content_type,
    }
    if profile_token is None:
        profile_token = str(uuid.uuid4())
    input_["profile_token"] = profile_token

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