Querying All Log Streams in a Specified Log Group
Function
This API is used to query information about all log streams in a specified log group.
URI
GET /v2/{project_id}/groups/{log_group_id}/streams
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain it, see Obtaining a Project ID. |
|
log_group_id |
Yes |
String |
ID of the log group whose log streams will be queried. Generally, it contains 36 characters. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. For details about how to obtain it, see Obtaining a User Token. |
|
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
log_streams |
Array of LogStreamResBody objects |
Returned log stream information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
creation_time |
Long |
Creation time. |
|
log_stream_id |
String |
Log stream ID. |
|
log_stream_name |
String |
Log stream name. |
|
tag |
Map<String,String> |
Log stream tags. |
|
filter_count |
Integer |
Number of filters. |
|
is_favorite |
Boolean |
Whether to add a log stream to favorites. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Example Requests
Query all log streams in a specified log group.
GET https://{endpoint}/v2/{project_id}/groups/{log_group_id}/streams
/v2/{project_id}/groups/{log_group_id}/streams
Example Responses
Status code: 200
The request is successful.
{
"log_streams" : [ {
"creation_time" : 1630549842955,
"log_stream_name" : "lts-stream-02kh",
"log_stream_id" : "c54dbc58-0fd8-48ed-b007-6d54981427a7",
"filter_count" : 0
} ]
}
Status code: 401
Authentication failed. Check the token and try again.
{
"error_code" : "LTS.0003",
"error_msg" : "Invalid token"
}
Status code: 403
The request is rejected.The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications.
{
"error_code" : "LTS.0001",
"error_msg" : "Invalid projectId"
}
Status code: 500
The server has received the request but encountered an internal error.
{
"error_code" : "LTS.0010",
"error_msg" : "The system encountered an internal error"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The request is successful. |
|
401 |
Authentication failed. Check the token and try again. |
|
403 |
The request is rejected.The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications. |
|
500 |
The server has received the request but encountered an internal error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.