Domain name for API request: vpc.intl.tencentcloudapi.com.
This API is used to create a security group with the same rule configurations as an existing security group. The cloning only copies the security group and its rules, but not the security group tags.
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.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CloneSecurityGroup. |
Version | Yes | String | Common Params. The value used for this API: 2017-03-12. |
Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
SecurityGroupId | Yes | String | Security group instance ID, such as esg-33ocnj9n , which can be obtained through the DescribeSecurityGroups API. |
GroupName | No | String | The name of security group clone. You can enter any name within 60 characters. If this parameter is left empty, the security group clone will use the name of the source security group. |
GroupDescription | No | String | Description of the security group clone. You can enter up to 100 characters. If this parameter is left empty, the security group clone will use the description of the source security group. |
ProjectId | No | String | Project ID. Default value: 0. You can query it on the project management page of the Tencent Cloud console. |
RemoteRegion | No | String | The region of the source security group for a cross-region clone. For example, to clone the security group in Guangzhou to Shanghai, set it to ap-guangzhou . |
Parameter Name | Type | Description |
---|---|---|
SecurityGroup | SecurityGroup | Security group object Note: this field may return null , indicating that no valid values can be obtained. |
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. |
This example shows you how to clone a security group.
https://vpc.intl.tencentcloudapi.com/?Action=CloneSecurityGroup
&SecurityGroupId=sg-12345678
&<Common request parameters>
{
"Response": {
"RequestId": "354f4ac3-8546-4516-8c8a-69e3ab73aa8a",
"SecurityGroup": {
"SecurityGroupId": "sg-12341234",
"SecurityGroupName": "TestGroup",
"SecurityGroupDesc": "test-group-desc",
"ProjectId": "0",
"CreatedTime": "2018-01-13 19:26:33"
}
}
}
This example shows you how to clone a security group and specify the project ID.
https://vpc.intl.tencentcloudapi.com/?Action=CloneSecurityGroup
&SecurityGroupId=sg-12345678
&ProjectId=1001
&<Common request parameters>
{
"Response": {
"RequestId": "354f4ac3-8546-4516-8c8a-69e3ab73aa8a",
"SecurityGroup": {
"SecurityGroupId": "sg-12341278",
"SecurityGroupName": "TestGroup",
"SecurityGroupDesc": "test-group-desc",
"ProjectId": "1001",
"CreatedTime": "2018-01-13 19:26:33"
}
}
}
This example shows you how to clone a security group and specify the name and description of the newly created one.
https://vpc.intl.tencentcloudapi.com/?Action=CloneSecurityGroup
&SecurityGroupId=sg-12345678
&GroupName=test
&GroupDescription=test
&<Common request parameters>
{
"Response": {
"RequestId": "354f4ac3-8546-4516-8c8a-69e3ab73aa8a",
"SecurityGroup": {
"SecurityGroupId": "sg-12341256",
"SecurityGroupName": "test",
"SecurityGroupDesc": "test",
"ProjectId": "0",
"CreatedTime": "2018-01-13 19:26:33"
}
}
}
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 |
---|---|
InvalidParameterValue | The parameter value is invalid. |
InvalidParameterValue.Malformed | Invalid input parameter format. |
InvalidParameterValue.TooLong | Invalid parameter value. The parameter value is too long. |
LimitExceeded | Quota limit is reached. |
ResourceNotFound | The resource does not exist. |
UnsupportedOperation.RemoteRegionSgHasReferencedSg |
문제 해결에 도움이 되었나요?