VMware {code} Community
VirtPhysical
Enthusiast
Enthusiast
Jump to solution

vROPs - Issue creating an alert definition using the API

I'm trying to create an alert in vROPs using the API and I'm having issues with my JSON configuration, I've been playing around for a while now and cant get it to work... any tips?

/api/alertdefinitions 

{
  "name" : "VM Reconfiguration 2",
  "description" : "TBD",
  "adapterKindKey" : "VMWARE",
  "resourceKindKey" : "HostSystem",
  "waitCycles" : 1,
  "cancelCycles" : 1,
  "type" : 15,
  "subType" : 19,
  "states" : [ {
    "severity" : "WARNING",
    "base-symptom-set" : {
      "type" : "SYMPTOM_SET",
      "operator" : "AND",
      "symptom-sets" : [ {
        "type" : "SYMPTOM_SET",
        "relation" : "SELF",
        "aggregation" : "ALL",
        "symptomSetOperator" : "AND",
        "symptomDefinitionIds" : [ "{{TempSymptomID}}" ]
      } ]
    }
  } ]
}


When I POST, I'm getting the following error:

{
    "message": "Invalid request... #3 violations found.",
    "validationFailures": [
        {
            "failureMessage": "may not be empty",
            "violationPath": "alertDefinitionStates[0].symptoms.symptomDefinitionReferences"
        },
        {
            "failureMessage": "'AlertDefinitionState.impact' cannot be null.",
            "violationPath": "alertDefinitionStates[0].impact"
        },
        {
            "failureMessage": "'SymptomSet.relation' cannot be null.",
            "violationPath": "alertDefinitionStates[0].symptoms.relation"
        }
    ],
    "httpStatusCode": 400,
    "apiErrorCode": 400
}
 
Any thoughts what I am doing wrong? 
Labels (1)
0 Kudos
1 Solution

Accepted Solutions
VirtPhysical
Enthusiast
Enthusiast
Jump to solution

fixed it 
 

 

{
  "name" : "VM Reconfiguration 2",
  "description" : "TBD",
  "adapterKindKey" : "VMWARE",
  "resourceKindKey" : "HostSystem",
  "waitCycles" : 1,
  "cancelCycles" : 1,
  "type" : 15,
  "subType" : 19,
  "states" : [ {
    "severity" : "WARNING",
    "base-symptom-set" : {
      "type" : "SYMPTOM_SET",
      "operator" : "AND",
      "relation" : "SELF",
      "symptomDefinitionIds" : [ "{{TempSymptomID}}" ]
},
      "impact": {
                "impactType": "BADGE",
                "detail": "health"
      }
    }
   ]
}

 

View solution in original post

0 Kudos
1 Reply
VirtPhysical
Enthusiast
Enthusiast
Jump to solution

fixed it 
 

 

{
  "name" : "VM Reconfiguration 2",
  "description" : "TBD",
  "adapterKindKey" : "VMWARE",
  "resourceKindKey" : "HostSystem",
  "waitCycles" : 1,
  "cancelCycles" : 1,
  "type" : 15,
  "subType" : 19,
  "states" : [ {
    "severity" : "WARNING",
    "base-symptom-set" : {
      "type" : "SYMPTOM_SET",
      "operator" : "AND",
      "relation" : "SELF",
      "symptomDefinitionIds" : [ "{{TempSymptomID}}" ]
},
      "impact": {
                "impactType": "BADGE",
                "detail": "health"
      }
    }
   ]
}

 

0 Kudos