VMware Cloud Community
vt6711
Contributor
Contributor

how import .workflow to VRealize Orchestrator 8.1

Hello good night, I'm new in the world of VRealize Orchestrator, I will need import files type .workflow that I can download of this page, I have Version 8.1 it is possible? and how could i do it? and sorry for my bad English

Reply
0 Kudos
22 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Import/export units in vRO 8.1 UI client are the packages. Importing of individual workflows/resources/configurations/etc. is not supported at this time.

Reply
0 Kudos
vt6711
Contributor
Contributor

Hello Ilian, thank you very much for your answer... then if I have a .workflow, I cant in any way to import a my Orchestrator? or can I to do a packet with this .workflow and import to Orchetrator?

Best Regards

Reply
0 Kudos
stdrv
VMware Employee
VMware Employee

Hi,

This can be done only by using the REST api.

First you need to get the id of the category you want to import the workflow in by using the GET method of /vco/api/categories .

Then to import the .workflow file you will have to use the POST method of /vco/api/workflows .

You will need to provide the categoryId as a query parameter. ex: https://<orchestrator-fqdn>/vco/api/workflows?categoryId=8af885e971c499d70171c68d13ce0082

and provide the .workflow file as a form-data parameter with a key "file"

Reply
0 Kudos
jacobpeek
Contributor
Contributor

I am looking for additional info on the import function, I have tried to automate this through vro and have the export working using base64encode/decoding but I have yet to get the import API to function properly.  I am returning a 405 and 406 error, The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation.

 

 

Reply
0 Kudos
jacobpeek
Contributor
Contributor

If possible was this ever working using Postman? If so do you have an example ?  Thank you!

Reply
0 Kudos
jacobpeek
Contributor
Contributor

Hmm that doesn't seem accurate there is an API call for importing workflows requiring category ID, this is what I am exploring and attempting to get to work. 

Please look at 

/vco/api/workflows?categoryId=xxxxxxxxxxxxxxxx
Reply
0 Kudos
eoinbyrne
Expert
Expert

If you have a ".workflow" file you can use a ZIP tool (e.g., 7-zip) to expand the contents like this

eoinbyrne_0-1621606365559.png

 

The file "workflow-content" is XML but you can read the workflow script / items within it. Also, the header elements will show the parameters, attributes etc

eoinbyrne_1-1621606441742.png

 

Worst case, by doing this you should be able to manually re-construct the workflow in your 8.1 instance (create new workflow, build out the items and copy in the script elements)

 

Not the most elegant but will work if you only have one workflow. If you have many then this could get pretty tedious

 

-HTH

Reply
0 Kudos
xian_
Expert
Expert

Or you can connect to 8.1 with a legacy 7.6 java client and import your workflows with it.

Reply
0 Kudos
Compono
Contributor
Contributor

Does that still work in 8.3?  I've tried it, with no luck.

Reply
0 Kudos
xian_
Expert
Expert

If you mean the legacy client, yes: I used it with 8.1, 8.2, 8.3 and 8.4

Rick_Boyer
Contributor
Contributor

What port do you use when connecting to a version 8.x vROps instance with the legacy java client?

Reply
0 Kudos
xian_
Expert
Expert

It's vRO, not vROps,

the port I used was 443 with a vRA embedded vRO. Have not tried with standalone vRO.

Reply
0 Kudos
Rick_Boyer
Contributor
Contributor

Yeah, I meant vRO, and my instance is standalone and it doesn't work. 

Reply
0 Kudos
xian_
Expert
Expert

Try 8281

Reply
0 Kudos
jacobpeek
Contributor
Contributor

I have been able to get the import to work using postman successfully please see the postman code extract.

 

curl --location --request POST 'https://<My-instance-name>/vco/api/content/workflows/<My-Content-ID>?overwrite=true' \
--header 'Content-Type: multipart/form-data; boundary=------------------------3f87bcf3b4060f4d' \
--header 'Authorization: Basic MyTokenStringWhichisLong' \
--form 'file=@"/Users/jpeek1/Downloads/exportWorkflow-NEW.workflow"'
Reply
0 Kudos
Rick_Boyer
Contributor
Contributor

Tried 8281, 443, 8283 and /vco and nothing works.

Reply
0 Kudos
xian_
Expert
Expert

Jacob's method also works, but there is a tool for that: https://github.com/jakkulabs/PowervRO 

$SecurePassword = ConvertTo-SecureString "VMware1!" -AsPlainText -Force
Connect-vROServer -Server vra8.corp.local -Port 443 -Username myuser -Password $SecurePassword -IgnoreCertRequirements
Import-vROWorkflow -CategoryId 8a7480107103eca101711c92f9f91e71 -File test1.workflow -Overwrite

You need to know the ID of the folder (CategoryId) that you want to import to. Here is an easy way to find out within vRO, with this script:

System.log(System.getObjectId(Server.getWorkflowCategoryWithPath("MyCompany/Project1")));
Reply
0 Kudos
xian_
Expert
Expert

Also, I wrote a vRO workflow to import vRO workflows 🙂 

https://kuklis.github.io/cma/post/vro8-import-workflow/

imtrinity94
Enthusiast
Enthusiast

imtrinity94_0-1639034420869.png

It just failed for me. @xian_  Inputs were as desired.


Mayank Goyal
vRO Engineer
https://www.linkedin.com/in/mayankgoyal1994/
https://cloudblogger.co.in/
Reply
0 Kudos