curl --request PUT \
--url https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "homedir-example-1"
},
"spec": {
"directoryLimits": {
"capacityBytes": 16363825397760,
"inodes": 100000000
},
"defaultUserLimits": {
"capacityBytes": 10737418240
}
}
}
'import requests
url = "https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}"
payload = {
"metadata": { "name": "homedir-example-1" },
"spec": {
"directoryLimits": {
"capacityBytes": 16363825397760,
"inodes": 100000000
},
"defaultUserLimits": { "capacityBytes": 10737418240 }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {name: 'homedir-example-1'},
spec: {
directoryLimits: {capacityBytes: 16363825397760, inodes: 100000000},
defaultUserLimits: {capacityBytes: 10737418240}
}
})
};
fetch('https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}', 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/{filestorageDirectoryQuotaID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'name' => 'homedir-example-1'
],
'spec' => [
'directoryLimits' => [
'capacityBytes' => 16363825397760,
'inodes' => 100000000
],
'defaultUserLimits' => [
'capacityBytes' => 10737418240
]
]
]),
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/{filestorageDirectoryQuotaID}"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760,\n \"inodes\": 100000000\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760,\n \"inodes\": 100000000\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760,\n \"inodes\": 100000000\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\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"
}Update a file storage directory quota
Update the limits, defaults, rules, name and tags of a Directory Quota. The path cannot change and is not part of the request. Omitted limits and rules are cleared, and spec.rules replaces the full rule list.
curl --request PUT \
--url https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "homedir-example-1"
},
"spec": {
"directoryLimits": {
"capacityBytes": 16363825397760,
"inodes": 100000000
},
"defaultUserLimits": {
"capacityBytes": 10737418240
}
}
}
'import requests
url = "https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}"
payload = {
"metadata": { "name": "homedir-example-1" },
"spec": {
"directoryLimits": {
"capacityBytes": 16363825397760,
"inodes": 100000000
},
"defaultUserLimits": { "capacityBytes": 10737418240 }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {name: 'homedir-example-1'},
spec: {
directoryLimits: {capacityBytes: 16363825397760, inodes: 100000000},
defaultUserLimits: {capacityBytes: 10737418240}
}
})
};
fetch('https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}', 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/{filestorageDirectoryQuotaID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'name' => 'homedir-example-1'
],
'spec' => [
'directoryLimits' => [
'capacityBytes' => 16363825397760,
'inodes' => 100000000
],
'defaultUserLimits' => [
'capacityBytes' => 10737418240
]
]
]),
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/{filestorageDirectoryQuotaID}"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760,\n \"inodes\": 100000000\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760,\n \"inodes\": 100000000\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"homedir-example-1\"\n },\n \"spec\": {\n \"directoryLimits\": {\n \"capacityBytes\": 16363825397760,\n \"inodes\": 100000000\n },\n \"defaultUserLimits\": {\n \"capacityBytes\": 10737418240\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
Path Parameters
Body
A request to update a Directory Quota.
A Directory Quota update request.
Directory Quota settings on update. The path cannot change, so it is not part of an update. 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?