BenimusIQ
6 Indium

Setting a value in UDF using EDAA

Hello,

I am trying to use the new EMC Data Access API to perform some integration tasks between EMC Smarts and an ITSM tool. We have the API up and running and can perform actions related to acknowledgements, ownership, query relationships, etc. etc., however one of the tasks that we want to perform is to update one of the UserDefined fields to contain a ticket number from the ITSM system using this API.

We can see in the API docs that there is an action you can perform on an event called "updateUDField", however we have not been able to get this to work. Our understanding is that an HTTP POST to the resource/action/updateUDField with the appropriate content in the payload should update the field, however the API docs don't explain what the paylod should look like.

These should be analogous to the dmctl invoke commands, however we have never used this action via dmctl either, so we don't know what the content there should look like either.

dmctl> geto ICS_Notification | grep updateUDField

  <string> updateUDField <string>value

Has anyone tried to do this action via the API, and if so can you share what the xml-like payload looks like?

Thanks

-Ben

Labels (1)
Tags (2)
0 Kudos
3 Replies
8 Krypton

Re: Setting a value in UDF using EDAA

Hi BenimusIQ,

When using dmctl, the easiest method of updating a UserDefined field is to use the PUT option:

./dmctl -s INCHARGE-SA put ICS_Notification::NOTIFICATION-TestClass_TestDevice_TestEvent::UserDefined1 "My String"

The EMC Data Access API (EDAA) request has the following basic syntax to access or perform an action on a resource:

<HTTP_method>  <datasource><URI> [payload]

HTTP_method options:

  • GET - List the members or representation of the resource
  • PUT - Replace the collection or representation of the resource
  • POST - Create a new resource
  • DELETE - Delete the resource or collection

Therefore, I believe you should be able to update a UserDefined field as follows:

PUT https://<api_server>/msa20-dmt/msa/<source_name>/instances/ICS_Notification::<NotificationInstance>::UserDefined1 "My String"

where: <source_name> is the name assigned when the EDAA was configured, <NotificationInstance> is the notification instance you wish to update and "My String" is the value you wish to place in the UserDefined1 field.

Thanks,

Kind Regards,

Paul O'Rourke

0 Kudos
BenimusIQ
6 Indium

Re: Setting a value in UDF using EDAA

Hi Paul,

Thanks for the info, but unfortunately that didn't work. Steps I took are as follows:

curl -H Content-Type:text/xml -X PUT -w %{http_code} -d @udf12.html http://<hostname>:8080/msa20-dmt/msa/SAM/instances/ICS_Notification::NOTIFICATION-Integration_TestServer-Blackout_UpdateUDF12::UserDefined12

Content of udf12.html:

<arguments>

<value>CHG0123456</value>

</arguments>

<?xml version="1.0" encoding="UTF-8"?><atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:vsc="http://schemas.emc.com/vs-xml/namespace/Common/1.0">

  <atom:title>/msa20-dmt/msa/SAM/instances/ICS_Notification::NOTIFICATION-Integration_TestServer-Blackout_UpdateUDF12::UserDefined12</atom:title>

  <atom:updated>2014-06-02T10:20:46+10:00</atom:updated>

  <atom:author>

    <name>EDAA Feed</name>

  </atom:author>

  <atom:id>e42a2c51-09ae-4818-80d5-c2e15a34b9ad</atom:id>

<atom:entry>

  <atom:title type="text">MsaError - Msa Internal Server Error. Reason: NOT IMPLEMENTED. Caused by: Internal MSA error</atom:title>

  <atom:id>http://<hostname>:8080/msa20-dmt/msa/SAM/instances/MsaError::4021</atom:id>

  <atom:updated>2014-06-02T10:20:46+10:00</atom:updated>

  <atom:link rel="http://schemas.emc.com/msa/common/reln/type" href="http://<hostname>:8080/msa20-dmt/msa/SAM/types/MsaError"/>

<atom:content type="application/xml">

  <vsc:MsaError xmlns:inst="http://schemas.emc.com/vs-xml/namespace/Common/1.0" xmlns:vsc="http://schemas.emc.com/vs-xml/namespace/Common/1.0">

    <vsc:displayName>Msa Internal Server Error. Reason: NOT IMPLEMENTED. Caused by: Internal MSA error</vsc:displayName>

    <inst:Code>4021</inst:Code>

    <inst:CodeString>msa.internal.server.error</inst:CodeString>

    <inst:ErrorMessage>Msa Internal Server Error. Reason: NOT IMPLEMENTED. Caused by: Internal MSA error</inst:ErrorMessage>

    <inst:RequestUri>http://<hostname>:8080/msa20-dmt/msa/SAM/instances/ICS_Notification::NOTIFICATION-Integration_TestServer-Blackout_Upd...</inst:RequestUri>

    <inst:Time>2014-06-02T10:20:46+10:00</inst:Time>

    <inst:Type>OPERATION_ERROR</inst:Type>

    <atom:link rel="http://schemas.emc.com/msa/common/reln/type" href="http://<hostname>:8080/msa20-dmt/msa/SAM/types/MsaError"/>

  </vsc:MsaError>

</atom:content>

</atom:entry>

</atom:feed>

HTTP 500

The content of udf12.html that I posted above aligns with other actions we are performing using the EDAA, however as you can see we are getting a method not implemented message back rather than something like an XML parsing error, so it seems to like the content and the reference, but doesn't do anything with it...

-Ben

0 Kudos
hhe
6 Indium

Re: Setting a value in UDF using EDAA

I didn't have experience with EDAA before, but normally if you use dmctl to update a UDF of a notification instance, you need to invoke a change() on that notification instance, not sure if there is a similar action you can call via the EDAA.

You can let us know how you go, I am sure this can be resolved.

0 Kudos