Skip to content

Commit

Permalink
Added an endpoint in the Gateway/AppProvider to create new files
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Sep 20, 2021
1 parent 40dd70b commit f7ab578
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import "cs3/types/v1beta1/types.proto";
// Any method MAY return UNKNOWN.
// Any method MAY return UNAUTHENTICATED.
service ProviderAPI {
// Returns the App provider URL
// Returns the App URL and all necessary info to open a resource in an online editor.
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse);
}
Expand Down
33 changes: 32 additions & 1 deletion cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ service GatewayAPI {
// ************************ APP PROVIDER ********************/
// *****************************************************************/

// Returns the App provider URL, which allows the user to open a resource in an online editor.
// Creates a new file to be opened by an app. The new file MAY be either
// empty or generated out of a template if the AppProvider has such capability.
rpc CreateFileForApp(CreateFileForAppRequest) returns (CreateFileForAppResponse);
// Returns the App URL and all necessary info to open a resource in an online editor.
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenInApp(OpenInAppRequest) returns (cs3.app.provider.v1beta1.OpenInAppResponse);
// *****************************************************************/
// ************************ USER SHARE PROVIDER ********************/
Expand Down Expand Up @@ -529,6 +533,33 @@ message ListAuthProvidersResponse {
repeated string types = 3;
}

message CreateFileForAppRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The target container where the file has to be created.
cs3.storage.provider.v1beta1.Reference ref = 2;
// REQUIRED.
// The name of the file to be created.
string filename = 3;
// OPTIONAL.
// A reference to a template that SHOULD be used to create the file.
string template = 4;
}

message CreateFileForAppResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The resourceInfo of the file that was created.
cs3.storage.provider.v1beta1.ResourceInfo resource_info = 3;
}

message OpenInAppRequest {
// OPTIONAL.
// Opaque information.
Expand Down
111 changes: 109 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ <h2>Table of Contents</h2>
<a href="#cs3.gateway.v1beta1.AuthenticateResponse"><span class="badge">M</span>AuthenticateResponse</a>
</li>

<li>
<a href="#cs3.gateway.v1beta1.CreateFileForAppRequest"><span class="badge">M</span>CreateFileForAppRequest</a>
</li>

<li>
<a href="#cs3.gateway.v1beta1.CreateFileForAppResponse"><span class="badge">M</span>CreateFileForAppResponse</a>
</li>

<li>
<a href="#cs3.gateway.v1beta1.GetQuotaRequest"><span class="badge">M</span>GetQuotaRequest</a>
</li>
Expand Down Expand Up @@ -2050,6 +2058,96 @@ <h3 id="cs3.gateway.v1beta1.AuthenticateResponse">AuthenticateResponse</h3>



<h3 id="cs3.gateway.v1beta1.CreateFileForAppRequest">CreateFileForAppRequest</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>opaque</td>
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
<td></td>
<td><p>OPTIONAL.
Opaque information. </p></td>
</tr>

<tr>
<td>ref</td>
<td><a href="#cs3.storage.provider.v1beta1.Reference">cs3.storage.provider.v1beta1.Reference</a></td>
<td></td>
<td><p>REQUIRED.
The target container where the file has to be created. </p></td>
</tr>

<tr>
<td>filename</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The name of the file to be created. </p></td>
</tr>

<tr>
<td>template</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
A reference to a template that SHOULD be used to create the file. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.gateway.v1beta1.CreateFileForAppResponse">CreateFileForAppResponse</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>status</td>
<td><a href="#cs3.rpc.v1beta1.Status">cs3.rpc.v1beta1.Status</a></td>
<td></td>
<td><p>REQUIRED.
The response status. </p></td>
</tr>

<tr>
<td>opaque</td>
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
<td></td>
<td><p>OPTIONAL.
Opaque information. </p></td>
</tr>

<tr>
<td>resource_info</td>
<td><a href="#cs3.storage.provider.v1beta1.ResourceInfo">cs3.storage.provider.v1beta1.ResourceInfo</a></td>
<td></td>
<td><p>REQUIRED.
The resourceInfo of the file that was created. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.gateway.v1beta1.GetQuotaRequest">GetQuotaRequest</h3>
<p></p>

Expand Down Expand Up @@ -2779,11 +2877,20 @@ <h3 id="cs3.gateway.v1beta1.GatewayAPI">GatewayAPI</h3>
*****************************************************************/</p></td>
</tr>

<tr>
<td>CreateFileForApp</td>
<td><a href="#cs3.gateway.v1beta1.CreateFileForAppRequest">CreateFileForAppRequest</a></td>
<td><a href="#cs3.gateway.v1beta1.CreateFileForAppResponse">CreateFileForAppResponse</a></td>
<td><p>Creates a new file to be opened by an app. The new file MAY be either
empty or generated out of a template if the AppProvider has such capability.</p></td>
</tr>

<tr>
<td>OpenInApp</td>
<td><a href="#cs3.gateway.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">.cs3.app.provider.v1beta1.OpenInAppResponse</a></td>
<td><p>Returns the App provider URL, which allows the user to open a resource in an online editor.
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
MUST return CODE_NOT_FOUND if the resource does not exist.

*****************************************************************/
************************ USER SHARE PROVIDER ********************/
Expand Down Expand Up @@ -5149,7 +5256,7 @@ <h3 id="cs3.app.provider.v1beta1.ProviderAPI">ProviderAPI</h3>
<td>OpenInApp</td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">OpenInAppResponse</a></td>
<td><p>Returns the App provider URL
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
MUST return CODE_NOT_FOUND if the resource does not exist.</p></td>
</tr>

Expand Down

0 comments on commit f7ab578

Please sign in to comment.