ScriptvRops

Exploring vRops Internal API

Continuing from my last blog post I will show you some more of vRops API capabilities, this time it vRops Internal API. So if your new to the vRops API or just need some more background of how to use it please start by reading my previous blog post

vRops API consumed with Powershell

 

First a disclaimer:

This is not supported by VMware! I post this purely for educational purpose.

This should NOT be used for production. Again THIS IS NOT SUPPORTED.

 

Exploring vRops Internal API

This time I’m going to show vRops private / unsupported API, which seems to be called internal by VMware. The set of features for this API is quite short, so it’s not the holy grail we are talking about, but I thought I would share it anyway in the interest of educating. The vRops internal API gets accessed much in the same way that the regular API gets accessed, with the exception that you need to provide a header in which you accept that this is unsupported by setting a string to true.

First the URI for the vRops internal API is just an extension of the regular

https://vRopsIP/suite-api/internal/

Note the /internal/ – This has it own subset of feature which is different from the regular API and so far is limited to only a hand full or so commands.

This is the list as I know it, most should be easy to understand the behavior of:

  • REBALANCE_STATUS_PATH
  • REMOVE_NODE_PATH
  • REMOVE_COLLECTOR
  • GRACEFULLY_SHUTDOWN_GEMFIRE
  • PREPARE_CLUSTER_SERVICES_FOR_SHUTDOWN
  • CLUSTER_INFO
  • CLUSTER_STATE
  • CLUSTER_START

I haven’t had a change to test them all and once more they are unsupported so the behavior may not be as expected. Like I wrote above pretty short list and probably only one or two which could make sense to use on a more regular basis others could come in handy when doing clean up.

Before I dig more into what the different command does, here is how to use the commands with powershell. Much like my last blog post, I use the same command, but two things have been changed. Method is not only Get, but can also be Post, as seen below or delete. As in deleting a collector.

Invoke-RestMethod -Method Post -Headers @{'X-vRealizeOps-API-use-unsupported' = "true"} -Uri "https://vRopsIP/suite-api/internal/casa/clusters/start" -Credential $cred

If you should prefer to use a client like the RESTClient for Firefox, you will need to add a header with the ‘Name’ equal to ‘X-vRealizeOps-API-use-unsupported’ and the value set to ‘True’

vRops Interal API Firefox Rest Client

 

What does it do and how to I use it

I’m going to go through them one at a time.

  • REBALANCE_STATUS_PATH
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/rebalance/status
    • Status: Not tested
  • REMOVE_NODE_PATH
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/nodes
    • Status: Not tested
  • REMOVE_COLLECTOR
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/nodes/collectors
    • Status: Get not supported, use delete – Not tested
  • GRACEFULLY_SHUTDOWN_GEMFIRE
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/shutdown-gemfire
    • Status: Returns ‘500 Internal error’ and vRops stops working
  • PREPARE_CLUSTER_SERVICES_FOR_SHUTDOWN
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/prepare-cluster-services-for-shutdown
    • Status: Returns this status and vRops stops working
{ 
    "succeededPartially": false,
    "localizedErrorMessages": [], 
    "errorMessages": [], 
    "failedCompletely": false, 
    "succeeded": true, 
    "succeededCompletely": true 
}
  • CLUSTER_INFO
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/info
    • Status: Works returns an output like:
{
  "succeededPartially": false,
  "lduinfos": [
    {
      "collectorInfos": [],
      "controllerInfos": [
        {
          "name": "vRealize Operations Manager Controller-vROpsStandAlone",
          "instanceId": "268c3c12-9fe7-4eb7-86d4-1c7ec1bc7a3a",
          "systemTime": 1439278249787,
          "upTime": 104720,
          "startTime": 1439278145067,
          "usedMemory": 2190073160,
          "freeMemory": 5205336760,
          "totalMemory": 7395409920,
          "maxMemory": 7395409920,
          "ipAddresses": [
            "localhost.localdom"
          ],
          "localPlatformEventsCount": 11
        }
      ],
      "analyticsInfos": [
        {
          "name": "vRealize Operations Manager Analytics-vROpsStandAlone",
          "instanceId": "268c3c12-9fe7-4eb7-86d4-1c7ec1bc7a3a",
          "systemTime": 1439278249786,
          "upTime": 104719,
          "startTime": 1439278145067,
          "usedMemory": 2190073160,
          "freeMemory": 5205336760,
          "totalMemory": 7395409920,
          "maxMemory": 7395409920,
          "ipAddresses": [
            "localhost.localdom"
          ],
          "localResourceCount": 0,
          "localPrimaryResourceCount": 0,
          "localForwardDataCount": 259,
          "localPrimaryForwardDataCount": 259
        }
      ],
      "fsdbinfos": [
        {
          "name": "vRealize Operations Manager Fsdb-vROpsStandAlone",
          "instanceId": "268c3c12-9fe7-4eb7-86d4-1c7ec1bc7a3a",
          "systemTime": 1439278249787,
          "upTime": 104720,
          "startTime": 1439278145067,
          "usedMemory": 2190073160,
          "freeMemory": 5205336760,
          "totalMemory": 7395409920,
          "maxMemory": 7395409920,
          "ipAddresses": [
            "localhost.localdom"
          ],
         "state": {
            "state": "RUNNING"
          },
          "statistic": {
            "numberOfStoredResources": 0,
            "numberOfStoredMetrics": 0,
            "numberOfSavedResources": 0,
            "numberOfSavedMetrics": 0
          }
        }
      ],
      "lduid": {
        "lduId": "vROpsStandAlone"
      }
    }
  ],
  "failedCompletely": false,
  "succeeded": true,
  "succeededCompletely": true,
  "errorMessages": [],
  "localizedErrorMessages": []
}
  • CLUSTER_STATE
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/state
    • Status: Works returns an output like:
{
  "succeededPartially": false,
  "platformStates": {
    "vROpsStandAlone": {
      "268c3c12-9fe7-4eb7-86d4-1c7ec1bc7a3a": {
        "state": "STARTED"
      }
    }
  },
  "failedCompletely": false,
  "succeeded": true,
  "succeededCompletely": true,
  "errorMessages": [],
  "localizedErrorMessages": []
}
  • CLUSTER_START
    • URI: https://vRopsIP/suite-api/internal/casa/clusters/start
    • Status: Get not supported, use post – Not tested

 

That’s all – Now go have some fun with this

2 thoughts on “Exploring vRops Internal API

Leave a Reply

Your email address will not be published. Required fields are marked *