From 58bd597f0fa2219536adbd7cbe989cae6414b327 Mon Sep 17 00:00:00 2001
From: Giuseppe Lo Presti
Date: Thu, 25 Nov 2021 11:18:20 +0100
Subject: [PATCH 1/3] Initial edition of a Lock/Unlock/RefreshLock API
---
cs3/gateway/v1beta1/gateway_api.proto | 12 +++
.../provider/v1beta1/provider_api.proto | 100 ++++++++++++++++++
cs3/storage/provider/v1beta1/resources.proto | 24 +++++
3 files changed, 136 insertions(+)
diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto
index 9123ac62..81285e47 100644
--- a/cs3/gateway/v1beta1/gateway_api.proto
+++ b/cs3/gateway/v1beta1/gateway_api.proto
@@ -169,6 +169,18 @@ service GatewayAPI {
// Unsets arbitrary metdata into a storage resource.
// Arbitrary metadata is returned in a cs3.storage.provider.v1beta1.ResourceInfo.
rpc UnsetArbitraryMetadata(cs3.storage.provider.v1beta1.UnsetArbitraryMetadataRequest) returns (cs3.storage.provider.v1beta1.UnsetArbitraryMetadataResponse);
+ // Locks a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is already locked.
+ rpc SetLock(cs3.storage.provider.v1beta1.SetLockRequest) returns (cs3.storage.provider.v1beta1.SetLockResponse);
+ // Gets the lock metadata of a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ rpc GetLock(cs3.storage.provider.v1beta1.GetLockRequest) returns (cs3.storage.provider.v1beta1.GetLockResponse);
+ // Refreshes the lock metadata of a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ rpc RefreshLock(cs3.storage.provider.v1beta1.RefreshLockRequest) returns (cs3.storage.provider.v1beta1.RefreshLockResponse);
+ // Unlocks a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ rpc Unlock(cs3.storage.provider.v1beta1.UnlockRequest) returns (cs3.storage.provider.v1beta1.UnlockResponse);
// Creates the home directory for a user.
rpc CreateHome(cs3.storage.provider.v1beta1.CreateHomeRequest) returns (cs3.storage.provider.v1beta1.CreateHomeResponse);
// Creates a storage space.
diff --git a/cs3/storage/provider/v1beta1/provider_api.proto b/cs3/storage/provider/v1beta1/provider_api.proto
index a5f2f500..77ccf11b 100644
--- a/cs3/storage/provider/v1beta1/provider_api.proto
+++ b/cs3/storage/provider/v1beta1/provider_api.proto
@@ -148,6 +148,18 @@ service ProviderAPI {
// Unsets arbitrary metdata into a storage resource.
// Arbitrary metadata is returned in a cs3.storageprovider.v1beta1.ResourceInfo.
rpc UnsetArbitraryMetadata(UnsetArbitraryMetadataRequest) returns (UnsetArbitraryMetadataResponse);
+ // Locks a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is already locked.
+ rpc SetLock(SetLockRequest) returns (SetLockResponse);
+ // Gets the lock metadata of a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ rpc GetLock(GetLockRequest) returns (GetLockResponse);
+ // Refreshes the lock metadata of a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ rpc RefreshLock(RefreshLockRequest) returns (RefreshLockResponse);
+ // Unlocks a storage resource.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ rpc Unlock(UnlockRequest) returns (UnlockResponse);
// Creates the home directory for a user.
rpc CreateHome(CreateHomeRequest) returns (CreateHomeResponse);
// Gets the home path for the user.
@@ -784,6 +796,94 @@ message UnsetArbitraryMetadataResponse {
cs3.types.v1beta1.Opaque opaque = 2;
}
+message SetLockRequest {
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 1;
+ // REQUIRED.
+ // The reference on which the lock should be set,
+ // if no lock is present.
+ // The storage driver MUST ensure atomic handling
+ // of lock/unlock operations.
+ Reference ref = 2;
+ // REQUIRED.
+ // The lock metadata.
+ Lock lock = 3;
+}
+
+message SetLockResponse {
+ // REQUIRED.
+ // The response status.
+ cs3.rpc.v1beta1.Status status = 1;
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 2;
+}
+
+message GetLockRequest {
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 1;
+ // REQUIRED.
+ // The reference the lock is associated to.
+ Reference ref = 2;
+}
+
+message GetLockResponse {
+ // REQUIRED.
+ // The response status.
+ cs3.rpc.v1beta1.Status status = 1;
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 2;
+ // REQUIRED.
+ // The lock metadata
+ Lock lock = 3;
+}
+
+message RefreshLockRequest {
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 1;
+ // REQUIRED.
+ // The reference on which the lock should be refreshed.
+ // The storage driver MUST ensure atomic handling
+ // of lock/unlock operations.
+ Reference ref = 2;
+ // REQUIRED.
+ // The lock metadata.
+ Lock lock = 3;
+}
+
+message RefreshLockResponse {
+ // REQUIRED.
+ // The response status.
+ cs3.rpc.v1beta1.Status status = 1;
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 2;
+}
+
+message UnlockRequest {
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 1;
+ // REQUIRED.
+ // The reference the lock is associated to.
+ // The storage driver MUST ensure atomic handling
+ // of lock/unlock operations.
+ Reference ref = 2;
+}
+
+message UnlockResponse {
+ // REQUIRED.
+ // The response status.
+ cs3.rpc.v1beta1.Status status = 1;
+ // OPTIONAL.
+ // Opaque information.
+ cs3.types.v1beta1.Opaque opaque = 2;
+}
+
message CreateHomeRequest {
// OPTIONAL.
// Opaque information.
diff --git a/cs3/storage/provider/v1beta1/resources.proto b/cs3/storage/provider/v1beta1/resources.proto
index b67bde74..ac000df0 100644
--- a/cs3/storage/provider/v1beta1/resources.proto
+++ b/cs3/storage/provider/v1beta1/resources.proto
@@ -115,6 +115,30 @@ message ArbitraryMetadata {
map metadata = 1;
}
+// The available type of locks for a resource.
+enum LockType {
+ LOCK_TYPE_INVALID = 0;
+ // Shared (advisory) lock: the resource can be read or
+ // written or unlocked by everyone who has access.
+ LOCK_TYPE_SHARED = 1;
+ // Write lock: the resource can be read by everyone who has
+ // access, but write and unlock is restricted to the lock holder.
+ LOCK_TYPE_WRITE = 2;
+ // Exclusive lock: the resource cannot be read nor written
+ // nor unlocked except by the user holding the lock.
+ LOCK_TYPE_EXCL = 3;
+}
+
+// The metadata associated with a lock on a resource.
+message Lock {
+ // The type of lock.
+ LockType type = 1;
+ // The user holding the lock.
+ cs3.identity.user.v1beta1.UserId user = 2;
+ // Some arbitrary metadata associated with the lock.
+ string metadata = 3;
+}
+
// The available types of resources.
enum ResourceType {
RESOURCE_TYPE_INVALID = 0;
From 7cf716acb3a4bc2d68364880ec9140a4f2517d74 Mon Sep 17 00:00:00 2001
From: Giuseppe Lo Presti
Date: Wed, 1 Dec 2021 13:38:46 +0100
Subject: [PATCH 2/3] The lock holder is a user or an app
---
cs3/storage/provider/v1beta1/resources.proto | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/cs3/storage/provider/v1beta1/resources.proto b/cs3/storage/provider/v1beta1/resources.proto
index ac000df0..3030a2d2 100644
--- a/cs3/storage/provider/v1beta1/resources.proto
+++ b/cs3/storage/provider/v1beta1/resources.proto
@@ -133,10 +133,15 @@ enum LockType {
message Lock {
// The type of lock.
LockType type = 1;
- // The user holding the lock.
- cs3.identity.user.v1beta1.UserId user = 2;
+ // The entity holding the lock.
+ oneof holder {
+ // A userid if the lock is held by a user
+ cs3.identity.user.v1beta1.UserId user = 2;
+ // An application name if the lock is held by an app
+ string app_name = 3;
+ }
// Some arbitrary metadata associated with the lock.
- string metadata = 3;
+ string metadata = 4;
}
// The available types of resources.
From 789ff56782f1a22c1796e3309dde83e29a0fc3a7 Mon Sep 17 00:00:00 2001
From: Giuseppe Lo Presti
Date: Thu, 9 Dec 2021 17:28:56 +0100
Subject: [PATCH 3/3] Added last modification time and proposed a reference
implementation
Also some more detailed specs are provided for the implementations
---
cs3/gateway/v1beta1/gateway_api.proto | 17 +-
.../provider/v1beta1/provider_api.proto | 23 +-
cs3/storage/provider/v1beta1/resources.proto | 30 +-
docs/index.html | 509 +++++++++++++++++-
4 files changed, 559 insertions(+), 20 deletions(-)
diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto
index 81285e47..5e981bb6 100644
--- a/cs3/gateway/v1beta1/gateway_api.proto
+++ b/cs3/gateway/v1beta1/gateway_api.proto
@@ -170,16 +170,27 @@ service GatewayAPI {
// Arbitrary metadata is returned in a cs3.storage.provider.v1beta1.ResourceInfo.
rpc UnsetArbitraryMetadata(cs3.storage.provider.v1beta1.UnsetArbitraryMetadataRequest) returns (cs3.storage.provider.v1beta1.UnsetArbitraryMetadataResponse);
// Locks a storage resource.
+ // MUST return CODE_NOT_FOUND if the reference does not exist.
// MUST return CODE_PRECONDITION_FAILED if the reference is already locked.
+ // In addition, the implementation MUST ensure atomicity when multiple users
+ // concurrently attempt to set a lock.
+ // The caller MUST have write permissions on the resource.
rpc SetLock(cs3.storage.provider.v1beta1.SetLockRequest) returns (cs3.storage.provider.v1beta1.SetLockResponse);
// Gets the lock metadata of a storage resource.
- // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ // MUST return CODE_NOT_FOUND if the reference does not exist or is not locked.
+ // The caller MUST have read permissions on the resource.
rpc GetLock(cs3.storage.provider.v1beta1.GetLockRequest) returns (cs3.storage.provider.v1beta1.GetLockResponse);
// Refreshes the lock metadata of a storage resource.
- // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ // MUST return CODE_NOT_FOUND if the reference does not exist.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked
+ // or if the caller does not hold the lock.
+ // The caller MUST have write permissions on the resource.
rpc RefreshLock(cs3.storage.provider.v1beta1.RefreshLockRequest) returns (cs3.storage.provider.v1beta1.RefreshLockResponse);
// Unlocks a storage resource.
- // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ // MUST return CODE_NOT_FOUND if the reference does not exist.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked
+ // or if the caller does not hold the lock.
+ // The caller MUST have write permissions on the resource.
rpc Unlock(cs3.storage.provider.v1beta1.UnlockRequest) returns (cs3.storage.provider.v1beta1.UnlockResponse);
// Creates the home directory for a user.
rpc CreateHome(cs3.storage.provider.v1beta1.CreateHomeRequest) returns (cs3.storage.provider.v1beta1.CreateHomeResponse);
diff --git a/cs3/storage/provider/v1beta1/provider_api.proto b/cs3/storage/provider/v1beta1/provider_api.proto
index 77ccf11b..a9e231db 100644
--- a/cs3/storage/provider/v1beta1/provider_api.proto
+++ b/cs3/storage/provider/v1beta1/provider_api.proto
@@ -149,16 +149,27 @@ service ProviderAPI {
// Arbitrary metadata is returned in a cs3.storageprovider.v1beta1.ResourceInfo.
rpc UnsetArbitraryMetadata(UnsetArbitraryMetadataRequest) returns (UnsetArbitraryMetadataResponse);
// Locks a storage resource.
+ // MUST return CODE_NOT_FOUND if the reference does not exist.
// MUST return CODE_PRECONDITION_FAILED if the reference is already locked.
+ // In addition, the implementation MUST ensure atomicity when multiple users
+ // concurrently attempt to set a lock.
+ // The caller MUST have write permissions on the resource.
rpc SetLock(SetLockRequest) returns (SetLockResponse);
// Gets the lock metadata of a storage resource.
- // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ // MUST return CODE_NOT_FOUND if the reference does not exist or is not locked.
+ // The caller MUST have read permissions on the resource.
rpc GetLock(GetLockRequest) returns (GetLockResponse);
// Refreshes the lock metadata of a storage resource.
- // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ // MUST return CODE_NOT_FOUND if the reference does not exist.
+ // MUST return CODE_PRECONDITION_FALIED if the reference is not locked
+ // or if the caller does not hold the lock.
+ // The caller MUST have write permissions on the resource.
rpc RefreshLock(RefreshLockRequest) returns (RefreshLockResponse);
// Unlocks a storage resource.
- // MUST return CODE_PRECONDITION_FAILED if the reference is not locked.
+ // MUST return CODE_NOT_FOUND if the reference does not exist.
+ // MUST return CODE_PRECONDITION_FAILED if the reference is not locked
+ // or if the caller does not hold the lock.
+ // The caller MUST have write permissions on the resource.
rpc Unlock(UnlockRequest) returns (UnlockResponse);
// Creates the home directory for a user.
rpc CreateHome(CreateHomeRequest) returns (CreateHomeResponse);
@@ -803,8 +814,6 @@ message SetLockRequest {
// REQUIRED.
// The reference on which the lock should be set,
// if no lock is present.
- // The storage driver MUST ensure atomic handling
- // of lock/unlock operations.
Reference ref = 2;
// REQUIRED.
// The lock metadata.
@@ -847,8 +856,6 @@ message RefreshLockRequest {
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The reference on which the lock should be refreshed.
- // The storage driver MUST ensure atomic handling
- // of lock/unlock operations.
Reference ref = 2;
// REQUIRED.
// The lock metadata.
@@ -870,8 +877,6 @@ message UnlockRequest {
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The reference the lock is associated to.
- // The storage driver MUST ensure atomic handling
- // of lock/unlock operations.
Reference ref = 2;
}
diff --git a/cs3/storage/provider/v1beta1/resources.proto b/cs3/storage/provider/v1beta1/resources.proto
index 3030a2d2..380550a7 100644
--- a/cs3/storage/provider/v1beta1/resources.proto
+++ b/cs3/storage/provider/v1beta1/resources.proto
@@ -118,30 +118,46 @@ message ArbitraryMetadata {
// The available type of locks for a resource.
enum LockType {
LOCK_TYPE_INVALID = 0;
- // Shared (advisory) lock: the resource can be read or
- // written or unlocked by everyone who has access.
+ // Shared (advisory) lock: the resource can be read,
+ // written/overwritten or unlocked by everyone who has access.
LOCK_TYPE_SHARED = 1;
// Write lock: the resource can be read by everyone who has
- // access, but write and unlock is restricted to the lock holder.
+ // access, but write, refreshlock and unlock operations
+ // are restricted to the lock holder.
LOCK_TYPE_WRITE = 2;
- // Exclusive lock: the resource cannot be read nor written
- // nor unlocked except by the user holding the lock.
+ // Exclusive lock: only the lock holder can operate on the
+ // resource, anyone else is denied to access it.
LOCK_TYPE_EXCL = 3;
}
// The metadata associated with a lock on a resource.
+// Provided that storage drivers are free to implement the storage
+// of this metadata according to their constraints, a reference
+// implementation is given here. The lock SHOULD be stored
+// as an extended attribute on the referenced filesystem entry.
+// It MUST NOT be accessible via the Stat/SetArbitraryMetadata APIs,
+// and it SHOULD contain a base64-encoded JSON with the following format:
+// {
+// "type" : "",
+// "h" : "",
+// "md" : "",
+// "mtime" : ""
+// }
message Lock {
// The type of lock.
LockType type = 1;
// The entity holding the lock.
oneof holder {
- // A userid if the lock is held by a user
+ // A userid if the lock is held by a user.
cs3.identity.user.v1beta1.UserId user = 2;
- // An application name if the lock is held by an app
+ // An application name if the lock is held by an app.
string app_name = 3;
}
// Some arbitrary metadata associated with the lock.
string metadata = 4;
+ // The last modification time of the lock.
+ // The value is Unix Epoch timestamp in seconds.
+ cs3.types.v1beta1.Timestamp mtime = 5;
}
// The available types of resources.
diff --git a/docs/index.html b/docs/index.html
index d7d7e5db..c4056dd7 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1574,6 +1574,14 @@ Table of Contents
MGetHomeResponse
+
+ MGetLockRequest
+
+
+
+ MGetLockResponse
+
+
MGetPathRequest
@@ -1682,6 +1690,14 @@ Table of Contents
MPurgeRecycleResponse
+
+ MRefreshLockRequest
+
+
+
+ MRefreshLockResponse
+
+
MRemoveGrantRequest
@@ -1714,6 +1730,14 @@ Table of Contents
MSetArbitraryMetadataResponse
+
+ MSetLockRequest
+
+
+
+ MSetLockResponse
+
+
MStatRequest
@@ -1730,6 +1754,14 @@ Table of Contents
MTouchFileResponse
+
+ MUnlockRequest
+
+
+
+ MUnlockResponse
+
+
MUnsetArbitraryMetadataRequest
@@ -1805,6 +1837,10 @@ Table of Contents
MGrantee
+
+ MLock
+
+
MQuota
@@ -1850,6 +1886,10 @@ Table of Contents
EGranteeType
+
+ ELockType
+
+
EResourceChecksumType
@@ -2594,6 +2634,49 @@ GatewayAPI
Arbitrary metadata is returned in a cs3.storage.provider.v1beta1.ResourceInfo.
+
+ SetLock |
+ .cs3.storage.provider.v1beta1.SetLockRequest |
+ .cs3.storage.provider.v1beta1.SetLockResponse |
+ Locks a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist.
+MUST return CODE_PRECONDITION_FAILED if the reference is already locked.
+In addition, the implementation MUST ensure atomicity when multiple users
+concurrently attempt to set a lock.
+The caller MUST have write permissions on the resource. |
+
+
+
+ GetLock |
+ .cs3.storage.provider.v1beta1.GetLockRequest |
+ .cs3.storage.provider.v1beta1.GetLockResponse |
+ Gets the lock metadata of a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist or is not locked.
+The caller MUST have read permissions on the resource. |
+
+
+
+ RefreshLock |
+ .cs3.storage.provider.v1beta1.RefreshLockRequest |
+ .cs3.storage.provider.v1beta1.RefreshLockResponse |
+ Refreshes the lock metadata of a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist.
+MUST return CODE_PRECONDITION_FAILED if the reference is not locked
+or if the caller does not hold the lock.
+The caller MUST have write permissions on the resource. |
+
+
+
+ Unlock |
+ .cs3.storage.provider.v1beta1.UnlockRequest |
+ .cs3.storage.provider.v1beta1.UnlockResponse |
+ Unlocks a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist.
+MUST return CODE_PRECONDITION_FAILED if the reference is not locked
+or if the caller does not hold the lock.
+The caller MUST have write permissions on the resource. |
+
+
CreateHome |
.cs3.storage.provider.v1beta1.CreateHomeRequest |
@@ -5709,7 +5792,7 @@ MimeTypeInfo
OPTIONAL.
Whether the mime type is eligible for file creation in the web UI.
Defaults to false, i.e. files with this mime type can be opened
-but not directly allow_creationd from the web UI. |
+but not directly created from the web UI.
@@ -13464,6 +13547,80 @@ GetHomeResponse
+ GetLockRequest
+
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ ref |
+ Reference |
+ |
+ REQUIRED.
+The reference the lock is associated to. |
+
+
+
+
+
+
+
+
+
+ GetLockResponse
+
+
+
+
+
+
+
+
+
GetPathRequest
@@ -14576,6 +14733,80 @@ PurgeRecycleResponse<
+ RefreshLockRequest
+
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ ref |
+ Reference |
+ |
+ REQUIRED.
+The reference on which the lock should be refreshed. |
+
+
+
+ lock |
+ Lock |
+ |
+ REQUIRED.
+The lock metadata. |
+
+
+
+
+
+
+
+
+
+ RefreshLockResponse
+
+
+
+
+
+
+
+
+
RemoveGrantRequest
@@ -14884,6 +15115,81 @@
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ ref |
+ Reference |
+ |
+ REQUIRED.
+The reference on which the lock should be set,
+if no lock is present. |
+
+
+
+ lock |
+ Lock |
+ |
+ REQUIRED.
+The lock metadata. |
+
+
+
+
+
+
+
+
+
+ SetLockResponse
+
+
+
+
+
+
+
+
+
StatRequest
@@ -15033,6 +15339,72 @@ TouchFileResponse
+ UnlockRequest
+
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ opaque |
+ cs3.types.v1beta1.Opaque |
+ |
+ OPTIONAL.
+Opaque information. |
+
+
+
+ ref |
+ Reference |
+ |
+ REQUIRED.
+The reference the lock is associated to. |
+
+
+
+
+
+
+
+
+
+ UnlockResponse
+
+
+
+
+
+
+
+
+
UnsetArbitraryMetadataRequest
@@ -15537,6 +15909,49 @@ ProviderAPI
Arbitrary metadata is returned in a cs3.storageprovider.v1beta1.ResourceInfo.
+
+ SetLock |
+ SetLockRequest |
+ SetLockResponse |
+ Locks a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist.
+MUST return CODE_PRECONDITION_FAILED if the reference is already locked.
+In addition, the implementation MUST ensure atomicity when multiple users
+concurrently attempt to set a lock.
+The caller MUST have write permissions on the resource. |
+
+
+
+ GetLock |
+ GetLockRequest |
+ GetLockResponse |
+ Gets the lock metadata of a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist or is not locked.
+The caller MUST have read permissions on the resource. |
+
+
+
+ RefreshLock |
+ RefreshLockRequest |
+ RefreshLockResponse |
+ Refreshes the lock metadata of a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist.
+MUST return CODE_PRECONDITION_FALIED if the reference is not locked
+or if the caller does not hold the lock.
+The caller MUST have write permissions on the resource. |
+
+
+
+ Unlock |
+ UnlockRequest |
+ UnlockResponse |
+ Unlocks a storage resource.
+MUST return CODE_NOT_FOUND if the reference does not exist.
+MUST return CODE_PRECONDITION_FAILED if the reference is not locked
+or if the caller does not hold the lock.
+The caller MUST have write permissions on the resource. |
+
+
CreateHome |
CreateHomeRequest |
@@ -15926,6 +16341,59 @@ Grantee
+ Lock
+ The metadata associated with a lock on a resource.
Provided that storage drivers are free to implement the storage
of this metadata according to their constraints, a reference
implementation is given here. The lock SHOULD be stored
as an extended attribute on the referenced filesystem entry.
It MUST NOT be accessible via the Stat/SetArbitraryMetadata APIs,
and it SHOULD contain a base64-encoded JSON with the following format:
{
"type" : "",
"h" : "",
"md" : "",
"mtime" : ""
}
+
+
+
+
+ Field | Type | Label | Description |
+
+
+
+
+ type |
+ LockType |
+ |
+ The type of lock. |
+
+
+
+ user |
+ cs3.identity.user.v1beta1.UserId |
+ |
+ A userid if the lock is held by a user. |
+
+
+
+ app_name |
+ string |
+ |
+ An application name if the lock is held by an app. |
+
+
+
+ metadata |
+ string |
+ |
+ Some arbitrary metadata associated with the lock. |
+
+
+
+ mtime |
+ cs3.types.v1beta1.Timestamp |
+ |
+ The last modification time of the lock.
+The value is Unix Epoch timestamp in seconds. |
+
+
+
+
+
+
+
+
+
Quota
Represents a quota for a storage space.
@@ -16598,6 +17066,45 @@ GranteeType
+ LockType
+ The available type of locks for a resource.
+
+
+ Name | Number | Description |
+
+
+
+
+ LOCK_TYPE_INVALID |
+ 0 |
+ |
+
+
+
+ LOCK_TYPE_SHARED |
+ 1 |
+ Shared (advisory) lock: the resource can be read,
+written/overwritten or unlocked by everyone who has access. |
+
+
+
+ LOCK_TYPE_WRITE |
+ 2 |
+ Write lock: the resource can be read by everyone who has
+access, but write, refreshlock and unlock operations
+are restricted to the lock holder. |
+
+
+
+ LOCK_TYPE_EXCL |
+ 3 |
+ Exclusive lock: only the lock holder can operate on the
+resource, anyone else is denied to access it. |
+
+
+
+
+
ResourceChecksumType
The type of checksum to use.