With the latest release of vRealize Operations there were some updates to the REST APIs and I’ll cover them in this brief blog.
The biggest news is that the Custom Group APIs have been promoted to the public APIs and are placed under the /api/resources group. This means these APIs are now fully supported. If you have been using the internal version of these APIs, they’re still around in this release but you should plan to update your code or scripts to leverage the public versions. You can create/read/update/delete (or CRUD) custom groups, as well as get group members to verify your dynamic custom groups are adding the objects you intend.
If you read the technical overview of what’s new in 7.5, you know that custom profiles have returned. Along with them the /api/resources group now has custom profiles APIs, providing CRUD operations for virtual machine profiles.
The API GET /api/audit/system has been added to pull the System Audit report. The system audit report displays the types and number of objects that vRealize Operations Manager manages. Reported objects include those that are configured and collecting data, the types of objects, object counts for adapters, the metrics that are configured and being collected, super metrics, vRealize Operations Manager generated metrics, the number of applications used, and the number of custom groups.
You can use this report to help determine whether the number of objects in your environment exceeds a supported limit, for example.
You can now change the Admin account password using the CaSA public API. Using PUT /casa/cluster/security/adminpassword and including the following in your request body is all that is needed:
{ "old_password" : "oldPassword@123", "new_password" : "newPassword222!" }
For large responses to API queries, you now have the option to compress the responses. For example, you may be getting stats for thousands of virtual machines over the past hour. This could be a significant payload and add some delay to your script. Enabling compression of the response will help.
To use this feature, you need to do two things:
- Add the header “accept-encoding” with the value “gzip” to your request
- Add the query “compression=enabled” to your request
For example, in Postman a stats query might look like this:
If you’re new to vRealize Operations REST APIs be sure to check out this vBrownBag session to get started.