Quantcast
Channel: VMware Communities : All Content - vRealize Automation Tools
Viewing all articles
Browse latest Browse all 9859

vRA 6.2 REST API: Resource Action with VRO-mapped object

$
0
0

I created a Resource Action (Advanced Services - Resource Actions) that calls an orchestrator (VRO) workflow to do a few things.  The VRO workflow takes three objects as inputs: 2 string's and a VC:VirtualMachine.  Logging into the web GUI, when a user selects the action for the specific VM, they are presented with a form prompting for the content of the 2 strings.  The VC:VirtualMachine object is transparant and (I believe) is automatically mapped internally to the VM selected.  This action works great when launched through the web GUI.  Now I need to create the same scenario using the REST API.  I have created the JSON "ResourceActionRequest" object and included the 2 strings as entries in the request data, but I have no idea how to add in the VC:VirtualMachine object to the request.  I thought maybe it was also transparant, but I get an error if I try sending the JSON without the 3rd piece of data.  For example, here is my JSON "ResourceActionRequest" object:

 

{

    "@type": "ResourceActionRequest",

    "resourceRef": {

        "id": "<resourceRef-id>"

    },

    "resourceActionRef": {

        "id": "<resourceActionRef-id>"

    },

    "organization": {

        "tenantRef": "<label>",

        "tenantLabel": "<label>",

        "subtenantRef": "<subtenantRef>",

        "subtenantLabel": "<subtenantLabel>"

    },

    "state": "SUBMITTED",

    "requestNumber": 0,

    "requestData": {

        "entries": [{

            "key": "provider-MyFirstCustomProperty",

            "value": {

                "type": "string",

                "value": "blah,blah,blah"

            }

        },

        {

            "key": "provider-MySecondCustomProperty",

            "value": {

                "type": "string",

 

                "value": "blah,blah,blah"

            }

        }]

    }

}

 

I'm just not sure how to provide the VC:VirtualMachine into the request.  Any help would be appreciated.  Thanks!

 

-- Stephen


Viewing all articles
Browse latest Browse all 9859

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>