Domain name for API request: sqlserver.tencentcloudapi.com.
This API is used to query the commands of creating backups canonically.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
This document describes the parameters for Signature V1. It's recommended to use the V3 signature, which provides higher security. Note that for Signature V3, the common parameters need to be placed in the HTTP Header. See details.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: DescribeBackupCommand. |
Version | Yes | String | Common parameter. The value used for this API: 2018-03-28. |
Region | Yes | String | Common parameter. For more information, please see the list of regions supported by the product. |
BackupFileType | Yes | String | Backup file type. Full: full backup. FULL_LOG: full backup which needs log increments. FULL_DIFF: full backup which needs differential increments. LOG: log backup. DIFF: differential backup. |
DataBaseName | Yes | String | Database name |
IsRecovery | Yes | String | Whether restoration is required. No: not required. Yes: required. |
LocalPath | No | String | Storage path of backup files. If this parameter is left empty, the default storage path will be D:\. |
Parameter Name | Type | Description |
---|---|---|
Command | String | Create a backup command |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
Used when transaction logs need an incremental import. What is acquired is a full backup that is not restored.\\\\n
in the command means a line feed.
https://sqlserver.tencentcloudapi.com/?Action=DescribeBackupCommand
&BackupFileType=FULL
&DataBaseName=db1
&IsRecovery=YES
&LocalPath=E:/
&<Common request parameters>
{
"Response": {
"Command": "BACKUP DATABASE db1 TO DISK='E:/db1.bak' WITH INIT",
"RequestId": "1de3aea3-5fef-4891-b8b0-faeb4e3b5543"
}
}
This example shows you how to query the command to create a full backup and an incremental transaction log backup when you need to import the incremental transaction log backup. The full backup created does not need to be restored.
\\n in the command means a line feed.
https://sqlserver.tencentcloudapi.com/?Action=DescribeBackupCommand
&BackupFileType=FULL_LOG
&DataBaseName=db1
&IsRecovery=NO
&LocalPath=E:/
&<Common request parameters>
{
"Response": {
"Command": "declare @dbname varchar(100)\\\\ndeclare @localtime varchar(20)\\\\ndeclare @str varchar(8000)\\\\nset @dbname='db1'\\\\nset @localtime =replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')\\\\nset @str='BACKUP DATABASE [' + @dbname + '] TO DISK = N''E:/' + @dbname + '_' + @localtime + '_2full2_2noreconvery2.bak'' WITH INIT'\\\\nexec(@str)\\\\ngo",
"RequestId": "03199d88-9dda-49eb-a045-7c69eb4d3591"
}
}
This example shows you how to query the command to create an incremental transaction log backup when you need to import it. The incremental transaction log backup created needs to be restored.
\\n in the command means a line feed.
https://sqlserver.tencentcloudapi.com/?Action=DescribeBackupCommand
&BackupFileType=LOG
&DataBaseName=db1
&IsRecovery=YES
&LocalPath=E:/
&<Common request parameters>
{
"Response": {
"Command": "declare @dbname varchar(100)\\\\ndeclare @localtime varchar(20)\\\\ndeclare @str varchar(8000)\\\\nset @dbname='db1'\\\\nset @localtime =replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')\\\\nset @str='BACKUP LOG [' + @dbname + '] TO DISK = N''E:/' + @dbname + '_' + @localtime + '_2log2_2reconvery2.bak'' WITH FORMAT, INIT'\\\\nexec(@str)\\\\ngo",
"RequestId": "8d53700f-b80b-415a-8738-0c340eff2057"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InvalidParameter.InputIllegal | Input error. |
InvalidParameter.ParamsAssertFailed | An error occurred while converting parameter assertion. |
UnauthorizedOperation.PermissionDenied | CAM authentication error. |
Was this page helpful?