12 Replies Latest reply on Feb 17, 2020 2:14 AM by Aryan Anantwar

    How to start with TrueSight Orchestrator to initiate a workflow HTTP Request

    Maximilien Soullez
      Share This:

      Hello folk,

      I would like to use a workflow from TSO (BAO) to send a web request to one destination... i will continue my research but i'm sure it's a quick win for you , your help and advise will be appreciated...

      Because I'm confused, with our version TSO 8.1 and content 20.18.01 i can add to my grid some adapter like: HTTPAdapter and RESTAdapter and the corresponding module i guess, is AutoPilot-AD-Utilities...

       

      From TSO Development studio, i can see the module and some HTTP and REST process...

      So now, what is the right adapter in this case to send my request to third part ?

      If i use HTTP / POST, what property corresponds to the basic post variable "Body" bellow in Development studio (i'm still looking for online documentation...)

        • 1. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
          Alfredo Ingenito

          Hi,

           

          you should pass your HTTP payload (you called it "body") into the "data" input parameter

          of the Workflow POST.

          The HTTP request (specially if it is XML/HTML) should make use of HTTP Adapter.
          You can use REST Adapter in case of REST API integration (though you could use

          HTTP Adapter too).

          • 2. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
            Maximilien Soullez

            I am watching different video on the bmc youtube account, I can't find what I am looking for at the moment...

            Is there a "Git" Repo where we I can retrieve examples of workflow for call REST APIs? I must already understand how to use Devstudio to create a workflow for a REST PI / Web request command....

            I starded with the training : BMC Atrium Orchestrator 7.x Fundamentals – Part 2: It is also not in the first 6 modules that I find the info

             

            Any help will be appreciated

            • 3. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
              Maximilien Soullez

              I found some information here : https://docs.bmc.com/docs/TruesightOrchestrationContent/201801/rest-utilities-login-813432673.html
              By any chance, should anyone have some example somewhere "how and What is the detail, about the right steps to configure and make that functional"
              1 login
              2 POST command
              3 get result
              > what is the best practice and how to run the workflow in one shot to complete all step 1,2 and 3 

               

              if i want use security credential, not put in clear text the password for login... should my context password a "configuration ITEM from a custom module" ?

              ps: When i will be able to run this from TrueSight Orchestrator, my next step should be to call this workflow with some imput variables from a "TrueSight Server Automation" > a  Workflow Job !!!

              • 4. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
                Alfredo Ingenito

                Hi,

                 

                from your questions I get the impression that your knowledge of TSO is still too low for the goal you are trying to reach.

                Let me try with some more basic hints and then let me know if that helps or I under evaluated your TSO skills (I apologize in that case).

                You have to create your own workflow in your own module (i.e. New Module, New Process).

                Then you get empty workflow on the workarea.

                Just drag and drop from tree view on the left the workflows you want to add (i.e. HTTP/POST) into the workarea where your workflow is open. I guess you will need 2: one for login and a one for executing your action.

                Then select the gray line between green triangle and red octagon and detach it from the red, clicking on the green dot close there. Connects it to the first workflow you dropped in the workarea, then from the first to the 2nd then from the second to the end (red). Now you have your flow and you can begin fill in parameters value.

                For the values of json and so you must refer to the API description of target server.

                Each step in your workflow returns an output in the context item adapter_response you can parse it for the result.

                • 5. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
                  Aryan Anantwar

                  Hi,

                   

                  Yes, you can run complete all steps 1,2 and 3 in one execution

                  1. Create Login workflow which will use the username, password, login URL etc from Module Configurations
                  2. Login workflow should have an output parameter as authentication token
                  3. Create second workflow for 'Make Post Call' which should have an input parameter for authentication token and result as output parameter
                  4. Create a third (Main) workflow, i.e. 'REST Operation'
                  5. Add your Login workflow and after that add 'Make Post Call' and follwing that an assign activity.
                  6. Map the output parameter 'authentication token' of Login workflow to input parameter of 'Make Post Call' workflow.
                  7. In Assign activity you can extract the specific values applying XPATH on result parameter which will be output of 'Make Post Call' workflow
                  8. You just need to play with it according to your requirement and data.

                   

                  Regards,

                  Aryan Anantwar

                  1 of 1 people found this helpful
                  • 6. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
                    Maximilien Soullez

                    You right, i begin with "development studio" but i learn very Fast

                    I already have structured my workflow "probably a part" to login to my VMware/vROps, the output should = token result !, now the challenge for me is to understand if my configuration is ok or not, in parallel i'm waiting for my firewall team to open the communication...

                    So, I'll see soon if what I did makes sense or not! you can see bellow my beginner job

                    In another hand, i should be able to use the built-in process below "drag and drop" to my workflow, are they the solution and i will save time ?

                    • 8. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
                      Aryan Anantwar

                      Hi,

                       

                      The error shows that you have used some Context item or module config item and it is not correctly mapped.

                      Hence it is not able to access/get the value for it in workflow.

                       

                      Apart from that, as per you screenshots you have hardcoded the URL and some other values, which you can also put in module configuration and use them in your workflow.

                       

                      The error you are getting is just because of incorrect mapping of context / module config items.

                       

                      Regards,

                      Aryan Anantwar

                      • 9. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
                        Maximilien Soullez

                        I changed my plan to use the built-in AO login process, seem the same issue here, I can't even do a simple login with REST API to obtain a token

                        probably i miss something, in advance thanks for your advise... please see below ( FYI, this call REST API works with Postman)

                         

                        what I did :

                        1) i create a new module "DevAPI" then in this module i created different module configuration item (username, pwd"secure string", url)

                        2) i did a copy of the process bellow "Login" from OA Common utilities/bao utilities/rest/Login and past this process into my Module and rename it as "login test"

                         

                         

                        3) first, from my module i open login-test process and change 2 things "construct body" and "post"

                        below my construct body (i used my custom module configuration item)

                        below my post (i only changed true to false)

                         

                        4) i create a workflow "login" and then drag and drop + linked my custom process "login-test"

                         

                        5) finaly open "login-test" from the workflow "Login" and then change 4 value as requested (RESTAdapter and my custom module configuration item)

                         

                        6) RUN and failed ! the result = HTTP Status 401 – Unauthorized

                        below a part of workflow result

                        (...something weird about the url that we can see in the test result = https://myvmware.domain.com/identity/api/tokens/rest/login

                        even if I put only this information in my variable "https://myvmware.domain.com/identity/api/tokens" it's like the workflow added at the end "/rest/login", it may be an expected result. !?....)

                        ...

                        [TEXT=Adapter Request to Execute..]

                        [adapter name=RESTAdapter]

                        [adapter request xml=

                        <adapter-request xmlns:xalan="http://xml.apache.org/xalan">

                          <target-adapter>rest-actor</target-adapter>

                          <peer-location>

                            <location>this</location>

                          </peer-location>

                          <request-action>post</request-action>

                          <request-data>

                            <rest-adapter-request>

                              {"url":"https://myvmware.domain.com/identity/api/tokens/rest/login","use-ssl-certificate":"false","install-certificate":"false","allow-unsigned-certificate":"true","return-data-format":"XML", "headers" : { "Content-type" : "application/json" }}

                              <body>

                                <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Content">

                                  <CipherData>

                                    <CipherValue>encryptedvalue....</CipherValue>

                                  </CipherData>

                                </EncryptedData>

                              </body>

                            </rest-adapter-request>

                          </request-data>

                        </adapter-request>]

                        07 Feb 2020 11:09:08,807 [Current Time=Fri Feb 07 11:09:08 EST 2020] [Process Name=:AutoPilot-AD-Utilities:REST:Post] [Root Job Id=4c66da74c362e247:-68134cb5:1700d2b816e:-80001-1581091746916] [Job Id=4c66da74c362e247:-68134cb5:1700d2b816e:-80001-1581091746916/:DevAPI:MDO-Login:start:call-process[1]/:DevAPI:MDO-Login-tst:start:call-process[1]] [Parent Job Id=4c66da74c362e247:-68134cb5:1700d2b816e:-80001-1581091746916/:DevAPI:MDO-Login:start:call-process[1]]

                        [TEXT=Adapter response:]

                        [adapter response=

                        <rest-adapter-response>

                          <metadata>

                            <status>success</status>

                          </metadata>

                          <status-line>

                            <code>401</code>

                            <reason></reason>

                          </status-line>

                          <header-lines>

                            <Cache-Control>no-cache, no-store, max-age=0, must-revalidate</Cache-Control>

                            <Pragma>no-cache</Pragma>

                            <Expires>0</Expires>

                            <Strict-Transport-Security>max-age=31536000 ; includeSubDomains</Strict-Transport-Security>

                            <X-XSS-Protection>1; mode=block</X-XSS-Protection>

                            <X-Frame-Options>DENY</X-Frame-Options>

                            <X-Content-Type-Options>nosniff</X-Content-Type-Options>

                            <Content-Type>text/html;charset=utf-8</Content-Type>

                            <Content-Language>en</Content-Language>

                            <Content-Length>802</Content-Length>

                            <Date>Fri, 07 Feb 2020 16:09:07 GMT</Date>

                            <Connection>close</Connection>

                          </header-lines>

                          <message-body>

                            <html lang="en">

                              <head>

                                <meta name="generator" content="HTML Tidy, see www.w3.org" />

                                <title>HTTP Status 401 – Unauthorized</title>

                                <style type="text/css">

                        h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}

                        </style>

                              </head>

                              <body>

                                <h1>HTTP Status 401 – Unauthorized</h1>

                              </body>

                            </html>

                          </message-body>

                        </rest-adapter-response>]

                        • 10. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
                          Aryan Anantwar

                          Hi,

                           

                          I can see following issues in your workflow:

                          • You have used OOTB AutoPilot-OA-Common_Utilities->BAO_Utilities -> REST -> Login workflow, which is specifically designed to to consume AO REST APIs. This workflow appends /rest/login to the URL value you provide to this workflow as input, hence you are are seeing diff URL for your Login call when you use this workflow. See below:

                                   

                          • Also, I can see you are trying to get authentication token for your VMWare application using URL : https://myvmware.domain.com/identity/api/tokens" which is HTTPS and for this, you need to install SSL certificate for this applciation manually in AO keystore or let AO do it automatically.
                          • To get rid of the issue you are having at the moment, try below steps:
                            • Remove the Set URL assign activity from 'Login' workflow form your custom module
                            • Set below parameters as true for 'Post' workflow -
                              • use-ssl-certificate
                              • install-certificate
                              • allow-unsigned-certificate
                          • Test your workflow, it should be working (Hopefully )
                          • If still you get error for authorization, then try changing the type 'secure' to 'static value' for password module config item.

                           

                          Regards,

                          Aryan Anantwar

                          1 of 1 people found this helpful
                          • 11. Re: How to start with TrueSight Orchestrator to initiate a workflow HTTP Request
                            Maximilien Soullez

                            After removed Set URL assign activity, the workflow worked - i got the token result this is a first step - thanks.

                            FYI, in another hand I open a case with the support because, the credentials from the body "password" is in clear txt even if come from module configuration item "secure string" - this information in clear txt appear  in grid.log and RESTAdapter.log