Querying All Log Groups of an Account
Function
This API is used to query all log groups of an account.
URI
GET /v2/{project_id}/groups
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the ID, see Obtaining the AccountID, Project ID, Log Group ID, and Log Stream ID. Default value: None Value length: 32 characters |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. Default value: None Minimum length: 1000 characters Maximum length: 2000 characters |
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. Default value: None Minimum length: 30 characters Maximum length: 30 characters |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
log_groups |
Array of LogGroup objects |
Information of log groups. |
Parameter |
Type |
Description |
---|---|---|
creation_time |
long |
Time when a log group was created. |
log_group_name |
String |
Log group name. Minimum length: 1 character Maximum length: 64 characters |
log_group_id |
String |
Log group ID. Value length: 36 characters |
ttl_in_days |
Integer |
Log retention duration, in days. |
tag |
Map<String,String> |
Log group tag. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Enumerated value:
|
error_msg |
String |
Error message. Enumerated value:
|
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Enumerated value:
|
error_msg |
String |
Error message. Enumerated value:
|
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Enumerated value:
|
error_msg |
String |
Error message. Enumerated value:
|
Example Request
GET https://{endpoint}/v2/{project_id}/groups /v2/{project_id}/groups
Example Response
Status code: 200
{"log_groups":[{"creation_time":1630547141853,"log_group_name":"lts-group-01nh","log_group_id":"b6b9332b-091f-4b22-b810-264318d2d664","ttl_in_days":7}]}
Status code: 401
Authentication failed. Check the token and try again.
{ "error_code" : "LTS.0003", "error_msg" : "Invalid token" }
Status code: 403
The server understood the request but refused to authorize 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 server understood the request but refused to authorize it. The client should not repeat the request without modifications. |
500 |
The server has received the request but encountered an internal error. |
503 |
The requested service is unavailable. |
Error Codes
For details, 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