Help Center/ Relational Database Service/ API Reference/ Historical APIs/ API v3/ Shrinking Database Logs (Not Recommended)
Updated on 2024-08-28 GMT+08:00

Shrinking Database Logs (Not Recommended)

Function

This API is used to shrink database logs of an RDS for SQL Server instance.

This API will be unavailable on December 30, 2024. You are advised to switch workloads to the new API (Shrinking Database Logs) before then.

  • Before calling an API, you need to understand the API in Authentication.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/db_shrink

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    To obtain it, refer to Obtaining a Project ID.

    instance_id

    Yes

    Instance ID.

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

db_name

Yes

String

Database name.

Example Request

Shrinking database logs

POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/161e33e453954e21acfff65bfa3dbfebin04/db_shrink
{
    "db_name": "test1"
}

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    resp

    String

    Returns successful if the invoking is successful, or returns failed if the invoking fails.

Status Code

Error Code

For details, see Error Codes.