Skip to content

/AWS1/IF_SSM=>GETDEPLOYABLEPATCHSNAPFORI00()

About GetDeployablePatchSnapshotForInstance

Retrieves the current snapshot for the patch baseline the managed node uses. This API is primarily used by the AWS-RunPatchBaseline Systems Manager document (SSM document).

If you run the command locally, such as with the Command Line Interface (CLI), the system attempts to use your local Amazon Web Services credentials and the operation fails. To avoid this, you can run the command in the Amazon Web Services Systems Manager console. Use Run Command, a tool in Amazon Web Services Systems Manager, with an SSM document that enables you to target a managed node with a script or command. For example, run the command using the AWS-RunShellScript document or the AWS-RunPowerShellScript document.

Method Signature

IMPORTING

Required arguments:

iv_instanceid TYPE /AWS1/SSMINSTANCEID /AWS1/SSMINSTANCEID

The ID of the managed node for which the appropriate patch snapshot should be retrieved.

iv_snapshotid TYPE /AWS1/SSMSNAPSHOTID /AWS1/SSMSNAPSHOTID

The snapshot ID provided by the user when running AWS-RunPatchBaseline.

Optional arguments:

io_baselineoverride TYPE REF TO /AWS1/CL_SSMBASELINEOVERRIDE /AWS1/CL_SSMBASELINEOVERRIDE

Defines the basic information about a patch baseline override.

iv_uses3dualstackendpoint TYPE /AWS1/SSMBOOLEAN /AWS1/SSMBOOLEAN

Specifies whether to use S3 dualstack endpoints for the patch snapshot download URL. Set to true to receive a presigned URL that supports both IPv4 and IPv6 connectivity. Set to false to use standard IPv4-only endpoints. Default is false. This parameter is required for managed nodes in IPv6-only environments.

RETURNING

oo_output TYPE REF TO /aws1/cl_ssmgetdeployablepat01 /AWS1/CL_SSMGETDEPLOYABLEPAT01

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_ssm~getdeployablepatchsnapfori00(
  io_baselineoverride = new /aws1/cl_ssmbaselineoverride(
    io_approvalrules = new /aws1/cl_ssmpatchrulegroup(
      it_patchrules = VALUE /aws1/cl_ssmpatchrule=>tt_patchrulelist(
        (
          new /aws1/cl_ssmpatchrule(
            io_patchfiltergroup = new /aws1/cl_ssmpatchfiltergroup(
              it_patchfilters = VALUE /aws1/cl_ssmpatchfilter=>tt_patchfilterlist(
                (
                  new /aws1/cl_ssmpatchfilter(
                    it_values = VALUE /aws1/cl_ssmpatchfiltvallist_w=>tt_patchfiltervaluelist(
                      ( new /aws1/cl_ssmpatchfiltvallist_w( |string| ) )
                    )
                    iv_key = |string|
                  )
                )
              )
            )
            iv_approveafterdays = 123
            iv_approveuntildate = |string|
            iv_compliancelevel = |string|
            iv_enablenonsecurity = ABAP_TRUE
          )
        )
      )
    )
    io_globalfilters = new /aws1/cl_ssmpatchfiltergroup(
      it_patchfilters = VALUE /aws1/cl_ssmpatchfilter=>tt_patchfilterlist(
        (
          new /aws1/cl_ssmpatchfilter(
            it_values = VALUE /aws1/cl_ssmpatchfiltvallist_w=>tt_patchfiltervaluelist(
              ( new /aws1/cl_ssmpatchfiltvallist_w( |string| ) )
            )
            iv_key = |string|
          )
        )
      )
    )
    it_approvedpatches = VALUE /aws1/cl_ssmpatchidlist_w=>tt_patchidlist(
      ( new /aws1/cl_ssmpatchidlist_w( |string| ) )
    )
    it_rejectedpatches = VALUE /aws1/cl_ssmpatchidlist_w=>tt_patchidlist(
      ( new /aws1/cl_ssmpatchidlist_w( |string| ) )
    )
    it_sources = VALUE /aws1/cl_ssmpatchsource=>tt_patchsourcelist(
      (
        new /aws1/cl_ssmpatchsource(
          it_products = VALUE /aws1/cl_ssmpatchsrcproductl00=>tt_patchsourceproductlist(
            ( new /aws1/cl_ssmpatchsrcproductl00( |string| ) )
          )
          iv_configuration = |string|
          iv_name = |string|
        )
      )
    )
    iv_approvedpatchescplnclevel = |string|
    iv_approvedpatchesenbnonsec = ABAP_TRUE
    iv_availablesecupdscplncstat = |string|
    iv_operatingsystem = |string|
    iv_rejectedpatchesaction = |string|
  )
  iv_instanceid = |string|
  iv_snapshotid = |string|
  iv_uses3dualstackendpoint = ABAP_TRUE
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_instanceid = lo_result->get_instanceid( ).
  lv_snapshotid = lo_result->get_snapshotid( ).
  lv_snapshotdownloadurl = lo_result->get_snapshotdownloadurl( ).
  lv_product = lo_result->get_product( ).
ENDIF.