CreateAccessRule

Updated at:

Creates a permission group rule.

Operation description

A single permission group supports up to 300 rules.

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 authorization object.

The format 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 object on the file system.

Valid values:

  • RDWR: read and write. This is the default value.

  • RDONLY: read-only.

Valid values:

  • RDWR :

    Read and write.

  • RDONLY :

    Read-only.

RDWR

UserAccessType

string

No

The access permissions of system users of the authorization object on the file system.

Valid values:

  • no_squash: allows access to the file system as the root user. This is the default value.

  • root_squash: maps the root user to the nobody user when the file system is accessed as the root user.

  • all_squash: maps all users to the nobody user regardless of the user identity used to access the file system.

The nobody user is the default user in Linux systems. This user can only access public content on the server and features low permissions and high security.

Valid values:

  • all_squash :

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

  • no_squash :

    Allows access to the file system as the root user. This is the default value.

  • root_squash :

    Maps the root user to the nobody user when the file system is accessed as the root user.

no_squash

Priority

integer

No

The priority of the permission group rule.

When an authorized object matches multiple rules, the rule with the highest priority takes effect.

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

1

FileSystemType

string

No

The type of the file system.

Valid values:

  • standard: General-purpose NAS. This is the default value.

  • extreme: Extreme NAS.

Valid values:

  • standard :

    General-purpose NAS.

  • extreme :

    Extreme NAS.

standard

Ipv6SourceCidrIp

string

No

The source IPv6 CIDR block.

Both CIDR blocks and IPv6 address ranges are supported.

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

  • Only VPCs 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 group 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.