• Scalable File Service

sfs
  1. Help Center
  2. Scalable File Service
  3. API Reference(cli)
  4. API Description
  5. Share Access Rules
  6. Adding Share Access Rules

Adding Share Access Rules

Function

This interface is used to add share access rules.

NOTE:
  • This interface is an asynchronous interface. After the command is successfully executed, information about share access rules is displayed but this only indicates that the command is successfully delivered. Later, you can refer to Querying Share Access Rules to identify whether the rule adding is complete and successful.
  • APIs whose microversion is 2.28 or later can ignore error statuses of existing share access rules during rule adding. This function takes effect only when python-manilaclient version is 1.12.0 or later and --os-share-api-version is set to a value greater than or equal to 2.28. An example of sending a request by using a command is as follows: manila --os-share-api-version 2.28 access-allow 859059fa-dcb0-47c5-876e-f5a88a8636da cert 0157b53f-4974-4e80-91c9-098532bcaf00

Command

  • Usage
    manila access-allow [--access-level <access_level>]
                        <share> <access_type> <access_to>
  • Parameter description

    Name

    Mandatory

    Type

    Description

    share

    Yes

    string

    Specifies the UUID or name of the shared file system.

    access_type

    Yes

    string

    Specifies the type of the share access rule. For NFS shared file systems, the value can only be cert. When this parameter is set to cert for NFS shared file systems, set access_to to the VPC ID.

    access_to

    Yes

    string

    Specifies the value of the access rule. When the access rule type of the NFS share is cert, the value contains 1 to 64 characters and can only be the VPC ID.

    NOTE:

    The python-manilaclient tool and command lines support only VPC authorization and does not support IP address authorization. Use the RESTful API to create an access rule for IP address authorization.

    access_level

    No

    string

    Specifies the access level of the shared file system. Possible values are ro (read-only) and rw (read-write). The default value is rw.

  • Example command
    manila access-allow 416112b6-e5c9-4a46-8dd1-80749fc09336 cert 996357e2-ecf4-4b60-afc5-89001ee224d6
  • Example command (ignoring the error status of existing access rules when adding a share access rule)
    manila --os-share-api-version 2.28 access-allow c72067bf-9305-4330-852e-5117a0a949f9 cert 0157b53f-4974-4e80-91c9-098532bcaf00

Response

  • Parameter description

    Name

    Mandatory

    Type

    Description

    share_id

    Yes

    string

    Specifies the UUID of the shared file system to which the access rule is added.

    access_type

    Yes

    string

    Specifies the type of the share access rule.

    access_to

    Yes

    string

    Specifies the access that the back end grants or denies.

    access_level

    Yes

    string

    Specifies the access level of the shared file system.

    state

    Yes

    string

    Specifies the status of the share access rule. If the API version is earlier than 2.28, the status of the share access rule is new, active, or error. In 2.28 and later versions, the status of the share access rule is queued_to_apply, applying, active, error, queued_to_deny, or denying.

    id

    Yes

    string

    Specifies the UUID of the share access rule.

  • Example response
    root@n-version-client:~/ca# manila access-allow 416112b6-e5c9-4a46-8dd1-80749fc09336 cert 996357e2-ecf4-4b60-afc5-89001ee224d6
    +--------------+--------------------------------------+
    | Property     | Value                                |
    +--------------+--------------------------------------+
    | access_key   | None                                 |
    | share_id     | 416112b6-e5c9-4a46-8dd1-80749fc09336 |
    | access_type  | cert                                 |
    | access_to    | 996357e2-ecf4-4b60-afc5-89001ee224d6 |
    | access_level | rw                                   |
    | state        | new                                  |
    | id           | e0347b5c-8aec-402c-af83-775c3b5e0ad0 |
    +--------------+--------------------------------------+
  • Example response (ignoring the error status of existing access rules when adding a share access rule)
    root@n-version-client:~/ca# manila --os-share-api-version 2.28 access-allow  c72067bf-9305-4330-852e-5117a0a949f9 cert 0157b53f-4974-4e80-91c9-098532bcaf00
    +--------------+--------------------------------------+
    | Property     | Value                                |
    +--------------+--------------------------------------+
    | access_key   | None                                 |
    | share_id     | c72067bf-9305-4330-852e-5117a0a949f9 |
    | access_type  | cert                                 |
    | access_to    | 0157b53f-4974-4e80-91c9-098532bcaf00 |
    | access_level | rw                                   |
    | state        | queued_to_apply                      |
    | id           | c503ae9d-9ba5-4d1d-9897-e37b1b043fc0 |
    +--------------+--------------------------------------+