Skip to content

Commit

Permalink
DOC: add english doc 'access via rest api' (fluid-cloudnative#2490)
Browse files Browse the repository at this point in the history
Signed-off-by: ZhangXiaozheng <[email protected]>

Signed-off-by: ZhangXiaozheng <[email protected]>
  • Loading branch information
zhang-x-z authored Jan 5, 2023
1 parent dca6694 commit 76b0e5b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/en/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@
- [How to develop](dev/how_to_develop.md)
- [API_Doc](dev/api_doc.md)
- [Develop with Kind on MacOS](dev/dev_with_kind.md)
- [How to use client other than Go client](dev/multiple-client-support.md)
- [Performance Analyze with pprof](dev/pprof.md)
+ Client Usage
- [How to use client other than Go client](dev/multiple-client-support.md)
- [Access via REST API](samples/api_proxy.md)
51 changes: 51 additions & 0 deletions docs/en/samples/api_proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Demo - Restful-based file system client

Alluxio provides an access interface based on the [Restful API](https://docs.alluxio.io/os/user/stable/en/api/FS-API.html) for secondary development in Python, Java and Golang. AlluxioRuntime also provides support for this, and the feature is not turned on by default. It can be turned on via a CRD declaration.


## Running

1. Create Dataset and AlluxioRuntime resource objects
```yaml
$ cat<<EOF >dataset.yaml
apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
name: spark
spec:
mounts:
- mountPoint: https://mirrors.bit.edu.cn/apache/spark/
name: spark
---
apiVersion: data.fluid.io/v1alpha1
kind: AlluxioRuntime
metadata:
name: spark
spec:
replicas: 1
tieredstore:
levels:
- mediumtype: MEM
path: /dev/shm
quota: 1Gi
high: "0.95"
low: "0.7"
properties:
alluxio.user.streaming.data.timeout: 300sec
apiGateway:
enabled: true
EOF
```

> Note: Just set apiGateway to true to enable this capability.

2. Check Access Endpoint

```
$ kubectl get alluxioruntimes.data.fluid.io -owide
NAME READY MASTERS DESIRED MASTERS MASTER PHASE READY WORKERS DESIRED WORKERS WORKER PHASE READY FUSES DESIRED FUSES FUSE PHASE API GATEWAY AGE
spark 1 1 Ready 1 1 Ready 0 0 Ready spark-master-0.default:20009 110s
```

You can see that the API Gateway is accessed at spark-master-0.default:20009. You can access it from this address.
2 changes: 1 addition & 1 deletion docs/zh/samples/api_proxy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 示例 - 基于Restful的文件系统客户端

AlluxioRuntime提供了基于[Restful API](https://docs.alluxio.io/os/user/stable/en/api/FS-API.html)的访问接口,方便用户通过Python,Java和Golang等语言进行二次开发。AlluxioRuntime也提供了这方面的支持,该功能默认并没有开启。可以通过CRD的声明打开。
Alluxio提供了基于[Restful API](https://docs.alluxio.io/os/user/stable/en/api/FS-API.html)的访问接口,方便用户通过Python,Java和Golang等语言进行二次开发。AlluxioRuntime也提供了这方面的支持,该功能默认并没有开启。可以通过CRD的声明打开。


## 运行示例
Expand Down

0 comments on commit 76b0e5b

Please sign in to comment.