# Events

This article lists the model lifecycle events fired by EasyDCIM (saving, saved, updating, updated, deleting, deleted, creating, created). It explains when each event is dispatched and shows how extension code can listen to them to react to data changes inside the platform.

# System events

EasyDCIM models call several events, allowing you to hook into various points in the model's lifecycle using the following methods: saving, saved, updating, updated, deleting, deleted. Whenever a new item is saved for the first time, the creating and created events will start. If an item is not new and the save method is called, the updating / updated events will be started. In both cases, the saving / saved events will be called.

Example:

\Event::listen('easydcim.saving: device', function($model) {
$model->label = 'Custom Device Label';
});

The basic events fired by the system are the following:

# Devices

  • easydcim.saving: device
  • easydcim.saved: device
  • easydcim.updating: device
  • easydcim.updated: device
  • easydcim.deleting: device
  • easydcim.deleted: device
  • easydcim.device: boot (power on device)
  • easydcim.device: reboot (reboot device)
  • easydcim.device: shutdown (power off device)

# Items

  • easydcim.saving: item
  • easydcim.saved: item
  • easydcim.updating: item
  • easydcim.updated: item
  • easydcim.deleting: item
  • easydcim.deleted: item
  • easydcim.item: boot (power on device)
  • easydcim.item: reboot (reboot device)
  • easydcim.item: shutdown (power off device)

# Item models

  • easydcim.saving: itemModel
  • easydcim.saved: itemModel
  • easydcim.updating: itemModel
  • easydcim.updated: itemModel
  • easydcim.deleting: itemModel
  • easydcim.deleted: itemModel

# Item monitors

  • easydcim.saving: itemMonitor
  • easydcim.saved: itemMonitor
  • easydcim.updating: itemMonitor
  • easydcim.updated: itemMonitor
  • easydcim.deleting: itemMonitor
  • easydcim.deleted: itemMonitor

# Item ports

  • easydcim.saving: itemPort
  • easydcim.saved: itemPort
  • easydcim.updating: itemPort
  • easydcim.updated: itemPort
  • easydcim.deleting: itemPort
  • easydcim.deleted: itemPort

# Item power ports

  • easydcim.saving: itemPowerPort
  • easydcim.saved: itemPowerPort
  • easydcim.updating: itemPowerPort
  • easydcim.updated: itemPowerPort
  • easydcim.deleting: itemPowerPort
  • easydcim.deleted: itemPowerPort

# Item types

  • easydcim.saving: itemType
  • easydcim.saved: itemType
  • easydcim.updating: itemType
  • easydcim.updated: itemType
  • easydcim.deleting: itemType
  • easydcim.deleted: itemType

# Item type fields

  • easydcim.saving: itemTypeField
  • easydcim.saved: itemTypeField
  • easydcim.updating: itemTypeField
  • easydcim.updated: itemTypeField
  • easydcim.deleting: itemTypeField
  • easydcim.deleted: itemTypeField

# Locations

  • easydcim.saving: location
  • easydcim.saved: location
  • easydcim.updating: location
  • easydcim.updated: location
  • easydcim.deleting: location
  • easydcim.deleted: location

# Racks

  • easydcim.saving: rack
  • easydcim.saved: rack
  • easydcim.updating: rack
  • easydcim.updated: rack
  • easydcim.deleting: rack
  • easydcim.deleted: rack

# Floors

  • easydcim.saving: floor
  • easydcim.saved: floor
  • easydcim.updating: floor
  • easydcim.updated: floor
  • easydcim.deleting: floor
  • easydcim.deleted: floor

# Notifications

  • easydcim.saving: notification
  • easydcim.saved: notification
  • easydcim.updating: notification
  • easydcim.updated: notification
  • easydcim.deleting: notification
  • easydcim.deleted: notification

# Orders

  • easydcim.saving: order
  • easydcim.saved: order
  • easydcim.updating: order
  • easydcim.updated: order
  • easydcim.deleting: order
  • easydcim.deleted: order

# Services

  • easydcim.saving: service
  • easydcim.saved: service
  • easydcim.updating: service
  • easydcim.updated: service
  • easydcim.deleting: service
  • easydcim.deleted: service
  • easydcim.service.before: activate
  • easydcim.service.after: activate
  • easydcim.service.before: suspend
  • easydcim.service.after: suspend
  • easydcim.service.before: unsuspend
  • easydcim.service.after: unsuspend
  • easydcim.service.before: terminate
  • easydcim.service.after: terminate

# Service access levels

  • easydcim.saving: serviceAccessLevel
  • easydcim.saved: serviceAccessLevel
  • easydcim.updating: serviceAccessLevel
  • easydcim.updated: serviceAccessLevel
  • easydcim.deleting: serviceAccessLevel
  • easydcim.deleted: serviceAccessLevel

# Users

  • easydcim.saving: user
  • easydcim.saved: user
  • easydcim.updating: user
  • easydcim.updated: user
  • easydcim.deleting: user
  • easydcim.deleted: user