Hello,
I am working on a PowerShell script that interacts with a vCO workflow. I have no issues passing strings, but now I need to pass an inventory object, a vCAC blueprint object to be more precisely. But I can't figure out how to include the sdk-object information into the body of the Web request.
$body = '<execution-context xmlns="http://www.vmware.com/vco">
<parameters>
<parameter name="description" type="string">
<string>Hello vCO, I am PS</string>
</parameter>
<parameter name="blueprint" type="vCAC:Blueprint">
<sdk-object> href="https://XXXXXX:8281/api/catalog/vCAC/Blueprint/59a8b719-b5b6-4676-acaa-f9c89402a3c5%252Ffad8e332-0c5b-4110-a7c8-58890e246d48/" id="59a8b719-b5b6-4676-acaa-f9c89402a3c5/fad8e332-0c5b-4110-a7c8-58890e246d48" </sdk-object>
</parameter>
</parameters>
</execution-context>'
Invoke-WebRequest -uri https://XXXXXX:8281/api/workflows/516bb2af-213e-420e-9d93-b2babcdd5621/executions/ -Headers $headers -Body $body -ContentType "application/xml" -Method Post
Invoke-WebRequest : HTTP Status 409 - Parameter of type: vCAC:Blueprint did not have objectRef or id.
type Status report
message Parameter of type: vCAC:Blueprint did not have objectRef or id.
description The request could not be completed due to a conflict with the current state of the resource.
VMware vFabric tc Runtime
Any help on how to pass the object reference to the Web Request is appreciated.
Regards,
Juan.