Deleting a Log Group
Function
This API is used to delete a specified log group. If you no longer need a log group, you can delete it to release resources. If log transfer is enabled for log streams in this log group, you need to disable log transfer before the deletion.
Calling Method
For details, see Calling APIs.
URI
DELETE /v2/{project_id}/groups/{log_group_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID. It can be obtained by calling an API or from the console. For details, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
log_group_id |
Yes |
String |
Definition Log group ID. For details about how to obtain it, see Obtaining Log Group and Log Stream IDs. Constraints N/A Range N/A Default Value N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition User token obtained from IAM. For details about how to obtain it, see Obtaining a User Token. Constraints: N/A Range N/A Default Value N/A |
Content-Type |
Yes |
String |
Definition Message body format. Set this parameter to application/json;charset=utf8. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 204
The request is successful and the log group has been deleted.
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Definition Error code. For details, see Error Codes. Range N/A |
error_msg |
String |
Definition Error message. Range N/A |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Definition Error code. For details, see Error Codes. Range N/A |
error_msg |
String |
Definition Error message. Range N/A |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Definition Error code. For details, see Error Codes. Range N/A |
error_msg |
String |
Definition Error message. Range N/A |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Definition Error code. For details, see Error Codes. Range N/A |
error_msg |
String |
Definition Error message. Range N/A |
Example Requests
Delete a log group.
DELETE https://{endpoint}/v2/{project_id}/groups/{log_group_id} /v2/{project_id}/groups/{log_group_id}
Example Responses
Status code: 400
Invalid request. Modify the request based on the description in error_msg before a retry.
{ "error_code" : "LTS.0201", "error_msg" : "The log group is not existed" }
Status code: 401
Authentication failed. Check the token and try again.
{ "error_code" : "LTS.0003", "error_msg" : "Invalid token" }
Status code: 403
Request 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.0103", "error_msg" : "Failed to delete log group" }
Status Codes
Status Code |
Description |
---|---|
204 |
The request is successful and the log group has been deleted. |
400 |
Invalid request. Modify the request based on the description in error_msg before a retry. |
401 |
Authentication failed. Check the token and try again. |
403 |
Request 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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot