Help Center/ Relational Database Service/ API Reference/ API v3.1 (Recommended)/ Shrinking Database Logs (RDS for SQL Server)
Updated on 2025-12-09 GMT+08:00

Shrinking Database Logs (RDS for SQL Server)

Function

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

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

rds:database:shrink

permission_management

instance

- g:EnterpriseProjectId

- g:ResourceTag/<tag-key>

-

-

URI

  • URI format

    POST /v3.1/{project_id}/instances/{instance_id}/db-shrink

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Instance ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

db_name

Yes

String

Definition

Database name.

Constraints

N/A

Range

N/A

Default Value

N/A

Example Request

Shrinking database logs

POST https://{endpoint}/v3.1/0483b6b16e954cb88930a360d2c4e663/instances/161e33e453954e21acfff65bfa3dbfebin04/db-shrink
{
    "db_name": "test1"
}

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    resp

    String

    Definition

    Calling result.

    Range

    • successful: The API is successfully called.
    • failed: The API failed to be called.

Status Code

Error Code

For details, see Error Codes.