Active IQ Unified Manager Discussions

Use of REST / web services via a web browser?

solal
3,776 Views

Hi all.

I saw many examples of using REST to execute workflows remotely and used several of them, also created some examples.

One thing i'm still trying is to use that in a conventional web browser (Chrome, IE...) by giving a link (assuming I know and have all keys and values needed of course) for the user to click.

Idea is to show the link for lets say creating a new cloud environment for the managing user, he clicks the link and "hocus pocus" everything happens (same as in our powershell / perl examples).

Appreciate any help or ideas.

Thanks guys.

Solal.

6 REPLIES 6

sinhaa
3,776 Views

Solal, can you elaborate what exactly do you want to achieve? This "everything happens" is not accurate enough.

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

solal
3,776 Views

Sure thing.

The idea that the customer is asking is a link / button in a web application of his (accessible via a browser) that executes a workflow.

The link of course contains all attributes that we created to run thw workflow.

The thing behind that idea is the deployment of new SVMs for new customers in the company's cloud.

Our usage via REST in powershell is less adequate, since he wants to deploy it in his web application - a click on the link will execute the workflow.

sinhaa
3,776 Views

Looks very  possible, though I've not tried it myself till now. But I now I'm going to. I'll update you if soon.

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

abhit
3,776 Views

Hi Solal:

You can probably achieve it this way.

You can create a form in an HTML page with the attributes selected and with the values.

Please see the Bold text below. The entire textarea will be hidden since the style is set to display:none.

Only one Button will be visible for submitting the workflow.

If you want the attributes to be filled up in a form and then submitted to WFA,

if you google you will find examples where the user input data in HTML forms is converted to XML format.

Can be done either at the browser or the server side. Not sure what the customer will be interested in.

<html>

    <body>

        <form action="http://localhost:81/rest/workflows/47c9ca1f-63bf-4f30-8eca-17f076f70348/jobs" method="post">

            <textarea rows="20" cols="100" name=" " style="display:none;">

                <?xml version="1.0"?>

                       <workflowInput>

                         <userInputValues>

                           <userInputEntry key="ClusterName" value="sn1-cluster" />

                           <userInputEntry key="VserverName" value="sn1-cluster"/>

                           <userInputEntry key=”SnapMirrorPolicyName” value=”SnapMirrorPolicy_testcase”/>   

                         </userInputValues>

                       </workflowInput>

            </textarea>

            <input type="submit" value="Submit">

        </form>       

    </body>

</html>

Let us know if you have any further queries.

Regards

Abhi

solal
3,776 Views

Hi Abhi.

Thanks a lot for that example, I'll work on that.

In the meantime, is there a way for remote authentication so I would not have to run locally this HTML?

Solal.

abhit
3,776 Views

Hi Solal:

Just want to understand the question clearly.

You don't want to enter the credentials manually.

Is this what you are looking for?

HTML file can be put in a server and can be accessed in any client.

Regards

Abhi

Public