Files
deb-python-pyvmomi/docs/vim/event/EventManager.rst
Shawn Hartsock 15f7be9a52 pyVmomi reStructured Text Documentation
This external documentation for pyVmomi was generated using Googly Docs
(aka Google Standard Documentation) which renders very cleanly in
GitHub. Internal documentation for a class should be done in Sphinx
format because tools like pyCharm and Eclipse can use that documentation
as a hint for code completion.

Note: External docs as Googly Docs, internal docs as Sphinx.

Closes bug#15
2014-06-17 14:07:42 -04:00

5.4 KiB

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
  • .