Skip to main content
POST
/
cloud
/
v1
/
file_shares
/
{project_id}
/
{region_id}
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
task_id_list = client.cloud.file_shares.create(
    project_id=1,
    region_id=1,
    name="test-share-file-system",
    network={
        "network_id": "024a29e9-b4b7-4c91-9a46-505be123d9f8"
    },
    protocol="NFS",
    size=5,
)
print(task_id_list.tasks)
{
  "tasks": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

Example:

1

region_id
integer
required

Region ID

Example:

1

Body

application/json
name
string
required

File share name

Example:

"test-share-file-system"

network
FileShareNetworkSerializer · object
required

File share network configuration

protocol
string
required

File share protocol

Allowed value: "NFS"
Example:

"NFS"

size
integer
required

File share size

Required range: x >= 1
Example:

5

access
CreateAccessRuleSerializer · object[]

Access Rules

Example:
[
{
"access_mode": "ro",
"ip_address": "10.0.0.1"
}
]
tags
CreateTagsSerializer · object

Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.

Example:
{ "my-tag": "my-tag-value" }
volume_type
string
default:default_share_type

File share volume type

Allowed value: "default_share_type"

Response

200 - application/json

OK

tasks
string[]
required

List of task IDs

Example:
["d478ae29-dedc-4869-82f0-96104425f565"]