Retrieving Action Log Parts
Use the get-events operation to retrieve the Action log starting from a specified action, or all events of the specified type or class. For information on retrieving the ID of last action, refer to the Retrieving ID of Last Action section.
Request Packet Structure
A request XML packet retrieving actions log includes the get_events node:
<packet>
<event_log>
<get_events>
...
</get_events>
</event_log>
</packet>
The get_events node has the following graphical representation:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
- The lastId node is optional. It specifies the ID of an action to start from. Data type: integer.
Note: To retrieve all actions performed on the server, do not specify this node.
- The events field is optional.
- The type field is optional. It is required if the events node is specified. It defines the type of events to be retrieved. Data type: string.
- The class field is optional. It is required if the events node is specified. It defines the class of events to be retrieved. Data type: string.
Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The get_events node of the output XML packet is structured as follows:
Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.
-
The result node is required. It wraps the response retrieved from the server. Data type: resultType (
common.xsd
). -
The status node is required. It specifies the execution status of the get_events operation. Data type: string. Allowed values: ok | error.
-
The errcode node is optional. Is returns the error code if the get_events operation fails. Data type: integer.
-
The errtext node is optional. It returns the error message if the get_events operation fails. Data type: string.
-
The event node is optional. It contains an action data if the operation succeeds, and the list of retrieved actions is not empty. Data type: complex.
The following nodes are required only if the event node is present in the response packet:
- The id node is required. It holds action ID. Data type: integer.
- The type node is required. It specifies the type of the action. Data type: string. Allowed values: created | updated | deleted | status_changed | started | stopped | installed | uninstalled | siteapp_added | siteapp_removed | expired | terminated | exceeded | guid_changed.
- The time node is required. It specifies time when the action happened (in Unix timestamp). Data type: unsignedint.
- The class node is required. It specifies the class of object that performed the action. Data type: string. Allowed values: license | service | ip_address | admin_info | siteapp | client | client_limits | client_status | client_perms | client_ip_pool | db | db-user | site | domain | domain_limits | domain_user| domain_status | phosting | fhosting | subdomain | mailname | webuser | maillist | dns_zone | mailname_antivirus | mailname_spamfilter | mailname_mailgroup | mailname_autoresponder | mailname_attachment | session_preferences | db_server | domain_alias | remote_dns | dashboard_preset | dashboard_preset_type | dashboard_preset_name | domain_limit_size | client_limit_size | client_limit_traffic | domain_limit_traffic | plesk_component reseller | reseller_limits | reseller_status | reseller_perms | reseller_ip_pool | reseller_limit_size | reseller_limit_traffic | health_parameter
- The obj_id node is required. It specifies the unique field of an object that performed the action. Data type: string.
- The user node is required. It specifies the login name of a user who performed the action. Data type: string.
-
The host node is required. It specifies the IP address of a host from which the action was performed. Data type: string
Samples
This packet retrieves the Action log starting from the action with ID 177.
<packet>
<event_log>
<get_events>
<lastId>177</lastId>
</get_events>
</event_log>
</packet>
Response:
<packet>
<event_log>
<get_events>
<result>
<status>ok</status>
<event>
<id>177</id>
<type>updated</type>
<time>1165055109</time>
<class>dns_zone</class>
<obj_id>Mysite.com</obj_id>
<user>myUser</user>
<host>192.168.56.53</host>
</event>
<event>
<id>178</id>
<type>created</type>
<time>1165055209</time>
<class>mailname</class>
<obj_id>mail@Mysite.com</obj_id>
<user>myUser</user>
<host>192.168.56.53</host>
</event>
</result>
</get_events>
</event_log>
</packet>
If the ID is more than last operation ID, the response looks as follows:
<packet>
<event_log>
<get_events>
<result>
<status>ok</status>
</result>
</get_events>
</event_log>
</packet>