Highlighted
Absent Member.. WFlores Absent Member..
Absent Member..
756 views

Create an event via REST API with custom attributes during the same call

Hi There,

I'm trying to find out how to create an event with the REST API for OMi via adding the custom attributes during the same API call.

 

I've been able to create an event using this sample XML and going through the 10.0.1 OMi Extensibility Guide:

 

evenxml = """
<event xmlns="http://www.hp.com/2009/software/opr/data_model">
<title>Test EVENT</title>
<severity>normal</severity>
<priority>low</priority>
<state>open</state>
</event>
"""

 

I've also been able to update the event with the RelatedCIHint CMA using a sample xml like so:

customattrxml = """
<custom_attribute xmlns="http://www.hp.com/2009/software/opr/data_model">
<name>RelatedCIHint</name>
<value>GUCMDB:02ef4cc9a291b54de5997d02e3c6e624</value>
</custom_attribute>
"""

 

From what I understand, the CI resolver takes the RelatedCIHint value and associates the event with the actual CI to send a forwarding action to one of our other integrations - such as HP Service Manager.

Our problem is that the forwarding action is failing because the CI resolver is looking at the created event and it doesn't see a CI ID in it (as I mentioned, the CMA is added after the event is created)

So since the CMA RelatedCIHint is added after the event is created, the CI resolver doens't know about the CMA and therefore can't resolve the CI - at least that's what I'm told by our event management team.

So I'm wondering if there's a way to create an event with the CMA attribute in the same xml. Something like:

evenxml = """
<event xmlns="http://www.hp.com/2009/software/opr/data_model">
<title>Test EVENT</title>
<severity>normal</severity>
<priority>low</priority>
<state>open</state>
<custom_attribute>
<name>RelatedCIHint</name>
<value>GUCMDB:02ef4cc9a291b54de5997d02e3c6e624</value>
</custom_attribute>
</event>
"""

 

We think that if the event is added with the attribute in the same call, the CI resolver will work.

Has anyone ran into this issue before or is there a way to create an event with all its custom attributes in one call?

 

 

Thanks,

-Wadis

0 Likes
1 Reply
Acclaimed Contributor.. Harald Acclaimed Contributor..
Acclaimed Contributor..

Re: Create an event via REST API with custom attributes during the same call

Hello,

are you looking for this:

   <related_ci_hints>
     <hint>OmCoreId:adf5657a-1398-7584-19f2-c7991ca3251a</hint>
   </related_ci_hints>

Kind regards,
Harald

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.