curl --request PATCH \
--url https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "some_name",
"share_settings": {
"allowed_characters": "LCD",
"path_length": "LCD",
"root_squash": true
},
"tags": {
"my-tag": "my-tag-value",
"my-tag-to-remove": null
}
}
'import requests
url = "https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}"
payload = {
"name": "some_name",
"share_settings": {
"allowed_characters": "LCD",
"path_length": "LCD",
"root_squash": True
},
"tags": {
"my-tag": "my-tag-value",
"my-tag-to-remove": None
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'some_name',
share_settings: {allowed_characters: 'LCD', path_length: 'LCD', root_squash: true},
tags: {'my-tag': 'my-tag-value', 'my-tag-to-remove': null}
})
};
fetch('https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'some_name',
'share_settings' => [
'allowed_characters' => 'LCD',
'path_length' => 'LCD',
'root_squash' => true
],
'tags' => [
'my-tag' => 'my-tag-value',
'my-tag-to-remove' => null
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}"
payload := strings.NewReader("{\n \"name\": \"some_name\",\n \"share_settings\": {\n \"allowed_characters\": \"LCD\",\n \"path_length\": \"LCD\",\n \"root_squash\": true\n },\n \"tags\": {\n \"my-tag\": \"my-tag-value\",\n \"my-tag-to-remove\": null\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"some_name\",\n \"share_settings\": {\n \"allowed_characters\": \"LCD\",\n \"path_length\": \"LCD\",\n \"root_squash\": true\n },\n \"tags\": {\n \"my-tag\": \"my-tag-value\",\n \"my-tag-to-remove\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"some_name\",\n \"share_settings\": {\n \"allowed_characters\": \"LCD\",\n \"path_length\": \"LCD\",\n \"root_squash\": true\n },\n \"tags\": {\n \"my-tag\": \"my-tag-value\",\n \"my-tag-to-remove\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"connection_point": "10.254.0.43:/shares/share-7c14ca01-ea5e-4d85-a6e2-c104fe6b561a",
"created_at": "2023-04-25T11:06:49.226920",
"creator_task_id": "6ab1ead7-8640-4ae9-9e20-9e0bafcd2eca",
"id": "bd8c47ee-e565-4e26-8840-b537e6827b08",
"name": "test-sfs",
"network_id": "e72fd98e-32fa-474d-b0a3-bca11c3064ff",
"network_name": "File_share_test-sfs",
"project_id": 1337,
"protocol": "NFS",
"region": "Luxembourg 1",
"region_id": 7,
"share_network_name": "File_share_test-sfs_network",
"share_settings": {
"type_name": "standard"
},
"size": 10,
"status": "available",
"subnet_id": "ac601bb9-4d77-4356-96de-66ab29711815",
"subnet_name": "subnet_test-sfs",
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": "22b1eau7-8641-4ae9-9n20-9e0b5fcd2gca",
"type_name": "standard",
"volume_type": "default_share_type"
}Update file share
Rename file share, update tags or change VAST settings.
Deprecated: Use PATCH /v3/file_shares/// instead
curl --request PATCH \
--url https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "some_name",
"share_settings": {
"allowed_characters": "LCD",
"path_length": "LCD",
"root_squash": true
},
"tags": {
"my-tag": "my-tag-value",
"my-tag-to-remove": null
}
}
'import requests
url = "https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}"
payload = {
"name": "some_name",
"share_settings": {
"allowed_characters": "LCD",
"path_length": "LCD",
"root_squash": True
},
"tags": {
"my-tag": "my-tag-value",
"my-tag-to-remove": None
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'some_name',
share_settings: {allowed_characters: 'LCD', path_length: 'LCD', root_squash: true},
tags: {'my-tag': 'my-tag-value', 'my-tag-to-remove': null}
})
};
fetch('https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'some_name',
'share_settings' => [
'allowed_characters' => 'LCD',
'path_length' => 'LCD',
'root_squash' => true
],
'tags' => [
'my-tag' => 'my-tag-value',
'my-tag-to-remove' => null
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}"
payload := strings.NewReader("{\n \"name\": \"some_name\",\n \"share_settings\": {\n \"allowed_characters\": \"LCD\",\n \"path_length\": \"LCD\",\n \"root_squash\": true\n },\n \"tags\": {\n \"my-tag\": \"my-tag-value\",\n \"my-tag-to-remove\": null\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"some_name\",\n \"share_settings\": {\n \"allowed_characters\": \"LCD\",\n \"path_length\": \"LCD\",\n \"root_squash\": true\n },\n \"tags\": {\n \"my-tag\": \"my-tag-value\",\n \"my-tag-to-remove\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"some_name\",\n \"share_settings\": {\n \"allowed_characters\": \"LCD\",\n \"path_length\": \"LCD\",\n \"root_squash\": true\n },\n \"tags\": {\n \"my-tag\": \"my-tag-value\",\n \"my-tag-to-remove\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"connection_point": "10.254.0.43:/shares/share-7c14ca01-ea5e-4d85-a6e2-c104fe6b561a",
"created_at": "2023-04-25T11:06:49.226920",
"creator_task_id": "6ab1ead7-8640-4ae9-9e20-9e0bafcd2eca",
"id": "bd8c47ee-e565-4e26-8840-b537e6827b08",
"name": "test-sfs",
"network_id": "e72fd98e-32fa-474d-b0a3-bca11c3064ff",
"network_name": "File_share_test-sfs",
"project_id": 1337,
"protocol": "NFS",
"region": "Luxembourg 1",
"region_id": 7,
"share_network_name": "File_share_test-sfs_network",
"share_settings": {
"type_name": "standard"
},
"size": 10,
"status": "available",
"subnet_id": "ac601bb9-4d77-4356-96de-66ab29711815",
"subnet_name": "subnet_test-sfs",
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": "22b1eau7-8641-4ae9-9n20-9e0b5fcd2gca",
"type_name": "standard",
"volume_type": "default_share_type"
}Authorizations
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
1
Region ID
1
File Share ID
"bd8c47ee-e565-4e26-8840-b537e6827b08"
Body
Name
^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$"some_name"
Configuration settings for the share
Show child attributes
Show child attributes
Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide key-value pairs to add or update tags. Set tag values to null to remove tags. Unspecified tags remain unchanged. Read-only tags are always preserved and cannot be modified.
Examples:
- Add/update tags:
{'tags': {'environment': 'production', 'team': 'backend'}}adds new tags or updates existing ones. - Delete tags:
{'tags': {'old_tag': null}}removes specific tags. - Remove all tags:
{'tags': null}removes all user-managed tags (read-only tags are preserved). - Partial update:
{'tags': {'environment': 'staging'}}only updates specified tags. - Mixed operations:
{'tags': {'environment': 'production', 'cost_center': 'engineering', 'deprecated_tag': null}}adds/updates 'environment' and 'cost_center' while removing 'deprecated_tag', preserving other existing tags. - Replace all: first delete existing tags with null values, then add new ones in the same request.
Show child attributes
Show child attributes
{
"my-tag": "my-tag-value",
"my-tag-to-remove": null
}
Response
OK
Connection point. Can be null during File share creation
"10.254.0.43:/shares/share-7c14ca01-ea5e-4d85-a6e2-c104fe6b561a"
Datetime when the file share was created
"2023-04-25T11:06:49.226920"
Task that created this entity
"6ab1ead7-8640-4ae9-9e20-9e0bafcd2eca"
File share ID
"bd8c47ee-e565-4e26-8840-b537e6827b08"
File share name
"test-sfs"
Network ID.
"e72fd98e-32fa-474d-b0a3-bca11c3064ff"
Network name.
"File_share_test-sfs"
Project ID
1337
File share protocol
"NFS"
Region name
"Luxembourg 1"
Region ID
7
Share network name. May be null if the file share was created with volume type VAST
"File_share_test-sfs_network"
Share settings specific to the file share type
- StandardShareSettingsOutputSerializer
- DdnShareSettingsOutputSerializer
- VastShareSettingsOutputSerializer
Show child attributes
Show child attributes
File share size in GiB
x >= 110
File share status
available, awaiting_transfer, backup_creating, backup_restoring, backup_restoring_error, creating, creating_from_snapshot, deleted, deleting, ensuring, error, error_deleting, extending, extending_error, inactive, manage_error, manage_starting, migrating, migrating_to, replication_change, reverting, reverting_error, shrinking, shrinking_error, shrinking_possible_data_loss_error, unmanage_error, unmanage_starting, unmanaged "available"
Subnet ID.
"ac601bb9-4d77-4356-96de-66ab29711815"
Subnet name.
"subnet_test-sfs"
List of key-value tags associated 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.
Show child attributes
Show child attributes
[
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
]
The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.
"22b1eau7-8641-4ae9-9n20-9e0b5fcd2gca"
File share type name
ddn, standard, vast "standard"
Deprecated. Use type_name instead. File share disk type
ddn_share_type, default_share_type, vast_share_type "default_share_type"
Was this page helpful?