Querying Log Streams
Function
This API is used to query log streams.
URI
GET /v2/{project_id}/log-streams
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining the Account Tenant ID, Log Group ID, and Log Stream ID. Default: None Minimum: 32 Maximum: 32 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
log_group_name |
No |
String |
Log group name. Minimum: 1 Maximum: 64 |
log_stream_name |
No |
String |
Log stream name. Minimum: 1 Maximum: 64 |
offset |
No |
Integer |
Query cursor. Set the value to 0 in the first query. In subsequent queries, obtain the value from the response to the last request. Minimum: 0 Maximum: 1024 |
limit |
No |
Integer |
Number of records on each page. The maximum value is 100. Minimum: 0 Maximum: 100 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. Default: None Minimum: 1000 Maximum: 2000 |
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. Default: None Minimum: 30 Maximum: 30 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
log_streams |
Array of LogStream objects |
List of log groups. Array Length: 0 - 100 |
Parameter |
Type |
Description |
---|---|---|
creation_time |
Long |
Creation time. |
log_stream_name |
String |
Log stream name. Minimum: 1 Maximum: 64 |
log_stream_id |
String |
Log stream ID. Minimum: 36 Maximum: 36 |
filter_count |
Integer |
Number of filters. Minimum: 0 Maximum: 5 |
tag |
Map<String,String> |
Log stream tags. |
is_favorite |
Boolean |
Indicates whether to favorite the media asset. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 8 Maximum: 8 |
error_msg |
String |
Error message. Minimum: 1 Maximum: 1000 |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 8 Maximum: 8 |
error_msg |
String |
Error message. Minimum: 1 Maximum: 1000 |
Example Requests
If no parameter is specified, all log streams are returned. If log_group_name and log_stream_name are specified, the corresponding log stream is queried.
GET https://{endpoint}/v2/{project_id}/log-streams /v2/{project_id}/log-streams /v2/{project_id}/log-streams?log_group_name=lts-group-txxxx /v2/{project_id}/log-streams?log_stream_name=lts-xunjian-topic-xxxx /v2/{project_id}/log-streams?log_stream_name=lts-xunjian-topic-xxxx&log_group_name=lts-group-xxx
Example Responses
Status code: 200
Log stream information is returned.
{ "log_streams" : [ { "creation_time" : 1684725311230, "log_stream_name" : "lts-xxxx-lmytest-0522-12", "is_favorite" : true, "tag" : { "_sys_enterprise_project_id" : "0", "tag" : "66666@.com", "tag5" : "test5" }, "filter_count" : 0, "log_stream_id" : "f5fdce2d-xxxx-4689-8b8a-90d269f7db76" } ] }
Status code: 400
Invalid request. Modify the request based on the description in error_msg before a retry.
{ "error_code" : "LTS.0205", "error_msg" : "The log stream name has been existed" }
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 |
Log stream information is returned. |
400 |
Invalid request. Modify the request based on the description in error_msg before a retry. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot