import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
file_share = client.cloud.file_shares.get(
file_share_id="bd8c47ee-e565-4e26-8840-b537e6827b08",
project_id=1,
region_id=1,
)
print(file_share.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
fileShare, err := client.Cloud.FileShares.Get(
context.TODO(),
"bd8c47ee-e565-4e26-8840-b537e6827b08",
cloud.FileShareGetParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(1),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fileShare.ID)
}
curl --request GET \
--url https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}")
.header("Authorization", "<api-key>")
.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::Get.new(url)
request["Authorization"] = '<api-key>'
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"
}Get file share
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
file_share = client.cloud.file_shares.get(
file_share_id="bd8c47ee-e565-4e26-8840-b537e6827b08",
project_id=1,
region_id=1,
)
print(file_share.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
fileShare, err := client.Cloud.FileShares.Get(
context.TODO(),
"bd8c47ee-e565-4e26-8840-b537e6827b08",
cloud.FileShareGetParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(1),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fileShare.ID)
}
curl --request GET \
--url https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}")
.header("Authorization", "<api-key>")
.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::Get.new(url)
request["Authorization"] = '<api-key>'
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"
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?