BILLmanager Documentation

Event handlers

An event handler is a mechanism for automatic synchronization of add-ons with the main service. Eg. if a client has canceled the virtual server its public IP addresses will be released automatically. Event handlers in BILLmanager are assigned to certain functions. 

Even handlers for Vepp add-ons are started with the following functions: 

  • vds.open — termination of the VPS activation;
  • dedic.open — termination of the dedicated server activation;
  • service.postopen — termination of the manual processing of a service activation task; 
  • service.postsuspend — termination of the manual processing of a service suspension task;
  • service.postresume — termination of the manual processing of a service re-activation task;
  • service.postclose — termination of the manual processing of a service deletion task;
  • vds.edit — VPS modification;
  • dedic.edit — dedicated server modification;
  • service.detail.edit — termination of the manual processing of a service modification task;
  • gotoserver — switch to the service control panel; 
  • task.gettype — receiving a type of the task being created; 
  • auth — authorization in the service control panel. 

Service activation 


When starting the functions vds.open, dedic.open or service.postopen, the events handler: 

  1. Checks that the main service has an active Vepp add-on. If it doesn't exist, is not active, or no websites are ordered, the event won't be processed.
  2. Checks the event handler for the add-on. If it is not assigned, the event won't be processed.
  3. Checks the status of the main service. If it's not active, the event won't be processed.
  4. Selects an appropriate handler for the Vepp add-on. If it is not present or not active, the event won't be processed.
  5. Assigns the service handler to the add-on —  the processingmodule field in the item database table.
  6. Creates and runs the Vepp activation operation. 

Service suspension 


When starting the function service.postsuspend the events handler performs the following operations: 

  1. Checks that the main service has an active Vepp add-on. If it doesn't exist, the event won't be processed.
  2. Checks the event handler for the add-on. If it is not assigned, the event won't be processed.
  3. Creates and runs the Vepp suspension operation. 

Service re-activation 


When starting the function service.postresume the events handler performs the following operations: 

  1. Checks that the main service has an active Vepp add-on. If it doesn't exist, the event won't be processed.
  2. Checks the event handler for the add-on.
    • if it is not assigned:
      1. Selects an appropriate handler for the Vepp add-on. If it is not present or not active, the event won't be processed.
      2. Assigns the service handler to the add-on —  the processingmodule field in the item database table.
      3. Creates and runs the Vepp activation operation. 
    • If it is assigned, creates and runs the Vepp re-activation operation. 

Service suspension 


When starting the function service.postclose the events handler performs the following operations: 

  1. Checks that the main service has an active Vepp add-on. If it doesn't exist, the event won't be processed.
  2. Checks the event handler for the add-on. If it is not assigned, the event won't be processed.
  3. Creates and runs the Vepp deletion operation. 

Service modification


When starting the functions vds.edit, dedic.edit or service.detail.edit  the events handler performs the following operations: 

  1. Checks that the main service has an active Vepp add-on with the assigned event handler and the Vepp order.
    1. If there are no active add-on and order, the event won't be processed.
    2. If there is no active add-on, but the order exists and the main service is active the event handler:
      1. Selects an appropriate handler for the Vepp add-on. If it is not present or not active, the event won't be processed.
      2. Assigns the service handler to the add-on —  the processingmodule field in the item database table.
      3. Creates and runs the Vepp activation operation. 
    3. If the active add-on exists but there is no order, the event handler: 
      1. Checks the event handler for the add-on. If it is not assigned, the event won't be processed.
      2. Creates and runs the Vepp deletion operation. 
    4. If the active add-on and order exist, the event handler:
      1. Checks the event handler for the add-on. If it is not assigned, the event won't be processed.
      2. Creates and runs the Vepp modification operation. 

Log in to Vepp


When starting the function gotoserver the events handler performs the following operations: 

  1. Checks the event handler for the add-on. If it is not assigned, the event won't be processed.
  2. Checks the product type of the main service. If it is not a virtual or dedicated server, the event won't be processed.
  3. Checks that the main service has the active add-on with the assigned handler. If it doesn't exist or doesn't have the handler, the event won't be processed.
  4. Checks the source of the function call. 
    • if this is a request of the form for accessing the control panel from the BILLmanager interface, Vepp will be added to a list of possible variants; 
    • if this is a form with the list of control panels or a request from the authorization form, it will ask for the link for automatic login in Vepp and user redirect to that link. 

Get the task type


When starting the function task.gettype  the events handler performs the following operations: 

  1. Checks that the function is called for the Vepp add-on. If not, the event won't be processed.
  2. Checks the event handler for the add-on. If it is not assigned, the event won't be processed.
  3. Searches for the required type in the list of available tasks for the current operations and sends it back in the response.

Authentication in Vepp


When starting the function auth the event handler will automatically redirect to Vepp using the redirect parameter.