Skip to content

request_environment_info async

request_environment_info(
    info_type: EnvironmentInfoType,
    *,
    config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
    environment_id: Optional[EnvironmentId] = None,
    environment_name: Optional[EnvironmentName] = None,
) -> None

Initiates a request to compile the specified type of information of the deployed environment.

Setting the InfoType to tail compiles the last lines from the application server log files of every Amazon EC2 instance in your environment.

Setting the InfoType to bundle compresses the application server log files for every Amazon EC2 instance into a .zip file. Legacy and .NET containers do not support bundle logs.

Setting the InfoType to analyze collects recent events, instance health, and logs from your environment and sends them to Amazon Bedrock in your account to generate diagnostic insights and recommended next steps.

Use RetrieveEnvironmentInfo to obtain the set of logs.

Related Topics

Parameters:

  • environment_id (Optional[EnvironmentId], default: None ) –

    The ID of the environment of the requested data.

    If no such environment is found, RequestEnvironmentInfo returns an InvalidParameterValue error.

    Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, Elastic Beanstalk returns MissingRequiredParameter error.

  • environment_name (Optional[EnvironmentName], default: None ) –

    The name of the environment of the requested data.

    If no such environment is found, RequestEnvironmentInfo returns an InvalidParameterValue error.

    Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, Elastic Beanstalk returns MissingRequiredParameter error.

  • info_type (EnvironmentInfoType) –

    The type of information to request.

Raises:

Examples:

To request tailed logs The following operation requests logs from an environment named my-env:

>>> await client.request_environment_info(environment_name='my-env', info_type='tail')
Source code in docs_src/capo_elastic_beanstalk/_services/async_elastic_beanstalk.py
async def request_environment_info(
    self,
    info_type: "capo_elastic_beanstalk.types.environment_info_type.EnvironmentInfoType",
    *,
    config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
    environment_id: Optional[
        "capo_elastic_beanstalk.types.environment_id.EnvironmentId"
    ] = None,
    environment_name: Optional[
        "capo_elastic_beanstalk.types.environment_name.EnvironmentName"
    ] = None,
) -> None:
    """<p>Initiates a request to compile the specified type of information of the deployed environment.</p> <p> Setting the <code>InfoType</code> to <code>tail</code> compiles the last lines from the application server log files of every Amazon EC2 instance in your environment. </p> <p> Setting the <code>InfoType</code> to <code>bundle</code> compresses the application server log files for every Amazon EC2 instance into a <code>.zip</code> file. Legacy and .NET containers do not support bundle logs. </p> <p> Setting the <code>InfoType</code> to <code>analyze</code> collects recent events, instance health, and logs from your environment and sends them to Amazon Bedrock in your account to generate diagnostic insights and recommended next steps. </p> <p> Use <a>RetrieveEnvironmentInfo</a> to obtain the set of logs. </p> <p>Related Topics</p> <ul> <li> <p> <a>RetrieveEnvironmentInfo</a> </p> </li> </ul>

    Args:
        environment_id: <p>The ID of the environment of the requested data.</p> <p>If no such environment is found, <code>RequestEnvironmentInfo</code> returns an <code>InvalidParameterValue</code> error. </p> <p>Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, Elastic Beanstalk returns <code>MissingRequiredParameter</code> error. </p>
        environment_name: <p>The name of the environment of the requested data.</p> <p>If no such environment is found, <code>RequestEnvironmentInfo</code> returns an <code>InvalidParameterValue</code> error. </p> <p>Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, Elastic Beanstalk returns <code>MissingRequiredParameter</code> error. </p>
        info_type: <p>The type of information to request.</p>

    Raises:
        capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To request tailed logs
        The following operation requests logs from an environment named my-env:

        >>> await client.request_environment_info(environment_name='my-env', info_type='tail')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elastic_beanstalk.types.request_environment_info_message.RequestEnvironmentInfoMessage]",
    ) -> AsyncOperationResponse[None]:
        import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.request_environment_info

        (
            output,
            http_response,
        ) = await capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.request_environment_info.async_request_environment_info(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RequestEnvironmentInfo")
    )
    input_: capo_elastic_beanstalk.types.request_environment_info_message.RequestEnvironmentInfoMessage = {
        "info_type": info_type
    }
    if environment_id is not None:
        input_["environment_id"] = environment_id
    if environment_name is not None:
        input_["environment_name"] = environment_name

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