Samples are source codes of console utilities, which implement loading events to Traffic Monitor using Thrift interface of pushAPI SDK. The first utility is pushapi-cpp. Is implemented in С++. Is prepared for assembly in Windows and Linux operating systems. This utility demonstrates scripts of loading all event types that are already registered with Traffic Monitor. The second utility is pushapi-csharp. Is implemented in С#. Is prepared for assembly in Windows operating system. This utility demonstrates scripts of loading all event types that are already registered with Traffic Monitor. The third utility is pushapi-util. Is implemented in С++. Is prepared for assembly in Windows and Linux operating systems. This utility has an advanced command line interface which enables uploading any events to Traffic Monitor system, including events registered with an external system. Here is the command line description: ./pushevent-util
--host <pushapi address > [-port <pushapi port>] –token <plugin token> --id <company>
--class <event class> --service <event service>
--eventattr <attr_name:attr_value,…, attr_name:attr_value>
--sender <contact_type:contact_value,attr_name:attr_value,…,attr_name:attr_value>
--receiver <contact_type:contact_value,attr_name:attr_value,…,attr_name:attr_value>
--data file:<data_falie_name>, attr_name:attr_value,…, attr_name:attr_value
--mes <contact_type:contact_value,"message text"
[–addctx]
Where: - <pushapi address > – pushAPI server address;
- <pushapi port> – pushAPI server port; if the port is not specified, a default value is used;
- <plugin token> – the plugin authorization token. Is retrieved from the console, from the section of the given plugin;
- <company> – an identifier of the plugin vendor. A string. Must be the same as the string used for generating a license for the plugin;
- <event class> – the class of the passed event;
- <event service> – the service of the passed event. The plugin can register intercepted services by their names and pass the names;
- --eventattr – attributes of the passed event. Can be viewed in the list of commands with a sample. Some attribute names have fixed values and business sense;
- --sender – the event sender. The first pair of parameters defines the sender's contact. Then the sender's attributes are specified. There are three "special" contact types:
dev (the sender/recipient is a device), res (the sender/recipient is a resource), ws (the sender/recipient is a "Workstation"). If no sender is specified, then two senders will be generated: one sender with "Person" type and "auth" contact type and the other sender with "Workstation" type and dnshostname contact. Only one sender can be specified; - --receiver – the event recipient. Has the same parameters as the sender;
- --data – the event data. The first pair of parameters defines the path to a file with the event body. Other parameters describe attributes of these data. Some of the attributes are required for some file types;
- --mes – passing events of "Chat" class. A contact of the message sender and the message contents are specified. There can be several messages;
- --addctx – an optional parameter. Automatically adds two senders to the event: one sender with "Person" type and "auth" contact type and the other sender with "Workstation" type and
dnshostname contact type.
Examples of calling this utility can be found in the source codes of samples. Besides, SDK samples include: |