Skip to content

/AWS1/IF_DZN=>SEARCH()

Searches for assets in Amazon DataZone.

Search in Amazon DataZone is a powerful capability that enables users to discover and explore data assets, glossary terms, and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. Search can be scoped to specific types of resources (like assets, glossary terms, or data products) and can be filtered using various criteria such as creation date, owner, or status. The search functionality is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.

Many search commands in Amazon DataZone are paginated, including search and search-types. When the result set is large, Amazon DataZone returns a nextToken in the response. This token can be used to retrieve the next page of results.

Prerequisites:

  • The --domain-identifier must refer to an existing Amazon DataZone domain.

  • --search-scope must be one of: ASSET, GLOSSARY_TERM, DATA_PRODUCT, or GLOSSARY.

  • The user must have search permissions in the specified domain.

  • If using --filters, ensure that the JSON is well-formed and that each filter includes valid attribute and value keys.

  • For paginated results, be prepared to use --next-token to fetch additional pages.

Method Signature

IMPORTING

Required arguments:

iv_domainidentifier TYPE /AWS1/DZNDOMAINID /AWS1/DZNDOMAINID

The identifier of the Amazon DataZone domain.

iv_searchscope TYPE /AWS1/DZNINVENTORYSEARCHSCOPE /AWS1/DZNINVENTORYSEARCHSCOPE

The scope of the search.

Optional arguments:

iv_owningprojectidentifier TYPE /AWS1/DZNPROJECTID /AWS1/DZNPROJECTID

The identifier of the owning project specified for the search.

iv_maxresults TYPE /AWS1/DZNMAXRESULTS /AWS1/DZNMAXRESULTS

The maximum number of results to return in a single call to Search. When the number of results to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to Search to list the next set of results.

iv_nexttoken TYPE /AWS1/DZNPAGINATIONTOKEN /AWS1/DZNPAGINATIONTOKEN

When the number of results is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of results, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to Search to list the next set of results.

iv_searchtext TYPE /AWS1/DZNSEARCHTEXT /AWS1/DZNSEARCHTEXT

Specifies the text for which to search.

it_searchin TYPE /AWS1/CL_DZNSEARCHINITEM=>TT_SEARCHINLIST TT_SEARCHINLIST

The details of the search.

io_filters TYPE REF TO /AWS1/CL_DZNFILTERCLAUSE /AWS1/CL_DZNFILTERCLAUSE

Specifies the search filters.

io_sort TYPE REF TO /AWS1/CL_DZNSEARCHSORT /AWS1/CL_DZNSEARCHSORT

Specifies the way in which the search results are to be sorted.

it_additionalattributes TYPE /AWS1/CL_DZNSRCHOUTADDLATTRS_W=>TT_SEARCHOUTPUTADDLATTRIBUTES TT_SEARCHOUTPUTADDLATTRIBUTES

Specifies additional attributes for the Search action.

RETURNING

oo_output TYPE REF TO /aws1/cl_dznsearchoutput /AWS1/CL_DZNSEARCHOUTPUT

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

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->search(
  io_filters = new /aws1/cl_dznfilterclause(
    io_filter = new /aws1/cl_dznfilter(
      iv_attribute = |string|
      iv_value = |string|
    )
    it_and = VALUE /aws1/cl_dznfilterclause=>tt_filterlist(
      (
        new /aws1/cl_dznfilterclause(
          io_filter = new /aws1/cl_dznfilter(
            iv_attribute = |string|
            iv_value = |string|
          )
          it_or = VALUE /aws1/cl_dznfilterclause=>tt_filterlist(
          )
        )
      )
    )
    it_or = VALUE /aws1/cl_dznfilterclause=>tt_filterlist(
      (
        new /aws1/cl_dznfilterclause(
          io_filter = new /aws1/cl_dznfilter(
            iv_attribute = |string|
            iv_value = |string|
          )
          it_and = VALUE /aws1/cl_dznfilterclause=>tt_filterlist(
          )
        )
      )
    )
  )
  io_sort = new /aws1/cl_dznsearchsort(
    iv_attribute = |string|
    iv_order = |string|
  )
  it_additionalattributes = VALUE /aws1/cl_dznsrchoutaddlattrs_w=>tt_searchoutputaddlattributes(
    ( new /aws1/cl_dznsrchoutaddlattrs_w( |string| ) )
  )
  it_searchin = VALUE /aws1/cl_dznsearchinitem=>tt_searchinlist(
    ( new /aws1/cl_dznsearchinitem( |string| ) )
  )
  iv_domainidentifier = |string|
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_owningprojectidentifier = |string|
  iv_searchscope = |string|
  iv_searchtext = |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_items( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lo_glossaryitem = lo_row_1->get_glossaryitem( ).
      IF lo_glossaryitem IS NOT INITIAL.
        lv_domainid = lo_glossaryitem->get_domainid( ).
        lv_glossaryid = lo_glossaryitem->get_id( ).
        lv_glossaryname = lo_glossaryitem->get_name( ).
        lv_projectid = lo_glossaryitem->get_owningprojectid( ).
        lv_glossarydescription = lo_glossaryitem->get_description( ).
        lv_glossarystatus = lo_glossaryitem->get_status( ).
        LOOP AT lo_glossaryitem->get_usagerestrictions( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_glossaryusagerestrictio = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_createdat = lo_glossaryitem->get_createdat( ).
        lv_createdby = lo_glossaryitem->get_createdby( ).
        lv_updatedat = lo_glossaryitem->get_updatedat( ).
        lv_updatedby = lo_glossaryitem->get_updatedby( ).
        lo_glossaryitemadditionala = lo_glossaryitem->get_additionalattributes( ).
        IF lo_glossaryitemadditionala IS NOT INITIAL.
          LOOP AT lo_glossaryitemadditionala->get_matchrationale( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              LOOP AT lo_row_5->get_textmatches( ) into lo_row_6.
                lo_row_7 = lo_row_6.
                IF lo_row_7 IS NOT INITIAL.
                  lv_attribute = lo_row_7->get_attribute( ).
                  lv_string = lo_row_7->get_text( ).
                  LOOP AT lo_row_7->get_matchoffsets( ) into lo_row_8.
                    lo_row_9 = lo_row_8.
                    IF lo_row_9 IS NOT INITIAL.
                      lv_integer = lo_row_9->get_startoffset( ).
                      lv_integer = lo_row_9->get_endoffset( ).
                    ENDIF.
                  ENDLOOP.
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
      lo_glossarytermitem = lo_row_1->get_glossarytermitem( ).
      IF lo_glossarytermitem IS NOT INITIAL.
        lv_domainid = lo_glossarytermitem->get_domainid( ).
        lv_glossaryid = lo_glossarytermitem->get_glossaryid( ).
        lv_glossarytermid = lo_glossarytermitem->get_id( ).
        lv_glossarytermname = lo_glossarytermitem->get_name( ).
        lv_shortdescription = lo_glossarytermitem->get_shortdescription( ).
        LOOP AT lo_glossarytermitem->get_usagerestrictions( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_glossaryusagerestrictio = lo_row_3->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_longdescription = lo_glossarytermitem->get_longdescription( ).
        lo_termrelations = lo_glossarytermitem->get_termrelations( ).
        IF lo_termrelations IS NOT INITIAL.
          LOOP AT lo_termrelations->get_isa( ) into lo_row_10.
            lo_row_11 = lo_row_10.
            IF lo_row_11 IS NOT INITIAL.
              lv_glossarytermid = lo_row_11->get_value( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_termrelations->get_classifies( ) into lo_row_10.
            lo_row_11 = lo_row_10.
            IF lo_row_11 IS NOT INITIAL.
              lv_glossarytermid = lo_row_11->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
        lv_glossarytermstatus = lo_glossarytermitem->get_status( ).
        lv_createdat = lo_glossarytermitem->get_createdat( ).
        lv_createdby = lo_glossarytermitem->get_createdby( ).
        lv_updatedat = lo_glossarytermitem->get_updatedat( ).
        lv_updatedby = lo_glossarytermitem->get_updatedby( ).
        lo_glossarytermitemadditio = lo_glossarytermitem->get_additionalattributes( ).
        IF lo_glossarytermitemadditio IS NOT INITIAL.
          LOOP AT lo_glossarytermitemadditio->get_matchrationale( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              LOOP AT lo_row_5->get_textmatches( ) into lo_row_6.
                lo_row_7 = lo_row_6.
                IF lo_row_7 IS NOT INITIAL.
                  lv_attribute = lo_row_7->get_attribute( ).
                  lv_string = lo_row_7->get_text( ).
                  LOOP AT lo_row_7->get_matchoffsets( ) into lo_row_8.
                    lo_row_9 = lo_row_8.
                    IF lo_row_9 IS NOT INITIAL.
                      lv_integer = lo_row_9->get_startoffset( ).
                      lv_integer = lo_row_9->get_endoffset( ).
                    ENDIF.
                  ENDLOOP.
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
      lo_assetitem = lo_row_1->get_assetitem( ).
      IF lo_assetitem IS NOT INITIAL.
        lv_domainid = lo_assetitem->get_domainid( ).
        lv_assetidentifier = lo_assetitem->get_identifier( ).
        lv_assetname = lo_assetitem->get_name( ).
        lv_assettypeidentifier = lo_assetitem->get_typeidentifier( ).
        lv_revision = lo_assetitem->get_typerevision( ).
        lv_externalidentifier = lo_assetitem->get_externalidentifier( ).
        lv_description = lo_assetitem->get_description( ).
        lv_createdat = lo_assetitem->get_createdat( ).
        lv_createdby = lo_assetitem->get_createdby( ).
        lv_createdat = lo_assetitem->get_firstrevisioncreatedat( ).
        lv_createdby = lo_assetitem->get_firstrevisioncreatedby( ).
        LOOP AT lo_assetitem->get_glossaryterms( ) into lo_row_10.
          lo_row_11 = lo_row_10.
          IF lo_row_11 IS NOT INITIAL.
            lv_glossarytermid = lo_row_11->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_projectid = lo_assetitem->get_owningprojectid( ).
        lo_assetitemadditionalattr = lo_assetitem->get_additionalattributes( ).
        IF lo_assetitemadditionalattr IS NOT INITIAL.
          LOOP AT lo_assetitemadditionalattr->get_formsoutput( ) into lo_row_12.
            lo_row_13 = lo_row_12.
            IF lo_row_13 IS NOT INITIAL.
              lv_formname = lo_row_13->get_formname( ).
              lv_formtypename = lo_row_13->get_typename( ).
              lv_revision = lo_row_13->get_typerevision( ).
              lv_string = lo_row_13->get_content( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_assetitemadditionalattr->get_readonlyformsoutput( ) into lo_row_12.
            lo_row_13 = lo_row_12.
            IF lo_row_13 IS NOT INITIAL.
              lv_formname = lo_row_13->get_formname( ).
              lv_formtypename = lo_row_13->get_typename( ).
              lv_revision = lo_row_13->get_typerevision( ).
              lv_string = lo_row_13->get_content( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_assetitemadditionalattr->get_latsttimeseriesdataptf01( ) into lo_row_14.
            lo_row_15 = lo_row_14.
            IF lo_row_15 IS NOT INITIAL.
              lv_timeseriesformname = lo_row_15->get_formname( ).
              lv_formtypeidentifier = lo_row_15->get_typeidentifier( ).
              lv_revision = lo_row_15->get_typerevision( ).
              lv_timestamp = lo_row_15->get_timestamp( ).
              lv_string = lo_row_15->get_contentsummary( ).
              lv_datapointidentifier = lo_row_15->get_id( ).
            ENDIF.
          ENDLOOP.
          LOOP AT lo_assetitemadditionalattr->get_matchrationale( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              LOOP AT lo_row_5->get_textmatches( ) into lo_row_6.
                lo_row_7 = lo_row_6.
                IF lo_row_7 IS NOT INITIAL.
                  lv_attribute = lo_row_7->get_attribute( ).
                  lv_string = lo_row_7->get_text( ).
                  LOOP AT lo_row_7->get_matchoffsets( ) into lo_row_8.
                    lo_row_9 = lo_row_8.
                    IF lo_row_9 IS NOT INITIAL.
                      lv_integer = lo_row_9->get_startoffset( ).
                      lv_integer = lo_row_9->get_endoffset( ).
                    ENDIF.
                  ENDLOOP.
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
        ENDIF.
        LOOP AT lo_assetitem->get_governedglossaryterms( ) into lo_row_16.
          lo_row_17 = lo_row_16.
          IF lo_row_17 IS NOT INITIAL.
            lv_glossarytermid = lo_row_17->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
      lo_dataproductresultitem = lo_row_1->get_dataproductitem( ).
      IF lo_dataproductresultitem IS NOT INITIAL.
        lv_domainid = lo_dataproductresultitem->get_domainid( ).
        lv_dataproductid = lo_dataproductresultitem->get_id( ).
        lv_dataproductname = lo_dataproductresultitem->get_name( ).
        lv_projectid = lo_dataproductresultitem->get_owningprojectid( ).
        lv_dataproductdescription = lo_dataproductresultitem->get_description( ).
        LOOP AT lo_dataproductresultitem->get_glossaryterms( ) into lo_row_10.
          lo_row_11 = lo_row_10.
          IF lo_row_11 IS NOT INITIAL.
            lv_glossarytermid = lo_row_11->get_value( ).
          ENDIF.
        ENDLOOP.
        lv_createdat = lo_dataproductresultitem->get_createdat( ).
        lv_createdby = lo_dataproductresultitem->get_createdby( ).
        lv_createdat = lo_dataproductresultitem->get_firstrevisioncreatedat( ).
        lv_createdby = lo_dataproductresultitem->get_firstrevisioncreatedby( ).
        lo_dataproductitemaddition = lo_dataproductresultitem->get_additionalattributes( ).
        IF lo_dataproductitemaddition IS NOT INITIAL.
          LOOP AT lo_dataproductitemaddition->get_matchrationale( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              LOOP AT lo_row_5->get_textmatches( ) into lo_row_6.
                lo_row_7 = lo_row_6.
                IF lo_row_7 IS NOT INITIAL.
                  lv_attribute = lo_row_7->get_attribute( ).
                  lv_string = lo_row_7->get_text( ).
                  LOOP AT lo_row_7->get_matchoffsets( ) into lo_row_8.
                    lo_row_9 = lo_row_8.
                    IF lo_row_9 IS NOT INITIAL.
                      lv_integer = lo_row_9->get_startoffset( ).
                      lv_integer = lo_row_9->get_endoffset( ).
                    ENDIF.
                  ENDLOOP.
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
  lv_paginationtoken = lo_result->get_nexttoken( ).
  lv_integer = lo_result->get_totalmatchcount( ).
ENDIF.