System logs REST API
Use this REST API to manage system logs.
Get all system logs
| REST API information | Value | Description |
|---|---|---|
| URI | /admin/resources/systemlogs | |
| Method | GET | |
| Returns | 200 | Returns a list of all System Logs |
| 404 | The System Log list was not found | |
| 500 | Platform System Manager encountered an internal error while processing the request. |
Returns a list of System Logs.
You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.
- collection_set
- The type of log sets that are collected.
- created_time
- The time at which the object is created.
- id
- The unique ID of the object in the system.
- packaged_log_url
- The URL of the packaged log file.
- state
- The general availability of the object. If "pending", the object is created but not activated. If "available", the object is active in the system.
- updated_time
- The time at which the object was last updated.
- start_period
- The long value of the start time of the collection period. This value is in milliseconds from 1/1/70. For example: 1363185596186
- end_period
- The long value of the end time of the collection period.
Note: If only the
start_period value
is provided, an attempt is made to collect all logs from the start
period to the current time. If both values for start_period and end_period are
provided, an attempt is made to use those values, but the actual collection
range is rounded to the nearest 60 minutes, either by adding a few
minutes to the start period or subtracting a few minutes from the
end period.Get a specific System Log
| REST API information | Value | Description |
|---|---|---|
| URI | /admin/resources/systemlogs/{id} | |
| Method | GET | |
| Returns | 200 | The System Log was returned. |
| 404 | The System Log was not found | |
| 500 | Platform System Manager encountered an internal error while processing the request. |
Returns a single System Log identified by {id}.
You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.
Create system log
| REST API information | Value | Description |
|---|---|---|
| URI | /admin/resources/systemlogs | |
| Method | POST | |
| Returns | 200 | Returns the new system log. |
| 404 | The specified data was not valid. | |
| 500 | Platform System Manager encountered an internal error while processing the request. |
Creates a new system log.
You can use optional parameters to modify the response from the REST API call. For more information, see the Related information section.
- collection_set
- The collection set to be created. This parameter is optional and
the default value is
management.The following types of collection sets are available:- Backup and restore
- Block Storage Replication
- Platform System Manager deployment
- Platform System Manager dumps
- Platform System Manager management
- Platform System Manager system
- Virtualization management
- comment_string
- A comment to describe the collection set. This parameter is optional.
- start_period
- The lower bound time (in ms) of the files to be collected. This parameter is optional and can be used to decrease the size of the collection set.
- end_period
- The upper bound time (in ms) of the files to be collected. This parameter is optional and can be used to decrease the size of the collection set.
- problem
- Either a problem object from the
admin.problemscommand, or parameters to create a new problem when you create this collection set. This parameter is optional.You can use the followingproblemparameters:event_msg_text: The title of the problem to be created.problem_description: The description of the problem to be created.severity: The severity of the problem to be created.service_request_number: The service request number of an existing service ticket. After the problem is created, an attempt is made to attach the request number to an existing service ticket so that you can manage the service ticket through Cloud Pak System. This parameter is optional.
- username
- The user ID that is listed as the submitter of this request.
Sample POST request
POST /admin/resources/systemlogs
{
"collection_set":"management",
"comment":"management collection set for new problem",
"start_period":"1450099662265",
"end_period":"1450199662265",
"problem":{
"problem_description":"Found a problem that we want IBM to know about.",
"event_msg_text":"Manually created problem",
"service_request_number":"12345,678,000",
"severity":3
}
}