From 7e11c5cbf25eb93636ec3ded79656f63868f0ca5 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Fri, 19 Mar 2021 14:17:43 +0100 Subject: [PATCH 01/12] Add draft of adr for spaces API. --- docs/adr/0005-api-for-spaces.md | 107 ++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 docs/adr/0005-api-for-spaces.md diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md new file mode 100644 index 00000000000..ba8a2d90ef1 --- /dev/null +++ b/docs/adr/0005-api-for-spaces.md @@ -0,0 +1,107 @@ +# 5. Graph API for Spaces + +* Status: proposed +* Deciders: @butonic, @micbar, @dragotin, @hodyroff, @pmaier1 +* Date: 2021-03-19 + +Technical Story: API to enable the concept of [Spaces](https://github.com/owncloud/enterprise/issues/3863) + +## Context and Problem Statement + +As one of the building blocks for Spaces in oCIS we plan to add an API that returns information about available spaces. + +> Note: The term "spaces" is used here in the context of "a space where files can be saved", similar to a directory. It is not to be confused with space in the sense of file space for example. + +The purpose of this new API is to give clients a very simple way to query the dynamic list of spaces, that the user has access to. Clients can provide a way better user experience with that. + +This API would even allow to provide (WebDAV-) endpoints depending on the kind and version of the client asking for it. + +This ADR discusses how this API could be designed. + +## Decision Drivers + +- Make it easy to work with a dynamic list of spaces of a user for the clients. +- No longer the need to make assumptions about WebDAV- and other routes in clients. +- More meta data available about spaces for a better user experience. +- Part of the bigger spaces plan. +- Important to consider in client migration scenarios, ie. in CERN. + +## Considered Options + +1. [Microsoft Graph API](https://developer.microsoft.com/en-us/graph) inspired API that provides the requested information. + +## Decision Outcome + +This the DRAFT for the API. + +### API to Get Info about Spaces + +ownCloud servers provide an API to query for available spaces of an user. + +Most important, the API returns the WebDAV endpoint for each space. With that, clients do not have to make assumptions about WebDAV routes any more. + +See [Drive item in Microsoft Graph API](https://docs.microsoft.com/de-de/graph/api/resources/onedrive?view=graph-rest-1.0) + +### Get "Home folder" + +Retrieve information about the home space of a user. Note: This is only a subset of the spaces the user might have access to. + +API Call: `/me/drive`: Returns the information of the users home folder. + +### Get All Spaces of a User + +Retrieve a list of available spaces of a user. This includes all spaces the user has access to at that moment, also the home space. + +API Call: `/me/drives`: Returns a list of spaces. + +### Common Reply + +The reply to both calls is either one or a list of [Drive representation objects](https://docs.microsoft.com/de-de/graph/api/resources/drive?view=graph-rest-1.0): + +``` +{ + "id": "string", + "createdDateTime": "string (timestamp)", + "description": "string", + "driveType": "personal | business | documentLibrary", + "eTag": "string", + "lastModifiedDateTime": "string (timestamp)", + "name": "string", + "owner": { "@odata.type": "microsoft.graph.identitySet" }, + "webUrl": "url" +} + +``` + +The meaning of the object are in ownClouds context: + +1. **id** - a unique ID identifying the space +2. **driveType** - describing the type of the space. +3. **eTag** - the current ETag of the space +4. **owner** - an owner object to whom the space belong +5. **webUrl** - the relative Webdav path in ownCloud. It must include the `remote.php` part in oC10 installations. + + +The following driveType values are available in the first step, but might be enhanced later: + +* **personal**: The users home space +* **documentLibrary**: The project spaces available for the user +* **shares**: The share jail, contains all shares for the user (*) + +The (*) marked types are not defined in the official MS API. + +### Positive Consequences + +- A well understood and mature API from Microsoft adopted to our needs. +- Prerequisite for Spaces in oCIS. +- Enables further steps in client development. + +### Negative Consequences + +- Migration impact on existing installations. Still to be investigated. + +### Open Topics + +- Do we need a new WebDAV endpoint? +- What are the WebDAV pathes for Trashbin, Versions + + option: additional entries in the reply struct From 95035af06d6db1d8f49211eb5f0deaaaa56950e5 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 19 Apr 2021 16:54:00 +0200 Subject: [PATCH 02/12] Consider review feedback: refine some wordings. --- docs/adr/0005-api-for-spaces.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index ba8a2d90ef1..fbc3d454164 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -44,9 +44,9 @@ See [Drive item in Microsoft Graph API](https://docs.microsoft.com/de-de/graph/a ### Get "Home folder" -Retrieve information about the home space of a user. Note: This is only a subset of the spaces the user might have access to. +Retrieve information about the home space of a user. Note: The user has access to more spaces. This call only returns the home space to provide API parity with the Graph API. -API Call: `/me/drive`: Returns the information of the users home folder. +API Call: `/me/drive`: Returns the information about the users home folder. ### Get All Spaces of a User @@ -68,7 +68,8 @@ The reply to both calls is either one or a list of [Drive representation objects "lastModifiedDateTime": "string (timestamp)", "name": "string", "owner": { "@odata.type": "microsoft.graph.identitySet" }, - "webUrl": "url" + "webUrl": "url", + "coowner": [ { "@odata.type": "microsoft.graph.identitySet" } ] } ``` @@ -78,14 +79,14 @@ The meaning of the object are in ownClouds context: 1. **id** - a unique ID identifying the space 2. **driveType** - describing the type of the space. 3. **eTag** - the current ETag of the space -4. **owner** - an owner object to whom the space belong +4. **owner** - an owner object to whom the space belongs 5. **webUrl** - the relative Webdav path in ownCloud. It must include the `remote.php` part in oC10 installations. - +6. **coowner** - optional array owner objects of the co-owners of a space (*) The following driveType values are available in the first step, but might be enhanced later: * **personal**: The users home space -* **documentLibrary**: The project spaces available for the user +* **projectSpaces**: The project spaces available for the user (*) * **shares**: The share jail, contains all shares for the user (*) The (*) marked types are not defined in the official MS API. @@ -104,4 +105,6 @@ The (*) marked types are not defined in the official MS API. - Do we need a new WebDAV endpoint? - What are the WebDAV pathes for Trashbin, Versions - + option: additional entries in the reply struct + + option: additional entries in the reply struct +- The identitySet object used for "owner" and "coowner" require to implement the [https://docs.microsoft.com/de-de/graph/api/resources/identityset?view=graph-rest-1.0](IdentitySet) JSON object, which contains information that seems to be of limited benefit for oCIS. An alternative would be to implement a simpler identity object for oCIS and use that. + From 10ed8a6903d177ffce5387131447bd29655bc423 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 19 Apr 2021 17:25:25 +0200 Subject: [PATCH 03/12] Add a driveStatus value to the spaces object. It indicates the status if the user has accepted the space or if it is mandatory like shares or personal. --- docs/adr/0005-api-for-spaces.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index fbc3d454164..0da7559bdab 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -63,7 +63,8 @@ The reply to both calls is either one or a list of [Drive representation objects "id": "string", "createdDateTime": "string (timestamp)", "description": "string", - "driveType": "personal | business | documentLibrary", + "driveType": "personal | projectSpaces | shares", + "driveStatus": "accepted | pending | mandatory", "eTag": "string", "lastModifiedDateTime": "string (timestamp)", "name": "string", @@ -78,12 +79,13 @@ The meaning of the object are in ownClouds context: 1. **id** - a unique ID identifying the space 2. **driveType** - describing the type of the space. -3. **eTag** - the current ETag of the space -4. **owner** - an owner object to whom the space belongs -5. **webUrl** - the relative Webdav path in ownCloud. It must include the `remote.php` part in oC10 installations. -6. **coowner** - optional array owner objects of the co-owners of a space (*) +3. **driveStatus** - telling the status +4. **eTag** - the current ETag of the space +5. **owner** - an owner object to whom the space belongs +6. **webUrl** - the relative Webdav path in ownCloud. It must include the `remote.php` part in oC10 installations. +7. **coowner** - optional array owner objects of the co-owners of a space (*) -The following driveType values are available in the first step, but might be enhanced later: +The following *driveType* values are available in the first step, but might be enhanced later: * **personal**: The users home space * **projectSpaces**: The project spaces available for the user (*) @@ -91,6 +93,12 @@ The following driveType values are available in the first step, but might be enh The (*) marked types are not defined in the official MS API. +The following *driveStatus* values are available: + +* **accepted**: The user has accepted the space and uses it +* **pending**: The user has not yet accepted the space , but can use it after having it accepted. +* **mandatory**: This is an mandatory space. Used for the personal- and shares-space. The user can not influence if it is visible or not, it is always available. + ### Positive Consequences - A well understood and mature API from Microsoft adopted to our needs. From 1b4cf20419670bc3ef4164d7502b7bf7e2d2d926 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 22 Apr 2021 18:17:28 +0200 Subject: [PATCH 04/12] Update docs/adr/0005-api-for-spaces.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörn Friedrich Dreyer --- docs/adr/0005-api-for-spaces.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index 0da7559bdab..a5a11bdb8e2 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -10,7 +10,7 @@ Technical Story: API to enable the concept of [Spaces](https://github.com/ownclo As one of the building blocks for Spaces in oCIS we plan to add an API that returns information about available spaces. -> Note: The term "spaces" is used here in the context of "a space where files can be saved", similar to a directory. It is not to be confused with space in the sense of file space for example. +> Note: The term "spaces" is used here in the context of "a space where files can be saved", similar to a directory. It is not to be confused with space in the sense of free file space for example. The purpose of this new API is to give clients a very simple way to query the dynamic list of spaces, that the user has access to. Clients can provide a way better user experience with that. @@ -115,4 +115,3 @@ The following *driveStatus* values are available: - What are the WebDAV pathes for Trashbin, Versions + option: additional entries in the reply struct - The identitySet object used for "owner" and "coowner" require to implement the [https://docs.microsoft.com/de-de/graph/api/resources/identityset?view=graph-rest-1.0](IdentitySet) JSON object, which contains information that seems to be of limited benefit for oCIS. An alternative would be to implement a simpler identity object for oCIS and use that. - From de80dd9e399a3cdad4fe15e31d46c2e2dde031ae Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 22 Apr 2021 18:18:15 +0200 Subject: [PATCH 05/12] Update docs/adr/0005-api-for-spaces.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörn Friedrich Dreyer --- docs/adr/0005-api-for-spaces.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index a5a11bdb8e2..f25cc4dc68c 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -40,7 +40,7 @@ ownCloud servers provide an API to query for available spaces of an user. Most important, the API returns the WebDAV endpoint for each space. With that, clients do not have to make assumptions about WebDAV routes any more. -See [Drive item in Microsoft Graph API](https://docs.microsoft.com/de-de/graph/api/resources/onedrive?view=graph-rest-1.0) +See [Drive item in Microsoft Graph API](https://docs.microsoft.com/en-us/graph/api/resources/onedrive?view=graph-rest-1.0) for an overview of `drive` and `driveItem` resources. The concrete list of drives / spaces a user has access to can be obtained on multiple endpoints. ### Get "Home folder" From 16325083a02d5905c1e0aef0f09394431d037388 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 26 Apr 2021 14:41:07 +0200 Subject: [PATCH 06/12] Update docs/adr/0005-api-for-spaces.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörn Friedrich Dreyer --- docs/adr/0005-api-for-spaces.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index f25cc4dc68c..a84758a0c12 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -108,6 +108,9 @@ The following *driveStatus* values are available: ### Negative Consequences - Migration impact on existing installations. Still to be investigated. +- Requires additional webdav endpoint that allows accessing an arbitrary storage space, either + - with an id: `/dav/spaces//relative/path/to/file.ext`, or + - with a global path: `/dav/global////relative/path/to/file.ext`, e.g. `/dav/global/projects/Golive 2021/Resources/slides.odt` ### Open Topics From f0a1a53a43b4fc185adbb387823ca42d062692d1 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 26 Apr 2021 14:44:01 +0200 Subject: [PATCH 07/12] Update docs/adr/0005-api-for-spaces.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörn Friedrich Dreyer --- docs/adr/0005-api-for-spaces.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index a84758a0c12..3d9f93a1e85 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -54,6 +54,8 @@ Retrieve a list of available spaces of a user. This includes all spaces the user API Call: `/me/drives`: Returns a list of spaces. +There is also `/drives`, returning the list of spaces the user has access to. This endpoint is used to access any space by id using `/drives/{drive-id}`. + ### Common Reply The reply to both calls is either one or a list of [Drive representation objects](https://docs.microsoft.com/de-de/graph/api/resources/drive?view=graph-rest-1.0): From 774518eb9c48e6219a65f520dd24d31171e7a780 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 26 Apr 2021 14:46:31 +0200 Subject: [PATCH 08/12] Apply feedback from reviews. Most significant: root item in reply. --- docs/adr/0005-api-for-spaces.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index 3d9f93a1e85..2ebb728c2c1 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -8,16 +8,16 @@ Technical Story: API to enable the concept of [Spaces](https://github.com/ownclo ## Context and Problem Statement -As one of the building blocks for Spaces in oCIS we plan to add an API that returns information about available spaces. +As one of the building blocks for Spaces in oCIS we plan to add an API that returns information about available spaces. This ADR discusses the API design oriented on the Microsoft Graph API. > Note: The term "spaces" is used here in the context of "a space where files can be saved", similar to a directory. It is not to be confused with space in the sense of free file space for example. -The purpose of this new API is to give clients a very simple way to query the dynamic list of spaces, that the user has access to. Clients can provide a way better user experience with that. +The purpose of this new API is to give clients a very simple way to query the dynamic list of spaces, that the user has access to. Clients can provide a better user experience with that. + +This API is supposed to be queried often, to give clients a condensed view of the available spaces for a user, but also their eTags and cTags. Hence the clients do not have to perform a PROPFIND for every space separately. This API would even allow to provide (WebDAV-) endpoints depending on the kind and version of the client asking for it. -This ADR discusses how this API could be designed. - ## Decision Drivers - Make it easy to work with a dynamic list of spaces of a user for the clients. @@ -66,13 +66,15 @@ The reply to both calls is either one or a list of [Drive representation objects "createdDateTime": "string (timestamp)", "description": "string", "driveType": "personal | projectSpaces | shares", - "driveStatus": "accepted | pending | mandatory", + "oCDriveStatus": "accepted | pending | mandatory", "eTag": "string", "lastModifiedDateTime": "string (timestamp)", "name": "string", "owner": { "@odata.type": "microsoft.graph.identitySet" }, + "quota": { "@odata.type": "microsoft.graph.quota" }, + "root": { "@odata.type": "microsoft.graph.driveItem" }, "webUrl": "url", - "coowner": [ { "@odata.type": "microsoft.graph.identitySet" } ] + "oCCoOwner": [ { "@odata.type": "microsoft.graph.identitySet" } ] } ``` @@ -81,11 +83,15 @@ The meaning of the object are in ownClouds context: 1. **id** - a unique ID identifying the space 2. **driveType** - describing the type of the space. -3. **driveStatus** - telling the status +3. **oCDriveStatus** - telling the status (*) 4. **eTag** - the current ETag of the space 5. **owner** - an owner object to whom the space belongs -6. **webUrl** - the relative Webdav path in ownCloud. It must include the `remote.php` part in oC10 installations. -7. **coowner** - optional array owner objects of the co-owners of a space (*) +6. **quota** - quota information about this space +7. **root** - the root driveItem object. +6. **webUrl** - The URL to make this space visible in the browser. +7. **oCCoOwner** - optional array owner objects of the co-owners of a space (*) + +> Note: the **root** object is a [driveItem](https://docs.microsoft.com/de-de/graph/api/resources/driveitem?view=graph-rest-1.0) and contains information about the root of the space. Especially important is the member `webDavUrl` in the root object which provides the full URL to be used by clients to address items within the space. Also it contains the fields `eTag` and `cTag`. The following *driveType* values are available in the first step, but might be enhanced later: @@ -93,13 +99,17 @@ The following *driveType* values are available in the first step, but might be e * **projectSpaces**: The project spaces available for the user (*) * **shares**: The share jail, contains all shares for the user (*) -The (*) marked types are not defined in the official MS API. +Other space types such as backup, hidden etc. can be added later as requested. + +The (*) marked types are not defined in the official MS API. They are prefixed with `oC` to avoid namespace clashes. + The following *driveStatus* values are available: * **accepted**: The user has accepted the space and uses it * **pending**: The user has not yet accepted the space , but can use it after having it accepted. * **mandatory**: This is an mandatory space. Used for the personal- and shares-space. The user can not influence if it is visible or not, it is always available. +* **offline**: The space is currently not available. ### Positive Consequences @@ -116,7 +126,6 @@ The following *driveStatus* values are available: ### Open Topics -- Do we need a new WebDAV endpoint? - What are the WebDAV pathes for Trashbin, Versions + option: additional entries in the reply struct - The identitySet object used for "owner" and "coowner" require to implement the [https://docs.microsoft.com/de-de/graph/api/resources/identityset?view=graph-rest-1.0](IdentitySet) JSON object, which contains information that seems to be of limited benefit for oCIS. An alternative would be to implement a simpler identity object for oCIS and use that. From 144e3f81030a696bfa78c3a57d3874025f3fb2dc Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Tue, 27 Apr 2021 09:27:42 +0200 Subject: [PATCH 09/12] Remove eTag from response object as it comes through root item. --- docs/adr/0005-api-for-spaces.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index 2ebb728c2c1..4df3b3b47ad 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -66,8 +66,7 @@ The reply to both calls is either one or a list of [Drive representation objects "createdDateTime": "string (timestamp)", "description": "string", "driveType": "personal | projectSpaces | shares", - "oCDriveStatus": "accepted | pending | mandatory", - "eTag": "string", + "oCDriveStatus": "accepted | pending | mandatory | offline", "lastModifiedDateTime": "string (timestamp)", "name": "string", "owner": { "@odata.type": "microsoft.graph.identitySet" }, @@ -84,12 +83,11 @@ The meaning of the object are in ownClouds context: 1. **id** - a unique ID identifying the space 2. **driveType** - describing the type of the space. 3. **oCDriveStatus** - telling the status (*) -4. **eTag** - the current ETag of the space -5. **owner** - an owner object to whom the space belongs -6. **quota** - quota information about this space -7. **root** - the root driveItem object. -6. **webUrl** - The URL to make this space visible in the browser. -7. **oCCoOwner** - optional array owner objects of the co-owners of a space (*) +4. **owner** - an owner object to whom the space belongs +5. **quota** - quota information about this space +6. **root** - the root driveItem object. +7. **webUrl** - The URL to make this space visible in the browser. +8. **oCCoOwner** - optional array owner objects of the co-owners of a space (*) > Note: the **root** object is a [driveItem](https://docs.microsoft.com/de-de/graph/api/resources/driveitem?view=graph-rest-1.0) and contains information about the root of the space. Especially important is the member `webDavUrl` in the root object which provides the full URL to be used by clients to address items within the space. Also it contains the fields `eTag` and `cTag`. From 7d9afee7c63cc590d788890d45e8c9c76220fd53 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Fri, 30 Apr 2021 16:33:42 +0200 Subject: [PATCH 10/12] More review feedback: Added root driveItem object description. --- docs/adr/0005-api-for-spaces.md | 39 ++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/adr/0005-api-for-spaces.md index 4df3b3b47ad..2381108234b 100644 --- a/docs/adr/0005-api-for-spaces.md +++ b/docs/adr/0005-api-for-spaces.md @@ -75,12 +75,11 @@ The reply to both calls is either one or a list of [Drive representation objects "webUrl": "url", "oCCoOwner": [ { "@odata.type": "microsoft.graph.identitySet" } ] } - ``` -The meaning of the object are in ownClouds context: +The meaning of the objects in Open Graph API context are: -1. **id** - a unique ID identifying the space +1. **id** - a unique ID identifying the space, called Storage Space ID. 2. **driveType** - describing the type of the space. 3. **oCDriveStatus** - telling the status (*) 4. **owner** - an owner object to whom the space belongs @@ -89,8 +88,6 @@ The meaning of the object are in ownClouds context: 7. **webUrl** - The URL to make this space visible in the browser. 8. **oCCoOwner** - optional array owner objects of the co-owners of a space (*) -> Note: the **root** object is a [driveItem](https://docs.microsoft.com/de-de/graph/api/resources/driveitem?view=graph-rest-1.0) and contains information about the root of the space. Especially important is the member `webDavUrl` in the root object which provides the full URL to be used by clients to address items within the space. Also it contains the fields `eTag` and `cTag`. - The following *driveType* values are available in the first step, but might be enhanced later: * **personal**: The users home space @@ -101,7 +98,6 @@ Other space types such as backup, hidden etc. can be added later as requested. The (*) marked types are not defined in the official MS API. They are prefixed with `oC` to avoid namespace clashes. - The following *driveStatus* values are available: * **accepted**: The user has accepted the space and uses it @@ -109,6 +105,37 @@ The following *driveStatus* values are available: * **mandatory**: This is an mandatory space. Used for the personal- and shares-space. The user can not influence if it is visible or not, it is always available. * **offline**: The space is currently not available. +> Note: the **root** object equals a [driveItem](https://docs.microsoft.com/de-de/graph/api/resources/driveitem?view=graph-rest-1.0) and contains information about the root resource (directory) of the space. + +This is an example object as it can be expected as `root` element. It is not complete, as not all elements will be implemented so far. + +``` +{ + "cTag": "string (etag)", + "webDavUrl": "string", + + /* inherited from baseItem */ + "id": "string (identifier)", + "createdBy": {"@odata.type": "microsoft.graph.identitySet"}, + "createdDateTime": "String (timestamp)", + "eTag": "string", + "lastModifiedBy": {"@odata.type": "microsoft.graph.identitySet"}, + "lastModifiedDateTime": "String (timestamp)", + "name": "string", + "webUrl": "string", +} +``` + +Meaningful fields of the root element in the context of the Open Graph API: + +1. **id** - a unique ID identifying the root directory node. +2. **webDavUrl** - The webdav path of the top item of the space. +3. **eTag** - an identifier that changes automatically if the content *or* metadata of the node or the underlying resources changes. +4. **cTag** - an identifier that changes automatically if the content of the root node or of one of the underlying resources changes. +5. **webUrl** - The URL to make this space visible in the browser. + +> Note: To indicate that only the metadata of a resource has changed, the eTag has changed, but the cTag not. + ### Positive Consequences - A well understood and mature API from Microsoft adopted to our needs. From e34b9854a6df50394ea20523b55789648696ee5c Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Fri, 30 Apr 2021 16:35:45 +0200 Subject: [PATCH 11/12] Move to the correct directory and fix the sequence number. --- .../0005-api-for-spaces.md => ocis/adr/0007-api-for-spaces.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{adr/0005-api-for-spaces.md => ocis/adr/0007-api-for-spaces.md} (100%) diff --git a/docs/adr/0005-api-for-spaces.md b/docs/ocis/adr/0007-api-for-spaces.md similarity index 100% rename from docs/adr/0005-api-for-spaces.md rename to docs/ocis/adr/0007-api-for-spaces.md From 3122239d21e3bc7a40ca0ead3fbf15de8e7647db Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Fri, 30 Apr 2021 17:14:55 +0200 Subject: [PATCH 12/12] More review motivated fixes and cleanups. --- docs/ocis/adr/0007-api-for-spaces.md | 29 +++++++++++----------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/docs/ocis/adr/0007-api-for-spaces.md b/docs/ocis/adr/0007-api-for-spaces.md index 2381108234b..22448d5cc22 100644 --- a/docs/ocis/adr/0007-api-for-spaces.md +++ b/docs/ocis/adr/0007-api-for-spaces.md @@ -66,27 +66,25 @@ The reply to both calls is either one or a list of [Drive representation objects "createdDateTime": "string (timestamp)", "description": "string", "driveType": "personal | projectSpaces | shares", - "oCDriveStatus": "accepted | pending | mandatory | offline", "lastModifiedDateTime": "string (timestamp)", "name": "string", "owner": { "@odata.type": "microsoft.graph.identitySet" }, "quota": { "@odata.type": "microsoft.graph.quota" }, "root": { "@odata.type": "microsoft.graph.driveItem" }, "webUrl": "url", - "oCCoOwner": [ { "@odata.type": "microsoft.graph.identitySet" } ] + "ocCoOwner": [ { "@odata.type": "microsoft.graph.identitySet" } ] } ``` The meaning of the objects in Open Graph API context are: -1. **id** - a unique ID identifying the space, called Storage Space ID. +1. **id** - a persistent and unique ID identifying the space, called Storage Space ID. 2. **driveType** - describing the type of the space. -3. **oCDriveStatus** - telling the status (*) -4. **owner** - an owner object to whom the space belongs -5. **quota** - quota information about this space -6. **root** - the root driveItem object. -7. **webUrl** - The URL to make this space visible in the browser. -8. **oCCoOwner** - optional array owner objects of the co-owners of a space (*) +3. **owner** - an owner object to whom the space belongs +4. **quota** - quota information about this space +5. **root** - the root driveItem object. +6. **webUrl** - The URL to make this space visible in the browser. +7. **ocCoOwner** - optional array owner objects of the co-owners of a space (*) The following *driveType* values are available in the first step, but might be enhanced later: @@ -96,16 +94,11 @@ The following *driveType* values are available in the first step, but might be e Other space types such as backup, hidden etc. can be added later as requested. -The (*) marked types are not defined in the official MS API. They are prefixed with `oC` to avoid namespace clashes. +> Note: The *projectSpaces* and *shares* space are virtual spaces. They only contain other spaces, and no regular resources. -The following *driveStatus* values are available: +The (*) marked types are not defined in the official MS API. They are prefixed with `oc` to avoid namespace clashes. -* **accepted**: The user has accepted the space and uses it -* **pending**: The user has not yet accepted the space , but can use it after having it accepted. -* **mandatory**: This is an mandatory space. Used for the personal- and shares-space. The user can not influence if it is visible or not, it is always available. -* **offline**: The space is currently not available. - -> Note: the **root** object equals a [driveItem](https://docs.microsoft.com/de-de/graph/api/resources/driveitem?view=graph-rest-1.0) and contains information about the root resource (directory) of the space. +The `root` object equals a [driveItem](https://docs.microsoft.com/de-de/graph/api/resources/driveitem?view=graph-rest-1.0) and contains information about the root resource (directory) of the space. This is an example object as it can be expected as `root` element. It is not complete, as not all elements will be implemented so far. @@ -128,7 +121,7 @@ This is an example object as it can be expected as `root` element. It is not com Meaningful fields of the root element in the context of the Open Graph API: -1. **id** - a unique ID identifying the root directory node. +1. **id** - a persistent and unique ID identifying the root directory node. 2. **webDavUrl** - The webdav path of the top item of the space. 3. **eTag** - an identifier that changes automatically if the content *or* metadata of the node or the underlying resources changes. 4. **cTag** - an identifier that changes automatically if the content of the root node or of one of the underlying resources changes.