OPR Action Web Services not working in OBM 23.4

We upgraded our OBM from 2023.05 to 23.4 - in 23.4 the ../opr-web/rest/10.10/direct_execution API does not work anymore - it is returning http error 415 in json format:

{
  "statusCode" : 415,
  "message" : "HTTP 415 Unsupported Media Type",
  "reasonPhrase" : "Unsupported Media Type"
}


in the documentation of this API has no change mentioned - the doc https://docs.microfocus.com/doc/Operations_Bridge_Manager/23.4/ActionWSReference points to <OMi_HOME>/opr/api/schema/OprDataModel.xsd which in 23.4 is 0 bytes !

Tags:

  • 0  

    Hello,

    Yes, it's like that on my system too.  Would you be able to copy the 2023.05 OprDataModel.xsd version to the 23.4 version?  I'll find out why it's like this...

    Thanks.

  • 0 in reply to   

    I copied the 2023.05 OprDataModel.xsd and restarted obm - did not change the outcome - still 415 http error

  • 0   in reply to 

    oki, I understand.  I'll contact you via an email about the next steps.

  • Suggested Answer

    0   in reply to 

    Hello,

    The error message 415 means the server has refused to accept the request because the payload format is unsupported.  If you could post your XML, then I'll be very happy to test it.

    I tested on a OBM 23.4 system running hotfix OBM234HF20240415T101635Z.  OprDataModel.xsd is still empty, but I don't think that's causing hte problem here. 

    The command worked:

    Run an action:
    # curl -s --noproxy '*' --insecure -X POST -H "Content-Type: application/xml" --user " youruser:yourpassword" --data @./action.xml somenode.com/.../direct_execution
    {
    "tool_execution_context" : {
    "id" : "24c9edd3-5647-4667-9227-3645c9400487",
    "tool_ref" : {
    "id" : "a03ab3b4-7e02-4d0c-80b2-d0b9d92276ed",
    "target_id" : "a03ab3b4-7e02-4d0c-80b2-d0b9d92276ed",
    "label" : "ActionWebService",
    "tool_type" : "om_agent_command",
    "has_user_parameter" : false,
    "requires_run_as_user" : true,
    "name" : "ActionWebService",
    "solution_id" : "null",
    "execution_count" : 0,
    "success_percentage" : 0.0
    },
    "user_parameters" : {
    "entry" : [ ]
    },
    "tool_execution_result_ref" : [ {
    "id" : "6aef02bd-2d67-4091-ba2c-3980d6bf1706",
    "execution_host" : "somenode.com",
    "tool_command" : "ovc",
    "tool_execution_state" : "pending"
    } ]
    }

    Getting the response to check if the command worked:
    # curl -s --noproxy '*' --insecure -X GET -H "Content-Type: application/xml" --user "youruser:yourpassword" --data @./action.xml somenode.com/.../6aef02bd-2d67-4091-ba2c-3980d6bf1706
    {
    "tool_execution_result" : {
    "id" : "6aef02bd-2d67-4091-ba2c-3980d6bf1706",
    "tool_ref" : {
    "id" : "a03ab3b4-7e02-4d0c-80b2-d0b9d92276ed",
    "target_id" : "a03ab3b4-7e02-4d0c-80b2-d0b9d92276ed",
    "label" : "ActionWebService",
    "tool_type" : "om_agent_command",
    "has_user_parameter" : false,
    "requires_run_as_user" : true,
    "name" : "ActionWebService",
    "solution_id" : "null",
    "execution_count" : 0,
    "success_percentage" : 0.0
    },
    "execution_host" : "somenode.com",
    "tool_command" : "ovc",
    "user_parameters" : {
    "entry" : [ ]
    },
    "tool_execution_state" : "finished",
    "started" : "2024-04-18T16:09:25.098+02:00",
    "started_text" : "04:09:25 PM",
    "finished" : "2024-04-18T16:09:37.181+02:00",
    "finished_text" : "04:09:37 PM",
    "executed_in_context_of" : {
    "entry" : [ ]
    },
    "output" : "hpsensor Compute Sensor AGENT,OA (8820) Running \noacore Operations Agent Core AGENT,OA (10392) Running \noahmon Agent Health Monitor AGENT,EA (4976) Running \nompolparm OM Parameter Handler AGENT,EA (13984) Running \nopcacta OVO Action Agent AGENT,EA (8784) Running \nopcgeni Generic Source Interceptor AGENT,EA (15404) Running \nopcle OVO Logfile Encapsulator AGENT,EA (17012) Running \nopcmona OVO Monitor Agent AGENT,EA (1124) Running \nopcmsga OVO Message Agent AGENT,EA (7148) Running \novbbccb OV Communication Broker CORE (9056) Running \novcd OV Control CORE (8496) Running \novconfd OV Config and Deploy COREXT (8980) Running \novcs OV Certificate Server SERVER (15760) Running \n",
    "result_code" : 0
    }
    }

    Where action.xml contains:
    <direct_execution xmlns="">www.hp.com/.../data_model" xmlns:xs="">www.w3.org/.../XMLSchema">
    <command>ovc</command>
    <tool_type>om_agent_command</tool_type>
    <execution_hosts>
    <execution_host>somenode.com</execution_host>
    </execution_hosts>
    </direct_execution>

    The XML should also work on your system but change somenode.com to a system with OA12 installed.

    Please note:
    "Allow command execution through Action Web Service" to false, else you get this message:

    {
    "statusCode" : 403,
    "message" : "Action WS call denied for user bad0cad0-face-4b0e-861b-e2ab2631b1a8. Global setting opr:opr.tool.exec.allow.direct.execution = false",
    "reasonPhrase" : "Forbidden"
    }

    "Secure Modify" is also set to false (makes testing easier but not for production).

    So I think you have another problem.

    All the best.

  • 0 in reply to   

    We get this error using the OO content pack which automatically builds the xml POST request as well when we use curl or any other tool for http requests.

    When I try your xml POST I get a http 400 bad request because of the "Content-Type: application/xml" header - if I delete that parameter I get the 415 http error using the exact same xml body and config settings. We have hotfix OBM234HF20240401T090421Z installed - I will try to get the version you are running from support for testing

  • 0   in reply to 

    Hello,

    Thanks for the message.  I think this would be better managed via a service request with Opentext support.  One last question, which OO content pack are you using as there are several.

    This is a screen shot of action.xml which I used:

    Thanks.

  • 0 in reply to   

    OO-Contentpacks:
    Micro Focus Solutions 2.8.6
    OpenText Solutions 3.0.3
    Operation: Execute Command [Operation]

    We will raise a support ticket for OO content pack.

    The manual POST with curl from your example is working now! - the content-type header required seems to be changed. So we can build a workaround in OO using native REST until the OO-Contentpack gets an update/fix because you can´t add/change the header in the Execute Command [Operation] in OO

    thank you for the help and solution!

  • Verified Answer

    +1   in reply to 

    Good to hear it's kinda working.  I don't know anything much about this integration, but I did noticed that https://docs.microfocus.com/doc/OO_MF_Solutions_Content/3.0.3/Home does not support OBM 23.4.  3.0.6 also does not support 23.4 :-(

  • 0   in reply to 

    OprDataModel.xsd.txt

    This is <OMi_HOME>/opr/api/schema/OprDataModel.xsd for your version of OBM.

    Please rename from OprDataModel.xsd.txt to OprDataModel.xsd.

    Thanks,

    Duncan