docs: rewrite quick start guide to match v3.0.2 (#8)
This commit is contained in:
+22
-38
@@ -1,34 +1,36 @@
|
|||||||
# 快速入门
|
# 快速入门
|
||||||
|
|
||||||
## 第一步:获取 API Key
|
## 第一步:安装 gis-actions
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -sLO https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/3.0.2/gis-actions_3.0.2_all.deb
|
||||||
|
sudo dpkg -i gis-actions_3.0.2_all.deb
|
||||||
|
```
|
||||||
|
|
||||||
|
前提条件:Linux 系统 + Docker。
|
||||||
|
|
||||||
|
## 第二步:获取 API Key
|
||||||
|
|
||||||
访问 https://auth.mercator.cn,创建 API Key(`mk_` 开头)。
|
访问 https://auth.mercator.cn,创建 API Key(`mk_` 开头)。
|
||||||
|
|
||||||
API Key 是 Agent 与平台交互的唯一凭证。
|
```bash
|
||||||
|
export AGENTGIS_API_KEY=mk_xxxxxxxxxxxxx
|
||||||
|
```
|
||||||
|
|
||||||
## 第二步:浏览套件
|
## 第三步:浏览套件
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 列出所有套件
|
# 列出所有套件
|
||||||
curl -s https://suites.mercator.cn/api/v1/suites
|
curl -s https://suites.mercator.cn/api/v1/suites | python3 -m json.tool
|
||||||
|
|
||||||
# 搜索套件
|
# 搜索套件
|
||||||
curl -s "https://suites.mercator.cn/api/v1/suites/search?q=缓冲区"
|
curl -s "https://suites.mercator.cn/api/v1/suites/search?q=缓冲区"
|
||||||
|
|
||||||
# 查看套件详情
|
|
||||||
curl -s https://suites.mercator.cn/api/v1/suites/{suite_id}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 第三步:选择套件
|
## 第四步:查看参数
|
||||||
|
|
||||||
从列表中筛选符合需求的套件,记录它的 `suite_id`。
|
|
||||||
|
|
||||||
## 第四步:读取参数结构
|
|
||||||
|
|
||||||
查看套件详情中的 `params_schema`,了解需要提供哪些参数:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -s https://suites.mercator.cn/api/v1/suites/{suite_id} | jq '.params_schema'
|
curl -s https://suites.mercator.cn/api/v1/suites/<suite-id> | jq '.params_schema'
|
||||||
```
|
```
|
||||||
|
|
||||||
返回示例:
|
返回示例:
|
||||||
@@ -46,35 +48,17 @@ curl -s https://suites.mercator.cn/api/v1/suites/{suite_id} | jq '.params_schema
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
根据参数声明构造输入数据。
|
## 第五步:执行套件
|
||||||
|
|
||||||
## 第五步:提交执行
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -s -X POST https://suites.mercator.cn/api/v1/suites/{suite_id}/execute \
|
agc run /tmp/output --suite-id <suite-id> --input buffer_distance=0.5
|
||||||
-H "Authorization: Bearer ***" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"buffer_distance": 0.5}'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
返回结果中包含 `task_id`,用这个 ID 查询执行状态。
|
执行在本地 Docker 容器中完成,数据不上传云端。
|
||||||
|
|
||||||
## 第五步:查询状态
|
## 第六步:查看结果
|
||||||
|
|
||||||
```bash
|
执行完成后,结果文件写入 `/tmp/output/` 目录。
|
||||||
curl -s https://suites.mercator.cn/api/v1/task/{task_id}/status
|
|
||||||
```
|
|
||||||
|
|
||||||
状态:`pending` → `running` → `completed` / `failed`
|
|
||||||
|
|
||||||
## 第六步:获取结果
|
|
||||||
|
|
||||||
任务完成后,从返回结果中读取输出数据。
|
|
||||||
|
|
||||||
## 前置条件
|
|
||||||
|
|
||||||
- **API Key**(必须)
|
|
||||||
- **GIS Actions** 在本地运行(用于实际执行任务)
|
|
||||||
|
|
||||||
## 数据安全
|
## 数据安全
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user