tencent cloud

APIs

ModifySecurityIPGroup

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-11-25 16:58:01

1. API Description

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

Modifies a security IP group.

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: ModifySecurityIPGroup.
Version Yes String Common Params. The value used for this API: 2022-09-01.
Region No String Common Params. This parameter is not required.
ZoneId Yes String Zone Id.
IPGroup Yes IPGroup IP group configuration.
Mode Yes String Operation type. Valid values:
  • append: Add a new IP address to the IPGroup or set a scheduled expiration time;
  • remove: Delete a specified IP address or its scheduled expiration time from the IPGroup;
  • update: Replace all content in Content or ExpireInfo of the IPGroup, and modifications to the name of the IPGroup are allowed.
  • Notes for the append operation:
  • When adding a scheduled expiration time for an IP or range, it must be later than the current time. If the IP or range does not exist in the group, you must add it in the Content parameter simultaneously. If the IP or range already has an expiration time, the new time will override the original time.
  • Notes for the remove operation:
  • When deleting an IP or range, related unexpired scheduled expiration times will also be deleted;
  • When deleting a scheduled expiration time, you can only delete a time that is not expired.
  • Notes for the update operation:
  • When replacing the content of Content, unexpired times of IPs or ranges not in Content will be deleted;
  • When replacing the content of IPExpireInfo, the IPs or ranges in IPExpireInfo must be in Content or exist in the IP group.
  • 3. Output Parameters

    Parameter Name Type Description
    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 Append IPs or ranges to an IP group

    To append the following IPs or ranges to an existing IP group: 1.1.1.1, 2.2.2.0/24.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifySecurityIPGroup
    <Common request parameters>
    
    {
        "IPGroup": {
            "GroupId": 67,
            "Name": "test3",
            "Content": [
                "1.1.1.1",
                "2.2.2.0/24"
            ]
        },
        "Mode": "append",
        "ZoneId": "zone-hduqwh"
    }

    Output Example

    {
        "Response": {
            "RequestId": "728cb059-8595-44c7-b6c6-b4a539ae823f"
        }
    }

    Example2 Append IPs or ranges to a security IP group and configure the expiration time.

    Append the following IPs or ranges to an existing security IP group: 1.1.1.1, 2.2.2.0/24, 3.3.3.3, and 4.4.4.4, and configure expiration times for 1.1.1.1, 2.2.2.0/24, and 4.4.4.4 respectively.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifySecurityIPGroup
    <Common request parameters>
    
    {
        "IPGroup": {
            "GroupId": 67,
            "Name": "test3",
            "Content": [
                "1.1.1.1",
                "2.2.2.0/24",
                "3.3.3.3",
                "4.4.4.4"
            ],
            "IPExpireInfo": [
                {
                    "ExpireTime": "2022-01-01T00:00:00+08:00",
                    "IPList": [
                        "1.1.1.1",
                        "4.4.4.4"
                    ]
                },
                {
                    "ExpireTime": "2022-01-02T00:00:00+08:00",
                    "IPList": [
                        "2.2.2.0/24"
                    ]
                }
            ]
        },
        "Mode": "append",
        "ZoneId": "zone-hduqwh"
    }

    Output Example

    {
        "Response": {
            "RequestId": "728cb059-8595-44c7-b6c6-b4a539ae823f"
        }
    }

    Example3 Modify the expiry date of an IP or range in an IP group

    1.1.1.1 in the IP group has a configured expiration time. You now need to change its scheduled expiration time.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifySecurityIPGroup
    <Common request parameters>
    
    {
        "IPGroup": {
            "GroupId": 67,
            "Name": "test3",
            "Content": [],
            "IPExpireInfo": [
                {
                    "ExpireTime": "2022-01-01T00:00:00+08:00",
                    "IPList": [
                        "1.1.1.1"
                    ]
                }
            ]
        },
        "Mode": "append",
        "ZoneId": "zone-hduqwh"
    }

    Output Example

    {
        "Response": {
            "RequestId": "728cb059-8595-44c7-b6c6-b4a539ae823f"
        }
    }

    Example4 Delete an IP or range from an IP group

    1.1.1.1 exists in the IP group and needs to be deleted now.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifySecurityIPGroup
    <Common request parameters>
    
    {
        "IPGroup": {
            "GroupId": 67,
            "Name": "test3",
            "Content": [
                "1.1.1.1"
            ]
        },
        "Mode": "remove",
        "ZoneId": "zone-hduqwh"
    }

    Output Example

    {
        "Response": {
            "RequestId": "5bdc699c-68df-4cb7-9d0a-1c174b0374ad"
        }
    }

    Example5 Delete the expiry date of an IP or range in an IP group

    1.1.1.1 exists in the IP group and is automatically configured with an expiration time. The expiration time of this IP needs to be deleted now.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifySecurityIPGroup
    <Common request parameters>
    
    {
        "IPGroup": {
            "GroupId": 67,
            "Name": "test3",
            "Content": [],
            "IPExpireInfo": [
                {
                    "IPList": [
                        "1.1.1.1"
                    ]
                }
            ]
        },
        "Mode": "remove",
        "ZoneId": "zone-hduqwh"
    }

    Output Example

    {
        "Response": {
            "RequestId": "728cb059-8595-44c7-b6c6-b4a539ae823f"
        }
    }

    Example6 Full Update of IPs or Ranges in a Security IP Group

    A full update of the IP group content is required. The IPs or ranges to update are: 1.1.1.1, 2.2.2.0/24.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifySecurityIPGroup
    <Common request parameters>
    
    {
        "IPGroup": {
            "GroupId": 67,
            "Name": "test3",
            "Content": [
                "1.1.1.1",
                "2.2.2.0/24"
            ]
        },
        "Mode": "update",
        "ZoneId": "zone-hduqwh"
    }

    Output Example

    {
        "Response": {
            "RequestId": "sh1u8a90-xxxx-49cd-swui-27cb34daa779"
        }
    }

    Example7 Full Update IPs or Ranges and Corresponding Expiry Dates in a Security IP Group

    A full update of the IP group content is required. The new IPs or ranges are: 1.1.1.1, 2.2.2.0/24, 3.3.3.3. Set an expiration time for 1.1.1.1.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifySecurityIPGroup
    <Common request parameters>
    
    {
        "IPGroup": {
            "GroupId": 67,
            "Name": "test3",
            "Content": [
                "1.1.1.1",
                "2.2.2.0/24",
                "3.3.3.3"
            ],
            "IPExpireInfo": [
                {
                    "ExpireTime": "2022-01-01T00:00:00+08:00",
                    "IPList": [
                        "1.1.1.1"
                    ]
                }
            ]
        },
        "Mode": "update",
        "ZoneId": "zone-hduqwh"
    }

    Output Example

    {
        "Response": {
            "RequestId": "728cb059-8595-44c7-b6c6-b4a539ae823f"
        }
    }

    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
    InternalError.ProxyServer Unknown error occurs on the real server.
    InvalidParameter.Security Parameter error.
    ResourceNotFound The resource does not exist.
    UnauthorizedOperation.CamUnauthorized Unauthorized Cam operation.
    UnauthorizedOperation.Unknown Unknown error occurs on the real server.

    도움말 및 지원

    문제 해결에 도움이 되었나요?

    피드백