Skip to content

Commit

Permalink
Merge pull request #5273 from owncloud/docs-improvements
Browse files Browse the repository at this point in the history
[docs-only] move api docs to root level
  • Loading branch information
mmattel authored Dec 22, 2022
2 parents 524ee5c + 01d3723 commit f1fefac
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hugo/
grpc_apis/
/**/grpc_apis/ocis/
mutagen.yml.lock
helpers/output/*
helpers/output/*
3 changes: 3 additions & 0 deletions docs/apis/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: APIs
---
11 changes: 11 additions & 0 deletions docs/apis/grpc_apis/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: gRPC
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/grpc_apis/
geekdocFilePath: _index.md
geekdocCollapseSection: true
---

## **R**emote   **P**rocedure   **C**alls

[gRPC](https://grpc.io) is a modern open source high performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking and authentication. It is also applicable in last mile of distributed computing to connect devices, mobile applications and browsers to backend services.
11 changes: 11 additions & 0 deletions docs/apis/http/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Http
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/
geekdocFilePath: _index.md
geekdocCollapseSection: true
---

The [Hypertext Transfer Protocol (HTTP)](https://www.rfc-editor.org/rfc/rfc2616) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser.

Development of HTTP was initiated by Tim Berners-Lee at CERN in 1989 and summarized in a simple document describing the behavior of a client and a server using the first HTTP protocol version that was named 0.9. That first version of HTTP protocol soon evolved into a more elaborated version that was the first draft toward a far future version 1.0
66 changes: 66 additions & 0 deletions docs/apis/http/graph/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "LibreGraph"
date: 2018-05-02T00:00:00+00:00
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs/apis/http/graph
geekdocFilePath: _index.md
geekdocCollapseSection: true
---

The LibreGraph API is a REST Api which is inspired by the [Microsoft Graph API](https://developer.microsoft.com/en-us/graph). It tries to stay compliant with the Microsoft Graph API and aims to be the Next Generation Api in Infinite Scale where we want to support most of the features of the platform.
The [API specification](https://github.com/owncloud/libre-graph-api) is available in the OpenApi 3 standard and there are generated client and server [SDKs](https://github.com/owncloud/libre-graph-api#clients) available. You can browse the API with the [Swagger UI](https://owncloud.dev/libre-graph-api/).

## Calling the LibreGraph API

```sh
{HTTP method} https://ocis.url/graph/{version}/{resource}?{query-parameters}
```

The request component consists of:

| Component | Description |
|--------------------|-------------------------------------------------------------------------|
| {HTTP method} | The HTTP method which is used in the request. |
| {version} | The version of the LibreGraph API used by the client. |
| {resource} | The LibreGraph Resource which the client is referencing in the request. |
| {query-parameters} | Optional parameters for the request to customize the response. |

### HTTP methods

| Method | Description |
|--------|-------------------------------|
| GET | Read data from a resource. |
| POST | Create a new resource. |
| PATCH | Update an existing resource. |
| PUT | Replace an existing resource. |
| DELETE | Delete an existing resource. |

The methods `GET` and `DELETE` need no request body. The methods `POST`, `PATCH` and `PUT` require a request body, normally in JSON format to provide the needed values.

### Version

Infinite Scale currently provides the version `v1.0`.

### Resource

A resource could be an entity or a complex type and is usually defined by properties. Entities are always recognizable by an `Id` property. The URL contains the resource which you are interacting with e.g. `/me/drives` or `/groups/{group-id}`.

Each resource could possibly require different permissions. Usually you need permissions on a higher level for creating or updating an existing resource than for reading.

### Query parameters

Query parameters can be OData system query options, or other strings that a method accepts to customize its response.

You can use optional OData system query options to include more or fewer properties than the default response, filter the response for items that match a custom query, or provide additional parameters for a method.

For example, adding the following filter parameter restricts the drives returned to only those with the driveType property of `project`.

```shell
GET https://ocis.url/graph/v1.0/drives?$filter=driveType eq 'project'
```
For more information about OData query options please check the [API specification](https://github.com/owncloud/libre-graph-api) and the provided examples.

## Resources

{{< toc-tree >}}
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions docs/grpc_apis/_index.md

This file was deleted.

6 changes: 3 additions & 3 deletions protogen/docs/GRPC.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
{{- $package := (index .Files 0).Package }}
title: "{{ $package }}"
url: /grpc_apis/{{ $package | replace "." "_" }}
url: /apis/grpc_apis/{{ $package | replace "." "_" }}
date: {{ now | date "2006-01-02T15:04:05Z07:00" }}
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
Expand All @@ -28,7 +28,7 @@ geekdocRepo: https://github.com/owncloud/ocis
{{- if and (hasPrefix "ocis." .LongType) (ge (len $filenameParts) 3) -}}
{{- $ltypeSpl := .LongType | splitList "." -}}
{{- $ltypePkg := slice $ltypeSpl 0 (sub (len $ltypeSpl) 1) | join "_" -}}
{{- $loca = printf "/grpc_apis/%s/#%s" $ltypePkg (.Type | lower) -}}
{{- $loca = printf "/apis/grpc_apis/%s/#%s" $ltypePkg (.Type | lower) -}}
{{- end -}}
| {{.Name}} | [{{.LongType}}]({{ $loca }}) | {{.Label}} | {{ .Description | replace "\n" "<br>" }}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end }} |
{{ end -}}
Expand Down Expand Up @@ -61,7 +61,7 @@ geekdocRepo: https://github.com/owncloud/ocis
{{ range .Extensions -}}
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{ .Description | replace "\n" "<br>" }}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} |
{{ end -}}
{{ end -}}
{{ end -}}
{{- range .Services }}
### {{ .Name }}

Expand Down

0 comments on commit f1fefac

Please sign in to comment.