Skip to content

/AWS1/IF_EBN=>DESCRIBEENVIRONMENTS()

About DescribeEnvironments

Returns descriptions for existing environments.

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 the DescribeEnvironments 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~DESCRIBEENVIRONMENTS
  IMPORTING
    !IV_APPLICATIONNAME TYPE /AWS1/EBNAPPLICATIONNAME OPTIONAL
    !IV_VERSIONLABEL TYPE /AWS1/EBNVERSIONLABEL OPTIONAL
    !IT_ENVIRONMENTIDS TYPE /AWS1/CL_EBNENVIRONMENTIDLST_W=>TT_ENVIRONMENTIDLIST OPTIONAL
    !IT_ENVIRONMENTNAMES TYPE /AWS1/CL_EBNENVIRONMENTNAMES00=>TT_ENVIRONMENTNAMESLIST OPTIONAL
    !IV_INCLUDEDELETED TYPE /AWS1/EBNINCLUDEDELETED OPTIONAL
    !IV_INCLUDEDDELETEDBACKTO TYPE /AWS1/EBNINCLUDEDELETEDBACKTO OPTIONAL
    !IV_MAXRECORDS TYPE /AWS1/EBNMAXRECORDS OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/EBNTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ebnenvironmentdscsmsg
  RAISING
    /AWS1/CX_EBNCLIENTEXC
    /AWS1/CX_EBNSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_applicationname TYPE /AWS1/EBNAPPLICATIONNAME /AWS1/EBNAPPLICATIONNAME

If specified, Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application.

iv_versionlabel TYPE /AWS1/EBNVERSIONLABEL /AWS1/EBNVERSIONLABEL

If specified, Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application version.

it_environmentids TYPE /AWS1/CL_EBNENVIRONMENTIDLST_W=>TT_ENVIRONMENTIDLIST TT_ENVIRONMENTIDLIST

If specified, Elastic Beanstalk restricts the returned descriptions to include only those that have the specified IDs.

it_environmentnames TYPE /AWS1/CL_EBNENVIRONMENTNAMES00=>TT_ENVIRONMENTNAMESLIST TT_ENVIRONMENTNAMESLIST

If specified, Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names.

iv_includedeleted TYPE /AWS1/EBNINCLUDEDELETED /AWS1/EBNINCLUDEDELETED

Indicates whether to include deleted environments:

true: Environments that have been deleted after IncludedDeletedBackTo are displayed.

false: Do not include deleted environments.

iv_includeddeletedbackto TYPE /AWS1/EBNINCLUDEDELETEDBACKTO /AWS1/EBNINCLUDEDELETEDBACKTO

If specified when IncludeDeleted is set to true, then environments deleted after this date are displayed.

iv_maxrecords TYPE /AWS1/EBNMAXRECORDS /AWS1/EBNMAXRECORDS

For a paginated request. Specify a maximum number of environments to include in each response.

If no MaxRecords is specified, all available environments are retrieved in a single response.

iv_nexttoken TYPE /AWS1/EBNTOKEN /AWS1/EBNTOKEN

For a paginated request. Specify a token from a previous response page to retrieve the next response page. All other parameter values must be identical to the ones specified in the initial request.

If no NextToken is specified, the first page is retrieved.

RETURNING

oo_output TYPE REF TO /aws1/cl_ebnenvironmentdscsmsg /AWS1/CL_EBNENVIRONMENTDSCSMSG

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->describeenvironments(
  it_environmentids = VALUE /aws1/cl_ebnenvironmentidlst_w=>tt_environmentidlist(
    ( new /aws1/cl_ebnenvironmentidlst_w( |string| ) )
  )
  it_environmentnames = VALUE /aws1/cl_ebnenvironmentnames00=>tt_environmentnameslist(
    ( new /aws1/cl_ebnenvironmentnames00( |string| ) )
  )
  iv_applicationname = |string|
  iv_includeddeletedbackto = '20150101000000.0000000'
  iv_includedeleted = ABAP_TRUE
  iv_maxrecords = 123
  iv_nexttoken = |string|
  iv_versionlabel = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_environments( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_environmentname = lo_row_1->get_environmentname( ).
      lv_environmentid = lo_row_1->get_environmentid( ).
      lv_applicationname = lo_row_1->get_applicationname( ).
      lv_versionlabel = lo_row_1->get_versionlabel( ).
      lv_solutionstackname = lo_row_1->get_solutionstackname( ).
      lv_platformarn = lo_row_1->get_platformarn( ).
      lv_configurationtemplatena = lo_row_1->get_templatename( ).
      lv_description = lo_row_1->get_description( ).
      lv_endpointurl = lo_row_1->get_endpointurl( ).
      lv_dnscname = lo_row_1->get_cname( ).
      lv_creationdate = lo_row_1->get_datecreated( ).
      lv_updatedate = lo_row_1->get_dateupdated( ).
      lv_environmentstatus = lo_row_1->get_status( ).
      lv_abortableoperationinpro = lo_row_1->get_abortableopinprogress( ).
      lv_environmenthealth = lo_row_1->get_health( ).
      lv_environmenthealthstatus = lo_row_1->get_healthstatus( ).
      lo_environmentresourcesdes = lo_row_1->get_resources( ).
      IF lo_environmentresourcesdes IS NOT INITIAL.
        lo_loadbalancerdescription = lo_environmentresourcesdes->get_loadbalancer( ).
        IF lo_loadbalancerdescription IS NOT INITIAL.
          lv_string = lo_loadbalancerdescription->get_loadbalancername( ).
          lv_string = lo_loadbalancerdescription->get_domain( ).
          LOOP AT lo_loadbalancerdescription->get_listeners( ) into lo_row_2.
            lo_row_3 = lo_row_2.
            IF lo_row_3 IS NOT INITIAL.
              lv_string = lo_row_3->get_protocol( ).
              lv_integer = lo_row_3->get_port( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
      lo_environmenttier = lo_row_1->get_tier( ).
      IF lo_environmenttier IS NOT INITIAL.
        lv_string = lo_environmenttier->get_name( ).
        lv_string = lo_environmenttier->get_type( ).
        lv_string = lo_environmenttier->get_version( ).
      ENDIF.
      LOOP AT lo_row_1->get_environmentlinks( ) into lo_row_4.
        lo_row_5 = lo_row_4.
        IF lo_row_5 IS NOT INITIAL.
          lv_string = lo_row_5->get_linkname( ).
          lv_string = lo_row_5->get_environmentname( ).
        ENDIF.
      ENDLOOP.
      lv_environmentarn = lo_row_1->get_environmentarn( ).
      lv_operationsrole = lo_row_1->get_operationsrole( ).
    ENDIF.
  ENDLOOP.
  lv_token = lo_result->get_nexttoken( ).
ENDIF.

To view information about an environment

The following operation retrieves information about an environment named my-env:

DATA(lo_result) = lo_client->describeenvironments(
  it_environmentnames = VALUE /aws1/cl_ebnenvironmentnames00=>tt_environmentnameslist(
    ( new /aws1/cl_ebnenvironmentnames00( |my-env| ) )
  )
).