Logging REST API

Use these REST APIs to log monitoring results for virtual system instances, virtual application instances, and shared service instances.

In the URI pattern, substitute the type of instance for the {instance_type} and the ID for the instance for the {instance_id}. The following table lists the value to use for each instance type:
Table 1. Values for {instance_type}
Type of instance Value for {instance_type} Example
virtual system instance virtualSystemInstances GET /resources/virtualSystemInstances/d-65d29715-9063-436d-8593-d5218208f8aa/logs/virtualMachines/was.11319468974926
virtual application instance virtualApplicationInstances GET /resources/virtualApplicationInstances/d-65d29715-9063-436d-8593-d5218208f8aa/logs/virtualMachines/Web_Application-was.11319468974926
shared service instance sharedServiceInstances GET /resources/sharedServiceInstances/d-65d29715-9063-436d-8593-d5218208f8aa/logs/virtualMachines/ss.11319468974926

List all the logs on a specific virtual machine

GET /resources/{instance_type}/{instance_id}/logs/virtualMachines/{virtual_machine_id}
Table 2. List all the logs on a specific virtual machine.
REST API information Value Description
Example URL https://localhost/resources/virtualApplicationInstances/d-65d29715-9063-436d-8593-d5218208f8aa/logs/virtualMachines/Web_Application-was.11319468974926  
Response content-type application/json  
Response example
{
    "OS":["/var/log/brcm-iscsi.log",
        "/var/log/cron",
        "/var/log/messages",
        "/var/log/secure",
        "/var/log/acpid",
        "/var/log/dmesg",
        "/var/log/yum.log",
        "/var/log/wtmp",
        "/var/log/spooler",
        "/var/log/maillog",
        "/var/log/boot.log"
    ],
    "WAS":["/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemErr.log",
        "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/native_stderr.log",
        "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/native_stdout.log",
        "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/SystemOut.log",
        "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/ffdc.3819090375058668621.txt",
        "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/FfdcSummary.txt",
        "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/ffdc/ffdc.6804038344002622019.txt"
    ],
    "IWD Agent":["/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.MONITORING/trace.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.MONITORING/console.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.WAS/trace.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.WAS/console.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.SSH/trace.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.SSH/console.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.AGENT/trace.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.AGENT/console.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/console.log.0",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/trace.log.0",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/trace.log.2",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/install/trace.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/install/console.log",
        "/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/trace.log.1",
        "/0config/0config.log"
    ]
}
Lists of files for different roles.
Response code 200 OK
Response code 401 The user is not authorized to perform this action.
Response code 403 Access forbidden
Response code 500 Unexpected error

Each attribute is the component name and the value is a list of the log files for that component. For example, "WAS":[…] the key "WAS" is the middleware name and its value is all the log files for WebSphere Application Server.

Get the content of a specific log file

GET  /resources/{instance_type}/{instance_id}/logs/virtualMachines/{virtual_machine_id}/{log_absolute_path}
Table 3. Get the content of a specific log file.
REST API information Value Description
Example URL https://localhost/resources/virtualApplicationInstances/d-65d29715-9063-436d-8593-d5218208f8aa/logs/virtualMachines/Web_Application-was.11319468974926/opt/IBM/maestro/agent/usr/servers/Web_Application-was.11319468974926/logs/Web_Application-was.11319468974926.WAS/trace.log  
Request headers Range bytes={start}-{end} For example, bytes=0-500. Specify the byte range of the log file to get. If the bye range is not set, entire log file is gotten.
Response example
[2011-10-24 16:03:53,756] WAS/start.py 47377699650752 pid=23164 INFO WAS: 8.0.0.1
[2011-10-24 16:03:53,757] WAS/start.py 47377699650752 pid=23164 INFO Installing WAR file simple under context root /simple
[2011-10-24 16:05:53,998] WAS/start.py 47377699650752 pid=23164 INFO set WAS role status to RUNNING
 
Response code 200 OK
Response code 401 The user is not authorized to perform this action.
Response code 403 Access forbidden
Response code 500 Unexpected error