This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Rest API need to return required data

Hi

Our requirement is that we need a rest  api  that returns data in a json format. For example, we will send server name i.e  krishna123  to rest api and it should return necessary information such as

  1. 1) Node status
  2. 2) Polling IP Address:
  3. 3) Machine Type:
  4. 4) Packet Loss
  5. 5) CPU Load
  6. 6) Memory Used:
  7. 7) App Health:
  8. 8) Operational State:
  9. 9) Guest Status: Up

thanks

K

  • POST to https://server-name:17778/SolarWinds/InformationService/v3/Json/Query

    With this body:

    {

    "query": "SELECT Status, IP, MachineType, PercentLoss, CPULoad, MemoryUsed FROM Orion.Nodes WHERE Caption=@name",

    "parameters": { "name": "krishna123" }

    }

    Can you clarify what you mean by "app health, operational state, guest status"?

  • Hi,

    Thanks for revert, as i am new for API, should i use the query in below way.

    https://Servername:17778/SolarWinds/InformationService/v3/Json/{"SELECT Status, IP, MachineType, PercentLoss, CPULoad, MemoryUsed FROM Orion.Nodes WHERE Caption=@name",

    "parameters": { "name": "nodename" }

    }

  • please suggest on my below comment, if i am on correct path to do.

    Hi,

    Thanks for revert, as i am new for API, should i use the query in below way.

    https://Servername:17778/SolarWinds/InformationService/v3/Json/{"SELECT Status, IP, MachineType, PercentLoss, CPULoad, MemoryUsed FROM Orion.Nodes WHERE Caption=@name",

    "parameters": { "name": "nodename" }

    }

  • Hi Krishna

    As TDanner has indicated, you create a POST connection to that URI and you send in your POST BODY the query, where the format needs to be correct:

    {

    "query": "SELECT Status, IP, MachineType, PercentLoss, CPULoad, MemoryUsed FROM Orion.Nodes WHERE Caption=@name",

    "parameters": { "name": "krishna123" }

    }

    You do not append that text onto the end of the URI

  • can we store the "query" on some template ? so we just call the parameter ?