IBM Security Verify

 View Only
Expand all | Collapse all

Add Multiple Key Value using Shell Script and Rest Api

  • 1.  Add Multiple Key Value using Shell Script and Rest Api

    Posted Tue May 28, 2024 09:27 AM

    Hi Team,

    Is it possible to update the ldap.conf file using rest api in which the keys are of same name but values are different
    Example : replica = xxx.xx.x.01 and replica = xxx.xx.02

    Below is my shell script

    #!/bin/sh
    [ "$DEBUG" ] && set -xappliance_hostname=$1
    username=$2
    password=$3
    configurationfile=$4
    stanza=$5
    entry=$6
    value=$7
    entry1=$8
    value1=$9[ "$CURL" ]  || CURL="curl -s -k -u "$username:$password""${CURL} -H "Accept: application/json" -H 'Content-Type: application/json' -X PUT https://${appliance_hostname}/isam/runtime/${configurationfile}/configuration/stanza/${stanza}/entry_name/${entry} --data-ascii '{"value":"'${value}'"}'${CURL} -H "Accept: application/json" -H 'Content-Type: application/json' -X PUT https://${appliance_hostname}/isam/runtime/${configurationfile}/configuration/stanza/${stanza}/entry_name/${entry1} --data-ascii '{"value":"'${value1}'"}'exit $?



    ------------------------------
    Sachin Kumbhar
    ------------------------------


  • 2.  RE: Add Multiple Key Value using Shell Script and Rest Api

    Posted Tue May 28, 2024 06:52 PM

    Sachin,

     

    You should be able to do a POST on the stanza endpoint.  Here is an extract from the Web services documentation:

     

    POST https://{appliance_hostname}/wga/reverseproxy/{reverseproxy_id}/configuration/stanza/{stanza_id}/entry_name

     POST_DATA: {

      entries: [

                                       ["entryName1", "value1"],

                                       ["entryName2", "value2"]

                              ]

                          }

     

    You should be able to specify the same entry name multiple times within the POST body.

     

    I hope that this helps.

     

    Scott A. Exton
    Senior Software Engineer
    Chief Programmer - IBM Security Verify Access

    IBM Master Inventor

    cid4122760825*<a href=image002.png@01D85F83.85516C50">