VMware {code} Community
fc989
Contributor
Contributor

Adding a custom property to a VROPS VM via REST API

Hi,

I am using POSTMAN and I am trying to add a custom property to a certain virtual machine in VROPS via the REST API but I am getting an error 400. The response body says:

failureMessage: "may not be empty"

violationPath: "statContents"

httpStatusCode: 400

I have added a custom metric in the same fashion successfully, would anyone know why I am getting this error?

I have verified my variable for the "VROPS_Server" and it is correct.  This was the same variable I used for the custom metric.

Here is my url: {{VROPS_Server}}/suite-api/api/resources/2c8aad6f-add4-4ada-8c50-a836b9e1ba6e/stats

Here is my JSON body:

{

  "property-content" : [

  {

    "statKey": "CustomProps|Service1",

    "timestamps": [ {1576095828958 ],

    "values": [ "DOWN" ],

    "others" : [],

    "otherAttributes" : {}

  }

  ]

}

thanks in advance,

Reply
0 Kudos
1 Reply
fc989
Contributor
Contributor

I found the answer, the url needed "properties", not "stat."

Reply
0 Kudos