Populate Action

Populate Action


Performing a POST /api/actions/{id}/query would yield a response object that
includes the resources that the action would apply to with the populated values of each action
context field for the resource. The response contains information about the parameters to the
action's method. It also includes a sample input that would be used for running the action with
POST /api/actions/{id} if you chose to run it on all applicable resources
and not change the default input values.

The json result inside actionExecution can be used directly as input perform the action. In the xml
result, the xml element ops:action-execution will need namespace binding added to it in order to use it
in the request.
xmlns:ops="http://webservice.vmware.com/vRealizeOpsMgr/1.0/"

Request
URI
POST
https://{api_host}/suite-api/api/actions/{id}/query
COPY
Path Parameters
string
id
Required

The Id for the action to be populate.


Request Body

The additional information needed to populate the action.

action-population of type(s) application/json
Required

Show optional properties

{
    "contextResourceId": [
        {}
    ]
}
"{\n  \"contextResourceId\" : [ \"c5af764a-d4d5-4258-829c-8acb0604e4c7\" ]\n}"
array of string
contextResourceId
Required

The UUID list of the resources that the population will be run against

Authentication
This operation uses the following authentication methods.
Responses
200

The populated action information

Returns populated-action of type(s) application/json
"{\n  \"id\" : \"VMWARE-Power Off VM\",\n  \"actionContext\" : {\n    \"id\" : \"Power Off VM\",\n    \"fields\" : [ {\n      \"id\" : \"Name\",\n      \"name\" : \"VM Name\",\n      \"component\" : \"textfield\",\n      \"input\" : false,\n      \"displayOrder\" : 0,\n      \"hidden\" : false,\n      \"expressionResults\" : [ \"MyVMName\" ]\n    } ]\n  },\n  \"methodParameters\" : [ {\n    \"id\" : \"mOR\",\n    \"dataType\" : \"String\",\n    \"isRequired\" : true,\n    \"isList\" : false\n  } ],\n  \"action-execution\" : {\n    \"contextId\" : \"PowerOffVM\",\n    \"contextResourceId\" : [ \"7e780215-da07-4da1-9167-cd6892dcfdd8\" ],\n    \"parameterGroup\" : [ {\n      \"resourceId\" : \"7e780215-da07-4da1-9167-cd6892dcfdd8\"\n    } ]\n  }\n}"
string
id
Required

The key of the populated action

object
actionContext
Optional

Represents an executable step within an action. It defines which method the step calls and what fields related to this step.

array of string
resourceId
Required

The resource ids that apply to the populated action

array of object
methodParameters
Optional

The parameters for the method that was populated

object
action-execution
Optional

Contains describe instance data about performing an action.

array of object
links
Optional

Represents a HTTP 'link' element.
It is implicit that all the link tags support http 'GET' method.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"contextResourceId":["string"]}' https://{api_host}/suite-api/api/actions/{id}/query