Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Shared File System

Updated on 2024-03-21 GMT+08:00

Function

This API is used to create a shared file system. After the file system is created, you need to mount the file system to ECSs to achieve shared file storage.

NOTE:

This API is an asynchronous API. If the returned status code is 200, the API request is successfully delivered and received. Later, you can query the status and path of the shared file system by referring to Querying Details About a Shared File System to identify whether the creation is complete and successful. If the status of the shared file system becomes available or the shared path is generated, the creation is successful.

NOTICE:

After a shared file system is created successfully, it can be used only after you add share access rules by referring to Adding a File System Access Rule.

URI

  • POST /v2/{project_id}/shares
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Specifies the project ID of the operator.

Request Header

The operation message header is the same as that of a common request. For details, see Table 3.

Request

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    share

    Yes

    Object

    For details, see the description of the share field.

  • Description of the share field

    Parameter

    Mandatory

    Type

    Description

    share_proto

    Yes

    String

    Specifies the file sharing protocol. The value can be NFS (for Linux OS).

    size

    Yes

    Integer

    Specifies the size (GB) of the shared file system. The applied capacity of the shared file system cannot be larger than the allowed quota. To view the allowed quota, see Quota Management.

    name

    No

    String

    Specifies the name of the shared file system, which contains 0 to 255 characters and can contain only letters, digits, hyphens (-), and underscores (_).

    description

    No

    String

    Specifies the description of the shared file system, which contains 0 to 255 characters and can contain only letters, digits, hyphens (-), and underscores (_).

    is_public

    No

    Boolean

    (Supported by API versions from v2.8 to v2.42). Specifies whether a file system can be publicly seen. If it is set to true, the file system can be seen publicly. If it is set to false, the file system can be seen privately. The default value is false.

    availability_zone

    No

    String

    Specifies the availability zone name. If this parameter is left blank, the default availability zone will be used. If the default availability zone contains no storage resources, the creation of the shared file system fails. The value contains 0 to 255 characters.

    metadata

    No

    Object

    Specifies the metadata information used to create the shared file system. The value consists of one or more key and value pairs organized as a dictionary of strings. For details, see the description of the metadata field.

  • Example request: POST https://{endpoint}/v2/16e1ab15c35a457e9c2b2aa189f544e1/shares
    Creating a 1-GB NFS file system that can only be seen privately
    {
       "share": {
           "name": "test",
           "description": "test description",
           "share_proto": "NFS",
           "share_network_id": null,
           "size": 1,
           "is_public": false
       }
    }
  • Example request (with Enterprise Project enabled): POST https://{endpoint}/v2/16e1ab15c35a457e9c2b2aa189f544e1/shares
    Creating a 1-GB NFS file system that can only be seen privately and adding it to an enterprise project
    {
       "share": {
           "share_type": null,
           "name": "test",
           "snapshot_id": null,
           "description": "test description",
           "metadata": {
               "enterprise_project_id": "9130c90d-73b8-4203-b790-d49f98d503df"
           },
           "share_proto": "NFS",
           "share_network_id": null,
           "size": 1,
           "is_public": false
       }
    }

Response

  • Parameter description

    Parameter

    Type

    Description

    share

    Object

    For details, see the description of the share field.

  • Description of the share field

    Parameter

    Type

    Description

    links

    Array

    Specifies the links of shared file systems.

    availability_zone

    String

    Specifies the availability zone.

    share_server_id

    String

    Specifies the ID for managing share services.

    id

    String

    Specifies the ID of the shared file system.

    size

    Integer

    Specifies the size (GB) of the shared file system.

    project_id

    String

    Specifies the ID of the project to which the shared file system belongs.

    metadata

    Object

    Sets one or more metadata key and value pairs as a dictionary of strings. The value of the share_used key indicates the file system used capacity, in bytes.

    status

    String

    Specifies the status of the shared file system.

    description

    String

    Describes the shared file system.

    host

    String

    Specifies the name of the host.

    name

    String

    Specifies the name of the shared file system.

    created_at

    String

    Specifies the date and time stamp when the shared file system was created.

    share_proto

    String

    Specifies the protocol for sharing file systems.

    share_type_name

    String

    Specifies the storage service type assigned for the shared file system, such as high-performance storage (composed of SSDs) and large-capacity storage (composed of SATA disks). This field is supported by API v2.6 and later versions.

    share_type

    String

    Specifies the ID of the file system type.

    volume_type

    String

    Specifies the volume type. The definition of this parameter is the same as that of share_type.

    export_locations

    Array

    Lists the mount locations. Currently, only a single mount location is supported. This parameter exists only when X-Openstack-Manila-Api-Version specified in the request header is smaller than 2.9.

    export_location

    String

    Specifies the mount location. This parameter exists only when X-Openstack-Manila-Api-Version specified in the request header is smaller than 2.9.

    is_public

    Boolean

    Specifies the visibility level of the shared file system. If true is returned, the file system can be seen publicly. If false is returned, the file system can be seen privately. The default value is false.

  • Example response
    {
        "share": {
            "status": "creating",
            "project_id": "16e1ab15c35a457e9c2b2aa189f544e1",
            "name": "share_London",
            "share_type": "25747776-08e5-494f-ab40-a64b9d20d8f7",
            "availability_zone": "az1.dc1",
            "created_at": "2015-09-18T10:25:24.533287",
            "export_location": null,
            "links": [
                {
                    "href": "http://192.168.198.54:8786/v2/16e1ab15c35a457e9c2b2aa189f544e1/shares/011d21e2-fbc3-4e4a-9993-9ea223f73264",
                    "rel": "self"
                },
                {
                    "href": "http://192.168.198.54:8786/16e1ab15c35a457e9c2b2aa189f544e1/shares/011d21e2-fbc3-4e4a-9993-9ea223f73264",
                    "rel": "bookmark"
                }
            ],
            "share_network_id": null,
            "export_locations": [],
            "share_proto": "NFS",
            "host": null,
            "volume_type": "default",
            "snapshot_id": null,
            "is_public": true,
            "metadata": {
                "project": "my_app",
                "aim": "doc"
            },
            "id": "011d21e2-fbc3-4e4a-9993-9ea223f73264",
            "size": 1,
            "description": "My custom share London"
        }
    }
    NOTE:

    When the client receives the system response, the shared file system is still being created. For this reason, the shared path cannot be queried immediately. You can use the API of Querying Mount Locations of a Shared File System to query the shared path after the creation is complete.

Status Codes

  • Normal

    200

  • Abnormal

    Status Code

    Description

    400 Bad Request

    The server failed to process the request.

    401 Unauthorized

    You must enter a username and the password to access the requested page.

    403 Forbidden

    Access to the requested page is forbidden.

    404 Not Found

    The requested page was not found.

    405 Method Not Allowed

    You are not allowed to use the method specified in the request.

    406 Not Acceptable

    The response generated by the server could not be accepted by the client.

    407 Proxy Authentication Required

    You must use the proxy server for authentication. Then the request can be processed.

    408 Request Timeout

    The request timed out.

    409 Conflict

    The request could not be processed due to a conflict.

    413 Quota Exceeded

    Insufficient user quota.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    501 Not Implemented

    Failed to complete the request because the server does not support the requested function.

    502 Bad Gateway

    Failed to complete the request because the request is invalid.

    503 Service Unavailable

    Failed to complete the request because the service is unavailable.

    504 Gateway Timeout

    A gateway timeout error occurred.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback