Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: zhengxiu <zhengxiu@huawei.com> Co-committed-by: zhengxiu <zhengxiu@huawei.com>
16 KiB
Querying Basic Log Configurations
Function
This API is used to query basic log configurations.
URI
GET /v1.0/{project_id}/clusters/{cluster_id}/logs/settings
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name. |
cluster_id |
Yes |
String |
ID of the cluster you want to query. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
No |
String |
The action can be base_log_collect or real_time_log_collect. base indicates the historical capability, and real_time indicates the real-time collection capability. If this parameter is not passed, base is used by default, which is compatible with the previous logic. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
logConfiguration |
logConfiguration object |
Log configuration entity object. |
realTimeLogCollectRecord |
realTimeLogCollect object |
Configure real-time log collection. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Log backup ID, which is generated using the system UUID. |
clusterId |
String |
Cluster ID. |
obsBucket |
String |
Name of the OBS bucket for storing logs. |
agency |
String |
Agency name. You can create an agency to allow CSS to call other cloud services. |
updateAt |
Long |
Update time. Format: Unix timestamp. |
basePath |
String |
Storage path of backed up logs in the OBS bucket. |
autoEnable |
Boolean |
Whether to enable automatic backup.
|
period |
String |
Start time of automatic log backup. If autoEnable is set to false, the value of this parameter is null. Format: GMT |
logSwitch |
Boolean |
Whether to enable the log function.
|
Parameter |
Type |
Description |
---|---|---|
id |
String |
Log collection ID, which is generated using the system UUID. |
clusterId |
String |
Cluster ID |
indexPrefix |
String |
Prefix of the index for saving logs. |
keepDays |
Integer |
Log retention duration. |
targetClusterId |
String |
ID of the target cluster where logs are saved. |
status |
String |
Status of a real-time log collection task. |
createAt |
Long |
Start time of a real-time log collection task. |
updateAt |
Long |
Update time of a real-time log collection task. |
Example Requests
None
Example Responses
Status code: 200
Request succeeded.
Example response to a real-time log collection request.
{ "logConfiguration" : null, "realTimeLogCollectRecord" : { "id" : "17939b7b-5a93-4ca5-8d3c-b9f2d0e715b4", "clusterId" : "e3201ceb-1a3e-49f3-bb2f-23a816440b20", "keepDays" : 30, "updateAt" : 1717666418870, "createAt" : 1717666405897, "targetClusterId" : "8c19644b-f2ef-44fc-abef-230a4c578ce7", "indexPrefix" : "aaa", "status" : "200" } }
Example response to a log backup request.
{ "logConfiguration" : { "id" : "00032118-aff5-40e8-b19a-dd4bb576e572", "clusterId" : "e3201ceb-1a3e-49f3-bb2f-23a816440b20", "obsBucket" : "css-autobk-notdel-cn-north-7", "agency" : "css_obs_agency", "updateAt" : 1639624882000, "basePath" : "css/log", "autoEnable" : false, "period" : null, "logSwitch" : false }, "realTimeLogCollectRecord" : null }
Status Codes
Status Code |
Description |
---|---|
200 |
Request succeeded. |
400 |
Invalid request. Modify the request before retry. |
409 |
The request could not be completed due to a conflict with the current state of the resource. The resource that the client attempts to create already exists, or the update request fails to be processed because of a conflict. |
412 |
The server did not meet one of the preconditions contained in the request. |
Error Codes
See Error Codes.