VMware Cloud Community
Aristizabal
Enthusiast
Enthusiast
Jump to solution

Invoke vCO workflow via PowerShell fails after 5.5.2 upgrade

Hello,

After upgrading vCO to 5.5.2 I am having problems executing workflows from PowerShell using REST. I read there are many changes on the vCO REST API on this new version so I am thinking the upgrade has something to do with the problem. 

$username = 'XXXXXX

$upassword = 'XXXXXX'

#create Headers for vCO REST call

$auth = $username + ':' + $upassword

$Encoded = [System.Text.Encoding]::UTF8.GetBytes($auth)

$EncodedPassword = [System.Convert]::ToBase64String($Encoded)

$headers = @{"Authorization"="Basic $($EncodedPassword)";}

$value = "nothing"

$body = '<execution-context xmlns="http://www.vmware.com/vco">

                <parameters>

                    <parameter name="arg_in_0" type="string">

                        <string>'+$value+'</string>

                    </parameter>

                </parameters>

            </execution-context>'

 

$ret =Invoke-WebRequest -uri https://vcoserver:8281/api/workflows/0049f373-8dc4-4c1b-ae67-15e7bc106fa4/executions/ -Headers $headers -Body $body -ContentType "application/xml" -Method Post

I get the following error:

Invoke-WebRequest : HTTP Status 401 - Full authentication is required to access this resource

type Status report

message Full authentication is required to access this resource

description This request requires HTTP authentication.

VMware vFabric tc Runtime 2.9.5.SR1/7.0.50.C.RELEASE

Thanks,

Juan.

Tags (2)
1 Solution

Accepted Solutions
igaydajiev
VMware Employee
VMware Employee
Jump to solution

try changing the url from

https://vcoserver:8281/api/workflows/0049f373-8dc4-4c1b-ae67-15e7bc106fa4/executions/

to

https://vcoserver:8281/vco/api/workflows/0049f373-8dc4-4c1b-ae67-15e7bc106fa4/executions/

vCO  was moved under /vco/ context


There should not be any REST API breaking changes.

I also notice that in provided script there is missing quote for user name

>$username = 'XXXXXX

View solution in original post

2 Replies
igaydajiev
VMware Employee
VMware Employee
Jump to solution

try changing the url from

https://vcoserver:8281/api/workflows/0049f373-8dc4-4c1b-ae67-15e7bc106fa4/executions/

to

https://vcoserver:8281/vco/api/workflows/0049f373-8dc4-4c1b-ae67-15e7bc106fa4/executions/

vCO  was moved under /vco/ context


There should not be any REST API breaking changes.

I also notice that in provided script there is missing quote for user name

>$username = 'XXXXXX

Aristizabal
Enthusiast
Enthusiast
Jump to solution

Thanks a lot, that was the issue. I remember now that I modified the vCO API location in order to make it compatible with vCAC 5.2, I guess that when I upgraded Orchestrator the API changed back to the default location.

Reply
0 Kudos