POST
/
cloud
/
v1
/
file_shares
/
{project_id}
/
{region_id}
/
{file_share_id}
/
access_rule
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
access_rule = client.cloud.file_shares.access_rules.create(
    file_share_id="bd8c47ee-e565-4e26-8840-b537e6827b08",
    project_id=1,
    region_id=1,
    access_mode="ro",
    ip_address="192.168.1.1",
)
print(access_rule.id)
{
  "access_level": "ro",
  "access_to": "192.168.1.1",
  "id": "4f09d7dd-f1f8-4352-b015-741b2192db47",
  "state": "active"
}

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

Examples:

1

region_id
integer
required

Region ID

Examples:

1

file_share_id
string<uuid4>
required

File Share ID

Examples:

"bd8c47ee-e565-4e26-8840-b537e6827b08"

Body

application/json
access_mode
enum<string>
required

Access mode

Available options:
ro,
rw
ip_address
required

Source IP or network

Examples:

"192.168.1.1"

"2001:db8::1"

"10.0.0.0/24"

"fd00::/8"

"0.0.0.0/0"

"::/0"

Response

200 - application/json

OK

access_level
enum<string>
required

Access mode

Available options:
ro,
rw
access_to
required

Source IP or network

Examples:

"192.168.1.1"

"2001:db8::1"

"10.0.0.0/24"

"fd00::/8"

"0.0.0.0/0"

"::/0"

id
string<uuid4>
required

Access Rule ID

Examples:

"4f09d7dd-f1f8-4352-b015-741b2192db47"

state
enum<string>
required

Access Rule state

Available options:
active,
applying,
denying,
error,
new,
queued_to_apply,
queued_to_deny