All Products
Search
Document Center

File Storage NAS:CreateAccessRule

Last Updated:Jun 25, 2026

Creates a permission rule for a permission group.

Operation description

A maximum of 300 rules can be added to a permission group.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

nas:CreateAccessRule

create

*AccessGroup

acs:nas:{#regionId}:{#accountId}:accessgroup/{#accessgroupName}

None None

Request parameters

Parameter

Type

Required

Description

Example

AccessGroupName

string

Yes

The name of the permission group.

vpc-test

SourceCidrIp

string

No

The IP address or CIDR block of the authorized address.

The value must be a single IP address or a CIDR block.

Note

Permission groups of the classic network type support only IP addresses.

192.0.2.0/16

RWAccessType

string

No

The read and write permissions of the authorized address on the file system.

Valid values:

  • RDWR (default): read and write.

  • RDONLY: read-only.

Valid values:

  • RDWR :

    read and write.

  • RDONLY :

    read and write.

RDWR

UserAccessType

string

No

The access permissions of the system user of the authorized address on the file system.

Valid values:

  • no_squash (default): allows access to the file system as the root user.

  • root_squash: maps the root user to the nobody user when the root user accesses the file system.

  • all_squash: maps all users to the nobody user regardless of the user identity.

The nobody user is a default user in Linux. The nobody user can access only public content on the server and has low privileges and high security. Authorization is required for the system user to access the file system.

Valid values:

  • all_squash :

    Maps all users to the nobody user regardless of the user identity.

  • no_squash :

    Default value. Allows access to the file system as the root user.

  • root_squash :

    Maps the root user to the nobody user when the root user accesses the file system.

no_squash

Priority

integer

No

The priority of the permission rule.

If an authorized address matches multiple rules, the rule with the highest priority takes effect.

Valid values: 1 to 100. The value 1 indicates the highest priority.

1

FileSystemType

string

No

The type of the file system.

Valid values:

  • standard (default): General-purpose NAS.

  • extreme: Extreme NAS.

Valid values:

  • standard :

    General-purpose NAS.

  • extreme :

    Extreme NAS.

standard

Ipv6SourceCidrIp

string

No

The source IPv6 CIDR block.

The value supports CIDR format and IPv6 format address range.

Note
  • The IPv6 feature is supported only by Extreme NAS file systems in regions in the Chinese mainland, and IPv6 must be enabled for the file system.

  • Only VPC networks are supported.

  • IPv4 and IPv6 are mutually exclusive.

2001:250:6000::***

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

A323836B-5BC6-45A6-8048-60675C23****

AccessRuleId

string

The ID of the permission rule.

1

Examples

Success response

JSON format

{
  "RequestId": "A323836B-5BC6-45A6-8048-60675C23****",
  "AccessRuleId": "1"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParam.Ipv6SourceCidrIp IPv6 address verification failed. IPv6 address verification failed.
400 InvalidParam.SourceCidrIp IPv4 address verification failed. IPv4 address verification failed.
400 InvalidParam.IPv4AndIPv6MutuallyExclusive You cannot configure IPv4 and IPv6 at the same time. You cannot configure IPv4 and IPv6 at the same time.
400 InvalidAccessGroup.NotsupportedIPv6 The access group does not support IPv6. The access group does not support IPv6.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.