Events API

On This Page

Events are emitted by the Iguazio backend for internal (services) and external (users) visibility of user actions, security actions and system state. The user can emit (manual) events as long as he has system admin role.

Events are displayed in the Iguazio Events Dashboard.

Before you start, make sure that the igz_mgmt package is installed and that you are logged in to the system with the igz_mgmt.Client API. If not, see Control plane API.

import igz_mgmt
client = igz_mgmt.Client(username="someone", access_key="some-access-id")

List Events, Audit Events, Communication Events

Events, Audit Events, Communication Events can be filtered by tenant, source, kind, classification, severity, etc.

The following example lists all info-level events for the current tenant.

events = igz_mgmt.Event.list(
    client, filter_by={"severity": igz_mgmt.constants.EventSeverity.info}
)

The following example lists all security audit events for login failures

audit_events = igz_mgmt.AuditEvent.list(
    client,
    filter_by={"kind": "Security.User.Login.Failed"},
)

The following example lists all communication events for the current tenant.

communication_events = igz_mgmt.CommunicationEvent.list(client)

Manual events

Manual events are events that are emitted by the user. If Iguazio-system has predefined “kind” for the events, the parameters text must be accordingly to the event definition. Ask Support team to learn more.

Create a manual audit event

import igz_mgmt.resources
import igz_mgmt.schemas.events

event = igz_mgmt.resources.AuditEvent(
    source="mlrun-api",
    kind="Software.Project.Secret.Created",
    visibility=igz_mgmt.constants.EventVisibility.external.value,
    classification=igz_mgmt.constants.EventClassification.security.value,
    system_event=True,
    description="Created a secret",
    severity=igz_mgmt.constants.EventSeverity.info.value,
    parameters_text=[
        igz_mgmt.schemas.events.ParametersText(name="secret_keys", value="a,b,c"),
        igz_mgmt.schemas.events.ParametersText(name="secret_name", value="my-secret"),
        igz_mgmt.schemas.events.ParametersText(name="project", value="my-project"),
    ],
)
event.emit(client)