Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login
    1. Home
    2. franknagel
    3. Topics
    F
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 76
    • Groups 0

    Topics

    • F

      Events und asynchrone Verarbitung bzw. Queueing

      Watching Ignoring Scheduled Pinned Locked Moved Entwicklung
      4
      0 Votes
      4 Posts
      566 Views
      dkirstenD
      Sehr cool. Hier ist übrigens mal nen Preview auf die neue Event Version: [image: 1542378585379-2940aeb7-067a-4a6c-9d08-f266223f1776-image.png] [image: 1542378687955-7e33e224-f81d-4568-8e9b-bb409725fc71-image.png]
    • F

      Events und Automatisierung

      Watching Ignoring Scheduled Pinned Locked Moved Betrieb
      2
      0 Votes
      2 Posts
      386 Views
      P
      genau. ich lass meine user ein virtual server objekt befuellen.. mehrere kategorien.. am schluss setzt der user den status auf 'to_deploy', und nur auf dieses event reagiere ich in einem eventhook, und stosse dann den deploy-eine-vm prozess an... die logik um das event zu filtern ist relativ kompliziert geworden.. weil 10mal nachbessern.. function check_event($event) { // at idoit overview category savebutton click -> we get two events, global and overview // at idoit global category savebutton click -> we get only one event if ($event->categoryConst=='C__CATG__OVERVIEW') { die (getmypid().": not reacting on events of overview category. quitting\n"); } //print_r ($event); $proceed=false; if ($event->categoryConst=='C__CATG__GLOBAL') { if (count ($event->changes)==0) die (getmypid().": no changes. quitting\n"); if (isset ($event->changes->C__OBJ__CMDB_STATUS->to)) { if ($event->changes->C__OBJ__CMDB_STATUS->to !=STRING_DEPLOY) die (getmypid().": status didnt change to '".STRING_DEPLOY."'. quitting\n"); else $proceed=true; } if (isset ($event->changes->{'isys_cmdb_dao_category_g_global::cmdb_status'}->to) ) { if ($event->changes->{'isys_cmdb_dao_category_g_global::cmdb_status'}->to!=STRING_DEPLOY) die (getmypid().": status didnt change to '".STRING_DEPLOY."'. quitting\n"); else $proceed=true; } } if ($proceed) debug( "checking server...\n"); else die (getmypid().": event didnt match categories global or cmdb_status, quitting\n"); } function get_event() { $deploy=""; while($l = fgets(STDIN)){ $deploy.=$l; } $event=json_decode(base64_decode($deploy)); if (json_last_error()) die (getmypid().": error json decode, quitting\n"); return $event; }