Skip to content

/AWS1/CL_PIP=>GETJOBDETAILS()

About GetJobDetails

Returns information about a job. Used for custom actions only.

When this API is called, CodePipeline returns temporary credentials for the S3 bucket used to store artifacts for the pipeline, if the action requires access to that S3 bucket for input or output artifacts. This API also returns any secret values defined for the action.

Method Signature

IMPORTING

Required arguments:

iv_jobid TYPE /AWS1/PIPJOBID /AWS1/PIPJOBID

The unique system-generated ID for the job.

RETURNING

oo_output TYPE REF TO /aws1/cl_pipgetjobdetsoutput /AWS1/CL_PIPGETJOBDETSOUTPUT

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->/aws1/if_pip~getjobdetails( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_jobdetails = lo_result->get_jobdetails( ).
  IF lo_jobdetails IS NOT INITIAL.
    lv_jobid = lo_jobdetails->get_id( ).
    lo_jobdata = lo_jobdetails->get_data( ).
    IF lo_jobdata IS NOT INITIAL.
      lo_actiontypeid = lo_jobdata->get_actiontypeid( ).
      IF lo_actiontypeid IS NOT INITIAL.
        lv_actioncategory = lo_actiontypeid->get_category( ).
        lv_actionowner = lo_actiontypeid->get_owner( ).
        lv_actionprovider = lo_actiontypeid->get_provider( ).
        lv_version = lo_actiontypeid->get_version( ).
      ENDIF.
      lo_actionconfiguration = lo_jobdata->get_actionconfiguration( ).
      IF lo_actionconfiguration IS NOT INITIAL.
        LOOP AT lo_actionconfiguration->get_configuration( ) into ls_row.
          lv_key = ls_row-key.
          lo_value = ls_row-value.
          IF lo_value IS NOT INITIAL.
            lv_actionconfigurationvalu = lo_value->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
      lo_pipelinecontext = lo_jobdata->get_pipelinecontext( ).
      IF lo_pipelinecontext IS NOT INITIAL.
        lv_pipelinename = lo_pipelinecontext->get_pipelinename( ).
        lo_stagecontext = lo_pipelinecontext->get_stage( ).
        IF lo_stagecontext IS NOT INITIAL.
          lv_stagename = lo_stagecontext->get_name( ).
        ENDIF.
        lo_actioncontext = lo_pipelinecontext->get_action( ).
        IF lo_actioncontext IS NOT INITIAL.
          lv_actionname = lo_actioncontext->get_name( ).
          lv_actionexecutionid = lo_actioncontext->get_actionexecutionid( ).
        ENDIF.
        lv_pipelinearn = lo_pipelinecontext->get_pipelinearn( ).
        lv_pipelineexecutionid = lo_pipelinecontext->get_pipelineexecutionid( ).
      ENDIF.
      LOOP AT lo_jobdata->get_inputartifacts( ) into lo_row_1.
        lo_row_2 = lo_row_1.
        IF lo_row_2 IS NOT INITIAL.
          lv_artifactname = lo_row_2->get_name( ).
          lv_revision = lo_row_2->get_revision( ).
          lo_artifactlocation = lo_row_2->get_location( ).
          IF lo_artifactlocation IS NOT INITIAL.
            lv_artifactlocationtype = lo_artifactlocation->get_type( ).
            lo_s3artifactlocation = lo_artifactlocation->get_s3location( ).
            IF lo_s3artifactlocation IS NOT INITIAL.
              lv_s3bucketname = lo_s3artifactlocation->get_bucketname( ).
              lv_s3objectkey = lo_s3artifactlocation->get_objectkey( ).
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
      LOOP AT lo_jobdata->get_outputartifacts( ) into lo_row_1.
        lo_row_2 = lo_row_1.
        IF lo_row_2 IS NOT INITIAL.
          lv_artifactname = lo_row_2->get_name( ).
          lv_revision = lo_row_2->get_revision( ).
          lo_artifactlocation = lo_row_2->get_location( ).
          IF lo_artifactlocation IS NOT INITIAL.
            lv_artifactlocationtype = lo_artifactlocation->get_type( ).
            lo_s3artifactlocation = lo_artifactlocation->get_s3location( ).
            IF lo_s3artifactlocation IS NOT INITIAL.
              lv_s3bucketname = lo_s3artifactlocation->get_bucketname( ).
              lv_s3objectkey = lo_s3artifactlocation->get_objectkey( ).
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
      lo_awssessioncredentials = lo_jobdata->get_artifactcredentials( ).
      IF lo_awssessioncredentials IS NOT INITIAL.
        lv_accesskeyid = lo_awssessioncredentials->get_accesskeyid( ).
        lv_secretaccesskey = lo_awssessioncredentials->get_secretaccesskey( ).
        lv_sessiontoken = lo_awssessioncredentials->get_sessiontoken( ).
      ENDIF.
      lv_continuationtoken = lo_jobdata->get_continuationtoken( ).
      lo_encryptionkey = lo_jobdata->get_encryptionkey( ).
      IF lo_encryptionkey IS NOT INITIAL.
        lv_encryptionkeyid = lo_encryptionkey->get_id( ).
        lv_encryptionkeytype = lo_encryptionkey->get_type( ).
      ENDIF.
    ENDIF.
    lv_accountid = lo_jobdetails->get_accountid( ).
  ENDIF.
ENDIF.