tencent cloud

Feedback

CreateAccessRules

Last updated: 2023-03-28 15:05:52

1. API Description

Domain name for API request: chdfs.tencentcloudapi.com.

This API is used to batch create permission rules. You don't need to enter the permission rule IDs and creation time.

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: CreateAccessRules.
Version Yes String Common Params. The value used for this API: 2020-11-12.
Region No String Common Params. This parameter is not required for this API.
AccessRules.N Yes Array of AccessRule Multiple permission rules (up to 10)
AccessGroupId Yes String Permission group ID

3. Output Parameters

Parameter Name Type Description
AccessRules Array of AccessRule List of permission rules
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Batch creating permission rules

This example shows you how to batch create permission rules.

Input Example

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

{
    "AccessRules": [
        {
            "Priority": "2",
            "AccessMode": "2",
            "Address": "127.0.0.1"
        },
        {
            "Priority": "1",
            "AccessMode": "1",
            "Address": "127.0.0.1"
        }
    ],
    "AccessGroupId": "ag-jwmfdcul"
}

Output Example

{
    "Response": {
        "AccessRules": [
            {
                "AccessRuleId": 13001,
                "Address": "127.0.0.1",
                "AccessMode": 1,
                "Priority": 1,
                "CreateTime": "2019-07-30T16:24:38+08:00"
            },
            {
                "AccessRuleId": 13002,
                "Address": "127.0.0.1",
                "AccessMode": 2,
                "Priority": 2,
                "CreateTime": "2019-07-30T16:24:38+08:00"
            }
        ],
        "RequestId": "5d6d3ef8-db1d-40de-afa1-d340302458bb"
    }
}

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 Operation failed.
InternalError Internal error.
InvalidParameter Incorrect parameter.
InvalidParameterValue Incorrect parameter value.
InvalidParameterValue.InvalidAccessGroupId Incorrect parameter value: AccessGroupId.
InvalidParameterValue.InvalidAccessRuleAddress Incorrect parameter value: Address of the permission rule.
LimitExceeded The quota limit is exceeded.
MissingParameter Missing parameter.
ResourceNotFound The resource does not exist.
ResourceNotFound.AccessGroupNotExists The permission group does not exist.
ResourceUnavailable The resource is unavailable.
UnauthorizedOperation Unauthorized operation.