Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend InitiateFileUpload to support exclusive uploads and etags-based checks #122

Merged
merged 3 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cs3/storage/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,20 @@ message InitiateFileUploadRequest {
// REQUIRED.
// The reference to which the action should be performed.
Reference ref = 2;
oneof options {
// OPTIONAL.
// Whether the file is to be uploaded in exclusive mode. Defaults to false.
// If true, the request SHALL be processed such that only one of multiple concurrent uploads
// to the same target reference MAY succeed, whereas all others MUST fail with CODE_ALREADY_EXISTS.
// The semantic is similar to the O_CREAT|O_EXCL POSIX flags.
// The request MUST return CODE_NOT_IMPLEMENTED if the provider does not support this mode.
bool if_not_exist = 3;
// OPTIONAL.
// Whether the file is to be uploaded if the given etag matches. Default to always upload.
// If a mismatching etag is given, the request MUST return CODE_ALREADY_EXISTS with the current etag
// in the opaque field.
string if_match = 4;
}
}

message InitiateFileUploadResponse {
Expand Down
22 changes: 22 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12595,6 +12595,28 @@ <h3 id="cs3.storage.provider.v1beta1.CreateContainerRequest">CreateContainerRequ
The reference to which the action should be performed. </p></td>
</tr>

<tr>
<td>if_not_exist</td>
<td><a href="#bool">bool</a></td>
<td></td>
<td><p>OPTIONAL.
Whether the file is to be uploaded in exclusive mode. Defaults to false.
If true, the request SHALL be processed such that only one of multiple concurrent uploads
to the same target reference MAY succeed, whereas all others MUST fail with CODE_ALREADY_EXISTS.
The semantic is similar to the O_CREAT|O_EXCL POSIX flags.
The request MUST return CODE_NOT_IMPLEMENTED if the provider does not support this mode. </p></td>
</tr>

<tr>
<td>if_match</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
Whether the file is to be uploaded if the given etag matches. Default to always upload.
If a mismatching etag is given, the request MUST return CODE_ALREADY_EXISTS with the current etag
in the opaque field. </p></td>
</tr>

</tbody>
</table>

Expand Down
Loading