Hitachi Ops Center​

 View Only
  • 1.  CURL Command - Invalid JSON Request

    Posted 03-29-2024 06:57

    Hello,

    after a lot of trial and error i wanted to ask for some support for a CURL Request to DetailView Data.

    Here is a Curl example i have tried:

    curl -k -u admin:PW 'https://localhost:8443/dbapi.do?action=query&dataset=defaultDs&processSync=true' -H 'Content-Type:application/json' -X POST -d '{"query":"hnasFS[@fs_data_read rx b .*]&[@fs_data_written rx b .*]"}' 

    I have also tried some other queries but i always get this response:
    {
    "code":"62010002",
    "error":"Invalid JSON Request"
    }

    Maybe somebody has a clue what i have missed within the command Structure.

    Thanks a lot in advance!

    Regards

    Miran



    ------------------------------
    Miran Kreuzer
    3 Banken IT GmbH
    ------------------------------


  • 2.  RE: CURL Command - Invalid JSON Request

    Posted 03-29-2024 09:02

    Hi Miran,

    I think your API query framing is not correct, end point must be placed after the body, for your reference please see the below PFREST/SVOS API, as API has a standardized query syntax hence almost all APIs' will have same structure.

    Below API creates a ldev in the storage [we bypassed the SSL handshake]

     curl -k -v -H "Accept:application/json" -H "Content-Type:application/json" -u <user_id>:<password> -X POST -d " { \"poolId\" : \"1\",\"byteFormatCapacity\" : \"10G\"}"  "https://XX.XX.XX.XX:443/ConfigurationManager/v1/objects/ldevs"

    If you could tell me which API you are trying and what do you want to accomplish then that would be helpful for us to be more specific.

    Thanks



    ------------------------------
    Prasenjit Chatterjee
    Software Engineer- Test
    Hitachi Vantara
    ------------------------------



  • 3.  RE: CURL Command - Invalid JSON Request

    Posted 03-29-2024 15:45

    Hello

    I think Prasenjit is talking about CMRest and it seems like Miran is talking about Analyzer Detialed View.

    Miran maybe you can let us know what you're trying to do, or what data you're looking for.

    If it is a standard report in Analyzer Detailed view you can propably just capture the rest API command. Using your browser. Example below:



    ------------------------------
    William Jansen Van Nieuwenhuizen
    Hitachi Vantara
    ------------------------------



  • 4.  RE: CURL Command - Invalid JSON Request

    Posted 04-02-2024 06:10

    Hello,

    first of all thanks for your responses and suggestions! We are generating some monthly reports for Storage Growth, IOPS and MPU Usage. I have some Powershell Scripts which are triggered on the last of the month, which should collect MPU and MPUmax Values and IOPS at that specific time and write those values into a csv File. I know that this isn't most compelling Solution but you can see the Growth over some month. 

    Therefore i will need an api Command for MPU Usage, for MPU Max Usage and Overall IOPS Values which i can write in a csv-file.

    Regards

    Miran



    ------------------------------
    Miran Kreuzer
    3 Banken IT GmbH
    ------------------------------