1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
|
.. _int: https://docs.python.org/2/library/stdtypes.html
.. _str: https://docs.python.org/2/library/stdtypes.html
.. _Event: ../../vim/event/Event.rst
.. _chainId: ../../vim/event/Event.rst#chainId
.. _vim.Task: ../../vim/Task.rst
.. _VI API 2.5: ../../vim/version.rst#vimversionversion2
.. _createdTime: ../../vim/event/Event.rst#createdTime
.. _vim.TaskInfo: ../../vim/TaskInfo.rst
.. _vim.event.Event: ../../vim/event/Event.rst
.. _vSphere API 4.0: ../../vim/version.rst#vimversionversion5
.. _vim.ManagedEntity: ../../vim/ManagedEntity.rst
.. _EntityEventArgument: ../../vim/event/EntityEventArgument.rst
.. _vim.fault.InvalidState: ../../vim/fault/InvalidState.rst
.. _vim.fault.InvalidEvent: ../../vim/fault/InvalidEvent.rst
.. _vim.event.EventFilterSpec: ../../vim/event/EventFilterSpec.rst
.. _vim.event.EventDescription: ../../vim/event/EventDescription.rst
.. _vmodl.fault.InvalidArgument: ../../vmodl/fault/InvalidArgument.rst
.. _vim.event.EventHistoryCollector: ../../vim/event/EventHistoryCollector.rst
.. _vim.event.EventDescription.EventArgDesc: ../../vim/event/EventDescription/EventArgDesc.rst
vim.event.EventManager
======================
This managed object type provides properties and methods for event management support. Event objects are used to record significant state changes of managed entities.
Attributes
----------
description (`vim.event.EventDescription`_):
privilege: System.View
Static descriptive strings used in events.
latestEvent (`vim.event.Event`_):
privilege: System.View
The latest event that happened on the VirtualCenter server.
maxCollector (`int`_):
privilege: System.View
For each client, the maximum number of event collectors that can exist simultaneously.
Methods
-------
RetrieveArgumentDescription(eventTypeId):
Retrieves the argument meta-data for a given Event type
since: `vSphere API 4.0`_
Privilege:
System.View
Args:
eventTypeId (`str`_):
Returns:
[`vim.event.EventDescription.EventArgDesc`_]:
CreateCollectorForEvents(filter):
Creates an event history collector, which is a specialized history collector that provides Event objects.Event collectors do not persist beyond the current client session.
Privilege:
System.View
Args:
filter (`vim.event.EventFilterSpec`_):
The event query filter.
Returns:
`vim.event.EventHistoryCollector`_:
The event collector based on the filter.
Raises:
`vim.fault.InvalidState`_:
if there are more than the maximum number of event collectors.
`vmodl.fault.InvalidArgument`_:
if the filter is null or if any of its fields is invalid, such as an invalid reference to a managed object, alarm, or scheduled task, or an invalid event type or event chain id, etc.
LogUserEvent(entity, msg):
Logs a user defined event against a particular managed entity.
Privilege:
Args:
entity (`vim.ManagedEntity`_):
The entity against which the event is logged. The entity must be the root folder, a DataCenter, a VirtualMachine, a HostSystem, or a ComputeResource.
msg (`str`_):
The message to be logged.
Returns:
None
Raises:
`vmodl.fault.InvalidArgument`_:
if the entity is of a wrong type or the "msg" string is empty.
QueryEvents(filter):
Returns the events in specified filter. Returns empty array when there are not any events qualified.
Privilege:
System.View
Args:
filter (`vim.event.EventFilterSpec`_):
The events qualified.
Returns:
[`vim.event.Event`_]:
The events matching the filter.
Raises:
`vmodl.fault.InvalidArgument`_:
if the filter is null or if any of its fields is invalid, such as an invalid reference to a managed object, alarm, or scheduled task, or an invalid event type or event chain id, etc.
PostEvent(eventToPost, taskInfo):
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 TaskManager#createTask.
since: `VI API 2.5`_
Privilege:
Global.LogEvent
Args:
eventToPost (`vim.event.Event`_):
Fully-specified event to post
taskInfo (`vim.TaskInfo`_, optional):
optional task associated with the event
Returns:
None
Raises:
`vim.fault.InvalidEvent`_:
no longer thrown by this API
`vmodl.fault.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`_.
|