kong 在Linux下操作
2015-11-20 16:00
591 查看
1、API
查询所有api
curl -i http://localhost:8888/apis/
查询单个api的插件
curl -i http://localhost:8888/apis/58600fdb-d8f4-47cd-c7ce-3dbefd7e78a6/plugins/
删除api
curl -X DELETE http://localhost:8888/apis/oxo9 --data "name=oxo9"
删除插件:
curl -X DELETE http://localhost:8888/apis/e73cc900-b2ae-4813-c899-7a5f8057f61b/plugins/af4e06d1-a10e-485a-c818-bbd6f4e28597 \
--data "api_id=e73cc900-b2ae-4813-c899-7a5f8057f61b" \
--data "id=af4e06d1-a10e-485a-c818-bbd6f4e28597"
查询api的oauth2 token
curl -i http://localhost:8888/consumers/{api id}/oauth2
创建API
curl -i -X POST \
--url http://localhost:8888/apis/ \
--data 'name=qwer' \
--data 'upstream_url=http://v.juhe.cn/weather/uni?' \
--data 'request_path=/api/qwer'
访问api
curl -i http://localhost:8889/api/k8s7 -H "authorization: bearer f8d2f2ad576a479ac71309fe64aa16a3"
2、Consumer
查询所有consumers
curl -i http://localhost:8888/consumers
查询单个consumer
curl -i http://localhost:8888/consumers/consumerId
删除consumer:
curl -X DELETE http://localhost:8888/consumers/admin \
--data "username=admin"
查询所有api
curl -i http://localhost:8888/apis/
查询单个api的插件
curl -i http://localhost:8888/apis/58600fdb-d8f4-47cd-c7ce-3dbefd7e78a6/plugins/
删除api
curl -X DELETE http://localhost:8888/apis/oxo9 --data "name=oxo9"
删除插件:
curl -X DELETE http://localhost:8888/apis/e73cc900-b2ae-4813-c899-7a5f8057f61b/plugins/af4e06d1-a10e-485a-c818-bbd6f4e28597 \
--data "api_id=e73cc900-b2ae-4813-c899-7a5f8057f61b" \
--data "id=af4e06d1-a10e-485a-c818-bbd6f4e28597"
查询api的oauth2 token
curl -i http://localhost:8888/consumers/{api id}/oauth2
创建API
curl -i -X POST \
--url http://localhost:8888/apis/ \
--data 'name=qwer' \
--data 'upstream_url=http://v.juhe.cn/weather/uni?' \
--data 'request_path=/api/qwer'
访问api
curl -i http://localhost:8889/api/k8s7 -H "authorization: bearer f8d2f2ad576a479ac71309fe64aa16a3"
2、Consumer
查询所有consumers
curl -i http://localhost:8888/consumers
查询单个consumer
curl -i http://localhost:8888/consumers/consumerId
删除consumer:
curl -X DELETE http://localhost:8888/consumers/admin \
--data "username=admin"
相关文章推荐
- Linux驱动部分-(一)内核模块的编写
- linux音频编程
- Linux---cp操作记录
- Linux环境下,用eclipse对ffmpeg源代码进行调试
- Linux之SSH登录密码验证很慢
- linux 开通ftp账号
- linux 下查看硬件信息(mac,IP地址,硬盘型号,序列号等)
- linux 驱动 指定下载的内核源码树编译
- PASSION之Linux命令集
- [转载]linux下svn常用指令
- 【转】在Linux下使用Jmeter执行测试任务
- Doxygen+linux
- centos下kubernetes+flannel部署(旧)
- Linux Advance--线程清理处理函数
- linux下运行strlwr函数的自定义
- linux-inode理解
- linux ssh 登录报hosts错误
- Linux下端口被占用解决
- centos 配置php
- linux命令——svn分支创建、合并