curl --request POST \
--url https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "homedir-example-1"
},
"spec": {
"path": "home/example-1",
"directoryLimits": {
"capacityBytes": 16363825397760
},
"defaultUserLimits": {
"capacityBytes": 10737418240
},
"rules": [
{
"subject": {
"kind": "user",
"name": "user1"
},
"limits": {
"capacityBytes": 38654705664
}
},
{
"subject": {
"kind": "user",
"id": 65534
},
"limits": {
"capacityBytes": 1099511627776
}
},
{
"subject": {
"kind": "group",
"name": "ml-team"
},
"limits": {
"capacityBytes": 2199023255552,
"inodes": 1000000
}
}
]
}
}
'import requests
url = "https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas"
payload = {
"metadata": { "name": "homedir-example-1" },
"spec": {
"path": "home/example-1",
"directoryLimits": { "capacityBytes": 16363825397760 },
"defaultUserLimits": { "capacityBytes": 10737418240 },
"rules": [
{
"subject": {
"kind": "user",
"name": "user1"
},
"limits": { "capacityBytes": 38654705664 }
},
{
"subject": {
"kind": "user",
"id": 65534
},
"limits": { "capacityBytes": 1099511627776 }
},
{
"subject": {
"kind": "group",
"name": "ml-team"
},
"limits": {
"capacityBytes": 2199023255552,
"inodes": 1000000
}
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {name: 'homedir-example-1'},
spec: {
path: 'home/example-1',
directoryLimits: {capacityBytes: 16363825397760},
defaultUserLimits: {capacityBytes: 10737418240},
rules: [
{subject: {kind: 'user', name: 'user1'}, limits: {capacityBytes: 38654705664}},
{subject: {kind: 'user', id: 65534}, limits: {capacityBytes: 1099511627776}},
{
subject: {kind: 'group', name: 'ml-team'},
limits: {capacityBytes: 2199023255552, inodes: 1000000}
}
]
}
})
};
fetch('https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas', 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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'name' => 'homedir-example-1'
],
'spec' => [
'path' => 'home/example-1',
'directoryLimits' => [
'capacityBytes' => 16363825397760
],
'defaultUserLimits' => [
'capacityBytes' => 10737418240
],
'rules' => [
[
'subject' => [
'kind' => 'user',
'name' => 'user1'
],
'limits' => [
'capacityBytes' => 38654705664
]
],
[
'subject' => [
'kind' => 'user',
'id' => 65534
],
'limits' => [
'capacityBytes' => 1099511627776
]
],
[
'subject' => [
'kind' => 'group',
'name' => 'ml-team'
],
'limits' => [
'capacityBytes' => 2199023255552,
'inodes' => 1000000
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"path\": \"home/example-1\",\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n },\n \"rules\": [\n {\n \"subject\": {\n \"kind\": \"user\",\n \"name\": \"user1\"\n },\n \"limits\": {\n \"capacityBytes\": 38654705664\n }\n },\n {\n \"subject\": {\n \"kind\": \"user\",\n \"id\": 65534\n },\n \"limits\": {\n \"capacityBytes\": 1099511627776\n }\n },\n {\n \"subject\": {\n \"kind\": \"group\",\n \"name\": \"ml-team\"\n },\n \"limits\": {\n \"capacityBytes\": 2199023255552,\n \"inodes\": 1000000\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"path\": \"home/example-1\",\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n },\n \"rules\": [\n {\n \"subject\": {\n \"kind\": \"user\",\n \"name\": \"user1\"\n },\n \"limits\": {\n \"capacityBytes\": 38654705664\n }\n },\n {\n \"subject\": {\n \"kind\": \"user\",\n \"id\": 65534\n },\n \"limits\": {\n \"capacityBytes\": 1099511627776\n }\n },\n {\n \"subject\": {\n \"kind\": \"group\",\n \"name\": \"ml-team\"\n },\n \"limits\": {\n \"capacityBytes\": 2199023255552,\n \"inodes\": 1000000\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"path\": \"home/example-1\",\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n },\n \"rules\": [\n {\n \"subject\": {\n \"kind\": \"user\",\n \"name\": \"user1\"\n },\n \"limits\": {\n \"capacityBytes\": 38654705664\n }\n },\n {\n \"subject\": {\n \"kind\": \"user\",\n \"id\": 65534\n },\n \"limits\": {\n \"capacityBytes\": 1099511627776\n }\n },\n {\n \"subject\": {\n \"kind\": \"group\",\n \"name\": \"ml-team\"\n },\n \"limits\": {\n \"capacityBytes\": 2199023255552,\n \"inodes\": 1000000\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"name": "<string>",
"id": "<string>",
"creationTime": "2023-11-07T05:31:56Z",
"provisioningStatus": "pending",
"healthStatus": "unknown",
"organizationId": "<string>",
"projectId": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"createdBy": "<string>",
"modifiedTime": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"deletionTime": "2023-11-07T05:31:56Z",
"provisioningStatusDetail": {
"reason": "Provisioning",
"message": "<string>"
},
"healthStatusDetail": {
"reason": "Healthy",
"message": "<string>"
}
},
"spec": {
"fileStorageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "home/example-1",
"directoryLimits": {
"capacityBytes": 10737418240,
"inodes": 1000000
},
"defaultUserLimits": {
"capacityBytes": 10737418240,
"inodes": 1000000
},
"defaultGroupLimits": {
"capacityBytes": 10737418240,
"inodes": 1000000
},
"rules": [
{
"subject": {
"kind": "user",
"name": "user1",
"id": 65534
},
"limits": {
"capacityBytes": 10737418240,
"inodes": 1000000
}
}
]
},
"status": {
"usage": {
"usedBytes": 2239325517172,
"usedInodes": 4169748,
"updatedAt": "2023-11-07T05:31:56Z"
},
"rules": [
{
"subject": {
"kind": "user",
"name": "user1",
"id": 65534
},
"provisioningStatus": "pending",
"message": "<string>",
"usage": {
"usedBytes": 2239325517172,
"usedInodes": 4169748
}
}
]
}
}{
"error": "invalid_request",
"error_description": "request body invalid",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "access_denied",
"error_description": "authentication failed",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "not_found",
"error_description": "the requested resource does not exist",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "conflict",
"error_description": "a resource with the same name already exists",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "unprocessable_content",
"error_description": "the request body was in the wrong format",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "server_error",
"error_description": "failed to token claim",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}Create a file storage directory quota
Create a Directory Quota under a File Storage. The directory is created if it does not exist. Returns the complete pending resource. A path already used by another quota of the File Storage, including one being deleted, or a deleting parent conflicts.
curl --request POST \
--url https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "homedir-example-1"
},
"spec": {
"path": "home/example-1",
"directoryLimits": {
"capacityBytes": 16363825397760
},
"defaultUserLimits": {
"capacityBytes": 10737418240
},
"rules": [
{
"subject": {
"kind": "user",
"name": "user1"
},
"limits": {
"capacityBytes": 38654705664
}
},
{
"subject": {
"kind": "user",
"id": 65534
},
"limits": {
"capacityBytes": 1099511627776
}
},
{
"subject": {
"kind": "group",
"name": "ml-team"
},
"limits": {
"capacityBytes": 2199023255552,
"inodes": 1000000
}
}
]
}
}
'import requests
url = "https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas"
payload = {
"metadata": { "name": "homedir-example-1" },
"spec": {
"path": "home/example-1",
"directoryLimits": { "capacityBytes": 16363825397760 },
"defaultUserLimits": { "capacityBytes": 10737418240 },
"rules": [
{
"subject": {
"kind": "user",
"name": "user1"
},
"limits": { "capacityBytes": 38654705664 }
},
{
"subject": {
"kind": "user",
"id": 65534
},
"limits": { "capacityBytes": 1099511627776 }
},
{
"subject": {
"kind": "group",
"name": "ml-team"
},
"limits": {
"capacityBytes": 2199023255552,
"inodes": 1000000
}
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {name: 'homedir-example-1'},
spec: {
path: 'home/example-1',
directoryLimits: {capacityBytes: 16363825397760},
defaultUserLimits: {capacityBytes: 10737418240},
rules: [
{subject: {kind: 'user', name: 'user1'}, limits: {capacityBytes: 38654705664}},
{subject: {kind: 'user', id: 65534}, limits: {capacityBytes: 1099511627776}},
{
subject: {kind: 'group', name: 'ml-team'},
limits: {capacityBytes: 2199023255552, inodes: 1000000}
}
]
}
})
};
fetch('https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas', 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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'name' => 'homedir-example-1'
],
'spec' => [
'path' => 'home/example-1',
'directoryLimits' => [
'capacityBytes' => 16363825397760
],
'defaultUserLimits' => [
'capacityBytes' => 10737418240
],
'rules' => [
[
'subject' => [
'kind' => 'user',
'name' => 'user1'
],
'limits' => [
'capacityBytes' => 38654705664
]
],
[
'subject' => [
'kind' => 'user',
'id' => 65534
],
'limits' => [
'capacityBytes' => 1099511627776
]
],
[
'subject' => [
'kind' => 'group',
'name' => 'ml-team'
],
'limits' => [
'capacityBytes' => 2199023255552,
'inodes' => 1000000
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"path\": \"home/example-1\",\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n },\n \"rules\": [\n {\n \"subject\": {\n \"kind\": \"user\",\n \"name\": \"user1\"\n },\n \"limits\": {\n \"capacityBytes\": 38654705664\n }\n },\n {\n \"subject\": {\n \"kind\": \"user\",\n \"id\": 65534\n },\n \"limits\": {\n \"capacityBytes\": 1099511627776\n }\n },\n {\n \"subject\": {\n \"kind\": \"group\",\n \"name\": \"ml-team\"\n },\n \"limits\": {\n \"capacityBytes\": 2199023255552,\n \"inodes\": 1000000\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"path\": \"home/example-1\",\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n },\n \"rules\": [\n {\n \"subject\": {\n \"kind\": \"user\",\n \"name\": \"user1\"\n },\n \"limits\": {\n \"capacityBytes\": 38654705664\n }\n },\n {\n \"subject\": {\n \"kind\": \"user\",\n \"id\": 65534\n },\n \"limits\": {\n \"capacityBytes\": 1099511627776\n }\n },\n {\n \"subject\": {\n \"kind\": \"group\",\n \"name\": \"ml-team\"\n },\n \"limits\": {\n \"capacityBytes\": 2199023255552,\n \"inodes\": 1000000\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"path\": \"home/example-1\",\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n },\n \"rules\": [\n {\n \"subject\": {\n \"kind\": \"user\",\n \"name\": \"user1\"\n },\n \"limits\": {\n \"capacityBytes\": 38654705664\n }\n },\n {\n \"subject\": {\n \"kind\": \"user\",\n \"id\": 65534\n },\n \"limits\": {\n \"capacityBytes\": 1099511627776\n }\n },\n {\n \"subject\": {\n \"kind\": \"group\",\n \"name\": \"ml-team\"\n },\n \"limits\": {\n \"capacityBytes\": 2199023255552,\n \"inodes\": 1000000\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"name": "<string>",
"id": "<string>",
"creationTime": "2023-11-07T05:31:56Z",
"provisioningStatus": "pending",
"healthStatus": "unknown",
"organizationId": "<string>",
"projectId": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"createdBy": "<string>",
"modifiedTime": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"deletionTime": "2023-11-07T05:31:56Z",
"provisioningStatusDetail": {
"reason": "Provisioning",
"message": "<string>"
},
"healthStatusDetail": {
"reason": "Healthy",
"message": "<string>"
}
},
"spec": {
"fileStorageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "home/example-1",
"directoryLimits": {
"capacityBytes": 10737418240,
"inodes": 1000000
},
"defaultUserLimits": {
"capacityBytes": 10737418240,
"inodes": 1000000
},
"defaultGroupLimits": {
"capacityBytes": 10737418240,
"inodes": 1000000
},
"rules": [
{
"subject": {
"kind": "user",
"name": "user1",
"id": 65534
},
"limits": {
"capacityBytes": 10737418240,
"inodes": 1000000
}
}
]
},
"status": {
"usage": {
"usedBytes": 2239325517172,
"usedInodes": 4169748,
"updatedAt": "2023-11-07T05:31:56Z"
},
"rules": [
{
"subject": {
"kind": "user",
"name": "user1",
"id": 65534
},
"provisioningStatus": "pending",
"message": "<string>",
"usage": {
"usedBytes": 2239325517172,
"usedInodes": 4169748
}
}
]
}
}{
"error": "invalid_request",
"error_description": "request body invalid",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "access_denied",
"error_description": "authentication failed",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "not_found",
"error_description": "the requested resource does not exist",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "conflict",
"error_description": "a resource with the same name already exists",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "unprocessable_content",
"error_description": "the request body was in the wrong format",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "server_error",
"error_description": "failed to token claim",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}Authorizations
Body
A request to create a Directory Quota.
A Directory Quota create request.
Directory Quota settings on create. At least one of directoryLimits, defaultUserLimits, defaultGroupLimits or a non-empty rules list is required; a request without any is rejected with 422. When directoryLimits is set, no default or rule limit may exceed it, compared separately for capacityBytes and inodes; a request that does is rejected with 422. directoryLimits.capacityBytes may not exceed the File Storage size. Quotas may be nested, and directoryLimits may not exceed the directoryLimits of a quota on a parent directory, nor be lower than those of a quota on a subdirectory, compared separately for capacityBytes and inodes. A request that breaks either rule is rejected with 422.
Show child attributes
Show child attributes
Response
A File Storage Directory Quota.
A File Storage Directory Quota.
Was this page helpful?