Populate Action Using POST

Populate Action Using POST


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}/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": [
        {}
    ]
}
{
    "contextResourceId": [
        "string"
    ]
}
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
{
    "action-execution": {
        "contextId": "string",
        "contextResourceId": [
            "string"
        ],
        "parameterGroups": [
            {
                "parameterValue": [
                    {
                        "name": "string",
                        "value": "string"
                    }
                ],
                "resourceId": "string"
            }
        ]
    },
    "actionContext": {
        "fields": [
            {
                "component": "string",
                "displayOrder": 0,
                "expressionResults": [
                    "string"
                ],
                "hidden": false,
                "id": "string",
                "input": false,
                "name": "string",
                "parameterKey": "string"
            }
        ],
        "id": "string"
    },
    "id": "string",
    "links": [
        {
            "description": "string",
            "href": "string",
            "name": "string",
            "rel": "string"
        }
    ],
    "methodParameters": [
        {
            "dataType": "string",
            "id": "string",
            "isList": false,
            "isRequired": false
        }
    ],
    "resourceId": [
        "string"
    ]
}
action-execution
Optional

Contains describe instance data about performing an action.

actionContext
Optional

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

string
id
Required

The key of the populated action

array of link
links
Optional

links

methodParameters
Optional

The parameters for the method that was populated

array of string
resourceId
Required

The resource ids that apply to the populated action