snakhuda123
Contributor
Contributor

KB article to create custom alerting is not working for me

Hi team,

Hoping to see if you can pin point the root cause of this 400 error pasted below. I am trying to create a new email template and I get 400 error.

VMware Knowledge Base

Executed step 3 from KB article by replacing IP address of the master node.

]# curl -k -X POST -i -H "X-vRealizeOps-API-use-unsupported: true" -H "Content-Type: application/json; charset=UTF-8" -u admin -d '{
"id" : null,
"name" : "Email Template 1",
"html" : true,
"template" : "$$Subject=[Email Template 1 Subject] State:{{AlertCriticality}}, Name:{{AffectedResourceName}} \n\n New alert was generated at: {{AlertGenerateTime}} Info: {{AffectedResourceName}} {{AffectedResourceKind}}
Alert Definition Name: {{AlertDefinitionName}}
Alert Definition Description: {{AlertDefinitionDesc}}
Object Name : {{AffectedResourceName}}
Object Type : {{AffectedResourceKind}}
Alert Impact: {{AlertImpact}}
Alert State : {{AlertCriticality}}
Alert Type : {{AlertType}}
Alert Sub-Type : {{AlertSubType}}
Object Health State: {{ResourceHealthState}}
Object Risk State: {{ResourceRiskState}}
Object Efficiency State: {{ResourceEfficiencyState}}
Symptoms:
{{Anomalies}} Recommendations: {{AlertRecommendation}} vROps Server - {{vcopsServerName}} Alert details
",
"others" : [ ],
"otherAttributes" : {}
}' https://10.50.6.88/suite-api/api/notifications/email/templates
Enter host password for user 'admin':
HTTP/1.1 400 400
Date: Wed, 30 Sep 2020 19:01:08 GMT
Server: Apache
X-Request-ID: 4hh8Gupwd06DRmHiPoyKGdqIXSDJic1s
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src https: data: 'unsafe-inline' 'unsafe-eval'; child-src *
Vary: User-Agent
Connection: close
Transfer-Encoding: chunked
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ops:error xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ops="http://webservice.vmware.com/vRealizeOpsMgr/1.0/" httpStatusCode="400" apiErrorCode="400"><ops:message>Invalid input format.</ops:message><ops:moreInformation><ops:info name="api-uri">/suite-api/api/notifications/email/templates</ops:info></ops:moreInformation></ops:error>

thanks,

Salman

Tags (2)
5 Replies
KabirAli82
Hot Shot
Hot Shot

Hi Salman,

As of (I believe) vROps 8.0 basic auth is not longer supported. You need to get a bearer token. Best what you could do is use Postman with this collection;

Postman Client Collection for vRealize Operations REST APIs - Samples - VMware {code}

Make sure to first connect to vROps to get the token. From there on you can try to create an Email template using that KB as the JSON body.

It looks like you created another topic for the same issue, keep in mind that the people here are helping each other free of charge... so show a bit more patience next time. Smiley Wink


Was I helpful? Give a kudo for appreciation!
Braindumping @ http://kablog.nl/
Tweeting @ https://twitter.com/_Kabir_Ali_
0 Kudos
sxnxr
Commander
Commander

It is supported just disabled by default now in 8.1 and beyond

Follow VMware Knowledge Base to re enable it if you need to

snakhuda123
Contributor
Contributor

Hello Kabir,

I appreciate you trying to help free of charge. Just to be clear, I created two posts for two separate solutions. None of those worked with vROps 8.0.

VMware Knowledge Base

vRealize Operations Email Template Manager | VMware Flings

Tech support is also trying to assist from last one week but still no luck.

--Salman

0 Kudos
AMystery
Contributor
Contributor

I'm also dealing with the same error 400. I did discover the basic auth and changed that but am still stuck at the template not creating. 

0 Kudos
AMystery
Contributor
Contributor

According to support the custom email template creation is broken in 8.2 and not worth attempting and we should just wait until 8.3. Not the most useful support response but hopefully the release is soon since this is keeping me from having page-able notifications. 

0 Kudos