tencent cloud

腾讯云分布式缓存数据库(兼容 Redis)

动态与公告
产品动态
公告
新手指引
产品简介
产品概述
产品优势
应用场景
存储引擎
产品系列
产品版本
规格与性能
读写分离
多可用区部署
地域和可用区
名词解释
购买指南
计费概述
定价中心
购买实例
续费说明(包年包月)
退费说明(包年包月)
欠费说明
按量转包年包月
快速入门
快速创建实例
连接实例(Redis/Valkey 版)
操作指南
操作总览
连接数据库实例
管理实例
升级实例
管理节点(Redis/ValKey 版)
管理多可用区
备份与恢复
账号管理
参数配置
慢查询
访问管理
网络与安全
监控与告警
事件管理(Redis/ValKey 版)
数据迁移
Redis 版全球复制
数据库审计
诊断优化
Sentinel 模式
开发准则
命名规则
基本使用准则
Key 与 Value 设计原则
命令使用准则
客户端程序设计准则
连接池配置
命令参考
命令参考概览
Redis 版与 Valkey 版命令兼容性
大版本命令使用差异
Proxy 架构与直连模式的使用差异
命令更多操作(Redis/Valkey 版)
Memcached 版命令兼容性
实践教程
基于 Spring Boot 搭建 Redis 客户端监控
Redis 客户端连接配置策略与实践
集群架构全局 SCAN 使用指南
实例安全下线
热 Key 与 大 key
可用区迁移方案
故障处理
连接异常
Redisson 客户端超时重连异常分析及解决方案
性能排查与调优
API 文档
History
Introduction
API Category
Making API Requests
Instance APIs
Parameter Management APIs
Other APIs
Backup and Restoration APIs
Region APIs
Monitoring and Management APIs
Log APIs
Data Types
Error Codes
常见问题
使用常见问题
连接登录问题
购买相关问题
相关协议
服务等级协议
Terms of Service
词汇表
联系我们

CloneInstances

PDF
聚焦模式
字号
最后更新时间: 2026-01-13 21:50:05

1. API Description

Domain name for API request: redis.intl.tencentcloudapi.com.

This API is used to clone a complete new instance based on the current instance backup file.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CloneInstances.
Version Yes String Common Params. The value used for this API: 2018-04-12.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
InstanceId Yes String The ID of the source instance to be cloned, such as "crs-xjhsdj****". Log in to the Redis console and copy the instance ID in the instance list.
GoodsNum Yes Integer The number of clone instances at a time
- The maximum number of monthly subscribed instances is 100 for each purchase.
- The maximum number of pay-as-you-go instances is 30 for each purchase.
ZoneId Yes Integer ID of the AZ where the clone instance resides. For more information, see Regions and AZs.
BillingMode Yes Integer Billing mode. Valid values:
  • 0 (Pay-as-you-go)
  • 1 (Monthly subscription)
Period Yes Integer Purchase duration of an instance.
  • Unit: Month
  • Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48, 60 (for monthly subscription mode).
  • Valid value: 1 (for pay-as-you-go mode).
SecurityGroupIdList.N Yes Array of String Security group ID. Call the DescribeInstanceSecurityGroup API to obtain the security group ID for the instance.
BackupId Yes String Backup ID of the clone instance, which can be obtained through the DescribeInstanceBackups API.
NoAuth No Boolean Whether the clone instance supports password-free access. Valid values:
  • true (Yes)
  • false (No. When SSL or public network is enabled). Default value: false.
VpcId No String The VPC ID of the clone instance. If this parameter is not passed in, the classic network will be selected by default.
SubnetId No String The VPC subnet ID to which the clone instance belongs, which is not required for the classic network.
InstanceName No String Name of the clone instance.
Enter up to 60 letters, digits, hyphens, and underscores.
Password No String The access password of the clone instance.
  • When the input parameter NoAuth is true, this parameter is not required.
  • When the instance is Redis 2.8, 4.0, or 5.0, the password must contain 8–30 characters in at least two of the following types: lowercase letters, uppercase letters, digits, and special characters ()~!@#$%^&*-+=_|{}[]:;<>,.?/and cannot start with/`.
  • When the instance is CKV 3.2, the password must and can only contain 8–30 letters and digits.
AutoRenew No Integer The auto-renewal flag. Valid values
  • 0: Manual renewal (default).
  • 1: Auto-renewal.
  • 2: Not auto-renewal (set by user).
VPort No Integer Customized port. Valid range: 1024-65535. Default value: 6379.
NodeSet.N No Array of RedisNodeInfo Node information of an instance.
  • Currently supported type and AZ information of a node to be configured (master node or replica node) For more information, see RedisNodeInfo.
  • This parameter is not required for single-AZ deployment.
ProjectId No Integer Project ID. Log in to the Redis console, and find the project ID in Account Center > Project Management in the top-right corner.
ResourceTags.N No Array of ResourceTag Tag to be bound for the clone instance
TemplateId No String The parameter template ID associated with the clone instance
- If this parameter is not configured, the system will automatically adapt the corresponding default template based on the selected compatible version and architecture.
- You can query the parameter template list of the instance to get the template ID through the DescribeParamTemplates API.
AlarmPolicyList.N No Array of String The alarm policy ID of the instance to be cloned. Log in to the Tencent Cloud Observable Platform console, and get the policy ID in Alarm Management > Policy Management.
CloneTime No String Time to restore data for cloning.
Only instances with second-level backup enabled are supported.
EncryptPassword No Boolean Whether to encrypt the password.

3. Output Parameters

Parameter Name Type Description
DealId String Request task ID
InstanceIds Array of String Clone instance ID
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Request Example

This example shows you how to clone an instance.

Input Example

POST / HTTP/1.1
Host: redis.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CloneInstances
<Common request parameters>

{
    "InstanceId": "crs-qddzg***",
    "GoodsNum": 1,
    "ZoneId": 200005,
    "BillingMode": 0,
    "Period": 1,
    "SecurityGroupIdList": [
        "sg-o0lb0***"
    ],
    "BackupId": "331006369-11071477-*******",
    "VpcId": "vpc-c9v9o***",
    "SubnetId": "subnet-7054l***",
    "InstanceName": "InstanceName-redis-preversion",
    "Password": "pwd**********",
    "NodeSet": [
        {
            "NodeType": 0,
            "ZoneName": "ap-shanghai-5"
        },
        {
            "NodeType": 1,
            "ZoneName": "ap-shanghai-2"
        }
    ],
    "ProjectId": 1,
    "ResourceTags": [
        {
            "TagKey": "key1",
            "TagValue": "value2"
        }
    ],
    "AlarmPolicyList": [
        "policy-r7529***"
    ]
}

Output Example

{
    "Response": {
        "RequestId": "2a836c00-175f-11eb-aeb3-db134c8dXXXX",
        "InstanceIds": [
            "crs-kic3****"
        ],
        "DealId": "crs-qd3d3XXX"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.PayFailed Payment failed.
FailedOperation.SystemError Internal system error, which is irrelevant to the business.
FailedOperation.Unknown Invalid data is entered for weekday.
InternalError.InternalError Internal error.
InvalidParameter.EmptyParam The parameter is empty.
InvalidParameter.OnlyVPCOnSpecZoneId Only VPCs are provided in the Shanghai Finance AZ.
InvalidParameter.PermissionDenied The API has no CAM permissions.
InvalidParameterValue.BaseNetWorkAccessDeny The instance is not in a VPC.
InvalidParameterValue.CheckNotPass Business verification failed
InvalidParameterValue.InvalidInstanceTypeId The type of instances requested for purchase is incorrect (TypeId - 1: Cluster Edition; 2: Master-Replica Edition, i.e., the legacy Master-Replica Edition).
InvalidParameterValue.InvalidSubnetId The vpcid or subnet ID in the VPC is invalid.
InvalidParameterValue.PasswordEmpty The password is empty.
InvalidParameterValue.PasswordFreeDenied Tencent internal accounts are not allowed to use password-free instances.
InvalidParameterValue.PasswordRuleError When the password is set, the old password passed in by MC does not match the previously set password.
InvalidParameterValue.SecurityGroupIdsNotExists The request parameter or security group ID is incorrect.
InvalidParameterValue.UnVpcIdNotExists The uniqVpcId or subnet ID in the VPC is invalid.
LimitExceeded The quota limit has been reached.
LimitExceeded.InvalidMemSize The requested capacity is out of the purchasable specification range (memSize should be an integer multiple of 1,024 in MB).
LimitExceeded.InvalidParameterGoodsNumNotInRange The number of instances requested for purchase at a time is out of the purchasable quantity range.
LimitExceeded.PeriodLessThanMinLimit The length of purchase is invalid. It must be at least one month.
LimitExceeded.ReachTheAmountLimit The quantity of requested TencentDB for Redis instances falls out of the limit range.
ResourceInsufficient The resource is insufficient.
ResourceNotFound.AccountDoesNotExists The UIN value is empty.
ResourceNotFound.InstanceNotExists No Redis instance is found by the serialId.
ResourceUnavailable.InstanceDeleted The instance has already been repossessed.
ResourceUnavailable.NoEnoughVipInVPC The IP resources in the VPC are insufficient.
ResourceUnavailable.NoRedisService The requested region currently does not provide the Redis service.
ResourceUnavailable.NoServiceAvailableForThisZoneId The requested zoneId doesn’t provide Redis service.
ResourceUnavailable.SaleOut Resources of the specified type in the region are sold out.
UnauthorizedOperation.NoCAMAuthed No CAM permissions.
UnauthorizedOperation.UserNotInWhiteList The user is not in the allowlist.
UnsupportedOperation The operation is not supported.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈