Skip to content

/AWS1/IF_EBN=>DESCRIBEENVIRONMENTHEALTH()

About DescribeEnvironmentHealth

Returns information about the overall health of the specified environment. The DescribeEnvironmentHealth operation is only available with Elastic Beanstalk Enhanced Health.

This action only returns information about environments that the calling principle has IAM permissions to access. For example, consider a case where a user only has permission to access one of three environments. When the user calls this action, the response will only include the one environment that the user has permission to access instead of all three environments. If the user doesn’t have access to any of the environments an empty result is returned.

The AWSElasticBeanstalkReadOnly managed policy allows operators to view information about resources related to Elastic Beanstalk environments. For more information, see Managing Elastic Beanstalk user policies in the Elastic Beanstalk Developer Guide. For detailed instructions to attach a policy to a user or group, see the section Controlling access with managed policies in the same topic.

Method Signature

METHODS /AWS1/IF_EBN~DESCRIBEENVIRONMENTHEALTH
  IMPORTING
    !IV_ENVIRONMENTNAME TYPE /AWS1/EBNENVIRONMENTNAME OPTIONAL
    !IV_ENVIRONMENTID TYPE /AWS1/EBNENVIRONMENTID OPTIONAL
    !IT_ATTRIBUTENAMES TYPE /AWS1/CL_EBNENVIRONMENTHEALT00=>TT_ENVIRONMENTHEALTHATTRIBUTES OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ebndscenvironmenthe01
  RAISING
    /AWS1/CX_EBNELASTICBEANSTALK00
    /AWS1/CX_EBNINVALIDREQUESTEX
    /AWS1/CX_EBNCLIENTEXC
    /AWS1/CX_EBNSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_environmentname TYPE /AWS1/EBNENVIRONMENTNAME /AWS1/EBNENVIRONMENTNAME

Specify the environment by name.

You must specify either this or an EnvironmentName, or both.

iv_environmentid TYPE /AWS1/EBNENVIRONMENTID /AWS1/EBNENVIRONMENTID

Specify the environment by ID.

You must specify either this or an EnvironmentName, or both.

it_attributenames TYPE /AWS1/CL_EBNENVIRONMENTHEALT00=>TT_ENVIRONMENTHEALTHATTRIBUTES TT_ENVIRONMENTHEALTHATTRIBUTES

Specify the response elements to return. To retrieve all attributes, set to All. If no attribute names are specified, returns the name of the environment.

RETURNING

oo_output TYPE REF TO /aws1/cl_ebndscenvironmenthe01 /AWS1/CL_EBNDSCENVIRONMENTHE01

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->describeenvironmenthealth(
  it_attributenames = VALUE /aws1/cl_ebnenvironmenthealt00=>tt_environmenthealthattributes(
    ( new /aws1/cl_ebnenvironmenthealt00( |string| ) )
  )
  iv_environmentid = |string|
  iv_environmentname = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_environmentname = lo_result->get_environmentname( ).
  lv_string = lo_result->get_healthstatus( ).
  lv_environmenthealth = lo_result->get_status( ).
  lv_string = lo_result->get_color( ).
  LOOP AT lo_result->get_causes( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_cause = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  lo_applicationmetrics = lo_result->get_applicationmetrics( ).
  IF lo_applicationmetrics IS NOT INITIAL.
    lv_nullableinteger = lo_applicationmetrics->get_duration( ).
    lv_requestcount = lo_applicationmetrics->get_requestcount( ).
    lo_statuscodes = lo_applicationmetrics->get_statuscodes( ).
    IF lo_statuscodes IS NOT INITIAL.
      lv_nullableinteger = lo_statuscodes->get_status2xx( ).
      lv_nullableinteger = lo_statuscodes->get_status3xx( ).
      lv_nullableinteger = lo_statuscodes->get_status4xx( ).
      lv_nullableinteger = lo_statuscodes->get_status5xx( ).
    ENDIF.
    lo_latency = lo_applicationmetrics->get_latency( ).
    IF lo_latency IS NOT INITIAL.
      lv_nullabledouble = lo_latency->get_p999( ).
      lv_nullabledouble = lo_latency->get_p99( ).
      lv_nullabledouble = lo_latency->get_p95( ).
      lv_nullabledouble = lo_latency->get_p90( ).
      lv_nullabledouble = lo_latency->get_p85( ).
      lv_nullabledouble = lo_latency->get_p75( ).
      lv_nullabledouble = lo_latency->get_p50( ).
      lv_nullabledouble = lo_latency->get_p10( ).
    ENDIF.
  ENDIF.
  lo_instancehealthsummary = lo_result->get_instanceshealth( ).
  IF lo_instancehealthsummary IS NOT INITIAL.
    lv_nullableinteger = lo_instancehealthsummary->get_nodata( ).
    lv_nullableinteger = lo_instancehealthsummary->get_unknown( ).
    lv_nullableinteger = lo_instancehealthsummary->get_pending( ).
    lv_nullableinteger = lo_instancehealthsummary->get_ok( ).
    lv_nullableinteger = lo_instancehealthsummary->get_info( ).
    lv_nullableinteger = lo_instancehealthsummary->get_warning( ).
    lv_nullableinteger = lo_instancehealthsummary->get_degraded( ).
    lv_nullableinteger = lo_instancehealthsummary->get_severe( ).
  ENDIF.
  lv_refreshedat = lo_result->get_refreshedat( ).
ENDIF.

To view environment health

The following operation retrieves overall health information for an environment named my-env:

DATA(lo_result) = lo_client->describeenvironmenthealth(
  it_attributenames = VALUE /aws1/cl_ebnenvironmenthealt00=>tt_environmenthealthattributes(
    ( new /aws1/cl_ebnenvironmenthealt00( |All| ) )
  )
  iv_environmentname = |my-env|
).