Event Manager Post Event

Event Manager Post Event

Posts the specified event, optionally associating it with a task.

The event being posted should have the following info in it:

  • The ManagedEntity on which the event is being posted should be set in the appropriate EntityEventArgument field of the base Event class. It is OK to not set any entity, in which case the event is treated as an event about the system.
  • Some Event fields (key, chainId, createdTime) are mandatory because of the nature of the structure, but any caller-supplied values will be overwritten by the system.

If the event being posted is to be associated with an existing Task, the appropriate TaskInfo needs to be passed in. This task can either be one returned from a vSphere API operation or an extension task created by calling CreateTask.

Required privileges: Global.LogEvent

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/EventManager/{moId}/PostEvent
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case EventManager/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
PostEventRequestType of type(s) application/json
Required
{
    "eventToPost": {
        "key": 0,
        "chainId": 0,
        "createdTime": "string",
        "userName": "string",
        "datacenter": {
            "datacenter": {
                "type": "string",
                "value": "string"
            }
        },
        "computeResource": {
            "computeResource": {
                "type": "string",
                "value": "string"
            }
        },
        "host": {
            "host": {
                "type": "string",
                "value": "string"
            }
        },
        "vm": {
            "vm": {
                "type": "string",
                "value": "string"
            }
        },
        "ds": {
            "datastore": {
                "type": "string",
                "value": "string"
            }
        },
        "net": {
            "network": {
                "type": "string",
                "value": "string"
            }
        },
        "dvs": {
            "dvs": {
                "type": "string",
                "value": "string"
            }
        },
        "fullFormattedMessage": "string",
        "changeTag": "string"
    },
    "taskInfo": {
        "key": "string",
        "task": {
            "type": "string",
            "value": "string"
        },
        "description": {
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        },
        "name": "string",
        "descriptionId": "string",
        "entity": {
            "type": "string",
            "value": "string"
        },
        "entityName": "string",
        "locked": [
            {
                "_typeName": "string",
                "type": "string",
                "value": "string"
            }
        ],
        "state": "string",
        "cancelled": false,
        "cancelable": false,
        "error": {
            "faultCause": "MethodFault Object",
            "faultMessage": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "arg": [
                        {
                            "_typeName": "string",
                            "key": "string",
                            "value": {
                                "_typeName": "string"
                            }
                        }
                    ],
                    "message": "string"
                }
            ]
        },
        "result": {
            "_typeName": "string"
        },
        "progress": 0,
        "progressDetails": [
            {
                "_typeName": "string",
                "key": "string",
                "value": {
                    "_typeName": "string"
                }
            }
        ],
        "reason": {
            "_typeName": "string"
        },
        "queueTime": "string",
        "startTime": "string",
        "completeTime": "string",
        "eventChainId": 0,
        "changeTag": "string",
        "parentTaskKey": "string",
        "rootTaskKey": "string",
        "activationId": "string"
    }
}
eventToPost
Required

This event is the base data object type from which all events inherit.

All event objects are data structures that describe events. While event data objects are data structures that describe events, event data type documentation may describe what the event records, rather than the data structure, itself.

taskInfo
Optional

This data object type contains all information about a task.

A task represents an operation performed by VirtualCenter or ESX.

Authentication
This operation uses the following authentication methods.
Responses
204

No Content

Operation doesn't return any data structure

500

InvalidArgument: if

  • an invalid reference to a managed object is passed in to one of the EntityEventArgument fields
  • an invalid severity value is passed in an EventEx.

InvalidEvent: no longer thrown by this API

Returns InvalidEvent of type(s) application/json
This response body class contains all of the following: VimFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}