Add a new REST API operation, taking a log level and a message, and printing it into the Scylla log. This can be useful when a test wants to mark certain positions in the log (e.g., to see which other log messages we get between the two positions). An alternative way to achieve this could have been for the test to write directly into the log file - but an on-disk log file is only one of the logging options that Scylla support, and the approach in this patch allows to add log message regardless of how Scylla keeps the logs. In motivation of this feature is that in the following patch the test/alternator framework will add log messages when starting and ending tests, which can help debug test failures. Signed-off-by: Nadav Har'El <nyh@scylladb.com>
185 lines
5.3 KiB
JSON
185 lines
5.3 KiB
JSON
{
|
|
"apiVersion":"0.0.1",
|
|
"swaggerVersion":"1.2",
|
|
"basePath":"{{Protocol}}://{{Host}}",
|
|
"resourcePath":"/system",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"apis":[
|
|
{
|
|
"path":"/system/logger",
|
|
"operations":[
|
|
{
|
|
"method":"GET",
|
|
"summary":"Get all logger names",
|
|
"type":"array",
|
|
"items":{
|
|
"type":"string"
|
|
},
|
|
"nickname":"get_all_logger_names",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"parameters":[
|
|
]
|
|
},
|
|
{
|
|
"method":"POST",
|
|
"summary":"Set all logger level",
|
|
"type":"void",
|
|
"nickname":"set_all_logger_level",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"parameters":[
|
|
{
|
|
"name":"level",
|
|
"description":"The new log level",
|
|
"required":true,
|
|
"allowMultiple":false,
|
|
"type":"string",
|
|
"enum":[
|
|
"error",
|
|
"warn",
|
|
"info",
|
|
"debug",
|
|
"trace"
|
|
],
|
|
"paramType":"query"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"path":"/system/log",
|
|
"operations":[
|
|
{
|
|
"method":"POST",
|
|
"summary":"Write a message to the Scylla log",
|
|
"type":"void",
|
|
"nickname":"write_log_message",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"parameters":[
|
|
{
|
|
"name":"message",
|
|
"description":"The message to write to the log",
|
|
"required":true,
|
|
"allowMultiple":false,
|
|
"type":"string",
|
|
"paramType":"query"
|
|
},
|
|
{
|
|
"name":"level",
|
|
"description":"The logging level to use",
|
|
"required":true,
|
|
"allowMultiple":false,
|
|
"type":"string",
|
|
"enum":[
|
|
"error",
|
|
"warn",
|
|
"info",
|
|
"debug",
|
|
"trace"
|
|
],
|
|
"paramType":"query"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"path":"/system/drop_sstable_caches",
|
|
"operations":[
|
|
{
|
|
"method":"POST",
|
|
"summary":"Drop in-memory caches for data which is in sstables",
|
|
"type":"void",
|
|
"nickname":"drop_sstable_caches",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"parameters":[
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"path":"/system/uptime_ms",
|
|
"operations":[
|
|
{
|
|
"method":"GET",
|
|
"summary":"Get system uptime, in milliseconds",
|
|
"type":"long",
|
|
"nickname":"get_system_uptime",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"parameters":[]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"path":"/system/logger/{name}",
|
|
"operations":[
|
|
{
|
|
"method":"GET",
|
|
"summary":"Get logger level",
|
|
"type":"string",
|
|
"nickname":"get_logger_level",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"parameters":[
|
|
{
|
|
"name":"name",
|
|
"description":"The logger to query about",
|
|
"required":true,
|
|
"allowMultiple":false,
|
|
"type":"string",
|
|
"paramType":"path"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"method":"POST",
|
|
"summary":"Set logger level",
|
|
"type":"void",
|
|
"nickname":"set_logger_level",
|
|
"produces":[
|
|
"application/json"
|
|
],
|
|
"parameters":[
|
|
{
|
|
"name":"name",
|
|
"description":"The logger to query about",
|
|
"required":true,
|
|
"allowMultiple":false,
|
|
"type":"string",
|
|
"paramType":"path"
|
|
},
|
|
{
|
|
"name":"level",
|
|
"description":"The new log level",
|
|
"required":true,
|
|
"allowMultiple":false,
|
|
"type":"string",
|
|
"enum":[
|
|
"error",
|
|
"warn",
|
|
"info",
|
|
"debug",
|
|
"trace"
|
|
],
|
|
"paramType":"query"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|