IBM License Metric Tool (ILMT)

IBM License Metric Tool (ILMT)

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  RESTAPI for classifying software

    Posted Thu June 15, 2023 09:11 AM

    The documentation is light on examples. Can you please illustrate the correct format of the curl command -- similar to below.  I can extract the software inventory but have had issues with the PUT command - a likely syntax issue.

    curl -k -v -X PUT https://127.0.0.1:9081/api/sam/v2/software_instances?token=758b14ae635a3b21e5c9316ab74145989b35af73 -d { "rows": [{ "instance_id":1,"product_release_guid": xxxx-xxxx-xxxx-xxxx,"metric_id":4,"is_confirmed":1}]} -o c:\temp\Software_Updates.json





    ------------------------------
    William Van Horne
    ------------------------------


  • 2.  RE: RESTAPI for classifying software

    Posted Fri June 16, 2023 03:17 AM

    Hello William,

    Your 'software_instances' API syntax looks ok as far as ILMT is concerned...

    But, as I can see you are using Windows box, so, ALL those double quotes characters need to be escaped (\) when using curl :
    \"rows\": ....

    That restriction doesn't exist on Unix based curl...


    Personally, I propose to put this json structure into some file (let's say test.txt):
    {
        "rows": [
          {
             "instance_id":1,
             "metric_id":4,
             "product_release_guid":"xxxx-xxxx-xxxx-xxxx",
             "is_charged":1
           }
        ]
    }

    and use that as an input to curl command :

    curl -k -v -X PUT https://127.0.0.1:9081/api/sam/v2/software_instances?token=xxx  -d @test.txt



    ------------------------------
    Thank you,
    Oktawian

    Oktawian Powązka, L3 Support
    IBM License Metric Tool
    ------------------------------