Help Center/ GaussDB/ API Reference/ APIs (Recommended)/ Log Management/ Querying the Link for Downloading Error Logs
Updated on 2025-08-11 GMT+08:00

Querying the Link for Downloading Error Logs

Function

This API is used to query the link for downloading error logs. Before calling this API:

URI

GET /v3/{project_id}/instances/{instance_id}/error-log

Table 1 Request path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

String

Yes

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

Table 2 Request query parameters

Parameter

Type

Mandatory

Description

offset

Integer

No

Definition

Index offset. The query starts from the next piece of data indexed by this parameter. For example, if this parameter is set to 0 and limit is set to 10, only the 1st to 10th records are displayed.

Constraints

The value must be a non-negative integer.

Range

Non-negative number

Default Value

0: The query starts from the first data record.

limit

Integer

No

Definition

Number of records returned by a query. For example, if this parameter is set to 10, a maximum of 10 records can be displayed.

Constraints

Non-negative number

Range

1–100

Default Value

10

start_time

String

Yes

Definition

Start time in the yyyy-mm-ddThh:mm:ssZ format.

T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the offset is +0800.

Constraints

N/A

Range

N/A

Default Value

N/A

end_time

String

Yes

Definition

End time in the yyyy-mm-ddThh:mm:ssZ format.

T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the offset is +0800.

Constraints

Only error logs generated in the past 30 days can be queried.

Range

N/A

Default Value

N/A

Request Parameters

None

Response Parameters

Table 3 Response body parameters

Parameter

Type

Mandatory

Description

total

Integer

Yes

Definition

Total number of records.

Range

N/A

log_files

Array of object

Yes

Definition

Log files.

For details, see Table 4.

Table 4 log_files field data structure description

Parameter

Type

Mandatory

Description

file_name

String

Yes

Definition

Log file name.

Range

N/A

file_link

String

Yes

Definition

Link for downloading the log file.

Range

N/A

file_size

String

Yes

Definition

Log file size in KB.

Range

N/A

start_time

String

Yes

Definition

Log start time.

Range

N/A

end_time

String

Yes

Definition

Log end time.

Range

N/A

status

String

Yes

Definition

Log collection status.

Range

N/A

Example Request

GET https://gaussdb-opengauss.cn-north-4.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/0317e6bbae534b8eb8f74f0eafcf1d3din01/error-log?start_time=2022-03-15T10:41:14+0800&end_time=2022-03-16T10:41:14+0800
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/0317e6bbae534b8eb8f74f0eafcf1d3din01/error-log?start_time=2022-03-15T10:41:14+0800&end_time=2022-03-16T10:41:14+0800

Example Response

{
	"total": 1,
	"log_files": [{
		"status": "ENABLE",
		"file_name": "d289e7f024d741698fb94d73316874ffin14_collector_20220506_155941.tar.gz",
		"start_time": "1651820343244",
		"end_time": "1651823943244",
		"file_size": "62",
		"file_link": "***"
	}]
}

Status Codes

Error Codes

For details, see Error Codes.